diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a6fbadef8cc1..9fd72f889f80 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -242,6 +242,15 @@ updates: labels: - "A:automerge" - dependencies + - package-ecosystem: gomod + directory: "/x/epochs" + schedule: + interval: weekly + day: wednesday + time: "03:15" + labels: + - "A:automerge" + - dependencies # Dependencies should be up to date on release branch - package-ecosystem: gomod diff --git a/.github/pr_labeler.yml b/.github/pr_labeler.yml index 88fcea7233ba..e8ab68592faa 100644 --- a/.github/pr_labeler.yml +++ b/.github/pr_labeler.yml @@ -62,6 +62,8 @@ - x/tx/**/* "C:x/upgrade": - x/upgrade/**/* +"C:x/epochs": + - x/epochs/**/* "Type: ADR": - docs/architecture/**/* "Type: Build": diff --git a/.github/workflows/issues.yml b/.github/workflows/issues.yml index 1ad3f0f1f3ea..b4f3775f27ba 100644 --- a/.github/workflows/issues.yml +++ b/.github/workflows/issues.yml @@ -11,7 +11,7 @@ jobs: name: Add issue to project runs-on: ubuntu-latest steps: - - uses: actions/add-to-project@v0.6.0 + - uses: actions/add-to-project@v1.0.1 with: project-url: https://github.com/orgs/cosmos/projects/26 # add all issues opened to the issue board for triage and assignment diff --git a/.github/workflows/md-link-checker.yml b/.github/workflows/md-link-checker.yml index 416536dae6a1..ec5c4d94c146 100644 --- a/.github/workflows/md-link-checker.yml +++ b/.github/workflows/md-link-checker.yml @@ -20,7 +20,7 @@ jobs: if: ${{ failure() }} steps: - name: Notify Slack on failure - uses: rtCamp/action-slack-notify@v2.2.1 + uses: rtCamp/action-slack-notify@v2.3.0 env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} SLACK_CHANNEL: sdk-sims diff --git a/.github/workflows/proto.yml b/.github/workflows/proto.yml index 409e9c490374..9d767c445289 100644 --- a/.github/workflows/proto.yml +++ b/.github/workflows/proto.yml @@ -15,7 +15,7 @@ jobs: timeout-minutes: 5 steps: - uses: actions/checkout@v4 - - uses: bufbuild/buf-setup-action@v1.30.0 + - uses: bufbuild/buf-setup-action@v1.30.1 - uses: bufbuild/buf-lint-action@v1 with: input: "proto" @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: bufbuild/buf-setup-action@v1.30.0 + - uses: bufbuild/buf-setup-action@v1.30.1 - uses: bufbuild/buf-breaking-action@v1 with: input: "proto" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c8788df5d728..84aaed0c4704 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,7 +37,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Notify Slack on success - uses: rtCamp/action-slack-notify@v2.2.1 + uses: rtCamp/action-slack-notify@v2.3.0 env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} SLACK_CHANNEL: cosmos-tech diff --git a/.github/workflows/sims-047.yml b/.github/workflows/sims-047.yml index 865758ca5fee..2115681b3d3d 100644 --- a/.github/workflows/sims-047.yml +++ b/.github/workflows/sims-047.yml @@ -115,7 +115,7 @@ jobs: - name: Notify Slack on success if: ${{ steps.last_status.outputs.last_status == 'failure' }} - uses: rtCamp/action-slack-notify@v2.2.1 + uses: rtCamp/action-slack-notify@v2.3.0 env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} SLACK_CHANNEL: sdk-sims @@ -134,7 +134,7 @@ jobs: if: ${{ failure() }} steps: - name: Notify Slack on failure - uses: rtCamp/action-slack-notify@v2.2.1 + uses: rtCamp/action-slack-notify@v2.3.0 env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} SLACK_CHANNEL: sdk-sims diff --git a/.github/workflows/sims-050.yml b/.github/workflows/sims-050.yml index 128980fa228d..e22e8e4aa895 100644 --- a/.github/workflows/sims-050.yml +++ b/.github/workflows/sims-050.yml @@ -115,7 +115,7 @@ jobs: - name: Notify Slack on success if: ${{ steps.last_status.outputs.last_status == 'failure' }} - uses: rtCamp/action-slack-notify@v2.2.1 + uses: rtCamp/action-slack-notify@v2.3.0 env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} SLACK_CHANNEL: sdk-sims @@ -134,7 +134,7 @@ jobs: if: ${{ failure() }} steps: - name: Notify Slack on failure - uses: rtCamp/action-slack-notify@v2.2.1 + uses: rtCamp/action-slack-notify@v2.3.0 env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} SLACK_CHANNEL: sdk-sims diff --git a/.github/workflows/sims-nightly.yml b/.github/workflows/sims-nightly.yml index d93533016419..3c1375cb3f9c 100644 --- a/.github/workflows/sims-nightly.yml +++ b/.github/workflows/sims-nightly.yml @@ -62,7 +62,7 @@ jobs: - name: Notify Slack on success if: ${{ steps.last_status.outputs.last_status == 'failure' }} - uses: rtCamp/action-slack-notify@v2.2.1 + uses: rtCamp/action-slack-notify@v2.3.0 env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} SLACK_CHANNEL: sdk-sims @@ -80,7 +80,7 @@ jobs: if: ${{ failure() }} steps: - name: Notify Slack on failure - uses: rtCamp/action-slack-notify@v2.2.1 + uses: rtCamp/action-slack-notify@v2.3.0 env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} SLACK_CHANNEL: sdk-sims diff --git a/.github/workflows/sims.yml b/.github/workflows/sims.yml index d9192e16796e..6427977d9098 100644 --- a/.github/workflows/sims.yml +++ b/.github/workflows/sims.yml @@ -100,7 +100,7 @@ jobs: - name: Notify Slack on success if: ${{ steps.last_status.outputs.last_status == 'failure' }} - uses: rtCamp/action-slack-notify@v2.2.1 + uses: rtCamp/action-slack-notify@v2.3.0 env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} SLACK_CHANNEL: sdk-sims @@ -119,7 +119,7 @@ jobs: if: ${{ failure() }} steps: - name: Notify Slack on failure - uses: rtCamp/action-slack-notify@v2.2.1 + uses: rtCamp/action-slack-notify@v2.3.0 env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} SLACK_CHANNEL: sdk-sims diff --git a/.github/workflows/starship-tests.yml b/.github/workflows/starship-tests.yml index 66b49754c3aa..a6e30b443ce0 100644 --- a/.github/workflows/starship-tests.yml +++ b/.github/workflows/starship-tests.yml @@ -67,7 +67,7 @@ jobs: - name: Notify Slack on success if: ${{ steps.last_status.outputs.last_status == 'failure' }} - uses: rtCamp/action-slack-notify@v2.2.1 + uses: rtCamp/action-slack-notify@v2.3.0 env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} SLACK_CHANNEL: sdk-sims @@ -85,7 +85,7 @@ jobs: if: ${{ failure() }} steps: - name: Notify Slack on failure - uses: rtCamp/action-slack-notify@v2.2.1 + uses: rtCamp/action-slack-notify@v2.3.0 env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} SLACK_CHANNEL: sdk-sims diff --git a/.github/workflows/staticmajor.yml b/.github/workflows/staticmajor.yml deleted file mode 100644 index 2666b289f390..000000000000 --- a/.github/workflows/staticmajor.yml +++ /dev/null @@ -1,23 +0,0 @@ -# Staticmajor: Static analyzer to catch leaking resources & other bad code patterns -name: Detect leaking resources and bad code patterns -on: - push: - branches: - - main - pull_request: - workflow_dispatch: - -jobs: - run_staticmajor: - runs-on: ubuntu-latest - steps: - - name: Check out repository code - uses: actions/checkout@v4 - - name: Staticmajor action - id: staticmajor - uses: orijtech/staticmajor-action@main - with: - packages: ./... - resleak: true - structslop: false - tests: false diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a379641c703c..b1383422a6d8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1222,3 +1222,34 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} with: projectBaseDir: x/mint/ + + test-x-epochs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: "1.22" + check-latest: true + cache: true + cache-dependency-path: x/epochs/go.sum + - uses: technote-space/get-diff-action@v6.1.2 + id: git_diff + with: + PATTERNS: | + x/epochs/**/*.go + x/epochs/go.mod + x/epochs/go.sum + - name: tests + if: env.GIT_DIFF + run: | + cd x/epochs + 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: x/epochs/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 85e5ba303496..255beffe097f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,7 +42,9 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i ### Features -* (runtime) [#19571](https://github.com/cosmos/cosmos-sdk/pull/19571) Implement `core/router.Service` it in runtime. This service is present in all modules (when using depinject). +* (runtime) [#19953](https://github.com/cosmos/cosmos-sdk/pull/19953) Implement `core/transaction.Service` in runtime. +* (client) [#19905](https://github.com/cosmos/cosmos-sdk/pull/19905) Add grpc client config to `client.toml`. +* (runtime) [#19571](https://github.com/cosmos/cosmos-sdk/pull/19571) Implement `core/router.Service` in runtime. This service is present in all modules (when using depinject). * (types) [#19164](https://github.com/cosmos/cosmos-sdk/pull/19164) Add a ValueCodec for the math.Uint type that can be used in collections maps. * (types) [#19281](https://github.com/cosmos/cosmos-sdk/pull/19281) Added a new method, `IsGT`, for `types.Coin`. This method is used to check if a `types.Coin` is greater than another `types.Coin`. * (client) [#18557](https://github.com/cosmos/cosmos-sdk/pull/18557) Add `--qrcode` flag to `keys show` command to support displaying keys address QR code. @@ -55,9 +57,18 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i * (gRPC) [#19049](https://github.com/cosmos/cosmos-sdk/pull/19049) Add debug log prints for each gRPC request. * (x/consensus) [#19483](https://github.com/cosmos/cosmos-sdk/pull/19483) Add consensus messages registration to consensus module. * (types) [#19759](https://github.com/cosmos/cosmos-sdk/pull/19759) Align SignerExtractionAdapter in PriorityNonceMempool Remove. +* (client) [#19870](https://github.com/cosmos/cosmos-sdk/pull/19870) Add new query command `wait-tx`. Alias `event-query-tx-for` to `wait-tx` for backward compatibility. ### Improvements +* (telemetry) [#19903](https://github.com/cosmos/cosmos-sdk/pull/19903) Conditionally emit metrics based on enablement. + * **Introduction of `Now` Function**: Added a new function called `Now` to the telemetry package. It returns the current system time if telemetry is enabled, or a zero time if telemetry is not enabled. + * **Atomic Global Variable**: Implemented an atomic global variable to manage the state of telemetry's enablement. This ensures thread safety for the telemetry state. + * **Conditional Telemetry Emission**: All telemetry functions have been updated to emit metrics only when telemetry is enabled. They perform a check with `isTelemetryEnabled()` and return early if telemetry is disabled, minimizing unnecessary operations and overhead. +* (types) [#19869](https://github.com/cosmos/cosmos-sdk/pull/19869) Removed `Any` type from `codec/types` and replaced it with an alias for `cosmos/gogoproto/types/any`. +* (server) [#19854](https://github.com/cosmos/cosmos-sdk/pull/19854) Add customizability to start command. + * Add `StartCmdOptions` in `server.AddCommands` instead of `servertypes.ModuleInitFlags`. To set custom flags set them in the `StartCmdOptions` struct on the `AddFlags` field. + * Add `StartCommandHandler` to `StartCmdOptions` to allow custom start command handlers. Users now have total control over how the app starts. * (types) [#19672](https://github.com/cosmos/cosmos-sdk/pull/19672) `PreBlock` now returns only an error for consistency with server/v2. The SDK has upgraded x/upgrade accordingly. `ResponsePreBlock` hence has been removed. * (server) [#19455](https://github.com/cosmos/cosmos-sdk/pull/19455) Allow calling back into the application struct in PostSetup. * (types) [#19512](https://github.com/cosmos/cosmos-sdk/pull/19512) The notion of basic manager does not exist anymore (and all related helpers). @@ -85,6 +96,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i * (types) [#18963](https://github.com/cosmos/cosmos-sdk/pull/18963) Swap out amino json encoding of `ABCIMessageLogs` for std lib json encoding * (x/auth) [#19651](https://github.com/cosmos/cosmos-sdk/pull/19651) Allow empty public keys in `GetSignBytesAdapter`. * (x/genutil) [#19735](https://github.com/cosmos/cosmos-sdk/pull/19735) Update genesis api to match new `appmodule.HasGenesis` interface. +* (server) [#19966](https://github.com/cosmos/cosmos-sdk/pull/19966) Return BlockHeader by shallow copy in server Context. ### Bug Fixes @@ -98,12 +110,23 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i * (baseapp) [#18551](https://github.com/cosmos/cosmos-sdk/pull/18551) Fix SelectTxForProposal the calculation method of tx bytes size is inconsistent with CometBFT * (server) [#18994](https://github.com/cosmos/cosmos-sdk/pull/18994) Update server context directly rather than a reference to a sub-object * (crypto) [#19691](https://github.com/cosmos/cosmos-sdk/pull/19691) Fix tx sign doesn't throw an error when incorrect Ledger is used. -* (baseapp) [#19616](https://github.com/cosmos/cosmos-sdk/pull/19616) Fix shared gas meter at the beginning of tx execution. +* [#19833](https://github.com/cosmos/cosmos-sdk/pull/19833) Fix some places in which we call Remove inside a Walk. +* [#19851](https://github.com/cosmos/cosmos-sdk/pull/19851) Fix some places in which we call Remove inside a Walk (x/staking and x/gov). +* (baseapp) [#19970](https://github.com/cosmos/cosmos-sdk/pull/19970) Fix default config values to use no-op mempool as default. +* (crypto) [#20027](https://github.com/cosmos/cosmos-sdk/pull/20027) secp256r1 keys now implement gogoproto's customtype interface. +* (x/bank) [#20028](https://github.com/cosmos/cosmos-sdk/pull/20028) Align query with multi denoms for send-enabled. +* (cli) [#20020](https://github.com/cosmos/cosmos-sdk/pull/20020) Make bootstrap-state command support both new and legacy genesis format. +* (baseapp) [#19616](https://github.com/cosmos/cosmos-sdk/pull/19616) Don't share gas meter in tx execution. ### API Breaking Changes +* (x/genutil) [#19926](https://github.com/cosmos/cosmos-sdk/pull/19926) Removal of the Address.String() method and related changes: + * Added an address codec as an argument to `CollectTxs`, `GenAppStateFromConfig`, and `AddGenesisAccount`. + * Removed the `ValidatorAddressCodec` argument from `CollectGenTxsCmd`, now utilizing the context for this purpose. + * Changed `ValidateAccountInGenesis` to accept a string instead of an `AccAddress`. +* (server) [#19854](https://github.com/cosmos/cosmos-sdk/pull/19854) Remove `servertypes.ModuleInitFlags` types and from `server.AddCommands` as `StartCmdOptions` already achieves the same goal. +* (types) [#19792](https://github.com/cosmos/cosmos-sdk/pull/19792) In `MsgSimulatorFn` `sdk.Context` argument is replaced for an `address.Codec`. It also returns an error. * (types) [#19742](https://github.com/cosmos/cosmos-sdk/pull/19742) Removes the use of `Accounts.String` - * `MsgSimulatorFn` now takes an `address.Codec` as argument and also returns an error. * `SimulationState` now has address and validator codecs as fields. * (types) [#19447](https://github.com/cosmos/cosmos-sdk/pull/19447) `module.testutil.MakeTestEncodingConfig` now takes `CodecOptions` as argument. * (types) [#19512](https://github.com/cosmos/cosmos-sdk/pull/19512) Remove basic manager and all related functions (`module.BasicManager`, `module.NewBasicManager`, `module.NewBasicManagerFromManager`, `NewGenesisOnlyAppModule`). @@ -156,6 +179,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i * Every module has the codec already, passing it created an unneeded dependency. * Additionally, to reflect this change, the module manager does not take a codec either. * (runtime) [#19747](https://github.com/cosmos/cosmos-sdk/pull/19747) `runtime.ValidatorAddressCodec` and `runtime.ConsensusAddressCodec` have been moved to `core`. +* (baseapp) [#19993](https://github.com/cosmos/cosmos-sdk/pull/19993) Indicate pruning with error code "not found" rather than "invalid request". ### Client Breaking Changes diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3a019201f95c..22f82c615066 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -344,7 +344,7 @@ Members must: * Be active contributors to the Cosmos SDK, and furthermore should be continuously making substantial contributions to the project's codebase, review process, documentation and ADRs * Have stake in the Cosmos SDK project, represented by: - * Being a client / user of the Comsos SDK + * Being a client / user of the Cosmos SDK * "[giving back](https://www.debian.org/social_contract)" to the software * Delegate representation in case of vacation or absence diff --git a/UPGRADING.md b/UPGRADING.md index a1a6bc8ce2be..6126ce607b9c 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -31,6 +31,13 @@ clientCtx = clientCtx. Refer to SimApp `root_v2.go` and `root.go` for an example with an app v2 and a legacy app. +Additionally, a simplification of the start command leads to the following change: + +```diff +- server.AddCommands(rootCmd, newApp, func(startCmd *cobra.Command) {}) ++ server.AddCommands(rootCmd, newApp, server.StartCmdOptions[servertypes.Application]{}) +``` + #### Server (`app.go`) ##### Module Manager @@ -141,18 +148,20 @@ There is no longer a need for the Cosmos SDK to host these protos for itself and That package containing proto v2 generated code, but the SDK now uses [buf generated go SDK instead](https://buf.build/docs/bsr/generated-sdks/go). If you were depending on `cosmossdk.io/api/tendermint`, please use the buf generated go SDK instead, or ask CometBFT host the generated proto v2 code. +The `codectypes.Any` has moved to `github.com/cosmos/gogoproto/types/any`. Module developers can update the `buf.gen.gogo.yaml` configuration files by adjusting the corresponding `opt` option to `Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any` for directly mapping the`Any` type to its new location. This change is optional as `codectypes.Any` is aliased to `gogoproto.Any` in the SDK. + ### Modules #### `**all**` ##### Simulation -As an effort to remove the use of the global config, `sdk.Address.String` method must be removed. As a consequence, `MsgSimulatorFn` has been updated to return an error and use an `address.Codec` to set -`staking.MsgUpdateParams.Authority`. +`MsgSimulatorFn` has been updated to return an error. Its context argument has been removed, and an address.Codec has +been added to avoid the use of the Accounts.String() method. ```diff -type MsgSimulatorFn func(r *rand.Rand, ctx sdk.Context, accs []Account) sdk.Msg -+type MsgSimulatorFn func(r *rand.Rand, ctx sdk.Context, accs []Account, cdc address.Codec) (sdk.Msg, error) ++type MsgSimulatorFn func(r *rand.Rand, accs []Account, cdc address.Codec) (sdk.Msg, error) ``` ##### Core API @@ -433,7 +442,7 @@ With the deprecation of the Amino JSON codec defined in [cosmos/gogoproto](https For core SDK types equivalence is asserted by generative testing of [SignableTypes](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-beta.0/tests/integration/rapidgen/rapidgen.go#L102) in [TestAminoJSON_Equivalence](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-beta.0/tests/integration/tx/aminojson/aminojson_test.go#L94). -**TODO: summarize proto annotation requirements.** +Read more about the available annotations [here](https://docs.cosmos.network/v0.50/build/building-modules/protobuf-annotations). #### Stringer diff --git a/api/cosmos/auth/v1beta1/tx.pulsar.go b/api/cosmos/auth/v1beta1/tx.pulsar.go index 4a364ba532ff..6e9de52a99fd 100644 --- a/api/cosmos/auth/v1beta1/tx.pulsar.go +++ b/api/cosmos/auth/v1beta1/tx.pulsar.go @@ -11,6 +11,7 @@ import ( 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" @@ -871,6 +872,1557 @@ func (x *fastReflection_MsgUpdateParamsResponse) ProtoMethods() *protoiface.Meth } } +var _ protoreflect.List = (*_MsgNonAtomicExec_2_list)(nil) + +type _MsgNonAtomicExec_2_list struct { + list *[]*anypb.Any +} + +func (x *_MsgNonAtomicExec_2_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgNonAtomicExec_2_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgNonAtomicExec_2_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*anypb.Any) + (*x.list)[i] = concreteValue +} + +func (x *_MsgNonAtomicExec_2_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*anypb.Any) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgNonAtomicExec_2_list) AppendMutable() protoreflect.Value { + v := new(anypb.Any) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgNonAtomicExec_2_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgNonAtomicExec_2_list) NewElement() protoreflect.Value { + v := new(anypb.Any) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgNonAtomicExec_2_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgNonAtomicExec protoreflect.MessageDescriptor + fd_MsgNonAtomicExec_signer protoreflect.FieldDescriptor + fd_MsgNonAtomicExec_msgs protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_auth_v1beta1_tx_proto_init() + md_MsgNonAtomicExec = File_cosmos_auth_v1beta1_tx_proto.Messages().ByName("MsgNonAtomicExec") + fd_MsgNonAtomicExec_signer = md_MsgNonAtomicExec.Fields().ByName("signer") + fd_MsgNonAtomicExec_msgs = md_MsgNonAtomicExec.Fields().ByName("msgs") +} + +var _ protoreflect.Message = (*fastReflection_MsgNonAtomicExec)(nil) + +type fastReflection_MsgNonAtomicExec MsgNonAtomicExec + +func (x *MsgNonAtomicExec) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgNonAtomicExec)(x) +} + +func (x *MsgNonAtomicExec) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_auth_v1beta1_tx_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_MsgNonAtomicExec_messageType fastReflection_MsgNonAtomicExec_messageType +var _ protoreflect.MessageType = fastReflection_MsgNonAtomicExec_messageType{} + +type fastReflection_MsgNonAtomicExec_messageType struct{} + +func (x fastReflection_MsgNonAtomicExec_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgNonAtomicExec)(nil) +} +func (x fastReflection_MsgNonAtomicExec_messageType) New() protoreflect.Message { + return new(fastReflection_MsgNonAtomicExec) +} +func (x fastReflection_MsgNonAtomicExec_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgNonAtomicExec +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgNonAtomicExec) Descriptor() protoreflect.MessageDescriptor { + return md_MsgNonAtomicExec +} + +// 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_MsgNonAtomicExec) Type() protoreflect.MessageType { + return _fastReflection_MsgNonAtomicExec_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgNonAtomicExec) New() protoreflect.Message { + return new(fastReflection_MsgNonAtomicExec) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgNonAtomicExec) Interface() protoreflect.ProtoMessage { + return (*MsgNonAtomicExec)(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_MsgNonAtomicExec) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Signer != "" { + value := protoreflect.ValueOfString(x.Signer) + if !f(fd_MsgNonAtomicExec_signer, value) { + return + } + } + if len(x.Msgs) != 0 { + value := protoreflect.ValueOfList(&_MsgNonAtomicExec_2_list{list: &x.Msgs}) + if !f(fd_MsgNonAtomicExec_msgs, 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_MsgNonAtomicExec) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.auth.v1beta1.MsgNonAtomicExec.signer": + return x.Signer != "" + case "cosmos.auth.v1beta1.MsgNonAtomicExec.msgs": + return len(x.Msgs) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.MsgNonAtomicExec")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.MsgNonAtomicExec 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_MsgNonAtomicExec) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.auth.v1beta1.MsgNonAtomicExec.signer": + x.Signer = "" + case "cosmos.auth.v1beta1.MsgNonAtomicExec.msgs": + x.Msgs = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.MsgNonAtomicExec")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.MsgNonAtomicExec 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_MsgNonAtomicExec) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.auth.v1beta1.MsgNonAtomicExec.signer": + value := x.Signer + return protoreflect.ValueOfString(value) + case "cosmos.auth.v1beta1.MsgNonAtomicExec.msgs": + if len(x.Msgs) == 0 { + return protoreflect.ValueOfList(&_MsgNonAtomicExec_2_list{}) + } + listValue := &_MsgNonAtomicExec_2_list{list: &x.Msgs} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.MsgNonAtomicExec")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.MsgNonAtomicExec 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_MsgNonAtomicExec) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.auth.v1beta1.MsgNonAtomicExec.signer": + x.Signer = value.Interface().(string) + case "cosmos.auth.v1beta1.MsgNonAtomicExec.msgs": + lv := value.List() + clv := lv.(*_MsgNonAtomicExec_2_list) + x.Msgs = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.MsgNonAtomicExec")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.MsgNonAtomicExec 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_MsgNonAtomicExec) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.auth.v1beta1.MsgNonAtomicExec.msgs": + if x.Msgs == nil { + x.Msgs = []*anypb.Any{} + } + value := &_MsgNonAtomicExec_2_list{list: &x.Msgs} + return protoreflect.ValueOfList(value) + case "cosmos.auth.v1beta1.MsgNonAtomicExec.signer": + panic(fmt.Errorf("field signer of message cosmos.auth.v1beta1.MsgNonAtomicExec is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.MsgNonAtomicExec")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.MsgNonAtomicExec 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_MsgNonAtomicExec) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.auth.v1beta1.MsgNonAtomicExec.signer": + return protoreflect.ValueOfString("") + case "cosmos.auth.v1beta1.MsgNonAtomicExec.msgs": + list := []*anypb.Any{} + return protoreflect.ValueOfList(&_MsgNonAtomicExec_2_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.MsgNonAtomicExec")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.MsgNonAtomicExec 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_MsgNonAtomicExec) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.auth.v1beta1.MsgNonAtomicExec", 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_MsgNonAtomicExec) 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_MsgNonAtomicExec) 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_MsgNonAtomicExec) 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_MsgNonAtomicExec) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgNonAtomicExec) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Signer) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if len(x.Msgs) > 0 { + for _, e := range x.Msgs { + 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().(*MsgNonAtomicExec) + 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.Msgs) > 0 { + for iNdEx := len(x.Msgs) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Msgs[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + } + if len(x.Signer) > 0 { + i -= len(x.Signer) + copy(dAtA[i:], x.Signer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signer))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgNonAtomicExec) + 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: MsgNonAtomicExec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgNonAtomicExec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Msgs", 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.Msgs = append(x.Msgs, &anypb.Any{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Msgs[len(x.Msgs)-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_NonAtomicExecResult protoreflect.MessageDescriptor + fd_NonAtomicExecResult_error protoreflect.FieldDescriptor + fd_NonAtomicExecResult_resp protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_auth_v1beta1_tx_proto_init() + md_NonAtomicExecResult = File_cosmos_auth_v1beta1_tx_proto.Messages().ByName("NonAtomicExecResult") + fd_NonAtomicExecResult_error = md_NonAtomicExecResult.Fields().ByName("error") + fd_NonAtomicExecResult_resp = md_NonAtomicExecResult.Fields().ByName("resp") +} + +var _ protoreflect.Message = (*fastReflection_NonAtomicExecResult)(nil) + +type fastReflection_NonAtomicExecResult NonAtomicExecResult + +func (x *NonAtomicExecResult) ProtoReflect() protoreflect.Message { + return (*fastReflection_NonAtomicExecResult)(x) +} + +func (x *NonAtomicExecResult) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_auth_v1beta1_tx_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_NonAtomicExecResult_messageType fastReflection_NonAtomicExecResult_messageType +var _ protoreflect.MessageType = fastReflection_NonAtomicExecResult_messageType{} + +type fastReflection_NonAtomicExecResult_messageType struct{} + +func (x fastReflection_NonAtomicExecResult_messageType) Zero() protoreflect.Message { + return (*fastReflection_NonAtomicExecResult)(nil) +} +func (x fastReflection_NonAtomicExecResult_messageType) New() protoreflect.Message { + return new(fastReflection_NonAtomicExecResult) +} +func (x fastReflection_NonAtomicExecResult_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_NonAtomicExecResult +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_NonAtomicExecResult) Descriptor() protoreflect.MessageDescriptor { + return md_NonAtomicExecResult +} + +// 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_NonAtomicExecResult) Type() protoreflect.MessageType { + return _fastReflection_NonAtomicExecResult_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_NonAtomicExecResult) New() protoreflect.Message { + return new(fastReflection_NonAtomicExecResult) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_NonAtomicExecResult) Interface() protoreflect.ProtoMessage { + return (*NonAtomicExecResult)(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_NonAtomicExecResult) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Error != "" { + value := protoreflect.ValueOfString(x.Error) + if !f(fd_NonAtomicExecResult_error, value) { + return + } + } + if x.Resp != nil { + value := protoreflect.ValueOfMessage(x.Resp.ProtoReflect()) + if !f(fd_NonAtomicExecResult_resp, 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_NonAtomicExecResult) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.auth.v1beta1.NonAtomicExecResult.error": + return x.Error != "" + case "cosmos.auth.v1beta1.NonAtomicExecResult.resp": + return x.Resp != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.NonAtomicExecResult")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.NonAtomicExecResult 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_NonAtomicExecResult) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.auth.v1beta1.NonAtomicExecResult.error": + x.Error = "" + case "cosmos.auth.v1beta1.NonAtomicExecResult.resp": + x.Resp = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.NonAtomicExecResult")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.NonAtomicExecResult 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_NonAtomicExecResult) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.auth.v1beta1.NonAtomicExecResult.error": + value := x.Error + return protoreflect.ValueOfString(value) + case "cosmos.auth.v1beta1.NonAtomicExecResult.resp": + value := x.Resp + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.NonAtomicExecResult")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.NonAtomicExecResult 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_NonAtomicExecResult) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.auth.v1beta1.NonAtomicExecResult.error": + x.Error = value.Interface().(string) + case "cosmos.auth.v1beta1.NonAtomicExecResult.resp": + x.Resp = value.Message().Interface().(*anypb.Any) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.NonAtomicExecResult")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.NonAtomicExecResult 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_NonAtomicExecResult) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.auth.v1beta1.NonAtomicExecResult.resp": + if x.Resp == nil { + x.Resp = new(anypb.Any) + } + return protoreflect.ValueOfMessage(x.Resp.ProtoReflect()) + case "cosmos.auth.v1beta1.NonAtomicExecResult.error": + panic(fmt.Errorf("field error of message cosmos.auth.v1beta1.NonAtomicExecResult is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.NonAtomicExecResult")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.NonAtomicExecResult 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_NonAtomicExecResult) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.auth.v1beta1.NonAtomicExecResult.error": + return protoreflect.ValueOfString("") + case "cosmos.auth.v1beta1.NonAtomicExecResult.resp": + m := new(anypb.Any) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.NonAtomicExecResult")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.NonAtomicExecResult 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_NonAtomicExecResult) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.auth.v1beta1.NonAtomicExecResult", 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_NonAtomicExecResult) 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_NonAtomicExecResult) 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_NonAtomicExecResult) 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_NonAtomicExecResult) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*NonAtomicExecResult) + 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.Error) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Resp != nil { + l = options.Size(x.Resp) + 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().(*NonAtomicExecResult) + 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.Resp != nil { + encoded, err := options.Marshal(x.Resp) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.Error) > 0 { + i -= len(x.Error) + copy(dAtA[i:], x.Error) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Error))) + 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().(*NonAtomicExecResult) + 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: NonAtomicExecResult: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: NonAtomicExecResult: 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 Error", 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.Error = 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 Resp", 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.Resp == nil { + x.Resp = &anypb.Any{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Resp); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_MsgNonAtomicExecResponse_1_list)(nil) + +type _MsgNonAtomicExecResponse_1_list struct { + list *[]*NonAtomicExecResult +} + +func (x *_MsgNonAtomicExecResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgNonAtomicExecResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgNonAtomicExecResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*NonAtomicExecResult) + (*x.list)[i] = concreteValue +} + +func (x *_MsgNonAtomicExecResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*NonAtomicExecResult) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgNonAtomicExecResponse_1_list) AppendMutable() protoreflect.Value { + v := new(NonAtomicExecResult) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgNonAtomicExecResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgNonAtomicExecResponse_1_list) NewElement() protoreflect.Value { + v := new(NonAtomicExecResult) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgNonAtomicExecResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgNonAtomicExecResponse protoreflect.MessageDescriptor + fd_MsgNonAtomicExecResponse_results protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_auth_v1beta1_tx_proto_init() + md_MsgNonAtomicExecResponse = File_cosmos_auth_v1beta1_tx_proto.Messages().ByName("MsgNonAtomicExecResponse") + fd_MsgNonAtomicExecResponse_results = md_MsgNonAtomicExecResponse.Fields().ByName("results") +} + +var _ protoreflect.Message = (*fastReflection_MsgNonAtomicExecResponse)(nil) + +type fastReflection_MsgNonAtomicExecResponse MsgNonAtomicExecResponse + +func (x *MsgNonAtomicExecResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgNonAtomicExecResponse)(x) +} + +func (x *MsgNonAtomicExecResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_auth_v1beta1_tx_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgNonAtomicExecResponse_messageType fastReflection_MsgNonAtomicExecResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgNonAtomicExecResponse_messageType{} + +type fastReflection_MsgNonAtomicExecResponse_messageType struct{} + +func (x fastReflection_MsgNonAtomicExecResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgNonAtomicExecResponse)(nil) +} +func (x fastReflection_MsgNonAtomicExecResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgNonAtomicExecResponse) +} +func (x fastReflection_MsgNonAtomicExecResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgNonAtomicExecResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgNonAtomicExecResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgNonAtomicExecResponse +} + +// 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_MsgNonAtomicExecResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgNonAtomicExecResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgNonAtomicExecResponse) New() protoreflect.Message { + return new(fastReflection_MsgNonAtomicExecResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgNonAtomicExecResponse) Interface() protoreflect.ProtoMessage { + return (*MsgNonAtomicExecResponse)(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_MsgNonAtomicExecResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Results) != 0 { + value := protoreflect.ValueOfList(&_MsgNonAtomicExecResponse_1_list{list: &x.Results}) + if !f(fd_MsgNonAtomicExecResponse_results, 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_MsgNonAtomicExecResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.auth.v1beta1.MsgNonAtomicExecResponse.results": + return len(x.Results) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.MsgNonAtomicExecResponse")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.MsgNonAtomicExecResponse 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_MsgNonAtomicExecResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.auth.v1beta1.MsgNonAtomicExecResponse.results": + x.Results = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.MsgNonAtomicExecResponse")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.MsgNonAtomicExecResponse 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_MsgNonAtomicExecResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.auth.v1beta1.MsgNonAtomicExecResponse.results": + if len(x.Results) == 0 { + return protoreflect.ValueOfList(&_MsgNonAtomicExecResponse_1_list{}) + } + listValue := &_MsgNonAtomicExecResponse_1_list{list: &x.Results} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.MsgNonAtomicExecResponse")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.MsgNonAtomicExecResponse 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_MsgNonAtomicExecResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.auth.v1beta1.MsgNonAtomicExecResponse.results": + lv := value.List() + clv := lv.(*_MsgNonAtomicExecResponse_1_list) + x.Results = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.MsgNonAtomicExecResponse")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.MsgNonAtomicExecResponse 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_MsgNonAtomicExecResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.auth.v1beta1.MsgNonAtomicExecResponse.results": + if x.Results == nil { + x.Results = []*NonAtomicExecResult{} + } + value := &_MsgNonAtomicExecResponse_1_list{list: &x.Results} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.MsgNonAtomicExecResponse")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.MsgNonAtomicExecResponse 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_MsgNonAtomicExecResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.auth.v1beta1.MsgNonAtomicExecResponse.results": + list := []*NonAtomicExecResult{} + return protoreflect.ValueOfList(&_MsgNonAtomicExecResponse_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.auth.v1beta1.MsgNonAtomicExecResponse")) + } + panic(fmt.Errorf("message cosmos.auth.v1beta1.MsgNonAtomicExecResponse 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_MsgNonAtomicExecResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.auth.v1beta1.MsgNonAtomicExecResponse", 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_MsgNonAtomicExecResponse) 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_MsgNonAtomicExecResponse) 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_MsgNonAtomicExecResponse) 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_MsgNonAtomicExecResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgNonAtomicExecResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Results) > 0 { + for _, e := range x.Results { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.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().(*MsgNonAtomicExecResponse) + 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.Results) > 0 { + for iNdEx := len(x.Results) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Results[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgNonAtomicExecResponse) + 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: MsgNonAtomicExecResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgNonAtomicExecResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Results", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Results = append(x.Results, &NonAtomicExecResult{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Results[len(x.Results)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + 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 @@ -964,6 +2516,131 @@ func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { return file_cosmos_auth_v1beta1_tx_proto_rawDescGZIP(), []int{1} } +// MsgNonAtomicExec defines the Msg/NonAtomicExec request type. +type MsgNonAtomicExec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` + Msgs []*anypb.Any `protobuf:"bytes,2,rep,name=msgs,proto3" json:"msgs,omitempty"` +} + +func (x *MsgNonAtomicExec) Reset() { + *x = MsgNonAtomicExec{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_auth_v1beta1_tx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgNonAtomicExec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgNonAtomicExec) ProtoMessage() {} + +// Deprecated: Use MsgNonAtomicExec.ProtoReflect.Descriptor instead. +func (*MsgNonAtomicExec) Descriptor() ([]byte, []int) { + return file_cosmos_auth_v1beta1_tx_proto_rawDescGZIP(), []int{2} +} + +func (x *MsgNonAtomicExec) GetSigner() string { + if x != nil { + return x.Signer + } + return "" +} + +func (x *MsgNonAtomicExec) GetMsgs() []*anypb.Any { + if x != nil { + return x.Msgs + } + return nil +} + +// NonAtomicExecResult defines the response structure for executing a +// MsgNonAtomicExec. +type NonAtomicExecResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + Resp *anypb.Any `protobuf:"bytes,2,opt,name=resp,proto3" json:"resp,omitempty"` +} + +func (x *NonAtomicExecResult) Reset() { + *x = NonAtomicExecResult{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_auth_v1beta1_tx_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NonAtomicExecResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NonAtomicExecResult) ProtoMessage() {} + +// Deprecated: Use NonAtomicExecResult.ProtoReflect.Descriptor instead. +func (*NonAtomicExecResult) Descriptor() ([]byte, []int) { + return file_cosmos_auth_v1beta1_tx_proto_rawDescGZIP(), []int{3} +} + +func (x *NonAtomicExecResult) GetError() string { + if x != nil { + return x.Error + } + return "" +} + +func (x *NonAtomicExecResult) GetResp() *anypb.Any { + if x != nil { + return x.Resp + } + return nil +} + +// MsgNonAtomicExecResponse defines the response of MsgNonAtomicExec. +type MsgNonAtomicExecResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Results []*NonAtomicExecResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` +} + +func (x *MsgNonAtomicExecResponse) Reset() { + *x = MsgNonAtomicExecResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_auth_v1beta1_tx_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgNonAtomicExecResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgNonAtomicExecResponse) ProtoMessage() {} + +// Deprecated: Use MsgNonAtomicExecResponse.ProtoReflect.Descriptor instead. +func (*MsgNonAtomicExecResponse) Descriptor() ([]byte, []int) { + return file_cosmos_auth_v1beta1_tx_proto_rawDescGZIP(), []int{4} +} + +func (x *MsgNonAtomicExecResponse) GetResults() []*NonAtomicExecResult { + if x != nil { + return x.Results + } + return nil +} + var File_cosmos_auth_v1beta1_tx_proto protoreflect.FileDescriptor var file_cosmos_auth_v1beta1_tx_proto_rawDesc = []byte{ @@ -971,47 +2648,77 @@ var file_cosmos_auth_v1beta1_tx_proto_rawDesc = []byte{ 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, - 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, - 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x61, - 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0xbf, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x3e, 0x0a, 0x06, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, - 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x34, 0x82, 0xe7, - 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, - 0x21, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x61, 0x75, - 0x74, 0x68, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x70, 0x0a, - 0x03, 0x4d, 0x73, 0x67, 0x12, 0x62, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x12, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, - 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2c, 0x2e, 0x63, 0x6f, 0x73, + 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, + 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, + 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbf, 0x01, 0x0a, 0x0f, + 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, + 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x3e, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, + 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x34, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x21, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x4d, 0x73, + 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, + 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x98, 0x01, 0x0a, 0x10, 0x4d, 0x73, 0x67, + 0x4e, 0x6f, 0x6e, 0x41, 0x74, 0x6f, 0x6d, 0x69, 0x63, 0x45, 0x78, 0x65, 0x63, 0x12, 0x30, 0x0a, + 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, + 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, + 0x45, 0x0a, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x41, 0x6e, 0x79, 0x42, 0x1b, 0xca, 0xb4, 0x2d, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x52, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x3a, 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, + 0x6e, 0x65, 0x72, 0x22, 0x55, 0x0a, 0x13, 0x4e, 0x6f, 0x6e, 0x41, 0x74, 0x6f, 0x6d, 0x69, 0x63, + 0x45, 0x78, 0x65, 0x63, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x12, 0x28, 0x0a, 0x04, 0x72, 0x65, 0x73, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x04, 0x72, 0x65, 0x73, 0x70, 0x22, 0x5e, 0x0a, 0x18, 0x4d, 0x73, + 0x67, 0x4e, 0x6f, 0x6e, 0x41, 0x74, 0x6f, 0x6d, 0x69, 0x63, 0x45, 0x78, 0x65, 0x63, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4e, 0x6f, + 0x6e, 0x41, 0x74, 0x6f, 0x6d, 0x69, 0x63, 0x45, 0x78, 0x65, 0x63, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x32, 0xd7, 0x01, 0x0a, 0x03, 0x4d, + 0x73, 0x67, 0x12, 0x62, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, + 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x0d, 0x4e, 0x6f, 0x6e, 0x41, 0x74, 0x6f, + 0x6d, 0x69, 0x63, 0x45, 0x78, 0x65, 0x63, 0x12, 0x25, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x4e, 0x6f, 0x6e, 0x41, 0x74, 0x6f, 0x6d, 0x69, 0x63, 0x45, 0x78, 0x65, 0x63, 0x1a, 0x2d, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x4e, 0x6f, 0x6e, 0x41, 0x74, 0x6f, 0x6d, 0x69, + 0x63, 0x45, 0x78, 0x65, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, + 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xc2, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, - 0xc2, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, - 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, - 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x61, 0x75, 0x74, - 0x68, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, - 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x2e, 0x56, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, - 0x74, 0x68, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x75, 0x74, 0x68, 0x3a, 0x3a, 0x56, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x3b, 0x61, 0x75, 0x74, 0x68, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, + 0x43, 0x41, 0x58, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x75, 0x74, + 0x68, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, + 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x75, 0x74, 0x68, 0x5c, 0x56, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x75, 0x74, 0x68, + 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -1026,21 +2733,30 @@ func file_cosmos_auth_v1beta1_tx_proto_rawDescGZIP() []byte { return file_cosmos_auth_v1beta1_tx_proto_rawDescData } -var file_cosmos_auth_v1beta1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cosmos_auth_v1beta1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_cosmos_auth_v1beta1_tx_proto_goTypes = []interface{}{ - (*MsgUpdateParams)(nil), // 0: cosmos.auth.v1beta1.MsgUpdateParams - (*MsgUpdateParamsResponse)(nil), // 1: cosmos.auth.v1beta1.MsgUpdateParamsResponse - (*Params)(nil), // 2: cosmos.auth.v1beta1.Params + (*MsgUpdateParams)(nil), // 0: cosmos.auth.v1beta1.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 1: cosmos.auth.v1beta1.MsgUpdateParamsResponse + (*MsgNonAtomicExec)(nil), // 2: cosmos.auth.v1beta1.MsgNonAtomicExec + (*NonAtomicExecResult)(nil), // 3: cosmos.auth.v1beta1.NonAtomicExecResult + (*MsgNonAtomicExecResponse)(nil), // 4: cosmos.auth.v1beta1.MsgNonAtomicExecResponse + (*Params)(nil), // 5: cosmos.auth.v1beta1.Params + (*anypb.Any)(nil), // 6: google.protobuf.Any } var file_cosmos_auth_v1beta1_tx_proto_depIdxs = []int32{ - 2, // 0: cosmos.auth.v1beta1.MsgUpdateParams.params:type_name -> cosmos.auth.v1beta1.Params - 0, // 1: cosmos.auth.v1beta1.Msg.UpdateParams:input_type -> cosmos.auth.v1beta1.MsgUpdateParams - 1, // 2: cosmos.auth.v1beta1.Msg.UpdateParams:output_type -> cosmos.auth.v1beta1.MsgUpdateParamsResponse - 2, // [2:3] is the sub-list for method output_type - 1, // [1:2] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 5, // 0: cosmos.auth.v1beta1.MsgUpdateParams.params:type_name -> cosmos.auth.v1beta1.Params + 6, // 1: cosmos.auth.v1beta1.MsgNonAtomicExec.msgs:type_name -> google.protobuf.Any + 6, // 2: cosmos.auth.v1beta1.NonAtomicExecResult.resp:type_name -> google.protobuf.Any + 3, // 3: cosmos.auth.v1beta1.MsgNonAtomicExecResponse.results:type_name -> cosmos.auth.v1beta1.NonAtomicExecResult + 0, // 4: cosmos.auth.v1beta1.Msg.UpdateParams:input_type -> cosmos.auth.v1beta1.MsgUpdateParams + 2, // 5: cosmos.auth.v1beta1.Msg.NonAtomicExec:input_type -> cosmos.auth.v1beta1.MsgNonAtomicExec + 1, // 6: cosmos.auth.v1beta1.Msg.UpdateParams:output_type -> cosmos.auth.v1beta1.MsgUpdateParamsResponse + 4, // 7: cosmos.auth.v1beta1.Msg.NonAtomicExec:output_type -> cosmos.auth.v1beta1.MsgNonAtomicExecResponse + 6, // [6:8] is the sub-list for method output_type + 4, // [4:6] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_cosmos_auth_v1beta1_tx_proto_init() } @@ -1074,6 +2790,42 @@ func file_cosmos_auth_v1beta1_tx_proto_init() { return nil } } + file_cosmos_auth_v1beta1_tx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgNonAtomicExec); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_auth_v1beta1_tx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NonAtomicExecResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_auth_v1beta1_tx_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgNonAtomicExecResponse); 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{ @@ -1081,7 +2833,7 @@ func file_cosmos_auth_v1beta1_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_auth_v1beta1_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 5, NumExtensions: 0, NumServices: 1, }, diff --git a/api/cosmos/auth/v1beta1/tx_grpc.pb.go b/api/cosmos/auth/v1beta1/tx_grpc.pb.go index f6330fcec421..c079d602fb3f 100644 --- a/api/cosmos/auth/v1beta1/tx_grpc.pb.go +++ b/api/cosmos/auth/v1beta1/tx_grpc.pb.go @@ -19,7 +19,8 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Msg_UpdateParams_FullMethodName = "/cosmos.auth.v1beta1.Msg/UpdateParams" + Msg_UpdateParams_FullMethodName = "/cosmos.auth.v1beta1.Msg/UpdateParams" + Msg_NonAtomicExec_FullMethodName = "/cosmos.auth.v1beta1.Msg/NonAtomicExec" ) // MsgClient is the client API for Msg service. @@ -31,6 +32,8 @@ type MsgClient interface { // // Since: cosmos-sdk 0.47 UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + // NonAtomicExec allows users to submit multiple messages for non-atomic execution. + NonAtomicExec(ctx context.Context, in *MsgNonAtomicExec, opts ...grpc.CallOption) (*MsgNonAtomicExecResponse, error) } type msgClient struct { @@ -50,6 +53,15 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts return out, nil } +func (c *msgClient) NonAtomicExec(ctx context.Context, in *MsgNonAtomicExec, opts ...grpc.CallOption) (*MsgNonAtomicExecResponse, error) { + out := new(MsgNonAtomicExecResponse) + err := c.cc.Invoke(ctx, Msg_NonAtomicExec_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer // for forward compatibility @@ -59,6 +71,8 @@ type MsgServer interface { // // Since: cosmos-sdk 0.47 UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + // NonAtomicExec allows users to submit multiple messages for non-atomic execution. + NonAtomicExec(context.Context, *MsgNonAtomicExec) (*MsgNonAtomicExecResponse, error) mustEmbedUnimplementedMsgServer() } @@ -69,6 +83,9 @@ type UnimplementedMsgServer struct { func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } +func (UnimplementedMsgServer) NonAtomicExec(context.Context, *MsgNonAtomicExec) (*MsgNonAtomicExecResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NonAtomicExec not implemented") +} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. @@ -100,6 +117,24 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_NonAtomicExec_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgNonAtomicExec) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).NonAtomicExec(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_NonAtomicExec_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).NonAtomicExec(ctx, req.(*MsgNonAtomicExec)) + } + return interceptor(ctx, in, info, handler) +} + // Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -111,6 +146,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "UpdateParams", Handler: _Msg_UpdateParams_Handler, }, + { + MethodName: "NonAtomicExec", + Handler: _Msg_NonAtomicExec_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/auth/v1beta1/tx.proto", diff --git a/api/cosmos/bank/module/v1/module.pulsar.go b/api/cosmos/bank/module/v1/module.pulsar.go index 188920e4441d..d34ac1d8e167 100644 --- a/api/cosmos/bank/module/v1/module.pulsar.go +++ b/api/cosmos/bank/module/v1/module.pulsar.go @@ -59,10 +59,57 @@ func (x *_Module_1_list) IsValid() bool { return x.list != nil } +var _ protoreflect.List = (*_Module_3_list)(nil) + +type _Module_3_list struct { + list *[]string +} + +func (x *_Module_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Module_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Module_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Module_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Module_3_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Module at list field RestrictionsOrder as it is not of Message kind")) +} + +func (x *_Module_3_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Module_3_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Module_3_list) IsValid() bool { + return x.list != nil +} + var ( md_Module protoreflect.MessageDescriptor fd_Module_blocked_module_accounts_override protoreflect.FieldDescriptor fd_Module_authority protoreflect.FieldDescriptor + fd_Module_restrictions_order protoreflect.FieldDescriptor ) func init() { @@ -70,6 +117,7 @@ func init() { md_Module = File_cosmos_bank_module_v1_module_proto.Messages().ByName("Module") fd_Module_blocked_module_accounts_override = md_Module.Fields().ByName("blocked_module_accounts_override") fd_Module_authority = md_Module.Fields().ByName("authority") + fd_Module_restrictions_order = md_Module.Fields().ByName("restrictions_order") } var _ protoreflect.Message = (*fastReflection_Module)(nil) @@ -149,6 +197,12 @@ func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, proto return } } + if len(x.RestrictionsOrder) != 0 { + value := protoreflect.ValueOfList(&_Module_3_list{list: &x.RestrictionsOrder}) + if !f(fd_Module_restrictions_order, value) { + return + } + } } // Has reports whether a field is populated. @@ -168,6 +222,8 @@ func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool { return len(x.BlockedModuleAccountsOverride) != 0 case "cosmos.bank.module.v1.Module.authority": return x.Authority != "" + case "cosmos.bank.module.v1.Module.restrictions_order": + return len(x.RestrictionsOrder) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.module.v1.Module")) @@ -188,6 +244,8 @@ func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) { x.BlockedModuleAccountsOverride = nil case "cosmos.bank.module.v1.Module.authority": x.Authority = "" + case "cosmos.bank.module.v1.Module.restrictions_order": + x.RestrictionsOrder = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.module.v1.Module")) @@ -213,6 +271,12 @@ func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) pro case "cosmos.bank.module.v1.Module.authority": value := x.Authority return protoreflect.ValueOfString(value) + case "cosmos.bank.module.v1.Module.restrictions_order": + if len(x.RestrictionsOrder) == 0 { + return protoreflect.ValueOfList(&_Module_3_list{}) + } + listValue := &_Module_3_list{list: &x.RestrictionsOrder} + return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.module.v1.Module")) @@ -239,6 +303,10 @@ func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value proto x.BlockedModuleAccountsOverride = *clv.list case "cosmos.bank.module.v1.Module.authority": x.Authority = value.Interface().(string) + case "cosmos.bank.module.v1.Module.restrictions_order": + lv := value.List() + clv := lv.(*_Module_3_list) + x.RestrictionsOrder = *clv.list default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.module.v1.Module")) @@ -265,6 +333,12 @@ func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protore } value := &_Module_1_list{list: &x.BlockedModuleAccountsOverride} return protoreflect.ValueOfList(value) + case "cosmos.bank.module.v1.Module.restrictions_order": + if x.RestrictionsOrder == nil { + x.RestrictionsOrder = []string{} + } + value := &_Module_3_list{list: &x.RestrictionsOrder} + return protoreflect.ValueOfList(value) case "cosmos.bank.module.v1.Module.authority": panic(fmt.Errorf("field authority of message cosmos.bank.module.v1.Module is not mutable")) default: @@ -285,6 +359,9 @@ func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protor return protoreflect.ValueOfList(&_Module_1_list{list: &list}) case "cosmos.bank.module.v1.Module.authority": return protoreflect.ValueOfString("") + case "cosmos.bank.module.v1.Module.restrictions_order": + list := []string{} + return protoreflect.ValueOfList(&_Module_3_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.module.v1.Module")) @@ -364,6 +441,12 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + if len(x.RestrictionsOrder) > 0 { + for _, s := range x.RestrictionsOrder { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -393,6 +476,15 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.RestrictionsOrder) > 0 { + for iNdEx := len(x.RestrictionsOrder) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.RestrictionsOrder[iNdEx]) + copy(dAtA[i:], x.RestrictionsOrder[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.RestrictionsOrder[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } if len(x.Authority) > 0 { i -= len(x.Authority) copy(dAtA[i:], x.Authority) @@ -522,6 +614,38 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { } x.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RestrictionsOrder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.RestrictionsOrder = append(x.RestrictionsOrder, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -582,6 +706,11 @@ type Module struct { BlockedModuleAccountsOverride []string `protobuf:"bytes,1,rep,name=blocked_module_accounts_override,json=blockedModuleAccountsOverride,proto3" json:"blocked_module_accounts_override,omitempty"` // authority defines the custom module authority. If not set, defaults to the governance module. Authority string `protobuf:"bytes,2,opt,name=authority,proto3" json:"authority,omitempty"` + // restrictions_order specifies the order of send restrictions and should be + // a list of module names which provide a send restriction instance. If no + // order is provided, then restrictions will be applied in alphabetical order + // of module names. + RestrictionsOrder []string `protobuf:"bytes,3,rep,name=restrictions_order,json=restrictionsOrder,proto3" json:"restrictions_order,omitempty"` } func (x *Module) Reset() { @@ -618,6 +747,13 @@ func (x *Module) GetAuthority() string { return "" } +func (x *Module) GetRestrictionsOrder() []string { + if x != nil { + return x.RestrictionsOrder + } + return nil +} + var File_cosmos_bank_module_v1_module_proto protoreflect.FileDescriptor var file_cosmos_bank_module_v1_module_proto_rawDesc = []byte{ @@ -626,30 +762,33 @@ var file_cosmos_bank_module_v1_module_proto_rawDesc = []byte{ 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8c, 0x01, + 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbb, 0x01, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x47, 0x0a, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x1d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, - 0x1b, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x15, 0x0a, 0x13, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, - 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x78, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x42, 0xd0, 0x01, 0x0a, - 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, - 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, - 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x4d, - 0xaa, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x6e, 0x6b, 0x2e, 0x4d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, - 0xe2, 0x02, 0x21, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, 0x4d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x42, - 0x61, 0x6e, 0x6b, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, + 0x2d, 0x0a, 0x12, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, + 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x11, 0x72, 0x65, 0x73, + 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x3a, 0x1b, + 0xba, 0xc0, 0x96, 0xda, 0x01, 0x15, 0x0a, 0x13, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x78, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x42, 0xd0, 0x01, 0x0a, 0x19, + 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, + 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x4d, 0xaa, + 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x6e, 0x6b, 0x2e, 0x4d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x21, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, 0x4d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x42, 0x61, + 0x6e, 0x6b, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/cosmos/epochs/module/v1/module.pulsar.go b/api/cosmos/epochs/module/v1/module.pulsar.go new file mode 100644 index 000000000000..b169d8466fc7 --- /dev/null +++ b/api/cosmos/epochs/module/v1/module.pulsar.go @@ -0,0 +1,502 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package modulev1 + +import ( + _ "cosmossdk.io/api/cosmos/app/v1alpha1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_Module protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_epochs_module_v1_module_proto_init() + md_Module = File_cosmos_epochs_module_v1_module_proto.Messages().ByName("Module") +} + +var _ protoreflect.Message = (*fastReflection_Module)(nil) + +type fastReflection_Module Module + +func (x *Module) ProtoReflect() protoreflect.Message { + return (*fastReflection_Module)(x) +} + +func (x *Module) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_epochs_module_v1_module_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Module_messageType fastReflection_Module_messageType +var _ protoreflect.MessageType = fastReflection_Module_messageType{} + +type fastReflection_Module_messageType struct{} + +func (x fastReflection_Module_messageType) Zero() protoreflect.Message { + return (*fastReflection_Module)(nil) +} +func (x fastReflection_Module_messageType) New() protoreflect.Message { + return new(fastReflection_Module) +} +func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor { + return md_Module +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Module) Type() protoreflect.MessageType { + return _fastReflection_Module_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Module) New() protoreflect.Message { + return new(fastReflection_Module) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage { + return (*Module)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.epochs.module.v1.Module does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.epochs.module.v1.Module does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.epochs.module.v1.Module does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.epochs.module.v1.Module does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.epochs.module.v1.Module does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.module.v1.Module")) + } + panic(fmt.Errorf("message cosmos.epochs.module.v1.Module does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.epochs.module.v1.Module", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Module) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Module) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Module) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Module) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/epochs/module/v1/module.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Module is the config object of the authz module. +type Module struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Module) Reset() { + *x = Module{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_epochs_module_v1_module_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Module) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Module) ProtoMessage() {} + +// Deprecated: Use Module.ProtoReflect.Descriptor instead. +func (*Module) Descriptor() ([]byte, []int) { + return file_cosmos_epochs_module_v1_module_proto_rawDescGZIP(), []int{0} +} + +var File_cosmos_epochs_module_v1_module_proto protoreflect.FileDescriptor + +var file_cosmos_epochs_module_v1_module_proto_rawDesc = []byte{ + 0x0a, 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2f, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, + 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x27, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x1d, 0xba, 0xc0, 0x96, + 0xda, 0x01, 0x17, 0x0a, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, + 0x6f, 0x2f, 0x78, 0x2f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x42, 0xdc, 0x01, 0x0a, 0x1b, 0x63, + 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, + 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x31, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, + 0x45, 0x4d, 0xaa, 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, + 0x68, 0x73, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x17, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x5c, 0x4d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x23, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, + 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1a, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x3a, 0x3a, 0x4d, + 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_cosmos_epochs_module_v1_module_proto_rawDescOnce sync.Once + file_cosmos_epochs_module_v1_module_proto_rawDescData = file_cosmos_epochs_module_v1_module_proto_rawDesc +) + +func file_cosmos_epochs_module_v1_module_proto_rawDescGZIP() []byte { + file_cosmos_epochs_module_v1_module_proto_rawDescOnce.Do(func() { + file_cosmos_epochs_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_epochs_module_v1_module_proto_rawDescData) + }) + return file_cosmos_epochs_module_v1_module_proto_rawDescData +} + +var file_cosmos_epochs_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cosmos_epochs_module_v1_module_proto_goTypes = []interface{}{ + (*Module)(nil), // 0: cosmos.epochs.module.v1.Module +} +var file_cosmos_epochs_module_v1_module_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_cosmos_epochs_module_v1_module_proto_init() } +func file_cosmos_epochs_module_v1_module_proto_init() { + if File_cosmos_epochs_module_v1_module_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_epochs_module_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Module); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_epochs_module_v1_module_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cosmos_epochs_module_v1_module_proto_goTypes, + DependencyIndexes: file_cosmos_epochs_module_v1_module_proto_depIdxs, + MessageInfos: file_cosmos_epochs_module_v1_module_proto_msgTypes, + }.Build() + File_cosmos_epochs_module_v1_module_proto = out.File + file_cosmos_epochs_module_v1_module_proto_rawDesc = nil + file_cosmos_epochs_module_v1_module_proto_goTypes = nil + file_cosmos_epochs_module_v1_module_proto_depIdxs = nil +} diff --git a/api/cosmos/epochs/v1beta1/events.pulsar.go b/api/cosmos/epochs/v1beta1/events.pulsar.go new file mode 100644 index 000000000000..f067d3989446 --- /dev/null +++ b/api/cosmos/epochs/v1beta1/events.pulsar.go @@ -0,0 +1,1078 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package epochsv1beta1 + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + runtime "github.com/cosmos/cosmos-proto/runtime" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_EventEpochEnd protoreflect.MessageDescriptor + fd_EventEpochEnd_epoch_number protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_epochs_v1beta1_events_proto_init() + md_EventEpochEnd = File_cosmos_epochs_v1beta1_events_proto.Messages().ByName("EventEpochEnd") + fd_EventEpochEnd_epoch_number = md_EventEpochEnd.Fields().ByName("epoch_number") +} + +var _ protoreflect.Message = (*fastReflection_EventEpochEnd)(nil) + +type fastReflection_EventEpochEnd EventEpochEnd + +func (x *EventEpochEnd) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventEpochEnd)(x) +} + +func (x *EventEpochEnd) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_epochs_v1beta1_events_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EventEpochEnd_messageType fastReflection_EventEpochEnd_messageType +var _ protoreflect.MessageType = fastReflection_EventEpochEnd_messageType{} + +type fastReflection_EventEpochEnd_messageType struct{} + +func (x fastReflection_EventEpochEnd_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventEpochEnd)(nil) +} +func (x fastReflection_EventEpochEnd_messageType) New() protoreflect.Message { + return new(fastReflection_EventEpochEnd) +} +func (x fastReflection_EventEpochEnd_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventEpochEnd +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventEpochEnd) Descriptor() protoreflect.MessageDescriptor { + return md_EventEpochEnd +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_EventEpochEnd) Type() protoreflect.MessageType { + return _fastReflection_EventEpochEnd_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventEpochEnd) New() protoreflect.Message { + return new(fastReflection_EventEpochEnd) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventEpochEnd) Interface() protoreflect.ProtoMessage { + return (*EventEpochEnd)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_EventEpochEnd) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.EpochNumber != int64(0) { + value := protoreflect.ValueOfInt64(x.EpochNumber) + if !f(fd_EventEpochEnd_epoch_number, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_EventEpochEnd) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.EventEpochEnd.epoch_number": + return x.EpochNumber != int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EventEpochEnd")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EventEpochEnd does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventEpochEnd) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.EventEpochEnd.epoch_number": + x.EpochNumber = int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EventEpochEnd")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EventEpochEnd does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_EventEpochEnd) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.epochs.v1beta1.EventEpochEnd.epoch_number": + value := x.EpochNumber + return protoreflect.ValueOfInt64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EventEpochEnd")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EventEpochEnd does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventEpochEnd) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.EventEpochEnd.epoch_number": + x.EpochNumber = value.Int() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EventEpochEnd")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EventEpochEnd does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventEpochEnd) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.EventEpochEnd.epoch_number": + panic(fmt.Errorf("field epoch_number of message cosmos.epochs.v1beta1.EventEpochEnd is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EventEpochEnd")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EventEpochEnd does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_EventEpochEnd) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.EventEpochEnd.epoch_number": + return protoreflect.ValueOfInt64(int64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EventEpochEnd")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EventEpochEnd does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_EventEpochEnd) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.epochs.v1beta1.EventEpochEnd", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_EventEpochEnd) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventEpochEnd) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_EventEpochEnd) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_EventEpochEnd) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventEpochEnd) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.EpochNumber != 0 { + n += 1 + runtime.Sov(uint64(x.EpochNumber)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EventEpochEnd) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.EpochNumber != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.EpochNumber)) + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*EventEpochEnd) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventEpochEnd: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventEpochEnd: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EpochNumber", wireType) + } + x.EpochNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.EpochNumber |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_EventEpochStart protoreflect.MessageDescriptor + fd_EventEpochStart_epoch_number protoreflect.FieldDescriptor + fd_EventEpochStart_epoch_start_time protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_epochs_v1beta1_events_proto_init() + md_EventEpochStart = File_cosmos_epochs_v1beta1_events_proto.Messages().ByName("EventEpochStart") + fd_EventEpochStart_epoch_number = md_EventEpochStart.Fields().ByName("epoch_number") + fd_EventEpochStart_epoch_start_time = md_EventEpochStart.Fields().ByName("epoch_start_time") +} + +var _ protoreflect.Message = (*fastReflection_EventEpochStart)(nil) + +type fastReflection_EventEpochStart EventEpochStart + +func (x *EventEpochStart) ProtoReflect() protoreflect.Message { + return (*fastReflection_EventEpochStart)(x) +} + +func (x *EventEpochStart) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_epochs_v1beta1_events_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EventEpochStart_messageType fastReflection_EventEpochStart_messageType +var _ protoreflect.MessageType = fastReflection_EventEpochStart_messageType{} + +type fastReflection_EventEpochStart_messageType struct{} + +func (x fastReflection_EventEpochStart_messageType) Zero() protoreflect.Message { + return (*fastReflection_EventEpochStart)(nil) +} +func (x fastReflection_EventEpochStart_messageType) New() protoreflect.Message { + return new(fastReflection_EventEpochStart) +} +func (x fastReflection_EventEpochStart_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EventEpochStart +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EventEpochStart) Descriptor() protoreflect.MessageDescriptor { + return md_EventEpochStart +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_EventEpochStart) Type() protoreflect.MessageType { + return _fastReflection_EventEpochStart_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EventEpochStart) New() protoreflect.Message { + return new(fastReflection_EventEpochStart) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EventEpochStart) Interface() protoreflect.ProtoMessage { + return (*EventEpochStart)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_EventEpochStart) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.EpochNumber != int64(0) { + value := protoreflect.ValueOfInt64(x.EpochNumber) + if !f(fd_EventEpochStart_epoch_number, value) { + return + } + } + if x.EpochStartTime != int64(0) { + value := protoreflect.ValueOfInt64(x.EpochStartTime) + if !f(fd_EventEpochStart_epoch_start_time, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_EventEpochStart) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.EventEpochStart.epoch_number": + return x.EpochNumber != int64(0) + case "cosmos.epochs.v1beta1.EventEpochStart.epoch_start_time": + return x.EpochStartTime != int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EventEpochStart")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EventEpochStart does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventEpochStart) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.EventEpochStart.epoch_number": + x.EpochNumber = int64(0) + case "cosmos.epochs.v1beta1.EventEpochStart.epoch_start_time": + x.EpochStartTime = int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EventEpochStart")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EventEpochStart does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_EventEpochStart) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.epochs.v1beta1.EventEpochStart.epoch_number": + value := x.EpochNumber + return protoreflect.ValueOfInt64(value) + case "cosmos.epochs.v1beta1.EventEpochStart.epoch_start_time": + value := x.EpochStartTime + return protoreflect.ValueOfInt64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EventEpochStart")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EventEpochStart does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventEpochStart) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.EventEpochStart.epoch_number": + x.EpochNumber = value.Int() + case "cosmos.epochs.v1beta1.EventEpochStart.epoch_start_time": + x.EpochStartTime = value.Int() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EventEpochStart")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EventEpochStart does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventEpochStart) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.EventEpochStart.epoch_number": + panic(fmt.Errorf("field epoch_number of message cosmos.epochs.v1beta1.EventEpochStart is not mutable")) + case "cosmos.epochs.v1beta1.EventEpochStart.epoch_start_time": + panic(fmt.Errorf("field epoch_start_time of message cosmos.epochs.v1beta1.EventEpochStart is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EventEpochStart")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EventEpochStart does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_EventEpochStart) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.EventEpochStart.epoch_number": + return protoreflect.ValueOfInt64(int64(0)) + case "cosmos.epochs.v1beta1.EventEpochStart.epoch_start_time": + return protoreflect.ValueOfInt64(int64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EventEpochStart")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EventEpochStart does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_EventEpochStart) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.epochs.v1beta1.EventEpochStart", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_EventEpochStart) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EventEpochStart) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_EventEpochStart) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_EventEpochStart) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EventEpochStart) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.EpochNumber != 0 { + n += 1 + runtime.Sov(uint64(x.EpochNumber)) + } + if x.EpochStartTime != 0 { + n += 1 + runtime.Sov(uint64(x.EpochStartTime)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EventEpochStart) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.EpochStartTime != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.EpochStartTime)) + i-- + dAtA[i] = 0x10 + } + if x.EpochNumber != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.EpochNumber)) + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*EventEpochStart) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventEpochStart: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EventEpochStart: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EpochNumber", wireType) + } + x.EpochNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.EpochNumber |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EpochStartTime", wireType) + } + x.EpochStartTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.EpochStartTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Since: x/epochs 0.1.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/epochs/v1beta1/events.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// EventEpochEnd is an event emitted when an epoch end. +type EventEpochEnd struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EpochNumber int64 `protobuf:"varint,1,opt,name=epoch_number,json=epochNumber,proto3" json:"epoch_number,omitempty"` +} + +func (x *EventEpochEnd) Reset() { + *x = EventEpochEnd{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_epochs_v1beta1_events_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventEpochEnd) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventEpochEnd) ProtoMessage() {} + +// Deprecated: Use EventEpochEnd.ProtoReflect.Descriptor instead. +func (*EventEpochEnd) Descriptor() ([]byte, []int) { + return file_cosmos_epochs_v1beta1_events_proto_rawDescGZIP(), []int{0} +} + +func (x *EventEpochEnd) GetEpochNumber() int64 { + if x != nil { + return x.EpochNumber + } + return 0 +} + +// EventEpochStart is an event emitted when an epoch start. +type EventEpochStart struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EpochNumber int64 `protobuf:"varint,1,opt,name=epoch_number,json=epochNumber,proto3" json:"epoch_number,omitempty"` + EpochStartTime int64 `protobuf:"varint,2,opt,name=epoch_start_time,json=epochStartTime,proto3" json:"epoch_start_time,omitempty"` +} + +func (x *EventEpochStart) Reset() { + *x = EventEpochStart{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_epochs_v1beta1_events_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventEpochStart) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventEpochStart) ProtoMessage() {} + +// Deprecated: Use EventEpochStart.ProtoReflect.Descriptor instead. +func (*EventEpochStart) Descriptor() ([]byte, []int) { + return file_cosmos_epochs_v1beta1_events_proto_rawDescGZIP(), []int{1} +} + +func (x *EventEpochStart) GetEpochNumber() int64 { + if x != nil { + return x.EpochNumber + } + return 0 +} + +func (x *EventEpochStart) GetEpochStartTime() int64 { + if x != nil { + return x.EpochStartTime + } + return 0 +} + +var File_cosmos_epochs_v1beta1_events_proto protoreflect.FileDescriptor + +var file_cosmos_epochs_v1beta1_events_proto_rawDesc = []byte{ + 0x0a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2f, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x70, 0x6f, + 0x63, 0x68, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x19, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x67, 0x65, + 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x32, 0x0a, 0x0d, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x45, 0x6e, 0x64, 0x12, 0x21, 0x0a, 0x0c, + 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0b, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, + 0x5e, 0x0a, 0x0f, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x53, 0x74, 0x61, + 0x72, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x6e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x4e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x28, 0x0a, 0x10, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0e, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x42, + 0xd4, 0x01, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0b, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2f, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x3b, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x45, 0x58, 0xaa, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0xca, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, + 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x21, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x5c, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x17, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_epochs_v1beta1_events_proto_rawDescOnce sync.Once + file_cosmos_epochs_v1beta1_events_proto_rawDescData = file_cosmos_epochs_v1beta1_events_proto_rawDesc +) + +func file_cosmos_epochs_v1beta1_events_proto_rawDescGZIP() []byte { + file_cosmos_epochs_v1beta1_events_proto_rawDescOnce.Do(func() { + file_cosmos_epochs_v1beta1_events_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_epochs_v1beta1_events_proto_rawDescData) + }) + return file_cosmos_epochs_v1beta1_events_proto_rawDescData +} + +var file_cosmos_epochs_v1beta1_events_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cosmos_epochs_v1beta1_events_proto_goTypes = []interface{}{ + (*EventEpochEnd)(nil), // 0: cosmos.epochs.v1beta1.EventEpochEnd + (*EventEpochStart)(nil), // 1: cosmos.epochs.v1beta1.EventEpochStart +} +var file_cosmos_epochs_v1beta1_events_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_cosmos_epochs_v1beta1_events_proto_init() } +func file_cosmos_epochs_v1beta1_events_proto_init() { + if File_cosmos_epochs_v1beta1_events_proto != nil { + return + } + file_cosmos_epochs_v1beta1_genesis_proto_init() + if !protoimpl.UnsafeEnabled { + file_cosmos_epochs_v1beta1_events_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventEpochEnd); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_epochs_v1beta1_events_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventEpochStart); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_epochs_v1beta1_events_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cosmos_epochs_v1beta1_events_proto_goTypes, + DependencyIndexes: file_cosmos_epochs_v1beta1_events_proto_depIdxs, + MessageInfos: file_cosmos_epochs_v1beta1_events_proto_msgTypes, + }.Build() + File_cosmos_epochs_v1beta1_events_proto = out.File + file_cosmos_epochs_v1beta1_events_proto_rawDesc = nil + file_cosmos_epochs_v1beta1_events_proto_goTypes = nil + file_cosmos_epochs_v1beta1_events_proto_depIdxs = nil +} diff --git a/api/cosmos/epochs/v1beta1/genesis.pulsar.go b/api/cosmos/epochs/v1beta1/genesis.pulsar.go new file mode 100644 index 000000000000..69afd9e88405 --- /dev/null +++ b/api/cosmos/epochs/v1beta1/genesis.pulsar.go @@ -0,0 +1,1628 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package epochsv1beta1 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_EpochInfo protoreflect.MessageDescriptor + fd_EpochInfo_identifier protoreflect.FieldDescriptor + fd_EpochInfo_start_time protoreflect.FieldDescriptor + fd_EpochInfo_duration protoreflect.FieldDescriptor + fd_EpochInfo_current_epoch protoreflect.FieldDescriptor + fd_EpochInfo_current_epoch_start_time protoreflect.FieldDescriptor + fd_EpochInfo_epoch_counting_started protoreflect.FieldDescriptor + fd_EpochInfo_current_epoch_start_height protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_epochs_v1beta1_genesis_proto_init() + md_EpochInfo = File_cosmos_epochs_v1beta1_genesis_proto.Messages().ByName("EpochInfo") + fd_EpochInfo_identifier = md_EpochInfo.Fields().ByName("identifier") + fd_EpochInfo_start_time = md_EpochInfo.Fields().ByName("start_time") + fd_EpochInfo_duration = md_EpochInfo.Fields().ByName("duration") + fd_EpochInfo_current_epoch = md_EpochInfo.Fields().ByName("current_epoch") + fd_EpochInfo_current_epoch_start_time = md_EpochInfo.Fields().ByName("current_epoch_start_time") + fd_EpochInfo_epoch_counting_started = md_EpochInfo.Fields().ByName("epoch_counting_started") + fd_EpochInfo_current_epoch_start_height = md_EpochInfo.Fields().ByName("current_epoch_start_height") +} + +var _ protoreflect.Message = (*fastReflection_EpochInfo)(nil) + +type fastReflection_EpochInfo EpochInfo + +func (x *EpochInfo) ProtoReflect() protoreflect.Message { + return (*fastReflection_EpochInfo)(x) +} + +func (x *EpochInfo) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_epochs_v1beta1_genesis_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EpochInfo_messageType fastReflection_EpochInfo_messageType +var _ protoreflect.MessageType = fastReflection_EpochInfo_messageType{} + +type fastReflection_EpochInfo_messageType struct{} + +func (x fastReflection_EpochInfo_messageType) Zero() protoreflect.Message { + return (*fastReflection_EpochInfo)(nil) +} +func (x fastReflection_EpochInfo_messageType) New() protoreflect.Message { + return new(fastReflection_EpochInfo) +} +func (x fastReflection_EpochInfo_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EpochInfo +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EpochInfo) Descriptor() protoreflect.MessageDescriptor { + return md_EpochInfo +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_EpochInfo) Type() protoreflect.MessageType { + return _fastReflection_EpochInfo_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EpochInfo) New() protoreflect.Message { + return new(fastReflection_EpochInfo) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EpochInfo) Interface() protoreflect.ProtoMessage { + return (*EpochInfo)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_EpochInfo) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Identifier != "" { + value := protoreflect.ValueOfString(x.Identifier) + if !f(fd_EpochInfo_identifier, value) { + return + } + } + if x.StartTime != nil { + value := protoreflect.ValueOfMessage(x.StartTime.ProtoReflect()) + if !f(fd_EpochInfo_start_time, value) { + return + } + } + if x.Duration != nil { + value := protoreflect.ValueOfMessage(x.Duration.ProtoReflect()) + if !f(fd_EpochInfo_duration, value) { + return + } + } + if x.CurrentEpoch != int64(0) { + value := protoreflect.ValueOfInt64(x.CurrentEpoch) + if !f(fd_EpochInfo_current_epoch, value) { + return + } + } + if x.CurrentEpochStartTime != nil { + value := protoreflect.ValueOfMessage(x.CurrentEpochStartTime.ProtoReflect()) + if !f(fd_EpochInfo_current_epoch_start_time, value) { + return + } + } + if x.EpochCountingStarted != false { + value := protoreflect.ValueOfBool(x.EpochCountingStarted) + if !f(fd_EpochInfo_epoch_counting_started, value) { + return + } + } + if x.CurrentEpochStartHeight != int64(0) { + value := protoreflect.ValueOfInt64(x.CurrentEpochStartHeight) + if !f(fd_EpochInfo_current_epoch_start_height, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_EpochInfo) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.EpochInfo.identifier": + return x.Identifier != "" + case "cosmos.epochs.v1beta1.EpochInfo.start_time": + return x.StartTime != nil + case "cosmos.epochs.v1beta1.EpochInfo.duration": + return x.Duration != nil + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch": + return x.CurrentEpoch != int64(0) + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch_start_time": + return x.CurrentEpochStartTime != nil + case "cosmos.epochs.v1beta1.EpochInfo.epoch_counting_started": + return x.EpochCountingStarted != false + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch_start_height": + return x.CurrentEpochStartHeight != int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EpochInfo")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EpochInfo does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EpochInfo) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.EpochInfo.identifier": + x.Identifier = "" + case "cosmos.epochs.v1beta1.EpochInfo.start_time": + x.StartTime = nil + case "cosmos.epochs.v1beta1.EpochInfo.duration": + x.Duration = nil + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch": + x.CurrentEpoch = int64(0) + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch_start_time": + x.CurrentEpochStartTime = nil + case "cosmos.epochs.v1beta1.EpochInfo.epoch_counting_started": + x.EpochCountingStarted = false + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch_start_height": + x.CurrentEpochStartHeight = int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EpochInfo")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EpochInfo does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_EpochInfo) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.epochs.v1beta1.EpochInfo.identifier": + value := x.Identifier + return protoreflect.ValueOfString(value) + case "cosmos.epochs.v1beta1.EpochInfo.start_time": + value := x.StartTime + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.epochs.v1beta1.EpochInfo.duration": + value := x.Duration + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch": + value := x.CurrentEpoch + return protoreflect.ValueOfInt64(value) + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch_start_time": + value := x.CurrentEpochStartTime + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.epochs.v1beta1.EpochInfo.epoch_counting_started": + value := x.EpochCountingStarted + return protoreflect.ValueOfBool(value) + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch_start_height": + value := x.CurrentEpochStartHeight + return protoreflect.ValueOfInt64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EpochInfo")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EpochInfo does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EpochInfo) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.EpochInfo.identifier": + x.Identifier = value.Interface().(string) + case "cosmos.epochs.v1beta1.EpochInfo.start_time": + x.StartTime = value.Message().Interface().(*timestamppb.Timestamp) + case "cosmos.epochs.v1beta1.EpochInfo.duration": + x.Duration = value.Message().Interface().(*durationpb.Duration) + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch": + x.CurrentEpoch = value.Int() + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch_start_time": + x.CurrentEpochStartTime = value.Message().Interface().(*timestamppb.Timestamp) + case "cosmos.epochs.v1beta1.EpochInfo.epoch_counting_started": + x.EpochCountingStarted = value.Bool() + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch_start_height": + x.CurrentEpochStartHeight = value.Int() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EpochInfo")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EpochInfo does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EpochInfo) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.EpochInfo.start_time": + if x.StartTime == nil { + x.StartTime = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.StartTime.ProtoReflect()) + case "cosmos.epochs.v1beta1.EpochInfo.duration": + if x.Duration == nil { + x.Duration = new(durationpb.Duration) + } + return protoreflect.ValueOfMessage(x.Duration.ProtoReflect()) + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch_start_time": + if x.CurrentEpochStartTime == nil { + x.CurrentEpochStartTime = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.CurrentEpochStartTime.ProtoReflect()) + case "cosmos.epochs.v1beta1.EpochInfo.identifier": + panic(fmt.Errorf("field identifier of message cosmos.epochs.v1beta1.EpochInfo is not mutable")) + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch": + panic(fmt.Errorf("field current_epoch of message cosmos.epochs.v1beta1.EpochInfo is not mutable")) + case "cosmos.epochs.v1beta1.EpochInfo.epoch_counting_started": + panic(fmt.Errorf("field epoch_counting_started of message cosmos.epochs.v1beta1.EpochInfo is not mutable")) + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch_start_height": + panic(fmt.Errorf("field current_epoch_start_height of message cosmos.epochs.v1beta1.EpochInfo is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EpochInfo")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EpochInfo does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_EpochInfo) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.EpochInfo.identifier": + return protoreflect.ValueOfString("") + case "cosmos.epochs.v1beta1.EpochInfo.start_time": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.epochs.v1beta1.EpochInfo.duration": + m := new(durationpb.Duration) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch": + return protoreflect.ValueOfInt64(int64(0)) + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch_start_time": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.epochs.v1beta1.EpochInfo.epoch_counting_started": + return protoreflect.ValueOfBool(false) + case "cosmos.epochs.v1beta1.EpochInfo.current_epoch_start_height": + return protoreflect.ValueOfInt64(int64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.EpochInfo")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.EpochInfo does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_EpochInfo) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.epochs.v1beta1.EpochInfo", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_EpochInfo) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EpochInfo) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_EpochInfo) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_EpochInfo) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EpochInfo) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Identifier) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.StartTime != nil { + l = options.Size(x.StartTime) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Duration != nil { + l = options.Size(x.Duration) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.CurrentEpoch != 0 { + n += 1 + runtime.Sov(uint64(x.CurrentEpoch)) + } + if x.CurrentEpochStartTime != nil { + l = options.Size(x.CurrentEpochStartTime) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.EpochCountingStarted { + n += 2 + } + if x.CurrentEpochStartHeight != 0 { + n += 1 + runtime.Sov(uint64(x.CurrentEpochStartHeight)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EpochInfo) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.CurrentEpochStartHeight != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.CurrentEpochStartHeight)) + i-- + dAtA[i] = 0x40 + } + if x.EpochCountingStarted { + i-- + if x.EpochCountingStarted { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if x.CurrentEpochStartTime != nil { + encoded, err := options.Marshal(x.CurrentEpochStartTime) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x2a + } + if x.CurrentEpoch != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.CurrentEpoch)) + i-- + dAtA[i] = 0x20 + } + if x.Duration != nil { + encoded, err := options.Marshal(x.Duration) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1a + } + if x.StartTime != nil { + encoded, err := options.Marshal(x.StartTime) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if len(x.Identifier) > 0 { + i -= len(x.Identifier) + copy(dAtA[i:], x.Identifier) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Identifier))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*EpochInfo) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EpochInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EpochInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Identifier", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Identifier = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.StartTime == nil { + x.StartTime = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.StartTime); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Duration == nil { + x.Duration = &durationpb.Duration{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Duration); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CurrentEpoch", wireType) + } + x.CurrentEpoch = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.CurrentEpoch |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CurrentEpochStartTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.CurrentEpochStartTime == nil { + x.CurrentEpochStartTime = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.CurrentEpochStartTime); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EpochCountingStarted", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.EpochCountingStarted = bool(v != 0) + case 8: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CurrentEpochStartHeight", wireType) + } + x.CurrentEpochStartHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.CurrentEpochStartHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_GenesisState_1_list)(nil) + +type _GenesisState_1_list struct { + list *[]*EpochInfo +} + +func (x *_GenesisState_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*EpochInfo) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*EpochInfo) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_1_list) AppendMutable() protoreflect.Value { + v := new(EpochInfo) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_1_list) NewElement() protoreflect.Value { + v := new(EpochInfo) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_GenesisState protoreflect.MessageDescriptor + fd_GenesisState_epochs protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_epochs_v1beta1_genesis_proto_init() + md_GenesisState = File_cosmos_epochs_v1beta1_genesis_proto.Messages().ByName("GenesisState") + fd_GenesisState_epochs = md_GenesisState.Fields().ByName("epochs") +} + +var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) + +type fastReflection_GenesisState GenesisState + +func (x *GenesisState) ProtoReflect() protoreflect.Message { + return (*fastReflection_GenesisState)(x) +} + +func (x *GenesisState) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_epochs_v1beta1_genesis_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_GenesisState_messageType fastReflection_GenesisState_messageType +var _ protoreflect.MessageType = fastReflection_GenesisState_messageType{} + +type fastReflection_GenesisState_messageType struct{} + +func (x fastReflection_GenesisState_messageType) Zero() protoreflect.Message { + return (*fastReflection_GenesisState)(nil) +} +func (x fastReflection_GenesisState_messageType) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} +func (x fastReflection_GenesisState_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_GenesisState) Descriptor() protoreflect.MessageDescriptor { + return md_GenesisState +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_GenesisState) Type() protoreflect.MessageType { + return _fastReflection_GenesisState_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_GenesisState) New() protoreflect.Message { + return new(fastReflection_GenesisState) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_GenesisState) Interface() protoreflect.ProtoMessage { + return (*GenesisState)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Epochs) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_1_list{list: &x.Epochs}) + if !f(fd_GenesisState_epochs, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.GenesisState.epochs": + return len(x.Epochs) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.GenesisState.epochs": + x.Epochs = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.epochs.v1beta1.GenesisState.epochs": + if len(x.Epochs) == 0 { + return protoreflect.ValueOfList(&_GenesisState_1_list{}) + } + listValue := &_GenesisState_1_list{list: &x.Epochs} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.GenesisState does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.GenesisState.epochs": + lv := value.List() + clv := lv.(*_GenesisState_1_list) + x.Epochs = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.GenesisState.epochs": + if x.Epochs == nil { + x.Epochs = []*EpochInfo{} + } + value := &_GenesisState_1_list{list: &x.Epochs} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.GenesisState.epochs": + list := []*EpochInfo{} + return protoreflect.ValueOfList(&_GenesisState_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.GenesisState")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.GenesisState does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_GenesisState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.epochs.v1beta1.GenesisState", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_GenesisState) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_GenesisState) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_GenesisState) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Epochs) > 0 { + for _, e := range x.Epochs { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Epochs) > 0 { + for iNdEx := len(x.Epochs) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Epochs[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*GenesisState) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Epochs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Epochs = append(x.Epochs, &EpochInfo{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Epochs[len(x.Epochs)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/epochs/v1beta1/genesis.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// EpochInfo is a struct that describes the data going into +// a timer defined by the x/epochs module. +type EpochInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // identifier is a unique reference to this particular timer. + Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` + // start_time is the time at which the timer first ever ticks. + // If start_time is in the future, the epoch will not begin until the start + // time. + StartTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + // duration is the time in between epoch ticks. + // In order for intended behavior to be met, duration should + // be greater than the chains expected block time. + // Duration must be non-zero. + Duration *durationpb.Duration `protobuf:"bytes,3,opt,name=duration,proto3" json:"duration,omitempty"` + // current_epoch is the current epoch number, or in other words, + // how many times has the timer 'ticked'. + // The first tick (current_epoch=1) is defined as + // the first block whose blocktime is greater than the EpochInfo start_time. + CurrentEpoch int64 `protobuf:"varint,4,opt,name=current_epoch,json=currentEpoch,proto3" json:"current_epoch,omitempty"` + // current_epoch_start_time describes the start time of the current timer + // interval. The interval is (current_epoch_start_time, + // current_epoch_start_time + duration] When the timer ticks, this is set to + // current_epoch_start_time = last_epoch_start_time + duration only one timer + // tick for a given identifier can occur per block. + // + // NOTE! The current_epoch_start_time may diverge significantly from the + // wall-clock time the epoch began at. Wall-clock time of epoch start may be + // >> current_epoch_start_time. Suppose current_epoch_start_time = 10, + // duration = 5. Suppose the chain goes offline at t=14, and comes back online + // at t=30, and produces blocks at every successive time. (t=31, 32, etc.) + // * The t=30 block will start the epoch for (10, 15] + // * The t=31 block will start the epoch for (15, 20] + // * The t=32 block will start the epoch for (20, 25] + // * The t=33 block will start the epoch for (25, 30] + // * The t=34 block will start the epoch for (30, 35] + // * The **t=36** block will start the epoch for (35, 40] + CurrentEpochStartTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=current_epoch_start_time,json=currentEpochStartTime,proto3" json:"current_epoch_start_time,omitempty"` + // epoch_counting_started is a boolean, that indicates whether this + // epoch timer has began yet. + EpochCountingStarted bool `protobuf:"varint,6,opt,name=epoch_counting_started,json=epochCountingStarted,proto3" json:"epoch_counting_started,omitempty"` + // current_epoch_start_height is the block height at which the current epoch + // started. (The block height at which the timer last ticked) + CurrentEpochStartHeight int64 `protobuf:"varint,8,opt,name=current_epoch_start_height,json=currentEpochStartHeight,proto3" json:"current_epoch_start_height,omitempty"` +} + +func (x *EpochInfo) Reset() { + *x = EpochInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_epochs_v1beta1_genesis_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EpochInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EpochInfo) ProtoMessage() {} + +// Deprecated: Use EpochInfo.ProtoReflect.Descriptor instead. +func (*EpochInfo) Descriptor() ([]byte, []int) { + return file_cosmos_epochs_v1beta1_genesis_proto_rawDescGZIP(), []int{0} +} + +func (x *EpochInfo) GetIdentifier() string { + if x != nil { + return x.Identifier + } + return "" +} + +func (x *EpochInfo) GetStartTime() *timestamppb.Timestamp { + if x != nil { + return x.StartTime + } + return nil +} + +func (x *EpochInfo) GetDuration() *durationpb.Duration { + if x != nil { + return x.Duration + } + return nil +} + +func (x *EpochInfo) GetCurrentEpoch() int64 { + if x != nil { + return x.CurrentEpoch + } + return 0 +} + +func (x *EpochInfo) GetCurrentEpochStartTime() *timestamppb.Timestamp { + if x != nil { + return x.CurrentEpochStartTime + } + return nil +} + +func (x *EpochInfo) GetEpochCountingStarted() bool { + if x != nil { + return x.EpochCountingStarted + } + return false +} + +func (x *EpochInfo) GetCurrentEpochStartHeight() int64 { + if x != nil { + return x.CurrentEpochStartHeight + } + return 0 +} + +// GenesisState defines the epochs module's genesis state. +type GenesisState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Epochs []*EpochInfo `protobuf:"bytes,1,rep,name=epochs,proto3" json:"epochs,omitempty"` +} + +func (x *GenesisState) Reset() { + *x = GenesisState{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_epochs_v1beta1_genesis_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenesisState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenesisState) ProtoMessage() {} + +// Deprecated: Use GenesisState.ProtoReflect.Descriptor instead. +func (*GenesisState) Descriptor() ([]byte, []int) { + return file_cosmos_epochs_v1beta1_genesis_proto_rawDescGZIP(), []int{1} +} + +func (x *GenesisState) GetEpochs() []*EpochInfo { + if x != nil { + return x.Epochs + } + return nil +} + +var File_cosmos_epochs_v1beta1_genesis_proto protoreflect.FileDescriptor + +var file_cosmos_epochs_v1beta1_genesis_proto_rawDesc = []byte{ + 0x0a, 0x23, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2f, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x70, + 0x6f, 0x63, 0x68, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x14, 0x67, 0x6f, + 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0xc4, 0x03, 0x0a, 0x09, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x49, 0x6e, 0x66, + 0x6f, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, + 0x72, 0x12, 0x43, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x09, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x55, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x42, 0x1e, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x12, 0x64, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x98, + 0xdf, 0x1f, 0x01, 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, + 0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, + 0x63, 0x68, 0x12, 0x5d, 0x0a, 0x18, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, + 0x6f, 0x63, 0x68, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x15, 0x63, 0x75, 0x72, 0x72, + 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, + 0x65, 0x12, 0x34, 0x0a, 0x16, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x14, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x69, 0x6e, 0x67, + 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x12, 0x3b, 0x0a, 0x1a, 0x63, 0x75, 0x72, 0x72, 0x65, + 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x68, + 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x17, 0x63, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x53, 0x74, 0x61, 0x72, 0x74, 0x48, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x4a, 0x04, 0x08, 0x07, 0x10, 0x08, 0x22, 0x4e, 0x0a, 0x0c, 0x47, 0x65, + 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x3e, 0x0a, 0x06, 0x65, 0x70, + 0x6f, 0x63, 0x68, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x04, 0xc8, 0xde, + 0x1f, 0x00, 0x52, 0x06, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x42, 0xd5, 0x01, 0x0a, 0x19, 0x63, + 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, + 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x3b, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, + 0x03, 0x43, 0x45, 0x58, 0xaa, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x45, 0x70, + 0x6f, 0x63, 0x68, 0x73, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x15, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x5c, 0x56, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x21, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x70, + 0x6f, 0x63, 0x68, 0x73, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x3a, 0x3a, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_epochs_v1beta1_genesis_proto_rawDescOnce sync.Once + file_cosmos_epochs_v1beta1_genesis_proto_rawDescData = file_cosmos_epochs_v1beta1_genesis_proto_rawDesc +) + +func file_cosmos_epochs_v1beta1_genesis_proto_rawDescGZIP() []byte { + file_cosmos_epochs_v1beta1_genesis_proto_rawDescOnce.Do(func() { + file_cosmos_epochs_v1beta1_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_epochs_v1beta1_genesis_proto_rawDescData) + }) + return file_cosmos_epochs_v1beta1_genesis_proto_rawDescData +} + +var file_cosmos_epochs_v1beta1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cosmos_epochs_v1beta1_genesis_proto_goTypes = []interface{}{ + (*EpochInfo)(nil), // 0: cosmos.epochs.v1beta1.EpochInfo + (*GenesisState)(nil), // 1: cosmos.epochs.v1beta1.GenesisState + (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 3: google.protobuf.Duration +} +var file_cosmos_epochs_v1beta1_genesis_proto_depIdxs = []int32{ + 2, // 0: cosmos.epochs.v1beta1.EpochInfo.start_time:type_name -> google.protobuf.Timestamp + 3, // 1: cosmos.epochs.v1beta1.EpochInfo.duration:type_name -> google.protobuf.Duration + 2, // 2: cosmos.epochs.v1beta1.EpochInfo.current_epoch_start_time:type_name -> google.protobuf.Timestamp + 0, // 3: cosmos.epochs.v1beta1.GenesisState.epochs:type_name -> cosmos.epochs.v1beta1.EpochInfo + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_cosmos_epochs_v1beta1_genesis_proto_init() } +func file_cosmos_epochs_v1beta1_genesis_proto_init() { + if File_cosmos_epochs_v1beta1_genesis_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_epochs_v1beta1_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EpochInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_epochs_v1beta1_genesis_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenesisState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_epochs_v1beta1_genesis_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cosmos_epochs_v1beta1_genesis_proto_goTypes, + DependencyIndexes: file_cosmos_epochs_v1beta1_genesis_proto_depIdxs, + MessageInfos: file_cosmos_epochs_v1beta1_genesis_proto_msgTypes, + }.Build() + File_cosmos_epochs_v1beta1_genesis_proto = out.File + file_cosmos_epochs_v1beta1_genesis_proto_rawDesc = nil + file_cosmos_epochs_v1beta1_genesis_proto_goTypes = nil + file_cosmos_epochs_v1beta1_genesis_proto_depIdxs = nil +} diff --git a/api/cosmos/epochs/v1beta1/query.pulsar.go b/api/cosmos/epochs/v1beta1/query.pulsar.go new file mode 100644 index 000000000000..59b6cfa0810b --- /dev/null +++ b/api/cosmos/epochs/v1beta1/query.pulsar.go @@ -0,0 +1,2010 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package epochsv1beta1 + +import ( + _ "cosmossdk.io/api/cosmos/base/query/v1beta1" + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_QueryEpochsInfoRequest protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_epochs_v1beta1_query_proto_init() + md_QueryEpochsInfoRequest = File_cosmos_epochs_v1beta1_query_proto.Messages().ByName("QueryEpochsInfoRequest") +} + +var _ protoreflect.Message = (*fastReflection_QueryEpochsInfoRequest)(nil) + +type fastReflection_QueryEpochsInfoRequest QueryEpochsInfoRequest + +func (x *QueryEpochsInfoRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryEpochsInfoRequest)(x) +} + +func (x *QueryEpochsInfoRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_epochs_v1beta1_query_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryEpochsInfoRequest_messageType fastReflection_QueryEpochsInfoRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryEpochsInfoRequest_messageType{} + +type fastReflection_QueryEpochsInfoRequest_messageType struct{} + +func (x fastReflection_QueryEpochsInfoRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryEpochsInfoRequest)(nil) +} +func (x fastReflection_QueryEpochsInfoRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryEpochsInfoRequest) +} +func (x fastReflection_QueryEpochsInfoRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryEpochsInfoRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryEpochsInfoRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryEpochsInfoRequest +} + +// 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_QueryEpochsInfoRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryEpochsInfoRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryEpochsInfoRequest) New() protoreflect.Message { + return new(fastReflection_QueryEpochsInfoRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryEpochsInfoRequest) Interface() protoreflect.ProtoMessage { + return (*QueryEpochsInfoRequest)(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_QueryEpochsInfoRequest) 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_QueryEpochsInfoRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryEpochsInfoRequest")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryEpochsInfoRequest 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_QueryEpochsInfoRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryEpochsInfoRequest")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryEpochsInfoRequest 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_QueryEpochsInfoRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryEpochsInfoRequest")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryEpochsInfoRequest 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_QueryEpochsInfoRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryEpochsInfoRequest")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryEpochsInfoRequest 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_QueryEpochsInfoRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryEpochsInfoRequest")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryEpochsInfoRequest 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_QueryEpochsInfoRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryEpochsInfoRequest")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryEpochsInfoRequest 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_QueryEpochsInfoRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.epochs.v1beta1.QueryEpochsInfoRequest", 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_QueryEpochsInfoRequest) 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_QueryEpochsInfoRequest) 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_QueryEpochsInfoRequest) 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_QueryEpochsInfoRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryEpochsInfoRequest) + 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().(*QueryEpochsInfoRequest) + 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().(*QueryEpochsInfoRequest) + 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: QueryEpochsInfoRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryEpochsInfoRequest: 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 = (*_QueryEpochsInfoResponse_1_list)(nil) + +type _QueryEpochsInfoResponse_1_list struct { + list *[]*EpochInfo +} + +func (x *_QueryEpochsInfoResponse_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_QueryEpochsInfoResponse_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_QueryEpochsInfoResponse_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*EpochInfo) + (*x.list)[i] = concreteValue +} + +func (x *_QueryEpochsInfoResponse_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*EpochInfo) + *x.list = append(*x.list, concreteValue) +} + +func (x *_QueryEpochsInfoResponse_1_list) AppendMutable() protoreflect.Value { + v := new(EpochInfo) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryEpochsInfoResponse_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_QueryEpochsInfoResponse_1_list) NewElement() protoreflect.Value { + v := new(EpochInfo) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_QueryEpochsInfoResponse_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_QueryEpochsInfoResponse protoreflect.MessageDescriptor + fd_QueryEpochsInfoResponse_epochs protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_epochs_v1beta1_query_proto_init() + md_QueryEpochsInfoResponse = File_cosmos_epochs_v1beta1_query_proto.Messages().ByName("QueryEpochsInfoResponse") + fd_QueryEpochsInfoResponse_epochs = md_QueryEpochsInfoResponse.Fields().ByName("epochs") +} + +var _ protoreflect.Message = (*fastReflection_QueryEpochsInfoResponse)(nil) + +type fastReflection_QueryEpochsInfoResponse QueryEpochsInfoResponse + +func (x *QueryEpochsInfoResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryEpochsInfoResponse)(x) +} + +func (x *QueryEpochsInfoResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_epochs_v1beta1_query_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryEpochsInfoResponse_messageType fastReflection_QueryEpochsInfoResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryEpochsInfoResponse_messageType{} + +type fastReflection_QueryEpochsInfoResponse_messageType struct{} + +func (x fastReflection_QueryEpochsInfoResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryEpochsInfoResponse)(nil) +} +func (x fastReflection_QueryEpochsInfoResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryEpochsInfoResponse) +} +func (x fastReflection_QueryEpochsInfoResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryEpochsInfoResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryEpochsInfoResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryEpochsInfoResponse +} + +// 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_QueryEpochsInfoResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryEpochsInfoResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryEpochsInfoResponse) New() protoreflect.Message { + return new(fastReflection_QueryEpochsInfoResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryEpochsInfoResponse) Interface() protoreflect.ProtoMessage { + return (*QueryEpochsInfoResponse)(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_QueryEpochsInfoResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Epochs) != 0 { + value := protoreflect.ValueOfList(&_QueryEpochsInfoResponse_1_list{list: &x.Epochs}) + if !f(fd_QueryEpochsInfoResponse_epochs, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryEpochsInfoResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.QueryEpochsInfoResponse.epochs": + return len(x.Epochs) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryEpochsInfoResponse")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryEpochsInfoResponse 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_QueryEpochsInfoResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.QueryEpochsInfoResponse.epochs": + x.Epochs = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryEpochsInfoResponse")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryEpochsInfoResponse 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_QueryEpochsInfoResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.epochs.v1beta1.QueryEpochsInfoResponse.epochs": + if len(x.Epochs) == 0 { + return protoreflect.ValueOfList(&_QueryEpochsInfoResponse_1_list{}) + } + listValue := &_QueryEpochsInfoResponse_1_list{list: &x.Epochs} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryEpochsInfoResponse")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryEpochsInfoResponse 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_QueryEpochsInfoResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.QueryEpochsInfoResponse.epochs": + lv := value.List() + clv := lv.(*_QueryEpochsInfoResponse_1_list) + x.Epochs = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryEpochsInfoResponse")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryEpochsInfoResponse 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_QueryEpochsInfoResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.QueryEpochsInfoResponse.epochs": + if x.Epochs == nil { + x.Epochs = []*EpochInfo{} + } + value := &_QueryEpochsInfoResponse_1_list{list: &x.Epochs} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryEpochsInfoResponse")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryEpochsInfoResponse 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_QueryEpochsInfoResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.QueryEpochsInfoResponse.epochs": + list := []*EpochInfo{} + return protoreflect.ValueOfList(&_QueryEpochsInfoResponse_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryEpochsInfoResponse")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryEpochsInfoResponse 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_QueryEpochsInfoResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.epochs.v1beta1.QueryEpochsInfoResponse", 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_QueryEpochsInfoResponse) 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_QueryEpochsInfoResponse) 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_QueryEpochsInfoResponse) 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_QueryEpochsInfoResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryEpochsInfoResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Epochs) > 0 { + for _, e := range x.Epochs { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryEpochsInfoResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Epochs) > 0 { + for iNdEx := len(x.Epochs) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Epochs[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryEpochsInfoResponse) + 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: QueryEpochsInfoResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryEpochsInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Epochs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Epochs = append(x.Epochs, &EpochInfo{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Epochs[len(x.Epochs)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryCurrentEpochRequest protoreflect.MessageDescriptor + fd_QueryCurrentEpochRequest_identifier protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_epochs_v1beta1_query_proto_init() + md_QueryCurrentEpochRequest = File_cosmos_epochs_v1beta1_query_proto.Messages().ByName("QueryCurrentEpochRequest") + fd_QueryCurrentEpochRequest_identifier = md_QueryCurrentEpochRequest.Fields().ByName("identifier") +} + +var _ protoreflect.Message = (*fastReflection_QueryCurrentEpochRequest)(nil) + +type fastReflection_QueryCurrentEpochRequest QueryCurrentEpochRequest + +func (x *QueryCurrentEpochRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryCurrentEpochRequest)(x) +} + +func (x *QueryCurrentEpochRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_epochs_v1beta1_query_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryCurrentEpochRequest_messageType fastReflection_QueryCurrentEpochRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryCurrentEpochRequest_messageType{} + +type fastReflection_QueryCurrentEpochRequest_messageType struct{} + +func (x fastReflection_QueryCurrentEpochRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryCurrentEpochRequest)(nil) +} +func (x fastReflection_QueryCurrentEpochRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryCurrentEpochRequest) +} +func (x fastReflection_QueryCurrentEpochRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCurrentEpochRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryCurrentEpochRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCurrentEpochRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryCurrentEpochRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryCurrentEpochRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryCurrentEpochRequest) New() protoreflect.Message { + return new(fastReflection_QueryCurrentEpochRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryCurrentEpochRequest) Interface() protoreflect.ProtoMessage { + return (*QueryCurrentEpochRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryCurrentEpochRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Identifier != "" { + value := protoreflect.ValueOfString(x.Identifier) + if !f(fd_QueryCurrentEpochRequest_identifier, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryCurrentEpochRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.QueryCurrentEpochRequest.identifier": + return x.Identifier != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryCurrentEpochRequest")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryCurrentEpochRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCurrentEpochRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.QueryCurrentEpochRequest.identifier": + x.Identifier = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryCurrentEpochRequest")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryCurrentEpochRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryCurrentEpochRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.epochs.v1beta1.QueryCurrentEpochRequest.identifier": + value := x.Identifier + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryCurrentEpochRequest")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryCurrentEpochRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCurrentEpochRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.QueryCurrentEpochRequest.identifier": + x.Identifier = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryCurrentEpochRequest")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryCurrentEpochRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCurrentEpochRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.QueryCurrentEpochRequest.identifier": + panic(fmt.Errorf("field identifier of message cosmos.epochs.v1beta1.QueryCurrentEpochRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryCurrentEpochRequest")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryCurrentEpochRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryCurrentEpochRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.QueryCurrentEpochRequest.identifier": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryCurrentEpochRequest")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryCurrentEpochRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryCurrentEpochRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.epochs.v1beta1.QueryCurrentEpochRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryCurrentEpochRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCurrentEpochRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryCurrentEpochRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryCurrentEpochRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryCurrentEpochRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Identifier) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryCurrentEpochRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Identifier) > 0 { + i -= len(x.Identifier) + copy(dAtA[i:], x.Identifier) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Identifier))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryCurrentEpochRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCurrentEpochRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCurrentEpochRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Identifier", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Identifier = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_QueryCurrentEpochResponse protoreflect.MessageDescriptor + fd_QueryCurrentEpochResponse_current_epoch protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_epochs_v1beta1_query_proto_init() + md_QueryCurrentEpochResponse = File_cosmos_epochs_v1beta1_query_proto.Messages().ByName("QueryCurrentEpochResponse") + fd_QueryCurrentEpochResponse_current_epoch = md_QueryCurrentEpochResponse.Fields().ByName("current_epoch") +} + +var _ protoreflect.Message = (*fastReflection_QueryCurrentEpochResponse)(nil) + +type fastReflection_QueryCurrentEpochResponse QueryCurrentEpochResponse + +func (x *QueryCurrentEpochResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryCurrentEpochResponse)(x) +} + +func (x *QueryCurrentEpochResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_epochs_v1beta1_query_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_QueryCurrentEpochResponse_messageType fastReflection_QueryCurrentEpochResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryCurrentEpochResponse_messageType{} + +type fastReflection_QueryCurrentEpochResponse_messageType struct{} + +func (x fastReflection_QueryCurrentEpochResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryCurrentEpochResponse)(nil) +} +func (x fastReflection_QueryCurrentEpochResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryCurrentEpochResponse) +} +func (x fastReflection_QueryCurrentEpochResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCurrentEpochResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryCurrentEpochResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryCurrentEpochResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_QueryCurrentEpochResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryCurrentEpochResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryCurrentEpochResponse) New() protoreflect.Message { + return new(fastReflection_QueryCurrentEpochResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryCurrentEpochResponse) Interface() protoreflect.ProtoMessage { + return (*QueryCurrentEpochResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_QueryCurrentEpochResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.CurrentEpoch != int64(0) { + value := protoreflect.ValueOfInt64(x.CurrentEpoch) + if !f(fd_QueryCurrentEpochResponse_current_epoch, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_QueryCurrentEpochResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.QueryCurrentEpochResponse.current_epoch": + return x.CurrentEpoch != int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryCurrentEpochResponse")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryCurrentEpochResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCurrentEpochResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.QueryCurrentEpochResponse.current_epoch": + x.CurrentEpoch = int64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryCurrentEpochResponse")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryCurrentEpochResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_QueryCurrentEpochResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.epochs.v1beta1.QueryCurrentEpochResponse.current_epoch": + value := x.CurrentEpoch + return protoreflect.ValueOfInt64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryCurrentEpochResponse")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryCurrentEpochResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCurrentEpochResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.QueryCurrentEpochResponse.current_epoch": + x.CurrentEpoch = value.Int() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryCurrentEpochResponse")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryCurrentEpochResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCurrentEpochResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.QueryCurrentEpochResponse.current_epoch": + panic(fmt.Errorf("field current_epoch of message cosmos.epochs.v1beta1.QueryCurrentEpochResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryCurrentEpochResponse")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryCurrentEpochResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_QueryCurrentEpochResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.epochs.v1beta1.QueryCurrentEpochResponse.current_epoch": + return protoreflect.ValueOfInt64(int64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.epochs.v1beta1.QueryCurrentEpochResponse")) + } + panic(fmt.Errorf("message cosmos.epochs.v1beta1.QueryCurrentEpochResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_QueryCurrentEpochResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.epochs.v1beta1.QueryCurrentEpochResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_QueryCurrentEpochResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_QueryCurrentEpochResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_QueryCurrentEpochResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_QueryCurrentEpochResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryCurrentEpochResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.CurrentEpoch != 0 { + n += 1 + runtime.Sov(uint64(x.CurrentEpoch)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*QueryCurrentEpochResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.CurrentEpoch != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.CurrentEpoch)) + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*QueryCurrentEpochResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCurrentEpochResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryCurrentEpochResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field CurrentEpoch", wireType) + } + x.CurrentEpoch = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.CurrentEpoch |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/epochs/v1beta1/query.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type QueryEpochsInfoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryEpochsInfoRequest) Reset() { + *x = QueryEpochsInfoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_epochs_v1beta1_query_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryEpochsInfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryEpochsInfoRequest) ProtoMessage() {} + +// Deprecated: Use QueryEpochsInfoRequest.ProtoReflect.Descriptor instead. +func (*QueryEpochsInfoRequest) Descriptor() ([]byte, []int) { + return file_cosmos_epochs_v1beta1_query_proto_rawDescGZIP(), []int{0} +} + +type QueryEpochsInfoResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Epochs []*EpochInfo `protobuf:"bytes,1,rep,name=epochs,proto3" json:"epochs,omitempty"` +} + +func (x *QueryEpochsInfoResponse) Reset() { + *x = QueryEpochsInfoResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_epochs_v1beta1_query_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryEpochsInfoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryEpochsInfoResponse) ProtoMessage() {} + +// Deprecated: Use QueryEpochsInfoResponse.ProtoReflect.Descriptor instead. +func (*QueryEpochsInfoResponse) Descriptor() ([]byte, []int) { + return file_cosmos_epochs_v1beta1_query_proto_rawDescGZIP(), []int{1} +} + +func (x *QueryEpochsInfoResponse) GetEpochs() []*EpochInfo { + if x != nil { + return x.Epochs + } + return nil +} + +type QueryCurrentEpochRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` +} + +func (x *QueryCurrentEpochRequest) Reset() { + *x = QueryCurrentEpochRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_epochs_v1beta1_query_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryCurrentEpochRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryCurrentEpochRequest) ProtoMessage() {} + +// Deprecated: Use QueryCurrentEpochRequest.ProtoReflect.Descriptor instead. +func (*QueryCurrentEpochRequest) Descriptor() ([]byte, []int) { + return file_cosmos_epochs_v1beta1_query_proto_rawDescGZIP(), []int{2} +} + +func (x *QueryCurrentEpochRequest) GetIdentifier() string { + if x != nil { + return x.Identifier + } + return "" +} + +type QueryCurrentEpochResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CurrentEpoch int64 `protobuf:"varint,1,opt,name=current_epoch,json=currentEpoch,proto3" json:"current_epoch,omitempty"` +} + +func (x *QueryCurrentEpochResponse) Reset() { + *x = QueryCurrentEpochResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_epochs_v1beta1_query_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryCurrentEpochResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryCurrentEpochResponse) ProtoMessage() {} + +// Deprecated: Use QueryCurrentEpochResponse.ProtoReflect.Descriptor instead. +func (*QueryCurrentEpochResponse) Descriptor() ([]byte, []int) { + return file_cosmos_epochs_v1beta1_query_proto_rawDescGZIP(), []int{3} +} + +func (x *QueryCurrentEpochResponse) GetCurrentEpoch() int64 { + if x != nil { + return x.CurrentEpoch + } + return 0 +} + +var File_cosmos_epochs_v1beta1_query_proto protoreflect.FileDescriptor + +var file_cosmos_epochs_v1beta1_query_proto_rawDesc = []byte{ + 0x0a, 0x21, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2f, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2a, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x18, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x59, 0x0a, 0x17, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x06, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x70, + 0x6f, 0x63, 0x68, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x45, 0x70, 0x6f, + 0x63, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x65, 0x70, + 0x6f, 0x63, 0x68, 0x73, 0x22, 0x3a, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, + 0x22, 0x40, 0x0a, 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, + 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, + 0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, + 0x63, 0x68, 0x32, 0xbe, 0x02, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x92, 0x01, 0x0a, + 0x0a, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x12, 0x2d, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x65, 0x70, 0x6f, 0x63, 0x68, + 0x73, 0x12, 0x9f, 0x01, 0x0a, 0x0c, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, + 0x63, 0x68, 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x70, 0x6f, + 0x63, 0x68, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2f, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x70, + 0x6f, 0x63, 0x68, 0x42, 0xd3, 0x01, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x34, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2f, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x45, 0x58, 0xaa, 0x02, 0x15, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x2e, 0x56, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0xca, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x70, 0x6f, + 0x63, 0x68, 0x73, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x21, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, 0x5c, 0x56, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x73, + 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_cosmos_epochs_v1beta1_query_proto_rawDescOnce sync.Once + file_cosmos_epochs_v1beta1_query_proto_rawDescData = file_cosmos_epochs_v1beta1_query_proto_rawDesc +) + +func file_cosmos_epochs_v1beta1_query_proto_rawDescGZIP() []byte { + file_cosmos_epochs_v1beta1_query_proto_rawDescOnce.Do(func() { + file_cosmos_epochs_v1beta1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_epochs_v1beta1_query_proto_rawDescData) + }) + return file_cosmos_epochs_v1beta1_query_proto_rawDescData +} + +var file_cosmos_epochs_v1beta1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_cosmos_epochs_v1beta1_query_proto_goTypes = []interface{}{ + (*QueryEpochsInfoRequest)(nil), // 0: cosmos.epochs.v1beta1.QueryEpochsInfoRequest + (*QueryEpochsInfoResponse)(nil), // 1: cosmos.epochs.v1beta1.QueryEpochsInfoResponse + (*QueryCurrentEpochRequest)(nil), // 2: cosmos.epochs.v1beta1.QueryCurrentEpochRequest + (*QueryCurrentEpochResponse)(nil), // 3: cosmos.epochs.v1beta1.QueryCurrentEpochResponse + (*EpochInfo)(nil), // 4: cosmos.epochs.v1beta1.EpochInfo +} +var file_cosmos_epochs_v1beta1_query_proto_depIdxs = []int32{ + 4, // 0: cosmos.epochs.v1beta1.QueryEpochsInfoResponse.epochs:type_name -> cosmos.epochs.v1beta1.EpochInfo + 0, // 1: cosmos.epochs.v1beta1.Query.EpochInfos:input_type -> cosmos.epochs.v1beta1.QueryEpochsInfoRequest + 2, // 2: cosmos.epochs.v1beta1.Query.CurrentEpoch:input_type -> cosmos.epochs.v1beta1.QueryCurrentEpochRequest + 1, // 3: cosmos.epochs.v1beta1.Query.EpochInfos:output_type -> cosmos.epochs.v1beta1.QueryEpochsInfoResponse + 3, // 4: cosmos.epochs.v1beta1.Query.CurrentEpoch:output_type -> cosmos.epochs.v1beta1.QueryCurrentEpochResponse + 3, // [3:5] is the sub-list for method output_type + 1, // [1:3] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_cosmos_epochs_v1beta1_query_proto_init() } +func file_cosmos_epochs_v1beta1_query_proto_init() { + if File_cosmos_epochs_v1beta1_query_proto != nil { + return + } + file_cosmos_epochs_v1beta1_genesis_proto_init() + if !protoimpl.UnsafeEnabled { + file_cosmos_epochs_v1beta1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryEpochsInfoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_epochs_v1beta1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryEpochsInfoResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_epochs_v1beta1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryCurrentEpochRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_epochs_v1beta1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryCurrentEpochResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_epochs_v1beta1_query_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_cosmos_epochs_v1beta1_query_proto_goTypes, + DependencyIndexes: file_cosmos_epochs_v1beta1_query_proto_depIdxs, + MessageInfos: file_cosmos_epochs_v1beta1_query_proto_msgTypes, + }.Build() + File_cosmos_epochs_v1beta1_query_proto = out.File + file_cosmos_epochs_v1beta1_query_proto_rawDesc = nil + file_cosmos_epochs_v1beta1_query_proto_goTypes = nil + file_cosmos_epochs_v1beta1_query_proto_depIdxs = nil +} diff --git a/api/cosmos/epochs/v1beta1/query_grpc.pb.go b/api/cosmos/epochs/v1beta1/query_grpc.pb.go new file mode 100644 index 000000000000..c4b3b9ffd869 --- /dev/null +++ b/api/cosmos/epochs/v1beta1/query_grpc.pb.go @@ -0,0 +1,150 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: cosmos/epochs/v1beta1/query.proto + +package epochsv1beta1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Query_EpochInfos_FullMethodName = "/cosmos.epochs.v1beta1.Query/EpochInfos" + Query_CurrentEpoch_FullMethodName = "/cosmos.epochs.v1beta1.Query/CurrentEpoch" +) + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type QueryClient interface { + // EpochInfos provide running epochInfos + EpochInfos(ctx context.Context, in *QueryEpochsInfoRequest, opts ...grpc.CallOption) (*QueryEpochsInfoResponse, error) + // CurrentEpoch provide current epoch of specified identifier + CurrentEpoch(ctx context.Context, in *QueryCurrentEpochRequest, opts ...grpc.CallOption) (*QueryCurrentEpochResponse, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) EpochInfos(ctx context.Context, in *QueryEpochsInfoRequest, opts ...grpc.CallOption) (*QueryEpochsInfoResponse, error) { + out := new(QueryEpochsInfoResponse) + err := c.cc.Invoke(ctx, Query_EpochInfos_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) CurrentEpoch(ctx context.Context, in *QueryCurrentEpochRequest, opts ...grpc.CallOption) (*QueryCurrentEpochResponse, error) { + out := new(QueryCurrentEpochResponse) + err := c.cc.Invoke(ctx, Query_CurrentEpoch_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +// All implementations must embed UnimplementedQueryServer +// for forward compatibility +type QueryServer interface { + // EpochInfos provide running epochInfos + EpochInfos(context.Context, *QueryEpochsInfoRequest) (*QueryEpochsInfoResponse, error) + // CurrentEpoch provide current epoch of specified identifier + CurrentEpoch(context.Context, *QueryCurrentEpochRequest) (*QueryCurrentEpochResponse, error) + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (UnimplementedQueryServer) EpochInfos(context.Context, *QueryEpochsInfoRequest) (*QueryEpochsInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EpochInfos not implemented") +} +func (UnimplementedQueryServer) CurrentEpoch(context.Context, *QueryCurrentEpochRequest) (*QueryCurrentEpochResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CurrentEpoch not implemented") +} +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} + +func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + s.RegisterService(&Query_ServiceDesc, srv) +} + +func _Query_EpochInfos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryEpochsInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).EpochInfos(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_EpochInfos_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).EpochInfos(ctx, req.(*QueryEpochsInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_CurrentEpoch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCurrentEpochRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).CurrentEpoch(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_CurrentEpoch_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).CurrentEpoch(ctx, req.(*QueryCurrentEpochRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Query_ServiceDesc is the grpc.ServiceDesc for Query service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Query_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.epochs.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "EpochInfos", + Handler: _Query_EpochInfos_Handler, + }, + { + MethodName: "CurrentEpoch", + Handler: _Query_CurrentEpoch_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/epochs/v1beta1/query.proto", +} diff --git a/api/cosmos/feegrant/v1beta1/query_grpc.pb.go b/api/cosmos/feegrant/v1beta1/query_grpc.pb.go index 52eb181462f8..23cff18036c4 100644 --- a/api/cosmos/feegrant/v1beta1/query_grpc.pb.go +++ b/api/cosmos/feegrant/v1beta1/query_grpc.pb.go @@ -30,7 +30,7 @@ const ( // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type QueryClient interface { - // Allowance returns granted allwance to the grantee by the granter. + // Allowance returns granted allowance to the grantee by the granter. Allowance(ctx context.Context, in *QueryAllowanceRequest, opts ...grpc.CallOption) (*QueryAllowanceResponse, error) // Allowances returns all the grants for the given grantee address. Allowances(ctx context.Context, in *QueryAllowancesRequest, opts ...grpc.CallOption) (*QueryAllowancesResponse, error) @@ -79,7 +79,7 @@ func (c *queryClient) AllowancesByGranter(ctx context.Context, in *QueryAllowanc // All implementations must embed UnimplementedQueryServer // for forward compatibility type QueryServer interface { - // Allowance returns granted allwance to the grantee by the granter. + // Allowance returns granted allowance to the grantee by the granter. Allowance(context.Context, *QueryAllowanceRequest) (*QueryAllowanceResponse, error) // Allowances returns all the grants for the given grantee address. Allowances(context.Context, *QueryAllowancesRequest) (*QueryAllowancesResponse, error) diff --git a/api/cosmos/lockup/lockup.pulsar.go b/api/cosmos/lockup/lockup.pulsar.go deleted file mode 100644 index d4caff540c05..000000000000 --- a/api/cosmos/lockup/lockup.pulsar.go +++ /dev/null @@ -1,752 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package lockup - -import ( - _ "cosmossdk.io/api/amino" - v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" - fmt "fmt" - runtime "github.com/cosmos/cosmos-proto/runtime" - _ "github.com/cosmos/gogoproto/gogoproto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoiface "google.golang.org/protobuf/runtime/protoiface" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - durationpb "google.golang.org/protobuf/types/known/durationpb" - io "io" - reflect "reflect" - sync "sync" -) - -var _ protoreflect.List = (*_Period_2_list)(nil) - -type _Period_2_list struct { - list *[]*v1beta1.Coin -} - -func (x *_Period_2_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_Period_2_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_Period_2_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) - (*x.list)[i] = concreteValue -} - -func (x *_Period_2_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) - *x.list = append(*x.list, concreteValue) -} - -func (x *_Period_2_list) AppendMutable() protoreflect.Value { - v := new(v1beta1.Coin) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_Period_2_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_Period_2_list) NewElement() protoreflect.Value { - v := new(v1beta1.Coin) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_Period_2_list) IsValid() bool { - return x.list != nil -} - -var ( - md_Period protoreflect.MessageDescriptor - fd_Period_length protoreflect.FieldDescriptor - fd_Period_amount protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_lockup_lockup_proto_init() - md_Period = File_cosmos_lockup_lockup_proto.Messages().ByName("Period") - fd_Period_length = md_Period.Fields().ByName("length") - fd_Period_amount = md_Period.Fields().ByName("amount") -} - -var _ protoreflect.Message = (*fastReflection_Period)(nil) - -type fastReflection_Period Period - -func (x *Period) ProtoReflect() protoreflect.Message { - return (*fastReflection_Period)(x) -} - -func (x *Period) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_lockup_lockup_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_Period_messageType fastReflection_Period_messageType -var _ protoreflect.MessageType = fastReflection_Period_messageType{} - -type fastReflection_Period_messageType struct{} - -func (x fastReflection_Period_messageType) Zero() protoreflect.Message { - return (*fastReflection_Period)(nil) -} -func (x fastReflection_Period_messageType) New() protoreflect.Message { - return new(fastReflection_Period) -} -func (x fastReflection_Period_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Period -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Period) Descriptor() protoreflect.MessageDescriptor { - return md_Period -} - -// 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_Period) Type() protoreflect.MessageType { - return _fastReflection_Period_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Period) New() protoreflect.Message { - return new(fastReflection_Period) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Period) Interface() protoreflect.ProtoMessage { - return (*Period)(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_Period) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Length != nil { - value := protoreflect.ValueOfMessage(x.Length.ProtoReflect()) - if !f(fd_Period_length, value) { - return - } - } - if len(x.Amount) != 0 { - value := protoreflect.ValueOfList(&_Period_2_list{list: &x.Amount}) - if !f(fd_Period_amount, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_Period) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.lockup.Period.length": - return x.Length != nil - case "cosmos.lockup.Period.amount": - return len(x.Amount) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.Period")) - } - panic(fmt.Errorf("message cosmos.lockup.Period 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_Period) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.lockup.Period.length": - x.Length = nil - case "cosmos.lockup.Period.amount": - x.Amount = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.Period")) - } - panic(fmt.Errorf("message cosmos.lockup.Period 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_Period) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.lockup.Period.length": - value := x.Length - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.lockup.Period.amount": - if len(x.Amount) == 0 { - return protoreflect.ValueOfList(&_Period_2_list{}) - } - listValue := &_Period_2_list{list: &x.Amount} - return protoreflect.ValueOfList(listValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.Period")) - } - panic(fmt.Errorf("message cosmos.lockup.Period 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_Period) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.lockup.Period.length": - x.Length = value.Message().Interface().(*durationpb.Duration) - case "cosmos.lockup.Period.amount": - lv := value.List() - clv := lv.(*_Period_2_list) - x.Amount = *clv.list - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.Period")) - } - panic(fmt.Errorf("message cosmos.lockup.Period 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_Period) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.lockup.Period.length": - if x.Length == nil { - x.Length = new(durationpb.Duration) - } - return protoreflect.ValueOfMessage(x.Length.ProtoReflect()) - case "cosmos.lockup.Period.amount": - if x.Amount == nil { - x.Amount = []*v1beta1.Coin{} - } - value := &_Period_2_list{list: &x.Amount} - return protoreflect.ValueOfList(value) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.Period")) - } - panic(fmt.Errorf("message cosmos.lockup.Period 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_Period) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.lockup.Period.length": - m := new(durationpb.Duration) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cosmos.lockup.Period.amount": - list := []*v1beta1.Coin{} - return protoreflect.ValueOfList(&_Period_2_list{list: &list}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.Period")) - } - panic(fmt.Errorf("message cosmos.lockup.Period 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_Period) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.lockup.Period", 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_Period) 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_Period) 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_Period) 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_Period) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Period) - 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.Length != nil { - l = options.Size(x.Length) - n += 1 + l + runtime.Sov(uint64(l)) - } - if len(x.Amount) > 0 { - for _, e := range x.Amount { - 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().(*Period) - 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.Amount) > 0 { - for iNdEx := len(x.Amount) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.Amount[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x12 - } - } - if x.Length != nil { - encoded, err := options.Marshal(x.Length) - 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().(*Period) - 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: Period: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Period: 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 Length", 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.Length == nil { - x.Length = &durationpb.Duration{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Length); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", 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.Amount = append(x.Amount, &v1beta1.Coin{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Amount[len(x.Amount)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.0 -// protoc (unknown) -// source: cosmos/lockup/lockup.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) -) - -// Period defines a length of time and amount of coins that will be lock. -type Period struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Period duration - Length *durationpb.Duration `protobuf:"bytes,1,opt,name=length,proto3" json:"length,omitempty"` - Amount []*v1beta1.Coin `protobuf:"bytes,2,rep,name=amount,proto3" json:"amount,omitempty"` -} - -func (x *Period) Reset() { - *x = Period{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_lockup_lockup_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Period) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Period) ProtoMessage() {} - -// Deprecated: Use Period.ProtoReflect.Descriptor instead. -func (*Period) Descriptor() ([]byte, []int) { - return file_cosmos_lockup_lockup_proto_rawDescGZIP(), []int{0} -} - -func (x *Period) GetLength() *durationpb.Duration { - if x != nil { - return x.Length - } - return nil -} - -func (x *Period) GetAmount() []*v1beta1.Coin { - if x != nil { - return x.Amount - } - return nil -} - -var File_cosmos_lockup_lockup_proto protoreflect.FileDescriptor - -var file_cosmos_lockup_lockup_proto_rawDesc = []byte{ - 0x0a, 0x1a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2f, - 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x1a, 0x11, 0x61, 0x6d, 0x69, - 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, - 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc5, 0x01, 0x0a, 0x06, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, - 0x40, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, - 0x98, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, - 0x68, 0x12, 0x79, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x46, 0xc8, 0xde, - 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, - 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x9a, 0xe7, - 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, - 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x95, 0x01, 0x0a, - 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, - 0x75, 0x70, 0x42, 0x0b, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x75, - 0x70, 0xa2, 0x02, 0x03, 0x43, 0x4c, 0x58, 0xaa, 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0xca, 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0xe2, 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x4c, 0x6f, - 0x63, 0x6b, 0x75, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_cosmos_lockup_lockup_proto_rawDescOnce sync.Once - file_cosmos_lockup_lockup_proto_rawDescData = file_cosmos_lockup_lockup_proto_rawDesc -) - -func file_cosmos_lockup_lockup_proto_rawDescGZIP() []byte { - file_cosmos_lockup_lockup_proto_rawDescOnce.Do(func() { - file_cosmos_lockup_lockup_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_lockup_lockup_proto_rawDescData) - }) - return file_cosmos_lockup_lockup_proto_rawDescData -} - -var file_cosmos_lockup_lockup_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_cosmos_lockup_lockup_proto_goTypes = []interface{}{ - (*Period)(nil), // 0: cosmos.lockup.Period - (*durationpb.Duration)(nil), // 1: google.protobuf.Duration - (*v1beta1.Coin)(nil), // 2: cosmos.base.v1beta1.Coin -} -var file_cosmos_lockup_lockup_proto_depIdxs = []int32{ - 1, // 0: cosmos.lockup.Period.length:type_name -> google.protobuf.Duration - 2, // 1: cosmos.lockup.Period.amount:type_name -> cosmos.base.v1beta1.Coin - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_cosmos_lockup_lockup_proto_init() } -func file_cosmos_lockup_lockup_proto_init() { - if File_cosmos_lockup_lockup_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_cosmos_lockup_lockup_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Period); 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_lockup_lockup_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_cosmos_lockup_lockup_proto_goTypes, - DependencyIndexes: file_cosmos_lockup_lockup_proto_depIdxs, - MessageInfos: file_cosmos_lockup_lockup_proto_msgTypes, - }.Build() - File_cosmos_lockup_lockup_proto = out.File - file_cosmos_lockup_lockup_proto_rawDesc = nil - file_cosmos_lockup_lockup_proto_goTypes = nil - file_cosmos_lockup_lockup_proto_depIdxs = nil -} diff --git a/api/cosmos/lockup/query.pulsar.go b/api/cosmos/lockup/query.pulsar.go deleted file mode 100644 index 385d923ef222..000000000000 --- a/api/cosmos/lockup/query.pulsar.go +++ /dev/null @@ -1,2891 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package lockup - -import ( - v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" - fmt "fmt" - runtime "github.com/cosmos/cosmos-proto/runtime" - _ "github.com/cosmos/gogoproto/gogoproto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoiface "google.golang.org/protobuf/runtime/protoiface" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - io "io" - reflect "reflect" - sync "sync" -) - -var ( - md_QueryLockupAccountInfoRequest protoreflect.MessageDescriptor -) - -func init() { - file_cosmos_lockup_query_proto_init() - md_QueryLockupAccountInfoRequest = File_cosmos_lockup_query_proto.Messages().ByName("QueryLockupAccountInfoRequest") -} - -var _ protoreflect.Message = (*fastReflection_QueryLockupAccountInfoRequest)(nil) - -type fastReflection_QueryLockupAccountInfoRequest QueryLockupAccountInfoRequest - -func (x *QueryLockupAccountInfoRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryLockupAccountInfoRequest)(x) -} - -func (x *QueryLockupAccountInfoRequest) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_lockup_query_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_QueryLockupAccountInfoRequest_messageType fastReflection_QueryLockupAccountInfoRequest_messageType -var _ protoreflect.MessageType = fastReflection_QueryLockupAccountInfoRequest_messageType{} - -type fastReflection_QueryLockupAccountInfoRequest_messageType struct{} - -func (x fastReflection_QueryLockupAccountInfoRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryLockupAccountInfoRequest)(nil) -} -func (x fastReflection_QueryLockupAccountInfoRequest_messageType) New() protoreflect.Message { - return new(fastReflection_QueryLockupAccountInfoRequest) -} -func (x fastReflection_QueryLockupAccountInfoRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryLockupAccountInfoRequest -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryLockupAccountInfoRequest) Descriptor() protoreflect.MessageDescriptor { - return md_QueryLockupAccountInfoRequest -} - -// 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_QueryLockupAccountInfoRequest) Type() protoreflect.MessageType { - return _fastReflection_QueryLockupAccountInfoRequest_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryLockupAccountInfoRequest) New() protoreflect.Message { - return new(fastReflection_QueryLockupAccountInfoRequest) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryLockupAccountInfoRequest) Interface() protoreflect.ProtoMessage { - return (*QueryLockupAccountInfoRequest)(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_QueryLockupAccountInfoRequest) 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_QueryLockupAccountInfoRequest) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.QueryLockupAccountInfoRequest")) - } - panic(fmt.Errorf("message cosmos.lockup.QueryLockupAccountInfoRequest 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_QueryLockupAccountInfoRequest) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.QueryLockupAccountInfoRequest")) - } - panic(fmt.Errorf("message cosmos.lockup.QueryLockupAccountInfoRequest 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_QueryLockupAccountInfoRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.QueryLockupAccountInfoRequest")) - } - panic(fmt.Errorf("message cosmos.lockup.QueryLockupAccountInfoRequest 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_QueryLockupAccountInfoRequest) 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.lockup.QueryLockupAccountInfoRequest")) - } - panic(fmt.Errorf("message cosmos.lockup.QueryLockupAccountInfoRequest 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_QueryLockupAccountInfoRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.QueryLockupAccountInfoRequest")) - } - panic(fmt.Errorf("message cosmos.lockup.QueryLockupAccountInfoRequest 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_QueryLockupAccountInfoRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.QueryLockupAccountInfoRequest")) - } - panic(fmt.Errorf("message cosmos.lockup.QueryLockupAccountInfoRequest 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_QueryLockupAccountInfoRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.lockup.QueryLockupAccountInfoRequest", 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_QueryLockupAccountInfoRequest) 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_QueryLockupAccountInfoRequest) 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_QueryLockupAccountInfoRequest) 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_QueryLockupAccountInfoRequest) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryLockupAccountInfoRequest) - 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().(*QueryLockupAccountInfoRequest) - 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().(*QueryLockupAccountInfoRequest) - 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: QueryLockupAccountInfoRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryLockupAccountInfoRequest: 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 = (*_QueryLockupAccountInfoResponse_1_list)(nil) - -type _QueryLockupAccountInfoResponse_1_list struct { - list *[]*v1beta1.Coin -} - -func (x *_QueryLockupAccountInfoResponse_1_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_QueryLockupAccountInfoResponse_1_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_QueryLockupAccountInfoResponse_1_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) - (*x.list)[i] = concreteValue -} - -func (x *_QueryLockupAccountInfoResponse_1_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) - *x.list = append(*x.list, concreteValue) -} - -func (x *_QueryLockupAccountInfoResponse_1_list) AppendMutable() protoreflect.Value { - v := new(v1beta1.Coin) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_QueryLockupAccountInfoResponse_1_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_QueryLockupAccountInfoResponse_1_list) NewElement() protoreflect.Value { - v := new(v1beta1.Coin) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_QueryLockupAccountInfoResponse_1_list) IsValid() bool { - return x.list != nil -} - -var _ protoreflect.List = (*_QueryLockupAccountInfoResponse_2_list)(nil) - -type _QueryLockupAccountInfoResponse_2_list struct { - list *[]*v1beta1.Coin -} - -func (x *_QueryLockupAccountInfoResponse_2_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_QueryLockupAccountInfoResponse_2_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_QueryLockupAccountInfoResponse_2_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) - (*x.list)[i] = concreteValue -} - -func (x *_QueryLockupAccountInfoResponse_2_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) - *x.list = append(*x.list, concreteValue) -} - -func (x *_QueryLockupAccountInfoResponse_2_list) AppendMutable() protoreflect.Value { - v := new(v1beta1.Coin) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_QueryLockupAccountInfoResponse_2_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_QueryLockupAccountInfoResponse_2_list) NewElement() protoreflect.Value { - v := new(v1beta1.Coin) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_QueryLockupAccountInfoResponse_2_list) IsValid() bool { - return x.list != nil -} - -var _ protoreflect.List = (*_QueryLockupAccountInfoResponse_3_list)(nil) - -type _QueryLockupAccountInfoResponse_3_list struct { - list *[]*v1beta1.Coin -} - -func (x *_QueryLockupAccountInfoResponse_3_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_QueryLockupAccountInfoResponse_3_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_QueryLockupAccountInfoResponse_3_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) - (*x.list)[i] = concreteValue -} - -func (x *_QueryLockupAccountInfoResponse_3_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) - *x.list = append(*x.list, concreteValue) -} - -func (x *_QueryLockupAccountInfoResponse_3_list) AppendMutable() protoreflect.Value { - v := new(v1beta1.Coin) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_QueryLockupAccountInfoResponse_3_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_QueryLockupAccountInfoResponse_3_list) NewElement() protoreflect.Value { - v := new(v1beta1.Coin) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_QueryLockupAccountInfoResponse_3_list) IsValid() bool { - return x.list != nil -} - -var _ protoreflect.List = (*_QueryLockupAccountInfoResponse_6_list)(nil) - -type _QueryLockupAccountInfoResponse_6_list struct { - list *[]*v1beta1.Coin -} - -func (x *_QueryLockupAccountInfoResponse_6_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_QueryLockupAccountInfoResponse_6_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_QueryLockupAccountInfoResponse_6_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) - (*x.list)[i] = concreteValue -} - -func (x *_QueryLockupAccountInfoResponse_6_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) - *x.list = append(*x.list, concreteValue) -} - -func (x *_QueryLockupAccountInfoResponse_6_list) AppendMutable() protoreflect.Value { - v := new(v1beta1.Coin) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_QueryLockupAccountInfoResponse_6_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_QueryLockupAccountInfoResponse_6_list) NewElement() protoreflect.Value { - v := new(v1beta1.Coin) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_QueryLockupAccountInfoResponse_6_list) IsValid() bool { - return x.list != nil -} - -var _ protoreflect.List = (*_QueryLockupAccountInfoResponse_7_list)(nil) - -type _QueryLockupAccountInfoResponse_7_list struct { - list *[]*v1beta1.Coin -} - -func (x *_QueryLockupAccountInfoResponse_7_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_QueryLockupAccountInfoResponse_7_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_QueryLockupAccountInfoResponse_7_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) - (*x.list)[i] = concreteValue -} - -func (x *_QueryLockupAccountInfoResponse_7_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) - *x.list = append(*x.list, concreteValue) -} - -func (x *_QueryLockupAccountInfoResponse_7_list) AppendMutable() protoreflect.Value { - v := new(v1beta1.Coin) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_QueryLockupAccountInfoResponse_7_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_QueryLockupAccountInfoResponse_7_list) NewElement() protoreflect.Value { - v := new(v1beta1.Coin) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_QueryLockupAccountInfoResponse_7_list) IsValid() bool { - return x.list != nil -} - -var ( - md_QueryLockupAccountInfoResponse protoreflect.MessageDescriptor - fd_QueryLockupAccountInfoResponse_original_locking protoreflect.FieldDescriptor - fd_QueryLockupAccountInfoResponse_delegated_free protoreflect.FieldDescriptor - fd_QueryLockupAccountInfoResponse_delegated_locking protoreflect.FieldDescriptor - fd_QueryLockupAccountInfoResponse_start_time protoreflect.FieldDescriptor - fd_QueryLockupAccountInfoResponse_end_time protoreflect.FieldDescriptor - fd_QueryLockupAccountInfoResponse_locked_coins protoreflect.FieldDescriptor - fd_QueryLockupAccountInfoResponse_unlocked_coins protoreflect.FieldDescriptor - fd_QueryLockupAccountInfoResponse_owner protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_lockup_query_proto_init() - md_QueryLockupAccountInfoResponse = File_cosmos_lockup_query_proto.Messages().ByName("QueryLockupAccountInfoResponse") - fd_QueryLockupAccountInfoResponse_original_locking = md_QueryLockupAccountInfoResponse.Fields().ByName("original_locking") - fd_QueryLockupAccountInfoResponse_delegated_free = md_QueryLockupAccountInfoResponse.Fields().ByName("delegated_free") - fd_QueryLockupAccountInfoResponse_delegated_locking = md_QueryLockupAccountInfoResponse.Fields().ByName("delegated_locking") - fd_QueryLockupAccountInfoResponse_start_time = md_QueryLockupAccountInfoResponse.Fields().ByName("start_time") - fd_QueryLockupAccountInfoResponse_end_time = md_QueryLockupAccountInfoResponse.Fields().ByName("end_time") - fd_QueryLockupAccountInfoResponse_locked_coins = md_QueryLockupAccountInfoResponse.Fields().ByName("locked_coins") - fd_QueryLockupAccountInfoResponse_unlocked_coins = md_QueryLockupAccountInfoResponse.Fields().ByName("unlocked_coins") - fd_QueryLockupAccountInfoResponse_owner = md_QueryLockupAccountInfoResponse.Fields().ByName("owner") -} - -var _ protoreflect.Message = (*fastReflection_QueryLockupAccountInfoResponse)(nil) - -type fastReflection_QueryLockupAccountInfoResponse QueryLockupAccountInfoResponse - -func (x *QueryLockupAccountInfoResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryLockupAccountInfoResponse)(x) -} - -func (x *QueryLockupAccountInfoResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_lockup_query_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_QueryLockupAccountInfoResponse_messageType fastReflection_QueryLockupAccountInfoResponse_messageType -var _ protoreflect.MessageType = fastReflection_QueryLockupAccountInfoResponse_messageType{} - -type fastReflection_QueryLockupAccountInfoResponse_messageType struct{} - -func (x fastReflection_QueryLockupAccountInfoResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryLockupAccountInfoResponse)(nil) -} -func (x fastReflection_QueryLockupAccountInfoResponse_messageType) New() protoreflect.Message { - return new(fastReflection_QueryLockupAccountInfoResponse) -} -func (x fastReflection_QueryLockupAccountInfoResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryLockupAccountInfoResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryLockupAccountInfoResponse) Descriptor() protoreflect.MessageDescriptor { - return md_QueryLockupAccountInfoResponse -} - -// 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_QueryLockupAccountInfoResponse) Type() protoreflect.MessageType { - return _fastReflection_QueryLockupAccountInfoResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryLockupAccountInfoResponse) New() protoreflect.Message { - return new(fastReflection_QueryLockupAccountInfoResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryLockupAccountInfoResponse) Interface() protoreflect.ProtoMessage { - return (*QueryLockupAccountInfoResponse)(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_QueryLockupAccountInfoResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.OriginalLocking) != 0 { - value := protoreflect.ValueOfList(&_QueryLockupAccountInfoResponse_1_list{list: &x.OriginalLocking}) - if !f(fd_QueryLockupAccountInfoResponse_original_locking, value) { - return - } - } - if len(x.DelegatedFree) != 0 { - value := protoreflect.ValueOfList(&_QueryLockupAccountInfoResponse_2_list{list: &x.DelegatedFree}) - if !f(fd_QueryLockupAccountInfoResponse_delegated_free, value) { - return - } - } - if len(x.DelegatedLocking) != 0 { - value := protoreflect.ValueOfList(&_QueryLockupAccountInfoResponse_3_list{list: &x.DelegatedLocking}) - if !f(fd_QueryLockupAccountInfoResponse_delegated_locking, value) { - return - } - } - if x.StartTime != nil { - value := protoreflect.ValueOfMessage(x.StartTime.ProtoReflect()) - if !f(fd_QueryLockupAccountInfoResponse_start_time, value) { - return - } - } - if x.EndTime != nil { - value := protoreflect.ValueOfMessage(x.EndTime.ProtoReflect()) - if !f(fd_QueryLockupAccountInfoResponse_end_time, value) { - return - } - } - if len(x.LockedCoins) != 0 { - value := protoreflect.ValueOfList(&_QueryLockupAccountInfoResponse_6_list{list: &x.LockedCoins}) - if !f(fd_QueryLockupAccountInfoResponse_locked_coins, value) { - return - } - } - if len(x.UnlockedCoins) != 0 { - value := protoreflect.ValueOfList(&_QueryLockupAccountInfoResponse_7_list{list: &x.UnlockedCoins}) - if !f(fd_QueryLockupAccountInfoResponse_unlocked_coins, value) { - return - } - } - if x.Owner != "" { - value := protoreflect.ValueOfString(x.Owner) - if !f(fd_QueryLockupAccountInfoResponse_owner, 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_QueryLockupAccountInfoResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.lockup.QueryLockupAccountInfoResponse.original_locking": - return len(x.OriginalLocking) != 0 - case "cosmos.lockup.QueryLockupAccountInfoResponse.delegated_free": - return len(x.DelegatedFree) != 0 - case "cosmos.lockup.QueryLockupAccountInfoResponse.delegated_locking": - return len(x.DelegatedLocking) != 0 - case "cosmos.lockup.QueryLockupAccountInfoResponse.start_time": - return x.StartTime != nil - case "cosmos.lockup.QueryLockupAccountInfoResponse.end_time": - return x.EndTime != nil - case "cosmos.lockup.QueryLockupAccountInfoResponse.locked_coins": - return len(x.LockedCoins) != 0 - case "cosmos.lockup.QueryLockupAccountInfoResponse.unlocked_coins": - return len(x.UnlockedCoins) != 0 - case "cosmos.lockup.QueryLockupAccountInfoResponse.owner": - return x.Owner != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.QueryLockupAccountInfoResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.QueryLockupAccountInfoResponse 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_QueryLockupAccountInfoResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.lockup.QueryLockupAccountInfoResponse.original_locking": - x.OriginalLocking = nil - case "cosmos.lockup.QueryLockupAccountInfoResponse.delegated_free": - x.DelegatedFree = nil - case "cosmos.lockup.QueryLockupAccountInfoResponse.delegated_locking": - x.DelegatedLocking = nil - case "cosmos.lockup.QueryLockupAccountInfoResponse.start_time": - x.StartTime = nil - case "cosmos.lockup.QueryLockupAccountInfoResponse.end_time": - x.EndTime = nil - case "cosmos.lockup.QueryLockupAccountInfoResponse.locked_coins": - x.LockedCoins = nil - case "cosmos.lockup.QueryLockupAccountInfoResponse.unlocked_coins": - x.UnlockedCoins = nil - case "cosmos.lockup.QueryLockupAccountInfoResponse.owner": - x.Owner = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.QueryLockupAccountInfoResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.QueryLockupAccountInfoResponse 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_QueryLockupAccountInfoResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.lockup.QueryLockupAccountInfoResponse.original_locking": - if len(x.OriginalLocking) == 0 { - return protoreflect.ValueOfList(&_QueryLockupAccountInfoResponse_1_list{}) - } - listValue := &_QueryLockupAccountInfoResponse_1_list{list: &x.OriginalLocking} - return protoreflect.ValueOfList(listValue) - case "cosmos.lockup.QueryLockupAccountInfoResponse.delegated_free": - if len(x.DelegatedFree) == 0 { - return protoreflect.ValueOfList(&_QueryLockupAccountInfoResponse_2_list{}) - } - listValue := &_QueryLockupAccountInfoResponse_2_list{list: &x.DelegatedFree} - return protoreflect.ValueOfList(listValue) - case "cosmos.lockup.QueryLockupAccountInfoResponse.delegated_locking": - if len(x.DelegatedLocking) == 0 { - return protoreflect.ValueOfList(&_QueryLockupAccountInfoResponse_3_list{}) - } - listValue := &_QueryLockupAccountInfoResponse_3_list{list: &x.DelegatedLocking} - return protoreflect.ValueOfList(listValue) - case "cosmos.lockup.QueryLockupAccountInfoResponse.start_time": - value := x.StartTime - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.lockup.QueryLockupAccountInfoResponse.end_time": - value := x.EndTime - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.lockup.QueryLockupAccountInfoResponse.locked_coins": - if len(x.LockedCoins) == 0 { - return protoreflect.ValueOfList(&_QueryLockupAccountInfoResponse_6_list{}) - } - listValue := &_QueryLockupAccountInfoResponse_6_list{list: &x.LockedCoins} - return protoreflect.ValueOfList(listValue) - case "cosmos.lockup.QueryLockupAccountInfoResponse.unlocked_coins": - if len(x.UnlockedCoins) == 0 { - return protoreflect.ValueOfList(&_QueryLockupAccountInfoResponse_7_list{}) - } - listValue := &_QueryLockupAccountInfoResponse_7_list{list: &x.UnlockedCoins} - return protoreflect.ValueOfList(listValue) - case "cosmos.lockup.QueryLockupAccountInfoResponse.owner": - value := x.Owner - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.QueryLockupAccountInfoResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.QueryLockupAccountInfoResponse 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_QueryLockupAccountInfoResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.lockup.QueryLockupAccountInfoResponse.original_locking": - lv := value.List() - clv := lv.(*_QueryLockupAccountInfoResponse_1_list) - x.OriginalLocking = *clv.list - case "cosmos.lockup.QueryLockupAccountInfoResponse.delegated_free": - lv := value.List() - clv := lv.(*_QueryLockupAccountInfoResponse_2_list) - x.DelegatedFree = *clv.list - case "cosmos.lockup.QueryLockupAccountInfoResponse.delegated_locking": - lv := value.List() - clv := lv.(*_QueryLockupAccountInfoResponse_3_list) - x.DelegatedLocking = *clv.list - case "cosmos.lockup.QueryLockupAccountInfoResponse.start_time": - x.StartTime = value.Message().Interface().(*timestamppb.Timestamp) - case "cosmos.lockup.QueryLockupAccountInfoResponse.end_time": - x.EndTime = value.Message().Interface().(*timestamppb.Timestamp) - case "cosmos.lockup.QueryLockupAccountInfoResponse.locked_coins": - lv := value.List() - clv := lv.(*_QueryLockupAccountInfoResponse_6_list) - x.LockedCoins = *clv.list - case "cosmos.lockup.QueryLockupAccountInfoResponse.unlocked_coins": - lv := value.List() - clv := lv.(*_QueryLockupAccountInfoResponse_7_list) - x.UnlockedCoins = *clv.list - case "cosmos.lockup.QueryLockupAccountInfoResponse.owner": - x.Owner = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.QueryLockupAccountInfoResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.QueryLockupAccountInfoResponse 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_QueryLockupAccountInfoResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.lockup.QueryLockupAccountInfoResponse.original_locking": - if x.OriginalLocking == nil { - x.OriginalLocking = []*v1beta1.Coin{} - } - value := &_QueryLockupAccountInfoResponse_1_list{list: &x.OriginalLocking} - return protoreflect.ValueOfList(value) - case "cosmos.lockup.QueryLockupAccountInfoResponse.delegated_free": - if x.DelegatedFree == nil { - x.DelegatedFree = []*v1beta1.Coin{} - } - value := &_QueryLockupAccountInfoResponse_2_list{list: &x.DelegatedFree} - return protoreflect.ValueOfList(value) - case "cosmos.lockup.QueryLockupAccountInfoResponse.delegated_locking": - if x.DelegatedLocking == nil { - x.DelegatedLocking = []*v1beta1.Coin{} - } - value := &_QueryLockupAccountInfoResponse_3_list{list: &x.DelegatedLocking} - return protoreflect.ValueOfList(value) - case "cosmos.lockup.QueryLockupAccountInfoResponse.start_time": - if x.StartTime == nil { - x.StartTime = new(timestamppb.Timestamp) - } - return protoreflect.ValueOfMessage(x.StartTime.ProtoReflect()) - case "cosmos.lockup.QueryLockupAccountInfoResponse.end_time": - if x.EndTime == nil { - x.EndTime = new(timestamppb.Timestamp) - } - return protoreflect.ValueOfMessage(x.EndTime.ProtoReflect()) - case "cosmos.lockup.QueryLockupAccountInfoResponse.locked_coins": - if x.LockedCoins == nil { - x.LockedCoins = []*v1beta1.Coin{} - } - value := &_QueryLockupAccountInfoResponse_6_list{list: &x.LockedCoins} - return protoreflect.ValueOfList(value) - case "cosmos.lockup.QueryLockupAccountInfoResponse.unlocked_coins": - if x.UnlockedCoins == nil { - x.UnlockedCoins = []*v1beta1.Coin{} - } - value := &_QueryLockupAccountInfoResponse_7_list{list: &x.UnlockedCoins} - return protoreflect.ValueOfList(value) - case "cosmos.lockup.QueryLockupAccountInfoResponse.owner": - panic(fmt.Errorf("field owner of message cosmos.lockup.QueryLockupAccountInfoResponse is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.QueryLockupAccountInfoResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.QueryLockupAccountInfoResponse 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_QueryLockupAccountInfoResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.lockup.QueryLockupAccountInfoResponse.original_locking": - list := []*v1beta1.Coin{} - return protoreflect.ValueOfList(&_QueryLockupAccountInfoResponse_1_list{list: &list}) - case "cosmos.lockup.QueryLockupAccountInfoResponse.delegated_free": - list := []*v1beta1.Coin{} - return protoreflect.ValueOfList(&_QueryLockupAccountInfoResponse_2_list{list: &list}) - case "cosmos.lockup.QueryLockupAccountInfoResponse.delegated_locking": - list := []*v1beta1.Coin{} - return protoreflect.ValueOfList(&_QueryLockupAccountInfoResponse_3_list{list: &list}) - case "cosmos.lockup.QueryLockupAccountInfoResponse.start_time": - m := new(timestamppb.Timestamp) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cosmos.lockup.QueryLockupAccountInfoResponse.end_time": - m := new(timestamppb.Timestamp) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cosmos.lockup.QueryLockupAccountInfoResponse.locked_coins": - list := []*v1beta1.Coin{} - return protoreflect.ValueOfList(&_QueryLockupAccountInfoResponse_6_list{list: &list}) - case "cosmos.lockup.QueryLockupAccountInfoResponse.unlocked_coins": - list := []*v1beta1.Coin{} - return protoreflect.ValueOfList(&_QueryLockupAccountInfoResponse_7_list{list: &list}) - case "cosmos.lockup.QueryLockupAccountInfoResponse.owner": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.QueryLockupAccountInfoResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.QueryLockupAccountInfoResponse 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_QueryLockupAccountInfoResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.lockup.QueryLockupAccountInfoResponse", 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_QueryLockupAccountInfoResponse) 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_QueryLockupAccountInfoResponse) 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_QueryLockupAccountInfoResponse) 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_QueryLockupAccountInfoResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryLockupAccountInfoResponse) - 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.OriginalLocking) > 0 { - for _, e := range x.OriginalLocking { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if len(x.DelegatedFree) > 0 { - for _, e := range x.DelegatedFree { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if len(x.DelegatedLocking) > 0 { - for _, e := range x.DelegatedLocking { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if x.StartTime != nil { - l = options.Size(x.StartTime) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.EndTime != nil { - l = options.Size(x.EndTime) - n += 1 + l + runtime.Sov(uint64(l)) - } - if len(x.LockedCoins) > 0 { - for _, e := range x.LockedCoins { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if len(x.UnlockedCoins) > 0 { - for _, e := range x.UnlockedCoins { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - l = len(x.Owner) - 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().(*QueryLockupAccountInfoResponse) - 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.Owner) > 0 { - i -= len(x.Owner) - copy(dAtA[i:], x.Owner) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Owner))) - i-- - dAtA[i] = 0x42 - } - if len(x.UnlockedCoins) > 0 { - for iNdEx := len(x.UnlockedCoins) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.UnlockedCoins[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x3a - } - } - if len(x.LockedCoins) > 0 { - for iNdEx := len(x.LockedCoins) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.LockedCoins[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x32 - } - } - if x.EndTime != nil { - encoded, err := options.Marshal(x.EndTime) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x2a - } - if x.StartTime != nil { - encoded, err := options.Marshal(x.StartTime) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x22 - } - if len(x.DelegatedLocking) > 0 { - for iNdEx := len(x.DelegatedLocking) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.DelegatedLocking[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x1a - } - } - if len(x.DelegatedFree) > 0 { - for iNdEx := len(x.DelegatedFree) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.DelegatedFree[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x12 - } - } - if len(x.OriginalLocking) > 0 { - for iNdEx := len(x.OriginalLocking) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.OriginalLocking[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().(*QueryLockupAccountInfoResponse) - 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: QueryLockupAccountInfoResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryLockupAccountInfoResponse: 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 OriginalLocking", 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.OriginalLocking = append(x.OriginalLocking, &v1beta1.Coin{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.OriginalLocking[len(x.OriginalLocking)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DelegatedFree", 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.DelegatedFree = append(x.DelegatedFree, &v1beta1.Coin{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.DelegatedFree[len(x.DelegatedFree)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DelegatedLocking", 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.DelegatedLocking = append(x.DelegatedLocking, &v1beta1.Coin{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.DelegatedLocking[len(x.DelegatedLocking)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.StartTime == nil { - x.StartTime = ×tamppb.Timestamp{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.StartTime); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EndTime", 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.EndTime == nil { - x.EndTime = ×tamppb.Timestamp{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.EndTime); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LockedCoins", 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.LockedCoins = append(x.LockedCoins, &v1beta1.Coin{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.LockedCoins[len(x.LockedCoins)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field UnlockedCoins", 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.UnlockedCoins = append(x.UnlockedCoins, &v1beta1.Coin{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.UnlockedCoins[len(x.UnlockedCoins)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Owner", 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.Owner = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_QueryLockingPeriodsRequest protoreflect.MessageDescriptor -) - -func init() { - file_cosmos_lockup_query_proto_init() - md_QueryLockingPeriodsRequest = File_cosmos_lockup_query_proto.Messages().ByName("QueryLockingPeriodsRequest") -} - -var _ protoreflect.Message = (*fastReflection_QueryLockingPeriodsRequest)(nil) - -type fastReflection_QueryLockingPeriodsRequest QueryLockingPeriodsRequest - -func (x *QueryLockingPeriodsRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryLockingPeriodsRequest)(x) -} - -func (x *QueryLockingPeriodsRequest) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_lockup_query_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_QueryLockingPeriodsRequest_messageType fastReflection_QueryLockingPeriodsRequest_messageType -var _ protoreflect.MessageType = fastReflection_QueryLockingPeriodsRequest_messageType{} - -type fastReflection_QueryLockingPeriodsRequest_messageType struct{} - -func (x fastReflection_QueryLockingPeriodsRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryLockingPeriodsRequest)(nil) -} -func (x fastReflection_QueryLockingPeriodsRequest_messageType) New() protoreflect.Message { - return new(fastReflection_QueryLockingPeriodsRequest) -} -func (x fastReflection_QueryLockingPeriodsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryLockingPeriodsRequest -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryLockingPeriodsRequest) Descriptor() protoreflect.MessageDescriptor { - return md_QueryLockingPeriodsRequest -} - -// 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_QueryLockingPeriodsRequest) Type() protoreflect.MessageType { - return _fastReflection_QueryLockingPeriodsRequest_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryLockingPeriodsRequest) New() protoreflect.Message { - return new(fastReflection_QueryLockingPeriodsRequest) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryLockingPeriodsRequest) Interface() protoreflect.ProtoMessage { - return (*QueryLockingPeriodsRequest)(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_QueryLockingPeriodsRequest) 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_QueryLockingPeriodsRequest) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.QueryLockingPeriodsRequest")) - } - panic(fmt.Errorf("message cosmos.lockup.QueryLockingPeriodsRequest 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_QueryLockingPeriodsRequest) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.QueryLockingPeriodsRequest")) - } - panic(fmt.Errorf("message cosmos.lockup.QueryLockingPeriodsRequest 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_QueryLockingPeriodsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.QueryLockingPeriodsRequest")) - } - panic(fmt.Errorf("message cosmos.lockup.QueryLockingPeriodsRequest 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_QueryLockingPeriodsRequest) 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.lockup.QueryLockingPeriodsRequest")) - } - panic(fmt.Errorf("message cosmos.lockup.QueryLockingPeriodsRequest 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_QueryLockingPeriodsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.QueryLockingPeriodsRequest")) - } - panic(fmt.Errorf("message cosmos.lockup.QueryLockingPeriodsRequest 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_QueryLockingPeriodsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.QueryLockingPeriodsRequest")) - } - panic(fmt.Errorf("message cosmos.lockup.QueryLockingPeriodsRequest 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_QueryLockingPeriodsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.lockup.QueryLockingPeriodsRequest", 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_QueryLockingPeriodsRequest) 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_QueryLockingPeriodsRequest) 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_QueryLockingPeriodsRequest) 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_QueryLockingPeriodsRequest) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryLockingPeriodsRequest) - 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().(*QueryLockingPeriodsRequest) - 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().(*QueryLockingPeriodsRequest) - 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: QueryLockingPeriodsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryLockingPeriodsRequest: 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 = (*_QueryLockingPeriodsResponse_1_list)(nil) - -type _QueryLockingPeriodsResponse_1_list struct { - list *[]*Period -} - -func (x *_QueryLockingPeriodsResponse_1_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_QueryLockingPeriodsResponse_1_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_QueryLockingPeriodsResponse_1_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Period) - (*x.list)[i] = concreteValue -} - -func (x *_QueryLockingPeriodsResponse_1_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Period) - *x.list = append(*x.list, concreteValue) -} - -func (x *_QueryLockingPeriodsResponse_1_list) AppendMutable() protoreflect.Value { - v := new(Period) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_QueryLockingPeriodsResponse_1_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_QueryLockingPeriodsResponse_1_list) NewElement() protoreflect.Value { - v := new(Period) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_QueryLockingPeriodsResponse_1_list) IsValid() bool { - return x.list != nil -} - -var ( - md_QueryLockingPeriodsResponse protoreflect.MessageDescriptor - fd_QueryLockingPeriodsResponse_locking_periods protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_lockup_query_proto_init() - md_QueryLockingPeriodsResponse = File_cosmos_lockup_query_proto.Messages().ByName("QueryLockingPeriodsResponse") - fd_QueryLockingPeriodsResponse_locking_periods = md_QueryLockingPeriodsResponse.Fields().ByName("locking_periods") -} - -var _ protoreflect.Message = (*fastReflection_QueryLockingPeriodsResponse)(nil) - -type fastReflection_QueryLockingPeriodsResponse QueryLockingPeriodsResponse - -func (x *QueryLockingPeriodsResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryLockingPeriodsResponse)(x) -} - -func (x *QueryLockingPeriodsResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_lockup_query_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_QueryLockingPeriodsResponse_messageType fastReflection_QueryLockingPeriodsResponse_messageType -var _ protoreflect.MessageType = fastReflection_QueryLockingPeriodsResponse_messageType{} - -type fastReflection_QueryLockingPeriodsResponse_messageType struct{} - -func (x fastReflection_QueryLockingPeriodsResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryLockingPeriodsResponse)(nil) -} -func (x fastReflection_QueryLockingPeriodsResponse_messageType) New() protoreflect.Message { - return new(fastReflection_QueryLockingPeriodsResponse) -} -func (x fastReflection_QueryLockingPeriodsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryLockingPeriodsResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryLockingPeriodsResponse) Descriptor() protoreflect.MessageDescriptor { - return md_QueryLockingPeriodsResponse -} - -// 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_QueryLockingPeriodsResponse) Type() protoreflect.MessageType { - return _fastReflection_QueryLockingPeriodsResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryLockingPeriodsResponse) New() protoreflect.Message { - return new(fastReflection_QueryLockingPeriodsResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryLockingPeriodsResponse) Interface() protoreflect.ProtoMessage { - return (*QueryLockingPeriodsResponse)(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_QueryLockingPeriodsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.LockingPeriods) != 0 { - value := protoreflect.ValueOfList(&_QueryLockingPeriodsResponse_1_list{list: &x.LockingPeriods}) - if !f(fd_QueryLockingPeriodsResponse_locking_periods, 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_QueryLockingPeriodsResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.lockup.QueryLockingPeriodsResponse.locking_periods": - return len(x.LockingPeriods) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.QueryLockingPeriodsResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.QueryLockingPeriodsResponse 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_QueryLockingPeriodsResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.lockup.QueryLockingPeriodsResponse.locking_periods": - x.LockingPeriods = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.QueryLockingPeriodsResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.QueryLockingPeriodsResponse 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_QueryLockingPeriodsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.lockup.QueryLockingPeriodsResponse.locking_periods": - if len(x.LockingPeriods) == 0 { - return protoreflect.ValueOfList(&_QueryLockingPeriodsResponse_1_list{}) - } - listValue := &_QueryLockingPeriodsResponse_1_list{list: &x.LockingPeriods} - return protoreflect.ValueOfList(listValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.QueryLockingPeriodsResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.QueryLockingPeriodsResponse 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_QueryLockingPeriodsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.lockup.QueryLockingPeriodsResponse.locking_periods": - lv := value.List() - clv := lv.(*_QueryLockingPeriodsResponse_1_list) - x.LockingPeriods = *clv.list - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.QueryLockingPeriodsResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.QueryLockingPeriodsResponse 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_QueryLockingPeriodsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.lockup.QueryLockingPeriodsResponse.locking_periods": - if x.LockingPeriods == nil { - x.LockingPeriods = []*Period{} - } - value := &_QueryLockingPeriodsResponse_1_list{list: &x.LockingPeriods} - return protoreflect.ValueOfList(value) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.QueryLockingPeriodsResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.QueryLockingPeriodsResponse 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_QueryLockingPeriodsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.lockup.QueryLockingPeriodsResponse.locking_periods": - list := []*Period{} - return protoreflect.ValueOfList(&_QueryLockingPeriodsResponse_1_list{list: &list}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.QueryLockingPeriodsResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.QueryLockingPeriodsResponse 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_QueryLockingPeriodsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.lockup.QueryLockingPeriodsResponse", 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_QueryLockingPeriodsResponse) 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_QueryLockingPeriodsResponse) 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_QueryLockingPeriodsResponse) 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_QueryLockingPeriodsResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryLockingPeriodsResponse) - 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.LockingPeriods) > 0 { - for _, e := range x.LockingPeriods { - 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().(*QueryLockingPeriodsResponse) - 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.LockingPeriods) > 0 { - for iNdEx := len(x.LockingPeriods) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.LockingPeriods[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().(*QueryLockingPeriodsResponse) - 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: QueryLockingPeriodsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryLockingPeriodsResponse: 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 LockingPeriods", 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.LockingPeriods = append(x.LockingPeriods, &Period{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.LockingPeriods[len(x.LockingPeriods)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.0 -// protoc (unknown) -// source: cosmos/lockup/query.proto - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// QueryLockupAccountInfoRequest get lockup account info -type QueryLockupAccountInfoRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *QueryLockupAccountInfoRequest) Reset() { - *x = QueryLockupAccountInfoRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_lockup_query_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryLockupAccountInfoRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryLockupAccountInfoRequest) ProtoMessage() {} - -// Deprecated: Use QueryLockupAccountInfoRequest.ProtoReflect.Descriptor instead. -func (*QueryLockupAccountInfoRequest) Descriptor() ([]byte, []int) { - return file_cosmos_lockup_query_proto_rawDescGZIP(), []int{0} -} - -// QueryLockupAccountInfoResponse return lockup account info -type QueryLockupAccountInfoResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // original_locking defines the value of the account original locking coins. - OriginalLocking []*v1beta1.Coin `protobuf:"bytes,1,rep,name=original_locking,json=originalLocking,proto3" json:"original_locking,omitempty"` - // delegated_free defines the value of the account free delegated amount. - DelegatedFree []*v1beta1.Coin `protobuf:"bytes,2,rep,name=delegated_free,json=delegatedFree,proto3" json:"delegated_free,omitempty"` - // delegated_locking defines the value of the account locking delegated amount. - DelegatedLocking []*v1beta1.Coin `protobuf:"bytes,3,rep,name=delegated_locking,json=delegatedLocking,proto3" json:"delegated_locking,omitempty"` - // end_time defines the value of the account lockup start time. - StartTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` - // end_time defines the value of the account lockup end time. - EndTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` - // locked_coins defines the value of the account locking coins. - LockedCoins []*v1beta1.Coin `protobuf:"bytes,6,rep,name=locked_coins,json=lockedCoins,proto3" json:"locked_coins,omitempty"` - // unlocked_coins defines the value of the account released coins from lockup. - UnlockedCoins []*v1beta1.Coin `protobuf:"bytes,7,rep,name=unlocked_coins,json=unlockedCoins,proto3" json:"unlocked_coins,omitempty"` - // owner defines the value of the owner of the lockup account. - Owner string `protobuf:"bytes,8,opt,name=owner,proto3" json:"owner,omitempty"` -} - -func (x *QueryLockupAccountInfoResponse) Reset() { - *x = QueryLockupAccountInfoResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_lockup_query_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryLockupAccountInfoResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryLockupAccountInfoResponse) ProtoMessage() {} - -// Deprecated: Use QueryLockupAccountInfoResponse.ProtoReflect.Descriptor instead. -func (*QueryLockupAccountInfoResponse) Descriptor() ([]byte, []int) { - return file_cosmos_lockup_query_proto_rawDescGZIP(), []int{1} -} - -func (x *QueryLockupAccountInfoResponse) GetOriginalLocking() []*v1beta1.Coin { - if x != nil { - return x.OriginalLocking - } - return nil -} - -func (x *QueryLockupAccountInfoResponse) GetDelegatedFree() []*v1beta1.Coin { - if x != nil { - return x.DelegatedFree - } - return nil -} - -func (x *QueryLockupAccountInfoResponse) GetDelegatedLocking() []*v1beta1.Coin { - if x != nil { - return x.DelegatedLocking - } - return nil -} - -func (x *QueryLockupAccountInfoResponse) GetStartTime() *timestamppb.Timestamp { - if x != nil { - return x.StartTime - } - return nil -} - -func (x *QueryLockupAccountInfoResponse) GetEndTime() *timestamppb.Timestamp { - if x != nil { - return x.EndTime - } - return nil -} - -func (x *QueryLockupAccountInfoResponse) GetLockedCoins() []*v1beta1.Coin { - if x != nil { - return x.LockedCoins - } - return nil -} - -func (x *QueryLockupAccountInfoResponse) GetUnlockedCoins() []*v1beta1.Coin { - if x != nil { - return x.UnlockedCoins - } - return nil -} - -func (x *QueryLockupAccountInfoResponse) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -// QueryLockingPeriodsRequest is used to query the periodic lockup account locking periods. -type QueryLockingPeriodsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *QueryLockingPeriodsRequest) Reset() { - *x = QueryLockingPeriodsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_lockup_query_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryLockingPeriodsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryLockingPeriodsRequest) ProtoMessage() {} - -// Deprecated: Use QueryLockingPeriodsRequest.ProtoReflect.Descriptor instead. -func (*QueryLockingPeriodsRequest) Descriptor() ([]byte, []int) { - return file_cosmos_lockup_query_proto_rawDescGZIP(), []int{2} -} - -// QueryLockingPeriodsResponse returns the periodic lockup account locking periods. -type QueryLockingPeriodsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // lockup_periods defines the value of the periodic lockup account locking periods. - LockingPeriods []*Period `protobuf:"bytes,1,rep,name=locking_periods,json=lockingPeriods,proto3" json:"locking_periods,omitempty"` -} - -func (x *QueryLockingPeriodsResponse) Reset() { - *x = QueryLockingPeriodsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_lockup_query_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryLockingPeriodsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryLockingPeriodsResponse) ProtoMessage() {} - -// Deprecated: Use QueryLockingPeriodsResponse.ProtoReflect.Descriptor instead. -func (*QueryLockingPeriodsResponse) Descriptor() ([]byte, []int) { - return file_cosmos_lockup_query_proto_rawDescGZIP(), []int{3} -} - -func (x *QueryLockingPeriodsResponse) GetLockingPeriods() []*Period { - if x != nil { - return x.LockingPeriods - } - return nil -} - -var File_cosmos_lockup_query_proto protoreflect.FileDescriptor - -var file_cosmos_lockup_query_proto_rawDesc = []byte{ - 0x0a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2f, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x1a, 0x1a, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, - 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x1f, 0x0a, - 0x1d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xfe, - 0x05, 0x0a, 0x1e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x76, 0x0a, 0x10, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x6c, 0x6f, - 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x0f, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, - 0x61, 0x6c, 0x4c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x12, 0x72, 0x0a, 0x0e, 0x64, 0x65, 0x6c, - 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x72, 0x65, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x30, 0xc8, 0xde, - 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, - 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x0d, - 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x46, 0x72, 0x65, 0x65, 0x12, 0x78, 0x0a, - 0x11, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6c, 0x6f, 0x63, 0x6b, 0x69, - 0x6e, 0x67, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, - 0x6f, 0x69, 0x6e, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x10, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, - 0x4c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x12, 0x3f, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, - 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x09, 0x73, - 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, - 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x07, 0x65, 0x6e, - 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x6e, 0x0a, 0x0c, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x5f, - 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x0b, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, - 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x12, 0x72, 0x0a, 0x0e, 0x75, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x65, - 0x64, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x30, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, - 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x52, 0x0d, 0x75, 0x6e, 0x6c, 0x6f, - 0x63, 0x6b, 0x65, 0x64, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, - 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x22, - 0x1c, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x50, - 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x5d, 0x0a, - 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, - 0x69, 0x6f, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x0f, - 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6c, - 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x52, 0x0e, 0x6c, 0x6f, - 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x42, 0x94, 0x01, 0x0a, - 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, - 0x75, 0x70, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, - 0xa2, 0x02, 0x03, 0x43, 0x4c, 0x58, 0xaa, 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0xca, 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, - 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0xe2, 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, - 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x0e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x4c, 0x6f, 0x63, - 0x6b, 0x75, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_cosmos_lockup_query_proto_rawDescOnce sync.Once - file_cosmos_lockup_query_proto_rawDescData = file_cosmos_lockup_query_proto_rawDesc -) - -func file_cosmos_lockup_query_proto_rawDescGZIP() []byte { - file_cosmos_lockup_query_proto_rawDescOnce.Do(func() { - file_cosmos_lockup_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_lockup_query_proto_rawDescData) - }) - return file_cosmos_lockup_query_proto_rawDescData -} - -var file_cosmos_lockup_query_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_cosmos_lockup_query_proto_goTypes = []interface{}{ - (*QueryLockupAccountInfoRequest)(nil), // 0: cosmos.lockup.QueryLockupAccountInfoRequest - (*QueryLockupAccountInfoResponse)(nil), // 1: cosmos.lockup.QueryLockupAccountInfoResponse - (*QueryLockingPeriodsRequest)(nil), // 2: cosmos.lockup.QueryLockingPeriodsRequest - (*QueryLockingPeriodsResponse)(nil), // 3: cosmos.lockup.QueryLockingPeriodsResponse - (*v1beta1.Coin)(nil), // 4: cosmos.base.v1beta1.Coin - (*timestamppb.Timestamp)(nil), // 5: google.protobuf.Timestamp - (*Period)(nil), // 6: cosmos.lockup.Period -} -var file_cosmos_lockup_query_proto_depIdxs = []int32{ - 4, // 0: cosmos.lockup.QueryLockupAccountInfoResponse.original_locking:type_name -> cosmos.base.v1beta1.Coin - 4, // 1: cosmos.lockup.QueryLockupAccountInfoResponse.delegated_free:type_name -> cosmos.base.v1beta1.Coin - 4, // 2: cosmos.lockup.QueryLockupAccountInfoResponse.delegated_locking:type_name -> cosmos.base.v1beta1.Coin - 5, // 3: cosmos.lockup.QueryLockupAccountInfoResponse.start_time:type_name -> google.protobuf.Timestamp - 5, // 4: cosmos.lockup.QueryLockupAccountInfoResponse.end_time:type_name -> google.protobuf.Timestamp - 4, // 5: cosmos.lockup.QueryLockupAccountInfoResponse.locked_coins:type_name -> cosmos.base.v1beta1.Coin - 4, // 6: cosmos.lockup.QueryLockupAccountInfoResponse.unlocked_coins:type_name -> cosmos.base.v1beta1.Coin - 6, // 7: cosmos.lockup.QueryLockingPeriodsResponse.locking_periods:type_name -> cosmos.lockup.Period - 8, // [8:8] is the sub-list for method output_type - 8, // [8:8] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name -} - -func init() { file_cosmos_lockup_query_proto_init() } -func file_cosmos_lockup_query_proto_init() { - if File_cosmos_lockup_query_proto != nil { - return - } - file_cosmos_lockup_lockup_proto_init() - if !protoimpl.UnsafeEnabled { - file_cosmos_lockup_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryLockupAccountInfoRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_lockup_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryLockupAccountInfoResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_lockup_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryLockingPeriodsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_lockup_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryLockingPeriodsResponse); 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_lockup_query_proto_rawDesc, - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_cosmos_lockup_query_proto_goTypes, - DependencyIndexes: file_cosmos_lockup_query_proto_depIdxs, - MessageInfos: file_cosmos_lockup_query_proto_msgTypes, - }.Build() - File_cosmos_lockup_query_proto = out.File - file_cosmos_lockup_query_proto_rawDesc = nil - file_cosmos_lockup_query_proto_goTypes = nil - file_cosmos_lockup_query_proto_depIdxs = nil -} diff --git a/api/cosmos/lockup/tx.pulsar.go b/api/cosmos/lockup/tx.pulsar.go deleted file mode 100644 index 9633724feefd..000000000000 --- a/api/cosmos/lockup/tx.pulsar.go +++ /dev/null @@ -1,6162 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package lockup - -import ( - _ "cosmossdk.io/api/amino" - v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" - _ "cosmossdk.io/api/cosmos/msg/v1" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - runtime "github.com/cosmos/cosmos-proto/runtime" - _ "github.com/cosmos/gogoproto/gogoproto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoiface "google.golang.org/protobuf/runtime/protoiface" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - anypb "google.golang.org/protobuf/types/known/anypb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - io "io" - reflect "reflect" - sync "sync" -) - -var ( - md_MsgInitLockupAccount protoreflect.MessageDescriptor - fd_MsgInitLockupAccount_owner protoreflect.FieldDescriptor - fd_MsgInitLockupAccount_end_time protoreflect.FieldDescriptor - fd_MsgInitLockupAccount_start_time protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_lockup_tx_proto_init() - md_MsgInitLockupAccount = File_cosmos_lockup_tx_proto.Messages().ByName("MsgInitLockupAccount") - fd_MsgInitLockupAccount_owner = md_MsgInitLockupAccount.Fields().ByName("owner") - fd_MsgInitLockupAccount_end_time = md_MsgInitLockupAccount.Fields().ByName("end_time") - fd_MsgInitLockupAccount_start_time = md_MsgInitLockupAccount.Fields().ByName("start_time") -} - -var _ protoreflect.Message = (*fastReflection_MsgInitLockupAccount)(nil) - -type fastReflection_MsgInitLockupAccount MsgInitLockupAccount - -func (x *MsgInitLockupAccount) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgInitLockupAccount)(x) -} - -func (x *MsgInitLockupAccount) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_lockup_tx_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgInitLockupAccount_messageType fastReflection_MsgInitLockupAccount_messageType -var _ protoreflect.MessageType = fastReflection_MsgInitLockupAccount_messageType{} - -type fastReflection_MsgInitLockupAccount_messageType struct{} - -func (x fastReflection_MsgInitLockupAccount_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgInitLockupAccount)(nil) -} -func (x fastReflection_MsgInitLockupAccount_messageType) New() protoreflect.Message { - return new(fastReflection_MsgInitLockupAccount) -} -func (x fastReflection_MsgInitLockupAccount_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgInitLockupAccount -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgInitLockupAccount) Descriptor() protoreflect.MessageDescriptor { - return md_MsgInitLockupAccount -} - -// 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_MsgInitLockupAccount) Type() protoreflect.MessageType { - return _fastReflection_MsgInitLockupAccount_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgInitLockupAccount) New() protoreflect.Message { - return new(fastReflection_MsgInitLockupAccount) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgInitLockupAccount) Interface() protoreflect.ProtoMessage { - return (*MsgInitLockupAccount)(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_MsgInitLockupAccount) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Owner != "" { - value := protoreflect.ValueOfString(x.Owner) - if !f(fd_MsgInitLockupAccount_owner, value) { - return - } - } - if x.EndTime != nil { - value := protoreflect.ValueOfMessage(x.EndTime.ProtoReflect()) - if !f(fd_MsgInitLockupAccount_end_time, value) { - return - } - } - if x.StartTime != nil { - value := protoreflect.ValueOfMessage(x.StartTime.ProtoReflect()) - if !f(fd_MsgInitLockupAccount_start_time, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgInitLockupAccount) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.lockup.MsgInitLockupAccount.owner": - return x.Owner != "" - case "cosmos.lockup.MsgInitLockupAccount.end_time": - return x.EndTime != nil - case "cosmos.lockup.MsgInitLockupAccount.start_time": - return x.StartTime != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgInitLockupAccount")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgInitLockupAccount 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_MsgInitLockupAccount) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.lockup.MsgInitLockupAccount.owner": - x.Owner = "" - case "cosmos.lockup.MsgInitLockupAccount.end_time": - x.EndTime = nil - case "cosmos.lockup.MsgInitLockupAccount.start_time": - x.StartTime = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgInitLockupAccount")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgInitLockupAccount 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_MsgInitLockupAccount) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.lockup.MsgInitLockupAccount.owner": - value := x.Owner - return protoreflect.ValueOfString(value) - case "cosmos.lockup.MsgInitLockupAccount.end_time": - value := x.EndTime - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.lockup.MsgInitLockupAccount.start_time": - value := x.StartTime - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgInitLockupAccount")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgInitLockupAccount 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_MsgInitLockupAccount) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.lockup.MsgInitLockupAccount.owner": - x.Owner = value.Interface().(string) - case "cosmos.lockup.MsgInitLockupAccount.end_time": - x.EndTime = value.Message().Interface().(*timestamppb.Timestamp) - case "cosmos.lockup.MsgInitLockupAccount.start_time": - x.StartTime = value.Message().Interface().(*timestamppb.Timestamp) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgInitLockupAccount")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgInitLockupAccount 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_MsgInitLockupAccount) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.lockup.MsgInitLockupAccount.end_time": - if x.EndTime == nil { - x.EndTime = new(timestamppb.Timestamp) - } - return protoreflect.ValueOfMessage(x.EndTime.ProtoReflect()) - case "cosmos.lockup.MsgInitLockupAccount.start_time": - if x.StartTime == nil { - x.StartTime = new(timestamppb.Timestamp) - } - return protoreflect.ValueOfMessage(x.StartTime.ProtoReflect()) - case "cosmos.lockup.MsgInitLockupAccount.owner": - panic(fmt.Errorf("field owner of message cosmos.lockup.MsgInitLockupAccount is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgInitLockupAccount")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgInitLockupAccount 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_MsgInitLockupAccount) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.lockup.MsgInitLockupAccount.owner": - return protoreflect.ValueOfString("") - case "cosmos.lockup.MsgInitLockupAccount.end_time": - m := new(timestamppb.Timestamp) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cosmos.lockup.MsgInitLockupAccount.start_time": - m := new(timestamppb.Timestamp) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgInitLockupAccount")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgInitLockupAccount 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_MsgInitLockupAccount) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.lockup.MsgInitLockupAccount", 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_MsgInitLockupAccount) 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_MsgInitLockupAccount) 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_MsgInitLockupAccount) 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_MsgInitLockupAccount) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgInitLockupAccount) - 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.Owner) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.EndTime != nil { - l = options.Size(x.EndTime) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.StartTime != nil { - l = options.Size(x.StartTime) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.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().(*MsgInitLockupAccount) - 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.StartTime != nil { - encoded, err := options.Marshal(x.StartTime) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x1a - } - if x.EndTime != nil { - encoded, err := options.Marshal(x.EndTime) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x12 - } - if len(x.Owner) > 0 { - i -= len(x.Owner) - copy(dAtA[i:], x.Owner) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Owner))) - 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().(*MsgInitLockupAccount) - 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: MsgInitLockupAccount: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgInitLockupAccount: 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 Owner", 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.Owner = 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 EndTime", 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.EndTime == nil { - x.EndTime = ×tamppb.Timestamp{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.EndTime); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.StartTime == nil { - x.StartTime = ×tamppb.Timestamp{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.StartTime); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - 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_MsgInitLockupAccountResponse protoreflect.MessageDescriptor -) - -func init() { - file_cosmos_lockup_tx_proto_init() - md_MsgInitLockupAccountResponse = File_cosmos_lockup_tx_proto.Messages().ByName("MsgInitLockupAccountResponse") -} - -var _ protoreflect.Message = (*fastReflection_MsgInitLockupAccountResponse)(nil) - -type fastReflection_MsgInitLockupAccountResponse MsgInitLockupAccountResponse - -func (x *MsgInitLockupAccountResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgInitLockupAccountResponse)(x) -} - -func (x *MsgInitLockupAccountResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_lockup_tx_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgInitLockupAccountResponse_messageType fastReflection_MsgInitLockupAccountResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgInitLockupAccountResponse_messageType{} - -type fastReflection_MsgInitLockupAccountResponse_messageType struct{} - -func (x fastReflection_MsgInitLockupAccountResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgInitLockupAccountResponse)(nil) -} -func (x fastReflection_MsgInitLockupAccountResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgInitLockupAccountResponse) -} -func (x fastReflection_MsgInitLockupAccountResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgInitLockupAccountResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgInitLockupAccountResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgInitLockupAccountResponse -} - -// 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_MsgInitLockupAccountResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgInitLockupAccountResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgInitLockupAccountResponse) New() protoreflect.Message { - return new(fastReflection_MsgInitLockupAccountResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgInitLockupAccountResponse) Interface() protoreflect.ProtoMessage { - return (*MsgInitLockupAccountResponse)(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_MsgInitLockupAccountResponse) 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_MsgInitLockupAccountResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgInitLockupAccountResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgInitLockupAccountResponse 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_MsgInitLockupAccountResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgInitLockupAccountResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgInitLockupAccountResponse 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_MsgInitLockupAccountResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgInitLockupAccountResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgInitLockupAccountResponse 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_MsgInitLockupAccountResponse) 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.lockup.MsgInitLockupAccountResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgInitLockupAccountResponse 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_MsgInitLockupAccountResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgInitLockupAccountResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgInitLockupAccountResponse 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_MsgInitLockupAccountResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgInitLockupAccountResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgInitLockupAccountResponse 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_MsgInitLockupAccountResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.lockup.MsgInitLockupAccountResponse", 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_MsgInitLockupAccountResponse) 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_MsgInitLockupAccountResponse) 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_MsgInitLockupAccountResponse) 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_MsgInitLockupAccountResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgInitLockupAccountResponse) - 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().(*MsgInitLockupAccountResponse) - 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().(*MsgInitLockupAccountResponse) - 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: MsgInitLockupAccountResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgInitLockupAccountResponse: 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 = (*_MsgInitPeriodicLockingAccount_3_list)(nil) - -type _MsgInitPeriodicLockingAccount_3_list struct { - list *[]*Period -} - -func (x *_MsgInitPeriodicLockingAccount_3_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_MsgInitPeriodicLockingAccount_3_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_MsgInitPeriodicLockingAccount_3_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Period) - (*x.list)[i] = concreteValue -} - -func (x *_MsgInitPeriodicLockingAccount_3_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Period) - *x.list = append(*x.list, concreteValue) -} - -func (x *_MsgInitPeriodicLockingAccount_3_list) AppendMutable() protoreflect.Value { - v := new(Period) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_MsgInitPeriodicLockingAccount_3_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_MsgInitPeriodicLockingAccount_3_list) NewElement() protoreflect.Value { - v := new(Period) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_MsgInitPeriodicLockingAccount_3_list) IsValid() bool { - return x.list != nil -} - -var ( - md_MsgInitPeriodicLockingAccount protoreflect.MessageDescriptor - fd_MsgInitPeriodicLockingAccount_owner protoreflect.FieldDescriptor - fd_MsgInitPeriodicLockingAccount_start_time protoreflect.FieldDescriptor - fd_MsgInitPeriodicLockingAccount_locking_periods protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_lockup_tx_proto_init() - md_MsgInitPeriodicLockingAccount = File_cosmos_lockup_tx_proto.Messages().ByName("MsgInitPeriodicLockingAccount") - fd_MsgInitPeriodicLockingAccount_owner = md_MsgInitPeriodicLockingAccount.Fields().ByName("owner") - fd_MsgInitPeriodicLockingAccount_start_time = md_MsgInitPeriodicLockingAccount.Fields().ByName("start_time") - fd_MsgInitPeriodicLockingAccount_locking_periods = md_MsgInitPeriodicLockingAccount.Fields().ByName("locking_periods") -} - -var _ protoreflect.Message = (*fastReflection_MsgInitPeriodicLockingAccount)(nil) - -type fastReflection_MsgInitPeriodicLockingAccount MsgInitPeriodicLockingAccount - -func (x *MsgInitPeriodicLockingAccount) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgInitPeriodicLockingAccount)(x) -} - -func (x *MsgInitPeriodicLockingAccount) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_lockup_tx_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_MsgInitPeriodicLockingAccount_messageType fastReflection_MsgInitPeriodicLockingAccount_messageType -var _ protoreflect.MessageType = fastReflection_MsgInitPeriodicLockingAccount_messageType{} - -type fastReflection_MsgInitPeriodicLockingAccount_messageType struct{} - -func (x fastReflection_MsgInitPeriodicLockingAccount_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgInitPeriodicLockingAccount)(nil) -} -func (x fastReflection_MsgInitPeriodicLockingAccount_messageType) New() protoreflect.Message { - return new(fastReflection_MsgInitPeriodicLockingAccount) -} -func (x fastReflection_MsgInitPeriodicLockingAccount_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgInitPeriodicLockingAccount -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgInitPeriodicLockingAccount) Descriptor() protoreflect.MessageDescriptor { - return md_MsgInitPeriodicLockingAccount -} - -// 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_MsgInitPeriodicLockingAccount) Type() protoreflect.MessageType { - return _fastReflection_MsgInitPeriodicLockingAccount_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgInitPeriodicLockingAccount) New() protoreflect.Message { - return new(fastReflection_MsgInitPeriodicLockingAccount) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgInitPeriodicLockingAccount) Interface() protoreflect.ProtoMessage { - return (*MsgInitPeriodicLockingAccount)(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_MsgInitPeriodicLockingAccount) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Owner != "" { - value := protoreflect.ValueOfString(x.Owner) - if !f(fd_MsgInitPeriodicLockingAccount_owner, value) { - return - } - } - if x.StartTime != nil { - value := protoreflect.ValueOfMessage(x.StartTime.ProtoReflect()) - if !f(fd_MsgInitPeriodicLockingAccount_start_time, value) { - return - } - } - if len(x.LockingPeriods) != 0 { - value := protoreflect.ValueOfList(&_MsgInitPeriodicLockingAccount_3_list{list: &x.LockingPeriods}) - if !f(fd_MsgInitPeriodicLockingAccount_locking_periods, 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_MsgInitPeriodicLockingAccount) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.lockup.MsgInitPeriodicLockingAccount.owner": - return x.Owner != "" - case "cosmos.lockup.MsgInitPeriodicLockingAccount.start_time": - return x.StartTime != nil - case "cosmos.lockup.MsgInitPeriodicLockingAccount.locking_periods": - return len(x.LockingPeriods) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgInitPeriodicLockingAccount")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgInitPeriodicLockingAccount 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_MsgInitPeriodicLockingAccount) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.lockup.MsgInitPeriodicLockingAccount.owner": - x.Owner = "" - case "cosmos.lockup.MsgInitPeriodicLockingAccount.start_time": - x.StartTime = nil - case "cosmos.lockup.MsgInitPeriodicLockingAccount.locking_periods": - x.LockingPeriods = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgInitPeriodicLockingAccount")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgInitPeriodicLockingAccount 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_MsgInitPeriodicLockingAccount) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.lockup.MsgInitPeriodicLockingAccount.owner": - value := x.Owner - return protoreflect.ValueOfString(value) - case "cosmos.lockup.MsgInitPeriodicLockingAccount.start_time": - value := x.StartTime - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.lockup.MsgInitPeriodicLockingAccount.locking_periods": - if len(x.LockingPeriods) == 0 { - return protoreflect.ValueOfList(&_MsgInitPeriodicLockingAccount_3_list{}) - } - listValue := &_MsgInitPeriodicLockingAccount_3_list{list: &x.LockingPeriods} - return protoreflect.ValueOfList(listValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgInitPeriodicLockingAccount")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgInitPeriodicLockingAccount 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_MsgInitPeriodicLockingAccount) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.lockup.MsgInitPeriodicLockingAccount.owner": - x.Owner = value.Interface().(string) - case "cosmos.lockup.MsgInitPeriodicLockingAccount.start_time": - x.StartTime = value.Message().Interface().(*timestamppb.Timestamp) - case "cosmos.lockup.MsgInitPeriodicLockingAccount.locking_periods": - lv := value.List() - clv := lv.(*_MsgInitPeriodicLockingAccount_3_list) - x.LockingPeriods = *clv.list - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgInitPeriodicLockingAccount")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgInitPeriodicLockingAccount 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_MsgInitPeriodicLockingAccount) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.lockup.MsgInitPeriodicLockingAccount.start_time": - if x.StartTime == nil { - x.StartTime = new(timestamppb.Timestamp) - } - return protoreflect.ValueOfMessage(x.StartTime.ProtoReflect()) - case "cosmos.lockup.MsgInitPeriodicLockingAccount.locking_periods": - if x.LockingPeriods == nil { - x.LockingPeriods = []*Period{} - } - value := &_MsgInitPeriodicLockingAccount_3_list{list: &x.LockingPeriods} - return protoreflect.ValueOfList(value) - case "cosmos.lockup.MsgInitPeriodicLockingAccount.owner": - panic(fmt.Errorf("field owner of message cosmos.lockup.MsgInitPeriodicLockingAccount is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgInitPeriodicLockingAccount")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgInitPeriodicLockingAccount 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_MsgInitPeriodicLockingAccount) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.lockup.MsgInitPeriodicLockingAccount.owner": - return protoreflect.ValueOfString("") - case "cosmos.lockup.MsgInitPeriodicLockingAccount.start_time": - m := new(timestamppb.Timestamp) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cosmos.lockup.MsgInitPeriodicLockingAccount.locking_periods": - list := []*Period{} - return protoreflect.ValueOfList(&_MsgInitPeriodicLockingAccount_3_list{list: &list}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgInitPeriodicLockingAccount")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgInitPeriodicLockingAccount 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_MsgInitPeriodicLockingAccount) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.lockup.MsgInitPeriodicLockingAccount", 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_MsgInitPeriodicLockingAccount) 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_MsgInitPeriodicLockingAccount) 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_MsgInitPeriodicLockingAccount) 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_MsgInitPeriodicLockingAccount) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgInitPeriodicLockingAccount) - 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.Owner) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.StartTime != nil { - l = options.Size(x.StartTime) - n += 1 + l + runtime.Sov(uint64(l)) - } - if len(x.LockingPeriods) > 0 { - for _, e := range x.LockingPeriods { - 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().(*MsgInitPeriodicLockingAccount) - 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.LockingPeriods) > 0 { - for iNdEx := len(x.LockingPeriods) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.LockingPeriods[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x1a - } - } - if x.StartTime != nil { - encoded, err := options.Marshal(x.StartTime) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x12 - } - if len(x.Owner) > 0 { - i -= len(x.Owner) - copy(dAtA[i:], x.Owner) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Owner))) - 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().(*MsgInitPeriodicLockingAccount) - 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: MsgInitPeriodicLockingAccount: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgInitPeriodicLockingAccount: 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 Owner", 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.Owner = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.StartTime == nil { - x.StartTime = ×tamppb.Timestamp{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.StartTime); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LockingPeriods", 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.LockingPeriods = append(x.LockingPeriods, &Period{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.LockingPeriods[len(x.LockingPeriods)-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_MsgInitPeriodicLockingAccountResponse protoreflect.MessageDescriptor -) - -func init() { - file_cosmos_lockup_tx_proto_init() - md_MsgInitPeriodicLockingAccountResponse = File_cosmos_lockup_tx_proto.Messages().ByName("MsgInitPeriodicLockingAccountResponse") -} - -var _ protoreflect.Message = (*fastReflection_MsgInitPeriodicLockingAccountResponse)(nil) - -type fastReflection_MsgInitPeriodicLockingAccountResponse MsgInitPeriodicLockingAccountResponse - -func (x *MsgInitPeriodicLockingAccountResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgInitPeriodicLockingAccountResponse)(x) -} - -func (x *MsgInitPeriodicLockingAccountResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_lockup_tx_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_MsgInitPeriodicLockingAccountResponse_messageType fastReflection_MsgInitPeriodicLockingAccountResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgInitPeriodicLockingAccountResponse_messageType{} - -type fastReflection_MsgInitPeriodicLockingAccountResponse_messageType struct{} - -func (x fastReflection_MsgInitPeriodicLockingAccountResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgInitPeriodicLockingAccountResponse)(nil) -} -func (x fastReflection_MsgInitPeriodicLockingAccountResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgInitPeriodicLockingAccountResponse) -} -func (x fastReflection_MsgInitPeriodicLockingAccountResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgInitPeriodicLockingAccountResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgInitPeriodicLockingAccountResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgInitPeriodicLockingAccountResponse -} - -// 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_MsgInitPeriodicLockingAccountResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgInitPeriodicLockingAccountResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgInitPeriodicLockingAccountResponse) New() protoreflect.Message { - return new(fastReflection_MsgInitPeriodicLockingAccountResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgInitPeriodicLockingAccountResponse) Interface() protoreflect.ProtoMessage { - return (*MsgInitPeriodicLockingAccountResponse)(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_MsgInitPeriodicLockingAccountResponse) 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_MsgInitPeriodicLockingAccountResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgInitPeriodicLockingAccountResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgInitPeriodicLockingAccountResponse 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_MsgInitPeriodicLockingAccountResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgInitPeriodicLockingAccountResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgInitPeriodicLockingAccountResponse 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_MsgInitPeriodicLockingAccountResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgInitPeriodicLockingAccountResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgInitPeriodicLockingAccountResponse 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_MsgInitPeriodicLockingAccountResponse) 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.lockup.MsgInitPeriodicLockingAccountResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgInitPeriodicLockingAccountResponse 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_MsgInitPeriodicLockingAccountResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgInitPeriodicLockingAccountResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgInitPeriodicLockingAccountResponse 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_MsgInitPeriodicLockingAccountResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgInitPeriodicLockingAccountResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgInitPeriodicLockingAccountResponse 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_MsgInitPeriodicLockingAccountResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.lockup.MsgInitPeriodicLockingAccountResponse", 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_MsgInitPeriodicLockingAccountResponse) 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_MsgInitPeriodicLockingAccountResponse) 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_MsgInitPeriodicLockingAccountResponse) 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_MsgInitPeriodicLockingAccountResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgInitPeriodicLockingAccountResponse) - 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().(*MsgInitPeriodicLockingAccountResponse) - 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().(*MsgInitPeriodicLockingAccountResponse) - 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: MsgInitPeriodicLockingAccountResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgInitPeriodicLockingAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_MsgDelegate protoreflect.MessageDescriptor - fd_MsgDelegate_sender protoreflect.FieldDescriptor - fd_MsgDelegate_validator_address protoreflect.FieldDescriptor - fd_MsgDelegate_amount protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_lockup_tx_proto_init() - md_MsgDelegate = File_cosmos_lockup_tx_proto.Messages().ByName("MsgDelegate") - fd_MsgDelegate_sender = md_MsgDelegate.Fields().ByName("sender") - fd_MsgDelegate_validator_address = md_MsgDelegate.Fields().ByName("validator_address") - fd_MsgDelegate_amount = md_MsgDelegate.Fields().ByName("amount") -} - -var _ protoreflect.Message = (*fastReflection_MsgDelegate)(nil) - -type fastReflection_MsgDelegate MsgDelegate - -func (x *MsgDelegate) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgDelegate)(x) -} - -func (x *MsgDelegate) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_lockup_tx_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgDelegate_messageType fastReflection_MsgDelegate_messageType -var _ protoreflect.MessageType = fastReflection_MsgDelegate_messageType{} - -type fastReflection_MsgDelegate_messageType struct{} - -func (x fastReflection_MsgDelegate_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgDelegate)(nil) -} -func (x fastReflection_MsgDelegate_messageType) New() protoreflect.Message { - return new(fastReflection_MsgDelegate) -} -func (x fastReflection_MsgDelegate_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgDelegate -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgDelegate) Descriptor() protoreflect.MessageDescriptor { - return md_MsgDelegate -} - -// 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_MsgDelegate) Type() protoreflect.MessageType { - return _fastReflection_MsgDelegate_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgDelegate) New() protoreflect.Message { - return new(fastReflection_MsgDelegate) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgDelegate) Interface() protoreflect.ProtoMessage { - return (*MsgDelegate)(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_MsgDelegate) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Sender != "" { - value := protoreflect.ValueOfString(x.Sender) - if !f(fd_MsgDelegate_sender, value) { - return - } - } - if x.ValidatorAddress != "" { - value := protoreflect.ValueOfString(x.ValidatorAddress) - if !f(fd_MsgDelegate_validator_address, value) { - return - } - } - if x.Amount != nil { - value := protoreflect.ValueOfMessage(x.Amount.ProtoReflect()) - if !f(fd_MsgDelegate_amount, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgDelegate) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.lockup.MsgDelegate.sender": - return x.Sender != "" - case "cosmos.lockup.MsgDelegate.validator_address": - return x.ValidatorAddress != "" - case "cosmos.lockup.MsgDelegate.amount": - return x.Amount != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgDelegate")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgDelegate 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_MsgDelegate) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.lockup.MsgDelegate.sender": - x.Sender = "" - case "cosmos.lockup.MsgDelegate.validator_address": - x.ValidatorAddress = "" - case "cosmos.lockup.MsgDelegate.amount": - x.Amount = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgDelegate")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgDelegate 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_MsgDelegate) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.lockup.MsgDelegate.sender": - value := x.Sender - return protoreflect.ValueOfString(value) - case "cosmos.lockup.MsgDelegate.validator_address": - value := x.ValidatorAddress - return protoreflect.ValueOfString(value) - case "cosmos.lockup.MsgDelegate.amount": - value := x.Amount - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgDelegate")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgDelegate 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_MsgDelegate) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.lockup.MsgDelegate.sender": - x.Sender = value.Interface().(string) - case "cosmos.lockup.MsgDelegate.validator_address": - x.ValidatorAddress = value.Interface().(string) - case "cosmos.lockup.MsgDelegate.amount": - x.Amount = value.Message().Interface().(*v1beta1.Coin) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgDelegate")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgDelegate 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_MsgDelegate) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.lockup.MsgDelegate.amount": - if x.Amount == nil { - x.Amount = new(v1beta1.Coin) - } - return protoreflect.ValueOfMessage(x.Amount.ProtoReflect()) - case "cosmos.lockup.MsgDelegate.sender": - panic(fmt.Errorf("field sender of message cosmos.lockup.MsgDelegate is not mutable")) - case "cosmos.lockup.MsgDelegate.validator_address": - panic(fmt.Errorf("field validator_address of message cosmos.lockup.MsgDelegate is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgDelegate")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgDelegate 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_MsgDelegate) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.lockup.MsgDelegate.sender": - return protoreflect.ValueOfString("") - case "cosmos.lockup.MsgDelegate.validator_address": - return protoreflect.ValueOfString("") - case "cosmos.lockup.MsgDelegate.amount": - m := new(v1beta1.Coin) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgDelegate")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgDelegate 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_MsgDelegate) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.lockup.MsgDelegate", 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_MsgDelegate) 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_MsgDelegate) 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_MsgDelegate) 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_MsgDelegate) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgDelegate) - 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.Sender) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.ValidatorAddress) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Amount != nil { - l = options.Size(x.Amount) - 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().(*MsgDelegate) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.Amount != nil { - encoded, err := options.Marshal(x.Amount) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x1a - } - if len(x.ValidatorAddress) > 0 { - i -= len(x.ValidatorAddress) - copy(dAtA[i:], x.ValidatorAddress) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ValidatorAddress))) - i-- - dAtA[i] = 0x12 - } - if len(x.Sender) > 0 { - i -= len(x.Sender) - copy(dAtA[i:], x.Sender) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Sender))) - 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().(*MsgDelegate) - 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: MsgDelegate: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgDelegate: 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 Sender", 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.Sender = 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 ValidatorAddress", 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.ValidatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", 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.Amount == nil { - x.Amount = &v1beta1.Coin{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Amount); 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_MsgUndelegate protoreflect.MessageDescriptor - fd_MsgUndelegate_sender protoreflect.FieldDescriptor - fd_MsgUndelegate_validator_address protoreflect.FieldDescriptor - fd_MsgUndelegate_amount protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_lockup_tx_proto_init() - md_MsgUndelegate = File_cosmos_lockup_tx_proto.Messages().ByName("MsgUndelegate") - fd_MsgUndelegate_sender = md_MsgUndelegate.Fields().ByName("sender") - fd_MsgUndelegate_validator_address = md_MsgUndelegate.Fields().ByName("validator_address") - fd_MsgUndelegate_amount = md_MsgUndelegate.Fields().ByName("amount") -} - -var _ protoreflect.Message = (*fastReflection_MsgUndelegate)(nil) - -type fastReflection_MsgUndelegate MsgUndelegate - -func (x *MsgUndelegate) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgUndelegate)(x) -} - -func (x *MsgUndelegate) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_lockup_tx_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgUndelegate_messageType fastReflection_MsgUndelegate_messageType -var _ protoreflect.MessageType = fastReflection_MsgUndelegate_messageType{} - -type fastReflection_MsgUndelegate_messageType struct{} - -func (x fastReflection_MsgUndelegate_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgUndelegate)(nil) -} -func (x fastReflection_MsgUndelegate_messageType) New() protoreflect.Message { - return new(fastReflection_MsgUndelegate) -} -func (x fastReflection_MsgUndelegate_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUndelegate -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgUndelegate) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUndelegate -} - -// 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_MsgUndelegate) Type() protoreflect.MessageType { - return _fastReflection_MsgUndelegate_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgUndelegate) New() protoreflect.Message { - return new(fastReflection_MsgUndelegate) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgUndelegate) Interface() protoreflect.ProtoMessage { - return (*MsgUndelegate)(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_MsgUndelegate) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Sender != "" { - value := protoreflect.ValueOfString(x.Sender) - if !f(fd_MsgUndelegate_sender, value) { - return - } - } - if x.ValidatorAddress != "" { - value := protoreflect.ValueOfString(x.ValidatorAddress) - if !f(fd_MsgUndelegate_validator_address, value) { - return - } - } - if x.Amount != nil { - value := protoreflect.ValueOfMessage(x.Amount.ProtoReflect()) - if !f(fd_MsgUndelegate_amount, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgUndelegate) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.lockup.MsgUndelegate.sender": - return x.Sender != "" - case "cosmos.lockup.MsgUndelegate.validator_address": - return x.ValidatorAddress != "" - case "cosmos.lockup.MsgUndelegate.amount": - return x.Amount != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgUndelegate")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgUndelegate 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_MsgUndelegate) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.lockup.MsgUndelegate.sender": - x.Sender = "" - case "cosmos.lockup.MsgUndelegate.validator_address": - x.ValidatorAddress = "" - case "cosmos.lockup.MsgUndelegate.amount": - x.Amount = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgUndelegate")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgUndelegate 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_MsgUndelegate) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.lockup.MsgUndelegate.sender": - value := x.Sender - return protoreflect.ValueOfString(value) - case "cosmos.lockup.MsgUndelegate.validator_address": - value := x.ValidatorAddress - return protoreflect.ValueOfString(value) - case "cosmos.lockup.MsgUndelegate.amount": - value := x.Amount - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgUndelegate")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgUndelegate 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_MsgUndelegate) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.lockup.MsgUndelegate.sender": - x.Sender = value.Interface().(string) - case "cosmos.lockup.MsgUndelegate.validator_address": - x.ValidatorAddress = value.Interface().(string) - case "cosmos.lockup.MsgUndelegate.amount": - x.Amount = value.Message().Interface().(*v1beta1.Coin) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgUndelegate")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgUndelegate 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_MsgUndelegate) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.lockup.MsgUndelegate.amount": - if x.Amount == nil { - x.Amount = new(v1beta1.Coin) - } - return protoreflect.ValueOfMessage(x.Amount.ProtoReflect()) - case "cosmos.lockup.MsgUndelegate.sender": - panic(fmt.Errorf("field sender of message cosmos.lockup.MsgUndelegate is not mutable")) - case "cosmos.lockup.MsgUndelegate.validator_address": - panic(fmt.Errorf("field validator_address of message cosmos.lockup.MsgUndelegate is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgUndelegate")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgUndelegate 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_MsgUndelegate) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.lockup.MsgUndelegate.sender": - return protoreflect.ValueOfString("") - case "cosmos.lockup.MsgUndelegate.validator_address": - return protoreflect.ValueOfString("") - case "cosmos.lockup.MsgUndelegate.amount": - m := new(v1beta1.Coin) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgUndelegate")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgUndelegate 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_MsgUndelegate) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.lockup.MsgUndelegate", 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_MsgUndelegate) 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_MsgUndelegate) 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_MsgUndelegate) 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_MsgUndelegate) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgUndelegate) - 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.Sender) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.ValidatorAddress) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Amount != nil { - l = options.Size(x.Amount) - 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().(*MsgUndelegate) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.Amount != nil { - encoded, err := options.Marshal(x.Amount) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x1a - } - if len(x.ValidatorAddress) > 0 { - i -= len(x.ValidatorAddress) - copy(dAtA[i:], x.ValidatorAddress) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ValidatorAddress))) - i-- - dAtA[i] = 0x12 - } - if len(x.Sender) > 0 { - i -= len(x.Sender) - copy(dAtA[i:], x.Sender) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Sender))) - 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().(*MsgUndelegate) - 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: MsgUndelegate: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUndelegate: 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 Sender", 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.Sender = 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 ValidatorAddress", 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.ValidatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", 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.Amount == nil { - x.Amount = &v1beta1.Coin{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Amount); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var _ protoreflect.List = (*_MsgSend_3_list)(nil) - -type _MsgSend_3_list struct { - list *[]*v1beta1.Coin -} - -func (x *_MsgSend_3_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_MsgSend_3_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_MsgSend_3_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) - (*x.list)[i] = concreteValue -} - -func (x *_MsgSend_3_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) - *x.list = append(*x.list, concreteValue) -} - -func (x *_MsgSend_3_list) AppendMutable() protoreflect.Value { - v := new(v1beta1.Coin) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_MsgSend_3_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_MsgSend_3_list) NewElement() protoreflect.Value { - v := new(v1beta1.Coin) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_MsgSend_3_list) IsValid() bool { - return x.list != nil -} - -var ( - md_MsgSend protoreflect.MessageDescriptor - fd_MsgSend_sender protoreflect.FieldDescriptor - fd_MsgSend_to_address protoreflect.FieldDescriptor - fd_MsgSend_amount protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_lockup_tx_proto_init() - md_MsgSend = File_cosmos_lockup_tx_proto.Messages().ByName("MsgSend") - fd_MsgSend_sender = md_MsgSend.Fields().ByName("sender") - fd_MsgSend_to_address = md_MsgSend.Fields().ByName("to_address") - fd_MsgSend_amount = md_MsgSend.Fields().ByName("amount") -} - -var _ protoreflect.Message = (*fastReflection_MsgSend)(nil) - -type fastReflection_MsgSend MsgSend - -func (x *MsgSend) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgSend)(x) -} - -func (x *MsgSend) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_lockup_tx_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgSend_messageType fastReflection_MsgSend_messageType -var _ protoreflect.MessageType = fastReflection_MsgSend_messageType{} - -type fastReflection_MsgSend_messageType struct{} - -func (x fastReflection_MsgSend_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgSend)(nil) -} -func (x fastReflection_MsgSend_messageType) New() protoreflect.Message { - return new(fastReflection_MsgSend) -} -func (x fastReflection_MsgSend_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgSend -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgSend) Descriptor() protoreflect.MessageDescriptor { - return md_MsgSend -} - -// 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_MsgSend) Type() protoreflect.MessageType { - return _fastReflection_MsgSend_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgSend) New() protoreflect.Message { - return new(fastReflection_MsgSend) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgSend) Interface() protoreflect.ProtoMessage { - return (*MsgSend)(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_MsgSend) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Sender != "" { - value := protoreflect.ValueOfString(x.Sender) - if !f(fd_MsgSend_sender, value) { - return - } - } - if x.ToAddress != "" { - value := protoreflect.ValueOfString(x.ToAddress) - if !f(fd_MsgSend_to_address, value) { - return - } - } - if len(x.Amount) != 0 { - value := protoreflect.ValueOfList(&_MsgSend_3_list{list: &x.Amount}) - if !f(fd_MsgSend_amount, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgSend) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.lockup.MsgSend.sender": - return x.Sender != "" - case "cosmos.lockup.MsgSend.to_address": - return x.ToAddress != "" - case "cosmos.lockup.MsgSend.amount": - return len(x.Amount) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgSend")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgSend 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_MsgSend) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.lockup.MsgSend.sender": - x.Sender = "" - case "cosmos.lockup.MsgSend.to_address": - x.ToAddress = "" - case "cosmos.lockup.MsgSend.amount": - x.Amount = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgSend")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgSend 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_MsgSend) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.lockup.MsgSend.sender": - value := x.Sender - return protoreflect.ValueOfString(value) - case "cosmos.lockup.MsgSend.to_address": - value := x.ToAddress - return protoreflect.ValueOfString(value) - case "cosmos.lockup.MsgSend.amount": - if len(x.Amount) == 0 { - return protoreflect.ValueOfList(&_MsgSend_3_list{}) - } - listValue := &_MsgSend_3_list{list: &x.Amount} - return protoreflect.ValueOfList(listValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgSend")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgSend 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_MsgSend) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.lockup.MsgSend.sender": - x.Sender = value.Interface().(string) - case "cosmos.lockup.MsgSend.to_address": - x.ToAddress = value.Interface().(string) - case "cosmos.lockup.MsgSend.amount": - lv := value.List() - clv := lv.(*_MsgSend_3_list) - x.Amount = *clv.list - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgSend")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgSend 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_MsgSend) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.lockup.MsgSend.amount": - if x.Amount == nil { - x.Amount = []*v1beta1.Coin{} - } - value := &_MsgSend_3_list{list: &x.Amount} - return protoreflect.ValueOfList(value) - case "cosmos.lockup.MsgSend.sender": - panic(fmt.Errorf("field sender of message cosmos.lockup.MsgSend is not mutable")) - case "cosmos.lockup.MsgSend.to_address": - panic(fmt.Errorf("field to_address of message cosmos.lockup.MsgSend is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgSend")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgSend 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_MsgSend) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.lockup.MsgSend.sender": - return protoreflect.ValueOfString("") - case "cosmos.lockup.MsgSend.to_address": - return protoreflect.ValueOfString("") - case "cosmos.lockup.MsgSend.amount": - list := []*v1beta1.Coin{} - return protoreflect.ValueOfList(&_MsgSend_3_list{list: &list}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgSend")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgSend 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_MsgSend) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.lockup.MsgSend", 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_MsgSend) 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_MsgSend) 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_MsgSend) 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_MsgSend) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgSend) - 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.Sender) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.ToAddress) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if len(x.Amount) > 0 { - for _, e := range x.Amount { - 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().(*MsgSend) - 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.Amount) > 0 { - for iNdEx := len(x.Amount) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.Amount[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x1a - } - } - if len(x.ToAddress) > 0 { - i -= len(x.ToAddress) - copy(dAtA[i:], x.ToAddress) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ToAddress))) - i-- - dAtA[i] = 0x12 - } - if len(x.Sender) > 0 { - i -= len(x.Sender) - copy(dAtA[i:], x.Sender) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Sender))) - 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().(*MsgSend) - 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: MsgSend: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSend: 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 Sender", 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.Sender = 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 ToAddress", 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.ToAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", 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.Amount = append(x.Amount, &v1beta1.Coin{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Amount[len(x.Amount)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var _ protoreflect.List = (*_MsgExecuteMessagesResponse_1_list)(nil) - -type _MsgExecuteMessagesResponse_1_list struct { - list *[]*anypb.Any -} - -func (x *_MsgExecuteMessagesResponse_1_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_MsgExecuteMessagesResponse_1_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_MsgExecuteMessagesResponse_1_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*anypb.Any) - (*x.list)[i] = concreteValue -} - -func (x *_MsgExecuteMessagesResponse_1_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*anypb.Any) - *x.list = append(*x.list, concreteValue) -} - -func (x *_MsgExecuteMessagesResponse_1_list) AppendMutable() protoreflect.Value { - v := new(anypb.Any) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_MsgExecuteMessagesResponse_1_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_MsgExecuteMessagesResponse_1_list) NewElement() protoreflect.Value { - v := new(anypb.Any) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_MsgExecuteMessagesResponse_1_list) IsValid() bool { - return x.list != nil -} - -var ( - md_MsgExecuteMessagesResponse protoreflect.MessageDescriptor - fd_MsgExecuteMessagesResponse_responses protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_lockup_tx_proto_init() - md_MsgExecuteMessagesResponse = File_cosmos_lockup_tx_proto.Messages().ByName("MsgExecuteMessagesResponse") - fd_MsgExecuteMessagesResponse_responses = md_MsgExecuteMessagesResponse.Fields().ByName("responses") -} - -var _ protoreflect.Message = (*fastReflection_MsgExecuteMessagesResponse)(nil) - -type fastReflection_MsgExecuteMessagesResponse MsgExecuteMessagesResponse - -func (x *MsgExecuteMessagesResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgExecuteMessagesResponse)(x) -} - -func (x *MsgExecuteMessagesResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_lockup_tx_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgExecuteMessagesResponse_messageType fastReflection_MsgExecuteMessagesResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgExecuteMessagesResponse_messageType{} - -type fastReflection_MsgExecuteMessagesResponse_messageType struct{} - -func (x fastReflection_MsgExecuteMessagesResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgExecuteMessagesResponse)(nil) -} -func (x fastReflection_MsgExecuteMessagesResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgExecuteMessagesResponse) -} -func (x fastReflection_MsgExecuteMessagesResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgExecuteMessagesResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgExecuteMessagesResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgExecuteMessagesResponse -} - -// 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_MsgExecuteMessagesResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgExecuteMessagesResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgExecuteMessagesResponse) New() protoreflect.Message { - return new(fastReflection_MsgExecuteMessagesResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgExecuteMessagesResponse) Interface() protoreflect.ProtoMessage { - return (*MsgExecuteMessagesResponse)(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_MsgExecuteMessagesResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Responses) != 0 { - value := protoreflect.ValueOfList(&_MsgExecuteMessagesResponse_1_list{list: &x.Responses}) - if !f(fd_MsgExecuteMessagesResponse_responses, 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_MsgExecuteMessagesResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.lockup.MsgExecuteMessagesResponse.responses": - return len(x.Responses) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgExecuteMessagesResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgExecuteMessagesResponse 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_MsgExecuteMessagesResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.lockup.MsgExecuteMessagesResponse.responses": - x.Responses = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgExecuteMessagesResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgExecuteMessagesResponse 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_MsgExecuteMessagesResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.lockup.MsgExecuteMessagesResponse.responses": - if len(x.Responses) == 0 { - return protoreflect.ValueOfList(&_MsgExecuteMessagesResponse_1_list{}) - } - listValue := &_MsgExecuteMessagesResponse_1_list{list: &x.Responses} - return protoreflect.ValueOfList(listValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgExecuteMessagesResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgExecuteMessagesResponse 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_MsgExecuteMessagesResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.lockup.MsgExecuteMessagesResponse.responses": - lv := value.List() - clv := lv.(*_MsgExecuteMessagesResponse_1_list) - x.Responses = *clv.list - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgExecuteMessagesResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgExecuteMessagesResponse 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_MsgExecuteMessagesResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.lockup.MsgExecuteMessagesResponse.responses": - if x.Responses == nil { - x.Responses = []*anypb.Any{} - } - value := &_MsgExecuteMessagesResponse_1_list{list: &x.Responses} - return protoreflect.ValueOfList(value) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgExecuteMessagesResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgExecuteMessagesResponse 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_MsgExecuteMessagesResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.lockup.MsgExecuteMessagesResponse.responses": - list := []*anypb.Any{} - return protoreflect.ValueOfList(&_MsgExecuteMessagesResponse_1_list{list: &list}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgExecuteMessagesResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgExecuteMessagesResponse 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_MsgExecuteMessagesResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.lockup.MsgExecuteMessagesResponse", 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_MsgExecuteMessagesResponse) 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_MsgExecuteMessagesResponse) 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_MsgExecuteMessagesResponse) 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_MsgExecuteMessagesResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgExecuteMessagesResponse) - 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.Responses) > 0 { - for _, e := range x.Responses { - 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().(*MsgExecuteMessagesResponse) - 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.Responses) > 0 { - for iNdEx := len(x.Responses) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.Responses[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().(*MsgExecuteMessagesResponse) - 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: MsgExecuteMessagesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgExecuteMessagesResponse: 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 Responses", 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.Responses = append(x.Responses, &anypb.Any{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Responses[len(x.Responses)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var _ protoreflect.List = (*_MsgWithdraw_3_list)(nil) - -type _MsgWithdraw_3_list struct { - list *[]string -} - -func (x *_MsgWithdraw_3_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_MsgWithdraw_3_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfString((*x.list)[i]) -} - -func (x *_MsgWithdraw_3_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - (*x.list)[i] = concreteValue -} - -func (x *_MsgWithdraw_3_list) Append(value protoreflect.Value) { - valueUnwrapped := value.String() - concreteValue := valueUnwrapped - *x.list = append(*x.list, concreteValue) -} - -func (x *_MsgWithdraw_3_list) AppendMutable() protoreflect.Value { - panic(fmt.Errorf("AppendMutable can not be called on message MsgWithdraw at list field Denoms as it is not of Message kind")) -} - -func (x *_MsgWithdraw_3_list) Truncate(n int) { - *x.list = (*x.list)[:n] -} - -func (x *_MsgWithdraw_3_list) NewElement() protoreflect.Value { - v := "" - return protoreflect.ValueOfString(v) -} - -func (x *_MsgWithdraw_3_list) IsValid() bool { - return x.list != nil -} - -var ( - md_MsgWithdraw protoreflect.MessageDescriptor - fd_MsgWithdraw_withdrawer protoreflect.FieldDescriptor - fd_MsgWithdraw_to_address protoreflect.FieldDescriptor - fd_MsgWithdraw_denoms protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_lockup_tx_proto_init() - md_MsgWithdraw = File_cosmos_lockup_tx_proto.Messages().ByName("MsgWithdraw") - fd_MsgWithdraw_withdrawer = md_MsgWithdraw.Fields().ByName("withdrawer") - fd_MsgWithdraw_to_address = md_MsgWithdraw.Fields().ByName("to_address") - fd_MsgWithdraw_denoms = md_MsgWithdraw.Fields().ByName("denoms") -} - -var _ protoreflect.Message = (*fastReflection_MsgWithdraw)(nil) - -type fastReflection_MsgWithdraw MsgWithdraw - -func (x *MsgWithdraw) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgWithdraw)(x) -} - -func (x *MsgWithdraw) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_lockup_tx_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgWithdraw_messageType fastReflection_MsgWithdraw_messageType -var _ protoreflect.MessageType = fastReflection_MsgWithdraw_messageType{} - -type fastReflection_MsgWithdraw_messageType struct{} - -func (x fastReflection_MsgWithdraw_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgWithdraw)(nil) -} -func (x fastReflection_MsgWithdraw_messageType) New() protoreflect.Message { - return new(fastReflection_MsgWithdraw) -} -func (x fastReflection_MsgWithdraw_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgWithdraw -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgWithdraw) Descriptor() protoreflect.MessageDescriptor { - return md_MsgWithdraw -} - -// 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_MsgWithdraw) Type() protoreflect.MessageType { - return _fastReflection_MsgWithdraw_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgWithdraw) New() protoreflect.Message { - return new(fastReflection_MsgWithdraw) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgWithdraw) Interface() protoreflect.ProtoMessage { - return (*MsgWithdraw)(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_MsgWithdraw) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Withdrawer != "" { - value := protoreflect.ValueOfString(x.Withdrawer) - if !f(fd_MsgWithdraw_withdrawer, value) { - return - } - } - if x.ToAddress != "" { - value := protoreflect.ValueOfString(x.ToAddress) - if !f(fd_MsgWithdraw_to_address, value) { - return - } - } - if len(x.Denoms) != 0 { - value := protoreflect.ValueOfList(&_MsgWithdraw_3_list{list: &x.Denoms}) - if !f(fd_MsgWithdraw_denoms, 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_MsgWithdraw) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.lockup.MsgWithdraw.withdrawer": - return x.Withdrawer != "" - case "cosmos.lockup.MsgWithdraw.to_address": - return x.ToAddress != "" - case "cosmos.lockup.MsgWithdraw.denoms": - return len(x.Denoms) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgWithdraw")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgWithdraw 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_MsgWithdraw) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.lockup.MsgWithdraw.withdrawer": - x.Withdrawer = "" - case "cosmos.lockup.MsgWithdraw.to_address": - x.ToAddress = "" - case "cosmos.lockup.MsgWithdraw.denoms": - x.Denoms = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgWithdraw")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgWithdraw 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_MsgWithdraw) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.lockup.MsgWithdraw.withdrawer": - value := x.Withdrawer - return protoreflect.ValueOfString(value) - case "cosmos.lockup.MsgWithdraw.to_address": - value := x.ToAddress - return protoreflect.ValueOfString(value) - case "cosmos.lockup.MsgWithdraw.denoms": - if len(x.Denoms) == 0 { - return protoreflect.ValueOfList(&_MsgWithdraw_3_list{}) - } - listValue := &_MsgWithdraw_3_list{list: &x.Denoms} - return protoreflect.ValueOfList(listValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgWithdraw")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgWithdraw 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_MsgWithdraw) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.lockup.MsgWithdraw.withdrawer": - x.Withdrawer = value.Interface().(string) - case "cosmos.lockup.MsgWithdraw.to_address": - x.ToAddress = value.Interface().(string) - case "cosmos.lockup.MsgWithdraw.denoms": - lv := value.List() - clv := lv.(*_MsgWithdraw_3_list) - x.Denoms = *clv.list - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgWithdraw")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgWithdraw 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_MsgWithdraw) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.lockup.MsgWithdraw.denoms": - if x.Denoms == nil { - x.Denoms = []string{} - } - value := &_MsgWithdraw_3_list{list: &x.Denoms} - return protoreflect.ValueOfList(value) - case "cosmos.lockup.MsgWithdraw.withdrawer": - panic(fmt.Errorf("field withdrawer of message cosmos.lockup.MsgWithdraw is not mutable")) - case "cosmos.lockup.MsgWithdraw.to_address": - panic(fmt.Errorf("field to_address of message cosmos.lockup.MsgWithdraw is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgWithdraw")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgWithdraw 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_MsgWithdraw) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.lockup.MsgWithdraw.withdrawer": - return protoreflect.ValueOfString("") - case "cosmos.lockup.MsgWithdraw.to_address": - return protoreflect.ValueOfString("") - case "cosmos.lockup.MsgWithdraw.denoms": - list := []string{} - return protoreflect.ValueOfList(&_MsgWithdraw_3_list{list: &list}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgWithdraw")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgWithdraw 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_MsgWithdraw) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.lockup.MsgWithdraw", 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_MsgWithdraw) 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_MsgWithdraw) 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_MsgWithdraw) 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_MsgWithdraw) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgWithdraw) - 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.Withdrawer) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.ToAddress) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if len(x.Denoms) > 0 { - for _, s := range x.Denoms { - l = len(s) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgWithdraw) - 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.Denoms) > 0 { - for iNdEx := len(x.Denoms) - 1; iNdEx >= 0; iNdEx-- { - i -= len(x.Denoms[iNdEx]) - copy(dAtA[i:], x.Denoms[iNdEx]) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Denoms[iNdEx]))) - i-- - dAtA[i] = 0x1a - } - } - if len(x.ToAddress) > 0 { - i -= len(x.ToAddress) - copy(dAtA[i:], x.ToAddress) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ToAddress))) - i-- - dAtA[i] = 0x12 - } - if len(x.Withdrawer) > 0 { - i -= len(x.Withdrawer) - copy(dAtA[i:], x.Withdrawer) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Withdrawer))) - 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().(*MsgWithdraw) - 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: MsgWithdraw: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgWithdraw: 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 Withdrawer", 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.Withdrawer = 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 ToAddress", 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.ToAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Denoms", 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.Denoms = append(x.Denoms, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var _ protoreflect.List = (*_MsgWithdrawResponse_2_list)(nil) - -type _MsgWithdrawResponse_2_list struct { - list *[]*v1beta1.Coin -} - -func (x *_MsgWithdrawResponse_2_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_MsgWithdrawResponse_2_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_MsgWithdrawResponse_2_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) - (*x.list)[i] = concreteValue -} - -func (x *_MsgWithdrawResponse_2_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) - *x.list = append(*x.list, concreteValue) -} - -func (x *_MsgWithdrawResponse_2_list) AppendMutable() protoreflect.Value { - v := new(v1beta1.Coin) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_MsgWithdrawResponse_2_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_MsgWithdrawResponse_2_list) NewElement() protoreflect.Value { - v := new(v1beta1.Coin) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_MsgWithdrawResponse_2_list) IsValid() bool { - return x.list != nil -} - -var ( - md_MsgWithdrawResponse protoreflect.MessageDescriptor - fd_MsgWithdrawResponse_reciever protoreflect.FieldDescriptor - fd_MsgWithdrawResponse_amount_received protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_lockup_tx_proto_init() - md_MsgWithdrawResponse = File_cosmos_lockup_tx_proto.Messages().ByName("MsgWithdrawResponse") - fd_MsgWithdrawResponse_reciever = md_MsgWithdrawResponse.Fields().ByName("reciever") - fd_MsgWithdrawResponse_amount_received = md_MsgWithdrawResponse.Fields().ByName("amount_received") -} - -var _ protoreflect.Message = (*fastReflection_MsgWithdrawResponse)(nil) - -type fastReflection_MsgWithdrawResponse MsgWithdrawResponse - -func (x *MsgWithdrawResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgWithdrawResponse)(x) -} - -func (x *MsgWithdrawResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_lockup_tx_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgWithdrawResponse_messageType fastReflection_MsgWithdrawResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgWithdrawResponse_messageType{} - -type fastReflection_MsgWithdrawResponse_messageType struct{} - -func (x fastReflection_MsgWithdrawResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgWithdrawResponse)(nil) -} -func (x fastReflection_MsgWithdrawResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgWithdrawResponse) -} -func (x fastReflection_MsgWithdrawResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgWithdrawResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgWithdrawResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgWithdrawResponse -} - -// 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_MsgWithdrawResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgWithdrawResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgWithdrawResponse) New() protoreflect.Message { - return new(fastReflection_MsgWithdrawResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgWithdrawResponse) Interface() protoreflect.ProtoMessage { - return (*MsgWithdrawResponse)(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_MsgWithdrawResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Reciever != "" { - value := protoreflect.ValueOfString(x.Reciever) - if !f(fd_MsgWithdrawResponse_reciever, value) { - return - } - } - if len(x.AmountReceived) != 0 { - value := protoreflect.ValueOfList(&_MsgWithdrawResponse_2_list{list: &x.AmountReceived}) - if !f(fd_MsgWithdrawResponse_amount_received, 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_MsgWithdrawResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.lockup.MsgWithdrawResponse.reciever": - return x.Reciever != "" - case "cosmos.lockup.MsgWithdrawResponse.amount_received": - return len(x.AmountReceived) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgWithdrawResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgWithdrawResponse 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_MsgWithdrawResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.lockup.MsgWithdrawResponse.reciever": - x.Reciever = "" - case "cosmos.lockup.MsgWithdrawResponse.amount_received": - x.AmountReceived = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgWithdrawResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgWithdrawResponse 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_MsgWithdrawResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.lockup.MsgWithdrawResponse.reciever": - value := x.Reciever - return protoreflect.ValueOfString(value) - case "cosmos.lockup.MsgWithdrawResponse.amount_received": - if len(x.AmountReceived) == 0 { - return protoreflect.ValueOfList(&_MsgWithdrawResponse_2_list{}) - } - listValue := &_MsgWithdrawResponse_2_list{list: &x.AmountReceived} - return protoreflect.ValueOfList(listValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgWithdrawResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgWithdrawResponse 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_MsgWithdrawResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.lockup.MsgWithdrawResponse.reciever": - x.Reciever = value.Interface().(string) - case "cosmos.lockup.MsgWithdrawResponse.amount_received": - lv := value.List() - clv := lv.(*_MsgWithdrawResponse_2_list) - x.AmountReceived = *clv.list - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgWithdrawResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgWithdrawResponse 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_MsgWithdrawResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.lockup.MsgWithdrawResponse.amount_received": - if x.AmountReceived == nil { - x.AmountReceived = []*v1beta1.Coin{} - } - value := &_MsgWithdrawResponse_2_list{list: &x.AmountReceived} - return protoreflect.ValueOfList(value) - case "cosmos.lockup.MsgWithdrawResponse.reciever": - panic(fmt.Errorf("field reciever of message cosmos.lockup.MsgWithdrawResponse is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgWithdrawResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgWithdrawResponse 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_MsgWithdrawResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.lockup.MsgWithdrawResponse.reciever": - return protoreflect.ValueOfString("") - case "cosmos.lockup.MsgWithdrawResponse.amount_received": - list := []*v1beta1.Coin{} - return protoreflect.ValueOfList(&_MsgWithdrawResponse_2_list{list: &list}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.lockup.MsgWithdrawResponse")) - } - panic(fmt.Errorf("message cosmos.lockup.MsgWithdrawResponse 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_MsgWithdrawResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.lockup.MsgWithdrawResponse", 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_MsgWithdrawResponse) 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_MsgWithdrawResponse) 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_MsgWithdrawResponse) 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_MsgWithdrawResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgWithdrawResponse) - 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.Reciever) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if len(x.AmountReceived) > 0 { - for _, e := range x.AmountReceived { - 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().(*MsgWithdrawResponse) - 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.AmountReceived) > 0 { - for iNdEx := len(x.AmountReceived) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.AmountReceived[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x12 - } - } - if len(x.Reciever) > 0 { - i -= len(x.Reciever) - copy(dAtA[i:], x.Reciever) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Reciever))) - 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().(*MsgWithdrawResponse) - 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: MsgWithdrawResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgWithdrawResponse: 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 Reciever", 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.Reciever = 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 AmountReceived", 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.AmountReceived = append(x.AmountReceived, &v1beta1.Coin{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.AmountReceived[len(x.AmountReceived)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.0 -// protoc (unknown) -// source: cosmos/lockup/tx.proto - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// MsgInitLockupAccount defines a message that enables creating a lockup -// account. -type MsgInitLockupAccount struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // owner of the vesting account - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // end of lockup - EndTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` - // start of lockup - StartTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` -} - -func (x *MsgInitLockupAccount) Reset() { - *x = MsgInitLockupAccount{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_lockup_tx_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgInitLockupAccount) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgInitLockupAccount) ProtoMessage() {} - -// Deprecated: Use MsgInitLockupAccount.ProtoReflect.Descriptor instead. -func (*MsgInitLockupAccount) Descriptor() ([]byte, []int) { - return file_cosmos_lockup_tx_proto_rawDescGZIP(), []int{0} -} - -func (x *MsgInitLockupAccount) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *MsgInitLockupAccount) GetEndTime() *timestamppb.Timestamp { - if x != nil { - return x.EndTime - } - return nil -} - -func (x *MsgInitLockupAccount) GetStartTime() *timestamppb.Timestamp { - if x != nil { - return x.StartTime - } - return nil -} - -// MsgInitLockupAccountResponse defines the Msg/InitLockupAccount response type. -type MsgInitLockupAccountResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *MsgInitLockupAccountResponse) Reset() { - *x = MsgInitLockupAccountResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_lockup_tx_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgInitLockupAccountResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgInitLockupAccountResponse) ProtoMessage() {} - -// Deprecated: Use MsgInitLockupAccountResponse.ProtoReflect.Descriptor instead. -func (*MsgInitLockupAccountResponse) Descriptor() ([]byte, []int) { - return file_cosmos_lockup_tx_proto_rawDescGZIP(), []int{1} -} - -// MsgInitPeriodicLockingAccount defines a message that enables creating a periodic locking -// account. -type MsgInitPeriodicLockingAccount struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // owner of the lockup account - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // start of lockup - StartTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` - LockingPeriods []*Period `protobuf:"bytes,3,rep,name=locking_periods,json=lockingPeriods,proto3" json:"locking_periods,omitempty"` -} - -func (x *MsgInitPeriodicLockingAccount) Reset() { - *x = MsgInitPeriodicLockingAccount{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_lockup_tx_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgInitPeriodicLockingAccount) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgInitPeriodicLockingAccount) ProtoMessage() {} - -// Deprecated: Use MsgInitPeriodicLockingAccount.ProtoReflect.Descriptor instead. -func (*MsgInitPeriodicLockingAccount) Descriptor() ([]byte, []int) { - return file_cosmos_lockup_tx_proto_rawDescGZIP(), []int{2} -} - -func (x *MsgInitPeriodicLockingAccount) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *MsgInitPeriodicLockingAccount) GetStartTime() *timestamppb.Timestamp { - if x != nil { - return x.StartTime - } - return nil -} - -func (x *MsgInitPeriodicLockingAccount) GetLockingPeriods() []*Period { - if x != nil { - return x.LockingPeriods - } - return nil -} - -// MsgInitPeriodicLockingAccountResponse defines the Msg/InitPeriodicLockingAccount -// response type. -type MsgInitPeriodicLockingAccountResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *MsgInitPeriodicLockingAccountResponse) Reset() { - *x = MsgInitPeriodicLockingAccountResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_lockup_tx_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgInitPeriodicLockingAccountResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgInitPeriodicLockingAccountResponse) ProtoMessage() {} - -// Deprecated: Use MsgInitPeriodicLockingAccountResponse.ProtoReflect.Descriptor instead. -func (*MsgInitPeriodicLockingAccountResponse) Descriptor() ([]byte, []int) { - return file_cosmos_lockup_tx_proto_rawDescGZIP(), []int{3} -} - -// MsgDelegate defines a message that enable lockup account to execute delegate message -type MsgDelegate struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // sender is the owner of the lockup account - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` - Amount *v1beta1.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"` -} - -func (x *MsgDelegate) Reset() { - *x = MsgDelegate{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_lockup_tx_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgDelegate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgDelegate) ProtoMessage() {} - -// Deprecated: Use MsgDelegate.ProtoReflect.Descriptor instead. -func (*MsgDelegate) Descriptor() ([]byte, []int) { - return file_cosmos_lockup_tx_proto_rawDescGZIP(), []int{4} -} - -func (x *MsgDelegate) GetSender() string { - if x != nil { - return x.Sender - } - return "" -} - -func (x *MsgDelegate) GetValidatorAddress() string { - if x != nil { - return x.ValidatorAddress - } - return "" -} - -func (x *MsgDelegate) GetAmount() *v1beta1.Coin { - if x != nil { - return x.Amount - } - return nil -} - -// MsgUndelegate defines a message that enable lockup account to execute undelegate message -type MsgUndelegate struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` - Amount *v1beta1.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"` -} - -func (x *MsgUndelegate) Reset() { - *x = MsgUndelegate{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_lockup_tx_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgUndelegate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgUndelegate) ProtoMessage() {} - -// Deprecated: Use MsgUndelegate.ProtoReflect.Descriptor instead. -func (*MsgUndelegate) Descriptor() ([]byte, []int) { - return file_cosmos_lockup_tx_proto_rawDescGZIP(), []int{5} -} - -func (x *MsgUndelegate) GetSender() string { - if x != nil { - return x.Sender - } - return "" -} - -func (x *MsgUndelegate) GetValidatorAddress() string { - if x != nil { - return x.ValidatorAddress - } - return "" -} - -func (x *MsgUndelegate) GetAmount() *v1beta1.Coin { - if x != nil { - return x.Amount - } - return nil -} - -// MsgSend defines a message that enable lockup account to execute send message -type MsgSend struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - ToAddress string `protobuf:"bytes,2,opt,name=to_address,json=toAddress,proto3" json:"to_address,omitempty"` - Amount []*v1beta1.Coin `protobuf:"bytes,3,rep,name=amount,proto3" json:"amount,omitempty"` -} - -func (x *MsgSend) Reset() { - *x = MsgSend{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_lockup_tx_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgSend) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgSend) ProtoMessage() {} - -// Deprecated: Use MsgSend.ProtoReflect.Descriptor instead. -func (*MsgSend) Descriptor() ([]byte, []int) { - return file_cosmos_lockup_tx_proto_rawDescGZIP(), []int{6} -} - -func (x *MsgSend) GetSender() string { - if x != nil { - return x.Sender - } - return "" -} - -func (x *MsgSend) GetToAddress() string { - if x != nil { - return x.ToAddress - } - return "" -} - -func (x *MsgSend) GetAmount() []*v1beta1.Coin { - if x != nil { - return x.Amount - } - return nil -} - -// MsgExecuteMessagesResponse defines the response for lockup execute operations -type MsgExecuteMessagesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Responses []*anypb.Any `protobuf:"bytes,1,rep,name=responses,proto3" json:"responses,omitempty"` -} - -func (x *MsgExecuteMessagesResponse) Reset() { - *x = MsgExecuteMessagesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_lockup_tx_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgExecuteMessagesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgExecuteMessagesResponse) ProtoMessage() {} - -// Deprecated: Use MsgExecuteMessagesResponse.ProtoReflect.Descriptor instead. -func (*MsgExecuteMessagesResponse) Descriptor() ([]byte, []int) { - return file_cosmos_lockup_tx_proto_rawDescGZIP(), []int{7} -} - -func (x *MsgExecuteMessagesResponse) GetResponses() []*anypb.Any { - if x != nil { - return x.Responses - } - return nil -} - -// MsgWithdraw defines a message that the owner of the lockup can perform to withdraw unlocked token to an account of -// choice -type MsgWithdraw struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Withdrawer string `protobuf:"bytes,1,opt,name=withdrawer,proto3" json:"withdrawer,omitempty"` - ToAddress string `protobuf:"bytes,2,opt,name=to_address,json=toAddress,proto3" json:"to_address,omitempty"` - Denoms []string `protobuf:"bytes,3,rep,name=denoms,proto3" json:"denoms,omitempty"` -} - -func (x *MsgWithdraw) Reset() { - *x = MsgWithdraw{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_lockup_tx_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgWithdraw) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgWithdraw) ProtoMessage() {} - -// Deprecated: Use MsgWithdraw.ProtoReflect.Descriptor instead. -func (*MsgWithdraw) Descriptor() ([]byte, []int) { - return file_cosmos_lockup_tx_proto_rawDescGZIP(), []int{8} -} - -func (x *MsgWithdraw) GetWithdrawer() string { - if x != nil { - return x.Withdrawer - } - return "" -} - -func (x *MsgWithdraw) GetToAddress() string { - if x != nil { - return x.ToAddress - } - return "" -} - -func (x *MsgWithdraw) GetDenoms() []string { - if x != nil { - return x.Denoms - } - return nil -} - -// MsgWithdrawResponse defines the response for MsgWithdraw -type MsgWithdrawResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Reciever string `protobuf:"bytes,1,opt,name=reciever,proto3" json:"reciever,omitempty"` - AmountReceived []*v1beta1.Coin `protobuf:"bytes,2,rep,name=amount_received,json=amountReceived,proto3" json:"amount_received,omitempty"` -} - -func (x *MsgWithdrawResponse) Reset() { - *x = MsgWithdrawResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_lockup_tx_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgWithdrawResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgWithdrawResponse) ProtoMessage() {} - -// Deprecated: Use MsgWithdrawResponse.ProtoReflect.Descriptor instead. -func (*MsgWithdrawResponse) Descriptor() ([]byte, []int) { - return file_cosmos_lockup_tx_proto_rawDescGZIP(), []int{9} -} - -func (x *MsgWithdrawResponse) GetReciever() string { - if x != nil { - return x.Reciever - } - return "" -} - -func (x *MsgWithdrawResponse) GetAmountReceived() []*v1beta1.Coin { - if x != nil { - return x.AmountReceived - } - return nil -} - -var File_cosmos_lockup_tx_proto protoreflect.FileDescriptor - -var file_cosmos_lockup_tx_proto_rawDesc = []byte{ - 0x0a, 0x16, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2f, - 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, - 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, - 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x2f, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, - 0x73, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x80, 0x02, 0x0a, - 0x14, 0x4d, 0x73, 0x67, 0x49, 0x6e, 0x69, 0x74, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2e, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x05, - 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x44, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, - 0x2a, 0x01, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x48, 0x0a, 0x0a, 0x73, - 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x0d, 0xc8, 0xde, 0x1f, - 0x00, 0x90, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, - 0x74, 0x54, 0x69, 0x6d, 0x65, 0x3a, 0x28, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x1f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x4d, 0x73, 0x67, 0x49, 0x6e, - 0x69, 0x74, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, - 0x1e, 0x0a, 0x1c, 0x4d, 0x73, 0x67, 0x49, 0x6e, 0x69, 0x74, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x94, 0x02, 0x0a, 0x1d, 0x4d, 0x73, 0x67, 0x49, 0x6e, 0x69, 0x74, 0x50, 0x65, 0x72, 0x69, 0x6f, - 0x64, 0x69, 0x63, 0x4c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x12, 0x2e, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, - 0x72, 0x12, 0x48, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x42, 0x0d, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, - 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x49, 0x0a, 0x0f, 0x6c, - 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x6c, 0x6f, - 0x63, 0x6b, 0x75, 0x70, 0x2e, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x42, 0x09, 0xc8, 0xde, 0x1f, - 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0e, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x50, - 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x3a, 0x2e, 0xe8, 0xa0, 0x1f, 0x00, 0x8a, 0xe7, 0xb0, 0x2a, - 0x25, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x4d, 0x73, 0x67, 0x49, - 0x6e, 0x69, 0x74, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x27, 0x0a, 0x25, 0x4d, 0x73, 0x67, 0x49, 0x6e, 0x69, - 0x74, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x69, 0x63, 0x4c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0xe2, 0x01, 0x0a, 0x0b, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, - 0x30, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, - 0x72, 0x12, 0x4e, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, - 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, - 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x12, 0x3c, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, - 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, - 0x13, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x65, - 0x6e, 0x64, 0x65, 0x72, 0x22, 0xe4, 0x01, 0x0a, 0x0d, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x64, 0x65, - 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x4e, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3c, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, - 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x13, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, - 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x22, 0x84, 0x02, 0x0a, 0x07, - 0x4d, 0x73, 0x67, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x0a, 0x74, 0x6f, 0x5f, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, - 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x74, 0x6f, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x12, 0x79, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x46, 0xc8, - 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, - 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x9a, - 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, - 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x13, 0x88, - 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x65, 0x6e, 0x64, - 0x65, 0x72, 0x22, 0x50, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x32, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x73, 0x22, 0xb1, 0x01, 0x0a, 0x0b, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, - 0x64, 0x72, 0x61, 0x77, 0x12, 0x38, 0x0a, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, - 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x52, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x65, 0x72, 0x12, 0x37, - 0x0a, 0x0a, 0x74, 0x6f, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x74, 0x6f, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x6e, 0x6f, 0x6d, - 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x73, 0x3a, - 0x17, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x0a, 0x77, 0x69, - 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x65, 0x72, 0x22, 0xd8, 0x01, 0x0a, 0x13, 0x4d, 0x73, 0x67, - 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x34, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x69, 0x65, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x08, 0x72, 0x65, - 0x63, 0x69, 0x65, 0x76, 0x65, 0x72, 0x12, 0x8a, 0x01, 0x0a, 0x0f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, - 0x74, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x46, 0xc8, 0xde, 0x1f, - 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, - 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x9a, 0xe7, 0xb0, - 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, - 0xb0, 0x2a, 0x01, 0x52, 0x0e, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, - 0x76, 0x65, 0x64, 0x42, 0x91, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6c, 0x6f, - 0x63, 0x6b, 0x75, 0x70, 0xa2, 0x02, 0x03, 0x43, 0x4c, 0x58, 0xaa, 0x02, 0x0d, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0xca, 0x02, 0x0d, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0xe2, 0x02, 0x19, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x5c, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, - 0x3a, 0x4c, 0x6f, 0x63, 0x6b, 0x75, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_cosmos_lockup_tx_proto_rawDescOnce sync.Once - file_cosmos_lockup_tx_proto_rawDescData = file_cosmos_lockup_tx_proto_rawDesc -) - -func file_cosmos_lockup_tx_proto_rawDescGZIP() []byte { - file_cosmos_lockup_tx_proto_rawDescOnce.Do(func() { - file_cosmos_lockup_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_lockup_tx_proto_rawDescData) - }) - return file_cosmos_lockup_tx_proto_rawDescData -} - -var file_cosmos_lockup_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 10) -var file_cosmos_lockup_tx_proto_goTypes = []interface{}{ - (*MsgInitLockupAccount)(nil), // 0: cosmos.lockup.MsgInitLockupAccount - (*MsgInitLockupAccountResponse)(nil), // 1: cosmos.lockup.MsgInitLockupAccountResponse - (*MsgInitPeriodicLockingAccount)(nil), // 2: cosmos.lockup.MsgInitPeriodicLockingAccount - (*MsgInitPeriodicLockingAccountResponse)(nil), // 3: cosmos.lockup.MsgInitPeriodicLockingAccountResponse - (*MsgDelegate)(nil), // 4: cosmos.lockup.MsgDelegate - (*MsgUndelegate)(nil), // 5: cosmos.lockup.MsgUndelegate - (*MsgSend)(nil), // 6: cosmos.lockup.MsgSend - (*MsgExecuteMessagesResponse)(nil), // 7: cosmos.lockup.MsgExecuteMessagesResponse - (*MsgWithdraw)(nil), // 8: cosmos.lockup.MsgWithdraw - (*MsgWithdrawResponse)(nil), // 9: cosmos.lockup.MsgWithdrawResponse - (*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp - (*Period)(nil), // 11: cosmos.lockup.Period - (*v1beta1.Coin)(nil), // 12: cosmos.base.v1beta1.Coin - (*anypb.Any)(nil), // 13: google.protobuf.Any -} -var file_cosmos_lockup_tx_proto_depIdxs = []int32{ - 10, // 0: cosmos.lockup.MsgInitLockupAccount.end_time:type_name -> google.protobuf.Timestamp - 10, // 1: cosmos.lockup.MsgInitLockupAccount.start_time:type_name -> google.protobuf.Timestamp - 10, // 2: cosmos.lockup.MsgInitPeriodicLockingAccount.start_time:type_name -> google.protobuf.Timestamp - 11, // 3: cosmos.lockup.MsgInitPeriodicLockingAccount.locking_periods:type_name -> cosmos.lockup.Period - 12, // 4: cosmos.lockup.MsgDelegate.amount:type_name -> cosmos.base.v1beta1.Coin - 12, // 5: cosmos.lockup.MsgUndelegate.amount:type_name -> cosmos.base.v1beta1.Coin - 12, // 6: cosmos.lockup.MsgSend.amount:type_name -> cosmos.base.v1beta1.Coin - 13, // 7: cosmos.lockup.MsgExecuteMessagesResponse.responses:type_name -> google.protobuf.Any - 12, // 8: cosmos.lockup.MsgWithdrawResponse.amount_received:type_name -> cosmos.base.v1beta1.Coin - 9, // [9:9] is the sub-list for method output_type - 9, // [9:9] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name -} - -func init() { file_cosmos_lockup_tx_proto_init() } -func file_cosmos_lockup_tx_proto_init() { - if File_cosmos_lockup_tx_proto != nil { - return - } - file_cosmos_lockup_lockup_proto_init() - if !protoimpl.UnsafeEnabled { - file_cosmos_lockup_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgInitLockupAccount); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_lockup_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgInitLockupAccountResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_lockup_tx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgInitPeriodicLockingAccount); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_lockup_tx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgInitPeriodicLockingAccountResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_lockup_tx_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgDelegate); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_lockup_tx_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgUndelegate); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_lockup_tx_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgSend); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_lockup_tx_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgExecuteMessagesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_lockup_tx_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgWithdraw); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_lockup_tx_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgWithdrawResponse); 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_lockup_tx_proto_rawDesc, - NumEnums: 0, - NumMessages: 10, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_cosmos_lockup_tx_proto_goTypes, - DependencyIndexes: file_cosmos_lockup_tx_proto_depIdxs, - MessageInfos: file_cosmos_lockup_tx_proto_msgTypes, - }.Build() - File_cosmos_lockup_tx_proto = out.File - file_cosmos_lockup_tx_proto_rawDesc = nil - file_cosmos_lockup_tx_proto_goTypes = nil - file_cosmos_lockup_tx_proto_depIdxs = nil -} diff --git a/api/cosmos/staking/v1beta1/staking.pulsar.go b/api/cosmos/staking/v1beta1/staking.pulsar.go index d8d779e67d33..d725e2e2423b 100644 --- a/api/cosmos/staking/v1beta1/staking.pulsar.go +++ b/api/cosmos/staking/v1beta1/staking.pulsar.go @@ -15895,6 +15895,8 @@ func (x *Pool) GetBondedTokens() string { // ValidatorUpdates defines an array of abci.ValidatorUpdate objects. // TODO: explore moving this to proto/cosmos/base to separate modules from tendermint dependence +// +// Deprecated: Do not use. type ValidatorUpdates struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -16409,71 +16411,71 @@ var file_cosmos_staking_v1beta1_staking_proto_rawDesc = []byte{ 0x0d, 0x62, 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0c, 0x62, 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x3a, - 0x08, 0xe8, 0xa0, 0x1f, 0x01, 0xf0, 0xa0, 0x1f, 0x01, 0x22, 0x59, 0x0a, 0x10, 0x56, 0x61, 0x6c, + 0x08, 0xe8, 0xa0, 0x1f, 0x01, 0xf0, 0xa0, 0x1f, 0x01, 0x22, 0x5d, 0x0a, 0x10, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x12, 0x45, 0x0a, 0x07, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x62, 0x63, 0x69, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x07, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x73, 0x22, 0xd0, 0x02, 0x0a, 0x19, 0x43, 0x6f, 0x6e, 0x73, 0x50, 0x75, 0x62, - 0x4b, 0x65, 0x79, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x69, 0x73, 0x74, 0x6f, - 0x72, 0x79, 0x12, 0x29, 0x0a, 0x10, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x6f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x56, 0x0a, - 0x0f, 0x6f, 0x6c, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x18, 0xca, 0xb4, - 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, - 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x0d, 0x6f, 0x6c, 0x64, 0x43, 0x6f, 0x6e, 0x73, 0x50, - 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, 0x56, 0x0a, 0x0f, 0x6e, 0x65, 0x77, 0x5f, 0x63, 0x6f, 0x6e, - 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x18, 0xca, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x0d, - 0x6e, 0x65, 0x77, 0x43, 0x6f, 0x6e, 0x73, 0x50, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, 0x16, 0x0a, - 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x68, - 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x36, 0x0a, 0x03, 0x66, 0x65, 0x65, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x09, 0xc8, - 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x03, 0x66, 0x65, 0x65, 0x3a, 0x08, 0x88, - 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x53, 0x0a, 0x19, 0x56, 0x61, 0x6c, 0x41, 0x64, - 0x64, 0x72, 0x73, 0x4f, 0x66, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x73, - 0x4b, 0x65, 0x79, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x2a, 0xb6, 0x01, 0x0a, - 0x0a, 0x42, 0x6f, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2c, 0x0a, 0x17, 0x42, - 0x4f, 0x4e, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, - 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x1a, 0x0f, 0x8a, 0x9d, 0x20, 0x0b, 0x55, 0x6e, - 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x14, 0x42, 0x4f, 0x4e, - 0x44, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x42, 0x4f, 0x4e, 0x44, 0x45, - 0x44, 0x10, 0x01, 0x1a, 0x0c, 0x8a, 0x9d, 0x20, 0x08, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x65, - 0x64, 0x12, 0x28, 0x0a, 0x15, 0x42, 0x4f, 0x4e, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, - 0x5f, 0x55, 0x4e, 0x42, 0x4f, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x1a, 0x0d, 0x8a, 0x9d, - 0x20, 0x09, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x22, 0x0a, 0x12, 0x42, - 0x4f, 0x4e, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x42, 0x4f, 0x4e, 0x44, 0x45, - 0x44, 0x10, 0x03, 0x1a, 0x0a, 0x8a, 0x9d, 0x20, 0x06, 0x42, 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x1a, - 0x04, 0x88, 0xa3, 0x1e, 0x00, 0x2a, 0x5d, 0x0a, 0x0a, 0x49, 0x6e, 0x66, 0x72, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x16, 0x49, 0x4e, 0x46, 0x52, 0x41, 0x43, 0x54, 0x49, 0x4f, - 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, - 0x1a, 0x0a, 0x16, 0x49, 0x4e, 0x46, 0x52, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x44, 0x4f, - 0x55, 0x42, 0x4c, 0x45, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x49, - 0x4e, 0x46, 0x52, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x44, 0x4f, 0x57, 0x4e, 0x54, 0x49, - 0x4d, 0x45, 0x10, 0x02, 0x42, 0xdc, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x42, 0x0c, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, - 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x73, 0x74, 0x61, - 0x6b, 0x69, 0x6e, 0x67, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x53, - 0x58, 0xaa, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x6b, 0x69, - 0x6e, 0x67, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x16, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0xe2, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x61, - 0x6b, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x3a, 0x3a, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x74, 0x65, 0x73, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xd0, 0x02, 0x0a, 0x19, 0x43, 0x6f, 0x6e, + 0x73, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, + 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x29, 0x0a, 0x10, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x56, 0x0a, 0x0f, 0x6f, 0x6c, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x5f, 0x70, 0x75, + 0x62, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, + 0x42, 0x18, 0xca, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x79, + 0x70, 0x74, 0x6f, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x52, 0x0d, 0x6f, 0x6c, 0x64, 0x43, + 0x6f, 0x6e, 0x73, 0x50, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, 0x56, 0x0a, 0x0f, 0x6e, 0x65, 0x77, + 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x18, 0xca, 0xb4, 0x2d, 0x14, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x50, 0x75, 0x62, 0x4b, + 0x65, 0x79, 0x52, 0x0d, 0x6e, 0x65, 0x77, 0x43, 0x6f, 0x6e, 0x73, 0x50, 0x75, 0x62, 0x6b, 0x65, + 0x79, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x36, 0x0a, 0x03, 0x66, 0x65, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, + 0x6e, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x03, 0x66, 0x65, + 0x65, 0x3a, 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x53, 0x0a, 0x19, 0x56, + 0x61, 0x6c, 0x41, 0x64, 0x64, 0x72, 0x73, 0x4f, 0x66, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x64, + 0x43, 0x6f, 0x6e, 0x73, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x18, 0xd2, 0xb4, 0x2d, + 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, + 0x2a, 0xb6, 0x01, 0x0a, 0x0a, 0x42, 0x6f, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x2c, 0x0a, 0x17, 0x42, 0x4f, 0x4e, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, + 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x1a, 0x0f, 0x8a, 0x9d, + 0x20, 0x0b, 0x55, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x26, 0x0a, + 0x14, 0x42, 0x4f, 0x4e, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x42, + 0x4f, 0x4e, 0x44, 0x45, 0x44, 0x10, 0x01, 0x1a, 0x0c, 0x8a, 0x9d, 0x20, 0x08, 0x55, 0x6e, 0x62, + 0x6f, 0x6e, 0x64, 0x65, 0x64, 0x12, 0x28, 0x0a, 0x15, 0x42, 0x4f, 0x4e, 0x44, 0x5f, 0x53, 0x54, + 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x42, 0x4f, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x02, + 0x1a, 0x0d, 0x8a, 0x9d, 0x20, 0x09, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x12, + 0x22, 0x0a, 0x12, 0x42, 0x4f, 0x4e, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x42, + 0x4f, 0x4e, 0x44, 0x45, 0x44, 0x10, 0x03, 0x1a, 0x0a, 0x8a, 0x9d, 0x20, 0x06, 0x42, 0x6f, 0x6e, + 0x64, 0x65, 0x64, 0x1a, 0x04, 0x88, 0xa3, 0x1e, 0x00, 0x2a, 0x5d, 0x0a, 0x0a, 0x49, 0x6e, 0x66, + 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x16, 0x49, 0x4e, 0x46, 0x52, 0x41, + 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x49, 0x4e, 0x46, 0x52, 0x41, 0x43, 0x54, 0x49, 0x4f, + 0x4e, 0x5f, 0x44, 0x4f, 0x55, 0x42, 0x4c, 0x45, 0x5f, 0x53, 0x49, 0x47, 0x4e, 0x10, 0x01, 0x12, + 0x17, 0x0a, 0x13, 0x49, 0x4e, 0x46, 0x52, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x44, 0x4f, + 0x57, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x02, 0x42, 0xdc, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x0c, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, + 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2f, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x3b, 0x73, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, + 0x02, 0x03, 0x43, 0x53, 0x58, 0xaa, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x53, + 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, + 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5c, + 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x22, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x5c, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x74, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/go.mod b/api/go.mod index 1467e61a79d8..7cd88d75c6be 100644 --- a/api/go.mod +++ b/api/go.mod @@ -5,20 +5,19 @@ go 1.20 require ( buf.build/gen/go/tendermint/tendermint/protocolbuffers/go v1.32.0-20231117195010-33ed361a9051.1 github.com/cosmos/cosmos-proto v1.0.0-beta.4 - github.com/cosmos/gogoproto v1.4.11 - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 - google.golang.org/grpc v1.62.1 + github.com/cosmos/gogoproto v1.4.12 + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de + google.golang.org/grpc v1.63.2 google.golang.org/protobuf v1.33.0 ) require ( buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.32.0-20230509103710-5e5b9fdd0180.1 // indirect - github.com/golang/protobuf v1.5.4 // indirect github.com/google/go-cmp v0.6.0 // indirect - golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/sys v0.17.0 // indirect + golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect ) diff --git a/api/go.sum b/api/go.sum index d211b34578bf..f88b7d477593 100644 --- a/api/go.sum +++ b/api/go.sum @@ -4,31 +4,29 @@ buf.build/gen/go/tendermint/tendermint/protocolbuffers/go v1.32.0-20231117195010 buf.build/gen/go/tendermint/tendermint/protocolbuffers/go v1.32.0-20231117195010-33ed361a9051.1/go.mod h1:9KmeMJUsSG3IiIwK63Lh1ipZJrwd7KHrWZseJeHukcs= github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU= github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= -github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/go-cmp v0.5.5/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= -golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb h1:mIKbk8weKhSeLH2GmUTrvx8CjkyJmnU1wFmg59CUjFA= -golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= diff --git a/baseapp/abci.go b/baseapp/abci.go index e54824f41e0f..148205e360e6 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -177,7 +177,7 @@ func (app *BaseApp) Query(_ context.Context, req *abci.RequestQuery) (resp *abci telemetry.IncrCounter(1, "query", "count") telemetry.IncrCounter(1, "query", req.Path) - defer telemetry.MeasureSince(time.Now(), req.Path) + defer telemetry.MeasureSince(telemetry.Now(), req.Path) if req.Path == QueryPathBroadcastTx { return sdkerrors.QueryResult(errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "can't route a broadcast tx message"), app.trace), nil @@ -1242,7 +1242,7 @@ func (app *BaseApp) CreateQueryContext(height int64, prove bool) (sdk.Context, e if err != nil { return sdk.Context{}, errorsmod.Wrapf( - sdkerrors.ErrInvalidRequest, + sdkerrors.ErrNotFound, "failed to load state at height %d; %s (latest height: %d)", height, err, lastBlockHeight, ) } diff --git a/baseapp/abci_test.go b/baseapp/abci_test.go index 33c4d75284bb..4a3693094353 100644 --- a/baseapp/abci_test.go +++ b/baseapp/abci_test.go @@ -1404,7 +1404,7 @@ func TestPrecommiterCalledWithDeliverState(t *testing.T) { func TestABCI_Proposal_HappyPath(t *testing.T) { anteKey := []byte("ante-key") - pool := mempool.NewSenderNonceMempool() + pool := mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(5000)) anteOpt := func(bapp *baseapp.BaseApp) { bapp.SetAnteHandler(anteHandlerTxTest(t, capKey1, anteKey)) } @@ -1582,7 +1582,7 @@ func TestABCI_Proposals_WithVE(t *testing.T) { func TestABCI_PrepareProposal_ReachedMaxBytes(t *testing.T) { anteKey := []byte("ante-key") - pool := mempool.NewSenderNonceMempool() + pool := mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(5000)) anteOpt := func(bapp *baseapp.BaseApp) { bapp.SetAnteHandler(anteHandlerTxTest(t, capKey1, anteKey)) } @@ -1612,7 +1612,7 @@ func TestABCI_PrepareProposal_ReachedMaxBytes(t *testing.T) { func TestABCI_PrepareProposal_BadEncoding(t *testing.T) { anteKey := []byte("ante-key") - pool := mempool.NewSenderNonceMempool() + pool := mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(5000)) anteOpt := func(bapp *baseapp.BaseApp) { bapp.SetAnteHandler(anteHandlerTxTest(t, capKey1, anteKey)) } @@ -1639,7 +1639,7 @@ func TestABCI_PrepareProposal_BadEncoding(t *testing.T) { } func TestABCI_PrepareProposal_OverGasUnderBytes(t *testing.T) { - pool := mempool.NewSenderNonceMempool() + pool := mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(5000)) suite := NewBaseAppSuite(t, baseapp.SetMempool(pool)) baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), NoopCounterServerImpl{}) @@ -1680,7 +1680,7 @@ func TestABCI_PrepareProposal_OverGasUnderBytes(t *testing.T) { } func TestABCI_PrepareProposal_MaxGas(t *testing.T) { - pool := mempool.NewSenderNonceMempool() + pool := mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(5000)) suite := NewBaseAppSuite(t, baseapp.SetMempool(pool)) baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), NoopCounterServerImpl{}) @@ -1719,7 +1719,7 @@ func TestABCI_PrepareProposal_MaxGas(t *testing.T) { func TestABCI_PrepareProposal_Failures(t *testing.T) { anteKey := []byte("ante-key") - pool := mempool.NewSenderNonceMempool() + pool := mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(5000)) anteOpt := func(bapp *baseapp.BaseApp) { bapp.SetAnteHandler(anteHandlerTxTest(t, capKey1, anteKey)) } diff --git a/baseapp/grpcrouter_test.go b/baseapp/grpcrouter_test.go index af5c24c4ccce..512877babfb7 100644 --- a/baseapp/grpcrouter_test.go +++ b/baseapp/grpcrouter_test.go @@ -168,7 +168,7 @@ func testQueryDataRacesSameHandler(t *testing.T, makeClientConn func(*baseapp.GR qr := baseapp.NewGRPCQueryRouter() interfaceRegistry := testdata.NewTestInterfaceRegistry() qr.SetInterfaceRegistry(interfaceRegistry) - testdata.RegisterQueryServer(qr, testdata.QueryImpl{}) + testdata_pulsar.RegisterQueryServer(qr, testdata_pulsar.QueryImpl{}) // The goal is to invoke the router concurrently and check for any data races. // 0. Run with: go test -race diff --git a/baseapp/testutil/buf.gen.yaml b/baseapp/testutil/buf.gen.yaml index d7d17bbb26f8..28cf98c279ed 100644 --- a/baseapp/testutil/buf.gen.yaml +++ b/baseapp/testutil/buf.gen.yaml @@ -2,4 +2,4 @@ version: v1 plugins: - name: gocosmos out: ../.. - opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any diff --git a/client/cmd.go b/client/cmd.go index 61412200fd5f..e817649d24dc 100644 --- a/client/cmd.go +++ b/client/cmd.go @@ -168,7 +168,7 @@ func ReadPersistentCommandFlags(clientCtx Context, flagSet *pflag.FlagSet) (Cont }))) } - grpcClient, err := grpc.Dial(grpcURI, dialOpts...) + grpcClient, err := grpc.NewClient(grpcURI, dialOpts...) if err != nil { return Context{}, err } diff --git a/client/config/config.go b/client/config/config.go index efe65bd34ec7..893ddd7df886 100644 --- a/client/config/config.go +++ b/client/config/config.go @@ -1,10 +1,15 @@ package config import ( + "crypto/tls" "fmt" "os" "path/filepath" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/credentials/insecure" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" ) @@ -26,12 +31,19 @@ func DefaultConfig() *Config { type ClientConfig Config type Config struct { - ChainID string `mapstructure:"chain-id" json:"chain-id"` - KeyringBackend string `mapstructure:"keyring-backend" json:"keyring-backend"` - KeyringDefaultKeyName string `mapstructure:"keyring-default-keyname" json:"keyring-default-keyname"` - Output string `mapstructure:"output" json:"output"` - Node string `mapstructure:"node" json:"node"` - BroadcastMode string `mapstructure:"broadcast-mode" json:"broadcast-mode"` + ChainID string `mapstructure:"chain-id" json:"chain-id"` + KeyringBackend string `mapstructure:"keyring-backend" json:"keyring-backend"` + KeyringDefaultKeyName string `mapstructure:"keyring-default-keyname" json:"keyring-default-keyname"` + Output string `mapstructure:"output" json:"output"` + Node string `mapstructure:"node" json:"node"` + BroadcastMode string `mapstructure:"broadcast-mode" json:"broadcast-mode"` + GRPC GRPCConfig `mapstructure:",squash"` +} + +// GRPCConfig holds the gRPC client configuration. +type GRPCConfig struct { + Address string `mapstructure:"grpc-address" json:"grpc-address"` + Insecure bool `mapstructure:"grpc-insecure" json:"grpc-insecure"` } // ReadFromClientConfig reads values from client.toml file and updates them in client.Context @@ -138,5 +150,35 @@ func CreateClientConfig(ctx client.Context, customClientTemplate string, customC WithClient(client). WithKeyring(keyring) + if conf.GRPC.Address != "" { + grpcClient, err := getGRPCClient(conf.GRPC) + if err != nil { + return ctx, fmt.Errorf("couldn't get grpc client: %w", err) + } + + ctx = ctx.WithGRPCClient(grpcClient) + } + return ctx, nil } + +// getGRPCClient creates and returns a new gRPC client connection based on the GRPCConfig. +// It determines the type of connection (secure or insecure) from the GRPCConfig and +// uses the specified server address to establish the connection. +func getGRPCClient(grpcConfig GRPCConfig) (*grpc.ClientConn, error) { + transport := grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{ + MinVersion: tls.VersionTLS12, + })) + + if grpcConfig.Insecure { + transport = grpc.WithTransportCredentials(insecure.NewCredentials()) + } + + dialOptions := []grpc.DialOption{transport} + grpcClient, err := grpc.NewClient(grpcConfig.Address, dialOptions...) + if err != nil { + return nil, fmt.Errorf("failed to dial gRPC server at %s: %w", grpcConfig.Address, err) + } + + return grpcClient, nil +} diff --git a/client/config/config_test.go b/client/config/config_test.go index ceb052e8acd5..248ed47cea9c 100644 --- a/client/config/config_test.go +++ b/client/config/config_test.go @@ -87,7 +87,6 @@ gas-adjustment = {{ .GasConfig.GasAdjustment }} # Memo to include in all transactions. note = "{{ .Note }}" ` - t.Run("custom template and config provided", func(t *testing.T) { clientCtx, cleanup, err := initClientContextWithTemplate(t, "", customClientConfigTemplate, customClientConfig) defer func() { @@ -181,3 +180,23 @@ func TestConfigCmdEnvFlag(t *testing.T) { }) } } + +func TestGRPCConfig(t *testing.T) { + expectedGRPCConfig := config.GRPCConfig{ + Address: "localhost:7070", + Insecure: true, + } + + clientCfg := config.DefaultConfig() + clientCfg.GRPC = expectedGRPCConfig + + t.Run("custom template with gRPC config", func(t *testing.T) { + clientCtx, cleanup, err := initClientContextWithTemplate(t, "", config.DefaultClientConfigTemplate, clientCfg) + defer cleanup() + + require.NoError(t, err) + + require.Equal(t, expectedGRPCConfig.Address, clientCtx.Viper.GetString("grpc-address")) + require.Equal(t, expectedGRPCConfig.Insecure, clientCtx.Viper.GetBool("grpc-insecure")) + }) +} diff --git a/client/config/toml.go b/client/config/toml.go index 7c43eccc15b8..35787219a236 100644 --- a/client/config/toml.go +++ b/client/config/toml.go @@ -8,7 +8,8 @@ import ( "github.com/spf13/viper" ) -const DefaultClientConfigTemplate = `# This is a TOML config file. +const ( + DefaultClientConfigTemplate = `# This is a TOML config file. # For more information, see https://github.com/toml-lang/toml ############################################################################### @@ -27,7 +28,16 @@ output = "{{ .Output }}" node = "{{ .Node }}" # Transaction broadcasting mode (sync|async) broadcast-mode = "{{ .BroadcastMode }}" + +# gRPC server endpoint to which the client will connect. +# It can be overwritten by the --grpc-addr flag in each command. +grpc-address = "{{ .GRPC.Address }}" + +# Allow the gRPC client to connect over insecure channels. +# It can be overwritten by the --grpc-insecure flag in each command. +grpc-insecure = {{ .GRPC.Insecure }} ` +) var configTemplate *template.Template diff --git a/client/docs/swagger-ui/swagger.yaml b/client/docs/swagger-ui/swagger.yaml index 173676b0b5f9..587653a77ac6 100644 --- a/client/docs/swagger-ui/swagger.yaml +++ b/client/docs/swagger-ui/swagger.yaml @@ -29488,7 +29488,7 @@ paths: - Query /cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}: get: - summary: Allowance returns granted allwance to the grantee by the granter. + summary: Allowance returns granted allowance to the grantee by the granter. operationId: Allowance responses: '200': diff --git a/client/flags/flags.go b/client/flags/flags.go index f2af30eb0714..801b7f5796a8 100644 --- a/client/flags/flags.go +++ b/client/flags/flags.go @@ -126,7 +126,7 @@ func AddTxFlagsToCmd(cmd *cobra.Command) { f.Uint64P(FlagSequence, "s", 0, "The sequence number of the signing account (offline mode only)") f.String(FlagNote, "", "Note to add a description to the transaction (previously --memo)") f.String(FlagFees, "", "Fees to pay along with transaction; eg: 10uatom") - f.String(FlagGasPrices, "", "Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom)") + f.String(FlagGasPrices, "", "Determine the transaction fee by multiplying max gas units by gas prices (e.g. 0.1uatom), rounding up to nearest denom unit") f.String(FlagNode, "tcp://localhost:26657", ": to CometBFT rpc interface for this chain") f.Bool(FlagUseLedger, false, "Use a connected Ledger device") f.Float64(FlagGasAdjustment, DefaultGasAdjustment, "adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored ") diff --git a/client/grpc/cmtservice/query.pb.go b/client/grpc/cmtservice/query.pb.go index d745dca1867e..647a30af955a 100644 --- a/client/grpc/cmtservice/query.pb.go +++ b/client/grpc/cmtservice/query.pb.go @@ -7,14 +7,14 @@ import ( context "context" fmt "fmt" p2p "github.com/cometbft/cometbft/proto/tendermint/p2p" - types1 "github.com/cometbft/cometbft/proto/tendermint/types" + types "github.com/cometbft/cometbft/proto/tendermint/types" _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" query "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" + any "github.com/cosmos/gogoproto/types/any" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -261,10 +261,10 @@ func (m *GetLatestValidatorSetResponse) GetPagination() *query.PageResponse { // Validator is the type for the validator-set. type Validator struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - PubKey *types.Any `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` - VotingPower int64 `protobuf:"varint,3,opt,name=voting_power,json=votingPower,proto3" json:"voting_power,omitempty"` - ProposerPriority int64 `protobuf:"varint,4,opt,name=proposer_priority,json=proposerPriority,proto3" json:"proposer_priority,omitempty"` + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + PubKey *any.Any `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` + VotingPower int64 `protobuf:"varint,3,opt,name=voting_power,json=votingPower,proto3" json:"voting_power,omitempty"` + ProposerPriority int64 `protobuf:"varint,4,opt,name=proposer_priority,json=proposerPriority,proto3" json:"proposer_priority,omitempty"` } func (m *Validator) Reset() { *m = Validator{} } @@ -307,7 +307,7 @@ func (m *Validator) GetAddress() string { return "" } -func (m *Validator) GetPubKey() *types.Any { +func (m *Validator) GetPubKey() *any.Any { if m != nil { return m.PubKey } @@ -375,9 +375,9 @@ func (m *GetBlockByHeightRequest) GetHeight() int64 { // GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. type GetBlockByHeightResponse struct { - BlockId *types1.BlockID `protobuf:"bytes,1,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"` + BlockId *types.BlockID `protobuf:"bytes,1,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"` // Deprecated: please use `sdk_block` instead - Block *types1.Block `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` + Block *types.Block `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` // Since: cosmos-sdk 0.47 SdkBlock *Block `protobuf:"bytes,3,opt,name=sdk_block,json=sdkBlock,proto3" json:"sdk_block,omitempty"` } @@ -415,14 +415,14 @@ func (m *GetBlockByHeightResponse) XXX_DiscardUnknown() { var xxx_messageInfo_GetBlockByHeightResponse proto.InternalMessageInfo -func (m *GetBlockByHeightResponse) GetBlockId() *types1.BlockID { +func (m *GetBlockByHeightResponse) GetBlockId() *types.BlockID { if m != nil { return m.BlockId } return nil } -func (m *GetBlockByHeightResponse) GetBlock() *types1.Block { +func (m *GetBlockByHeightResponse) GetBlock() *types.Block { if m != nil { return m.Block } @@ -475,9 +475,9 @@ var xxx_messageInfo_GetLatestBlockRequest proto.InternalMessageInfo // GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. type GetLatestBlockResponse struct { - BlockId *types1.BlockID `protobuf:"bytes,1,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"` + BlockId *types.BlockID `protobuf:"bytes,1,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"` // Deprecated: please use `sdk_block` instead - Block *types1.Block `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` + Block *types.Block `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` // Since: cosmos-sdk 0.47 SdkBlock *Block `protobuf:"bytes,3,opt,name=sdk_block,json=sdkBlock,proto3" json:"sdk_block,omitempty"` } @@ -515,14 +515,14 @@ func (m *GetLatestBlockResponse) XXX_DiscardUnknown() { var xxx_messageInfo_GetLatestBlockResponse proto.InternalMessageInfo -func (m *GetLatestBlockResponse) GetBlockId() *types1.BlockID { +func (m *GetLatestBlockResponse) GetBlockId() *types.BlockID { if m != nil { return m.BlockId } return nil } -func (m *GetLatestBlockResponse) GetBlock() *types1.Block { +func (m *GetLatestBlockResponse) GetBlock() *types.Block { if m != nil { return m.Block } @@ -3429,7 +3429,7 @@ func (m *Validator) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.PubKey == nil { - m.PubKey = &types.Any{} + m.PubKey = &any.Any{} } if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -3622,7 +3622,7 @@ func (m *GetBlockByHeightResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.BlockId == nil { - m.BlockId = &types1.BlockID{} + m.BlockId = &types.BlockID{} } if err := m.BlockId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -3658,7 +3658,7 @@ func (m *GetBlockByHeightResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Block == nil { - m.Block = &types1.Block{} + m.Block = &types.Block{} } if err := m.Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -3830,7 +3830,7 @@ func (m *GetLatestBlockResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.BlockId == nil { - m.BlockId = &types1.BlockID{} + m.BlockId = &types.BlockID{} } if err := m.BlockId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -3866,7 +3866,7 @@ func (m *GetLatestBlockResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Block == nil { - m.Block = &types1.Block{} + m.Block = &types.Block{} } if err := m.Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/client/rpc/rpc_test.go b/client/rpc/rpc_test.go index 7606602127f4..4fa96fa9c2e6 100644 --- a/client/rpc/rpc_test.go +++ b/client/rpc/rpc_test.go @@ -10,6 +10,8 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/metadata" + _ "cosmossdk.io/x/accounts" + "github.com/cosmos/cosmos-sdk/testutil/network" "github.com/cosmos/cosmos-sdk/testutil/testdata" "github.com/cosmos/cosmos-sdk/types/address" diff --git a/client/rpc/tx.go b/client/rpc/tx.go index 02b9852b8601..c22af90a8d8f 100644 --- a/client/rpc/tx.go +++ b/client/rpc/tx.go @@ -3,7 +3,9 @@ package rpc import ( "context" "encoding/hex" + "encoding/json" "fmt" + "io" "strings" "time" @@ -16,8 +18,11 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/version" ) +const TimeoutFlag = "timeout" + func newTxResponseCheckTx(res *coretypes.ResultBroadcastTxCommit) *sdk.TxResponse { if res == nil { return nil @@ -84,18 +89,36 @@ func newResponseFormatBroadcastTxCommit(res *coretypes.ResultBroadcastTxCommit) return newTxResponseDeliverTx(res) } -// QueryEventForTxCmd returns a CLI command that subscribes to a WebSocket connection and waits for a transaction event with the given hash. +// QueryEventForTxCmd is an alias for WaitTxCmd, kept for backwards compatibility. func QueryEventForTxCmd() *cobra.Command { + return WaitTxCmd() +} + +// WaitTx returns a CLI command that waits for a transaction with the given hash to be included in a block. +func WaitTxCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "event-query-tx-for [hash]", - Short: "Query for a transaction by hash", - Long: `Subscribes to a CometBFT WebSocket connection and waits for a transaction event with the given hash.`, - Args: cobra.ExactArgs(1), + Use: "wait-tx [hash]", + Aliases: []string{"event-query-tx-for"}, + Short: "Wait for a transaction to be included in a block", + Long: `Subscribes to a CometBFT WebSocket connection and waits for a transaction event with the given hash.`, + Example: fmt.Sprintf(`By providing the transaction hash: +$ %[1]sd q wait-tx [hash] + +Or, by piping a "tx" command: +$ %[1]sd tx [flags] | %[1]sd q wait-tx +`, version.AppName), + Args: cobra.MaximumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { return err } + + timeout, err := cmd.Flags().GetDuration(TimeoutFlag) + if err != nil { + return err + } + c, err := rpchttp.New(clientCtx.NodeURI, "/websocket") if err != nil { return err @@ -105,11 +128,34 @@ func QueryEventForTxCmd() *cobra.Command { } defer c.Stop() //nolint:errcheck // ignore stop error - ctx, cancel := context.WithTimeout(context.Background(), time.Second*15) + ctx, cancel := context.WithTimeout(context.Background(), timeout) defer cancel() - hash := args[0] - query := fmt.Sprintf("%s='%s' AND %s='%s'", tmtypes.EventTypeKey, tmtypes.EventTx, tmtypes.TxHashKey, hash) + var hash []byte + if len(args) == 0 { + // read hash from stdin + in, err := io.ReadAll(cmd.InOrStdin()) + if err != nil { + return err + } + hashByt, err := parseHashFromInput(in) + if err != nil { + return err + } + + hash = hashByt + } else { + // read hash from args + hashByt, err := hex.DecodeString(args[0]) + if err != nil { + return err + } + + hash = hashByt + } + + // subscribe to websocket events + query := fmt.Sprintf("%s='%s' AND %s='%X'", tmtypes.EventTypeKey, tmtypes.EventTx, tmtypes.TxHashKey, hash) const subscriber = "subscriber" eventCh, err := c.Subscribe(ctx, subscriber, query) if err != nil { @@ -117,6 +163,19 @@ func QueryEventForTxCmd() *cobra.Command { } defer c.UnsubscribeAll(context.Background(), subscriber) //nolint:errcheck // ignore unsubscribe error + // return immediately if tx is already included in a block + res, err := c.Tx(ctx, hash, false) + if err == nil { + // tx already included in a block + res := &coretypes.ResultBroadcastTxCommit{ + TxResult: res.TxResult, + Hash: res.Hash, + Height: res.Height, + } + return clientCtx.PrintProto(newResponseFormatBroadcastTxCommit(res)) + } + + // tx not yet included in a block, wait for event on websocket select { case evt := <-eventCh: if txe, ok := evt.Data.(tmtypes.EventDataTx); ok { @@ -128,13 +187,32 @@ func QueryEventForTxCmd() *cobra.Command { return clientCtx.PrintProto(newResponseFormatBroadcastTxCommit(res)) } case <-ctx.Done(): - return errors.ErrLogic.Wrapf("timed out waiting for event, the transaction could have already been included or wasn't yet included") + return errors.ErrLogic.Wrapf("timed out waiting for transaction %X to be included in a block", hash) } return nil }, } - flags.AddTxFlagsToCmd(cmd) + cmd.Flags().Duration(TimeoutFlag, 15*time.Second, "The maximum time to wait for the transaction to be included in a block") + flags.AddQueryFlagsToCmd(cmd) return cmd } + +func parseHashFromInput(in []byte) ([]byte, error) { + var resultTx coretypes.ResultTx + if err := json.Unmarshal(in, &resultTx); err == nil { + // input was JSON, return the hash + return resultTx.Hash, nil + } + + // try to parse the hash from the output of a tx command + lines := strings.Split(string(in), "\n") + for _, line := range lines { + if strings.HasPrefix(line, "txhash:") { + hash := strings.TrimSpace(line[len("txhash:"):]) + return hex.DecodeString(hash) + } + } + return nil, fmt.Errorf("txhash not found") +} diff --git a/client/tx/factory.go b/client/tx/factory.go index ae9dca28ad85..22053ba3d744 100644 --- a/client/tx/factory.go +++ b/client/tx/factory.go @@ -449,7 +449,7 @@ func (f Factory) BuildSimTx(msgs ...sdk.Msg) ([]byte, error) { // 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, // e.g. when using --gas=auto. -// When using --dry-run, we are is simulation mode only and should not check the keybase. +// When using --dry-run, we are in simulation mode only and should not check the keybase. // Ref: https://github.com/cosmos/cosmos-sdk/issues/11283 func (f Factory) getSimPK() (cryptotypes.PubKey, error) { var ( diff --git a/client/v2/CHANGELOG.md b/client/v2/CHANGELOG.md index efabebf0491c..eabfebff70a5 100644 --- a/client/v2/CHANGELOG.md +++ b/client/v2/CHANGELOG.md @@ -48,11 +48,12 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#19618](https://github.com/cosmos/cosmos-sdk/pull/19618) Marshal enum as string in queries. * [#19060](https://github.com/cosmos/cosmos-sdk/pull/19060) Use client context from root (or enhanced) command in autocli commands. - * Note, the given command must have a `client.Context` in its context. + * Note, the given command must have a `client.Context` in its context. * [#19216](https://github.com/cosmos/cosmos-sdk/pull/19216) Do not overwrite TxConfig, use directly the one provided in context. TxConfig should always be set in the `client.Context` in `root.go` of an app. ### Bug Fixes +* [#19976](https://github.com/cosmos/cosmos-sdk/pull/19976) Add encoder for `cosmos.base.v1beta1.DecCoin`. * [#19377](https://github.com/cosmos/cosmos-sdk/pull/19377) Partly fix comment parsing in autocli. * [#19060](https://github.com/cosmos/cosmos-sdk/pull/19060) Simplify key flag parsing logic in flag handler. diff --git a/client/v2/autocli/common_test.go b/client/v2/autocli/common_test.go index 2850abc226f3..9e8613be07ca 100644 --- a/client/v2/autocli/common_test.go +++ b/client/v2/autocli/common_test.go @@ -49,7 +49,7 @@ func initFixture(t *testing.T) *fixture { } }() - clientConn, err := grpc.Dial(listener.Addr().String(), grpc.WithTransportCredentials(insecure.NewCredentials())) + clientConn, err := grpc.NewClient(listener.Addr().String(), grpc.WithTransportCredentials(insecure.NewCredentials())) assert.NilError(t, err) encodingConfig := moduletestutil.MakeTestEncodingConfig(testutil.CodecOptions{}, bank.AppModule{}) diff --git a/client/v2/autocli/query.go b/client/v2/autocli/query.go index d93edb4dfce7..c2a3717a44bb 100644 --- a/client/v2/autocli/query.go +++ b/client/v2/autocli/query.go @@ -4,9 +4,11 @@ import ( "context" "fmt" "io" + "strings" "time" autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + "cosmossdk.io/math" "cosmossdk.io/x/tx/signing/aminojson" "github.com/cockroachdb/errors" "github.com/spf13/cobra" @@ -14,6 +16,8 @@ import ( "cosmossdk.io/client/v2/internal/flags" "cosmossdk.io/client/v2/internal/util" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // BuildQueryCommand builds the query commands for all the provided modules. If a custom command is provided for a @@ -182,5 +186,41 @@ func encoder(encoder aminojson.Encoder) aminojson.Encoder { _, err := fmt.Fprintf(w, `"%s"`, (time.Duration(seconds)*time.Second + (time.Duration(nanos) * time.Nanosecond)).String()) return err + }).DefineTypeEncoding("cosmos.base.v1beta1.DecCoin", func(_ *aminojson.Encoder, msg protoreflect.Message, w io.Writer) error { + var ( + denomName protoreflect.Name = "denom" + amountName protoreflect.Name = "amount" + ) + + fields := msg.Descriptor().Fields() + denomField := fields.ByName(denomName) + if denomField == nil { + return fmt.Errorf("expected denom field") + } + + denom := msg.Get(denomField).String() + + amountField := fields.ByName(amountName) + if amountField == nil { + return fmt.Errorf("expected amount field") + } + + amount := msg.Get(amountField).String() + decimalPlace := len(amount) - math.LegacyPrecision + if decimalPlace > 0 { + amount = amount[:decimalPlace] + "." + amount[decimalPlace:] + } else if decimalPlace == 0 { + amount = "0." + amount + } else { + amount = "0." + strings.Repeat("0", -decimalPlace) + amount + } + + amountDec, err := math.LegacyNewDecFromStr(amount) + if err != nil { + return fmt.Errorf("invalid amount: %s: %w", amount, err) + } + + _, err = fmt.Fprintf(w, `"%s"`, sdk.NewDecCoinFromDec(denom, amountDec)) // TODO(@julienrbrt): Eventually remove this SDK dependency + return err }) } diff --git a/client/v2/autocli/testdata/help-echo-msg.golden b/client/v2/autocli/testdata/help-echo-msg.golden index a4ba521452ea..fc981ffd4611 100644 --- a/client/v2/autocli/testdata/help-echo-msg.golden +++ b/client/v2/autocli/testdata/help-echo-msg.golden @@ -15,7 +15,7 @@ Flags: --from string Name or address of private key with which to sign --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) - --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --gas-prices string Determine the transaction fee by multiplying max gas units by gas prices (e.g. 0.1uatom), rounding up to nearest denom unit --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) -h, --help help for send --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) (default "os") diff --git a/client/v2/go.mod b/client/v2/go.mod index b24d41b428d7..d51130ca6a7f 100644 --- a/client/v2/go.mod +++ b/client/v2/go.mod @@ -16,7 +16,7 @@ require ( github.com/manifoldco/promptui v0.9.0 // indirect github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 - google.golang.org/grpc v1.62.1 + google.golang.org/grpc v1.63.2 google.golang.org/protobuf v1.33.0 gotest.tools/v3 v3.5.1 sigs.k8s.io/yaml v1.4.0 @@ -26,7 +26,7 @@ require ( cosmossdk.io/collections v0.4.0 // indirect cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/log v1.3.1 // indirect - cosmossdk.io/math v1.3.0 // indirect + cosmossdk.io/math v1.3.0 cosmossdk.io/store v1.0.2 // indirect cosmossdk.io/x/accounts v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 @@ -47,19 +47,19 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.6 // indirect + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 // indirect github.com/cometbft/cometbft-db v0.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/gogoproto v1.4.12 github.com/cosmos/iavl v1.0.0 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect @@ -108,7 +108,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -118,13 +118,13 @@ require ( github.com/mtibben/percent v0.2.1 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.0 // indirect github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.50.0 // indirect + github.com/prometheus/common v0.52.2 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect @@ -148,18 +148,18 @@ require ( gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 // indirect go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.21.0 // indirect + golang.org/x/crypto v0.22.0 // indirect golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.22.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.18.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect diff --git a/client/v2/go.sum b/client/v2/go.sum index dffbcc92afda..ba95584d1042 100644 --- a/client/v2/go.sum +++ b/client/v2/go.sum @@ -124,8 +124,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -147,8 +147,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/cosmos/iavl v1.0.0 h1:bw6t0Mv/mVCJvlMTOPHWLs5uUE3BRBfVWCRelOzl+so= github.com/cosmos/iavl v1.0.0/go.mod h1:CmTGqMnRnucjxbjduneZXT+0vPgNElYvdefjX2q9tYc= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= @@ -168,8 +168,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= @@ -455,8 +455,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -561,8 +561,8 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= @@ -603,8 +603,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= -github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -757,8 +757,8 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= @@ -807,8 +807,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -820,8 +820,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -877,12 +877,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -936,12 +936,12 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -959,8 +959,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/codec/any_test.go b/codec/any_test.go index d9996ec3d3c4..29efddbf6a21 100644 --- a/codec/any_test.go +++ b/codec/any_test.go @@ -3,6 +3,7 @@ package codec_test import ( "testing" + "github.com/cosmos/gogoproto/types/any/test" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/codec" @@ -10,30 +11,29 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - "github.com/cosmos/cosmos-sdk/testutil/testdata" "github.com/cosmos/cosmos-sdk/types/module/testutil" ) func NewTestInterfaceRegistry() codectypes.InterfaceRegistry { registry := codectypes.NewInterfaceRegistry() - registry.RegisterInterface("Animal", (*testdata.Animal)(nil)) + registry.RegisterInterface("Animal", (*test.Animal)(nil)) registry.RegisterImplementations( - (*testdata.Animal)(nil), - &testdata.Dog{}, - &testdata.Cat{}, + (*test.Animal)(nil), + &test.Dog{}, + &test.Cat{}, ) return registry } func TestMarshalAny(t *testing.T) { catRegistry := codectypes.NewInterfaceRegistry() - catRegistry.RegisterImplementations((*testdata.Animal)(nil), &testdata.Cat{}) + catRegistry.RegisterImplementations((*test.Animal)(nil), &test.Cat{}) registry := codectypes.NewInterfaceRegistry() cdc := codec.NewProtoCodec(registry) - kitty := &testdata.Cat{Moniker: "Kitty"} + kitty := &test.Cat{Moniker: "Kitty"} emptyBz, err := cdc.MarshalInterface(kitty) require.ErrorContains(t, err, "does not have a registered interface") @@ -41,11 +41,11 @@ func TestMarshalAny(t *testing.T) { require.NoError(t, err) require.NotEmpty(t, catBz) - var animal testdata.Animal + var animal test.Animal // deserializing cat bytes should error in an empty registry err = cdc.UnmarshalInterface(catBz, &animal) - require.ErrorContains(t, err, "no registered implementations of type testdata.Animal") + require.ErrorContains(t, err, "no registered implementations of type test.Animal") // deserializing an empty byte array will return nil, but no error err = cdc.UnmarshalInterface(emptyBz, &animal) @@ -53,7 +53,7 @@ func TestMarshalAny(t *testing.T) { require.NoError(t, err) // wrong type registration should fail - registry.RegisterImplementations((*testdata.Animal)(nil), &testdata.Dog{}) + registry.RegisterImplementations((*test.Animal)(nil), &test.Dog{}) err = cdc.UnmarshalInterface(catBz, &animal) require.Error(t, err) diff --git a/codec/types/any.go b/codec/types/any.go index 557cda0687ca..a3b4b7548afe 100644 --- a/codec/types/any.go +++ b/codec/types/any.go @@ -1,154 +1,39 @@ package types import ( - fmt "fmt" - - "github.com/cosmos/gogoproto/proto" - protov2 "google.golang.org/protobuf/proto" - - errorsmod "cosmossdk.io/errors" - - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + gogoproto "github.com/cosmos/gogoproto/types/any" ) -type Any struct { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - - TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"` - - // Must be a valid serialized protocol buffer of the above specified type. - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` - - cachedValue interface{} - - compat *anyCompat -} - -// NewAnyWithValue constructs a new Any packed with the value provided or -// returns an error if that value couldn't be packed. This also caches -// the packed value so that it can be retrieved from GetCachedValue without -// unmarshaling -func NewAnyWithValue(v proto.Message) (*Any, error) { - if v == nil { - return nil, errorsmod.Wrap(sdkerrors.ErrPackAny, "Expecting non nil value to create a new Any") - } - - var ( - bz []byte - err error - ) - if msg, ok := v.(protov2.Message); ok { - protov2MarshalOpts := protov2.MarshalOptions{Deterministic: true} - bz, err = protov2MarshalOpts.Marshal(msg) - } else { - bz, err = proto.Marshal(v) - } - if err != nil { - return nil, err - } - - return &Any{ - TypeUrl: MsgTypeURL(v), - Value: bz, - cachedValue: v, - }, nil -} - -// UnsafePackAny packs the value x in the Any and instead of returning the error -// in the case of a packing failure, keeps the cached value. This should only -// be used in situations where compatibility is needed with amino. Amino-only -// values can safely be packed using this method when they will only be -// marshaled with amino and not protobuf. -func UnsafePackAny(x interface{}) *Any { - if msg, ok := x.(proto.Message); ok { - any, err := NewAnyWithValue(msg) - if err == nil { - return any - } - } - return &Any{cachedValue: x} -} +// Any is an alias for gogoproto.Any. It represents a protocol buffer message +// that can contain any arbitrary data. This is used for encoding and decoding +// unknown or dynamic content in a type-safe manner. +type Any = gogoproto.Any -// pack packs the value x in the Any or returns an error. This also caches -// the packed value so that it can be retrieved from GetCachedValue without -// unmarshaling -func (any *Any) pack(x proto.Message) error { - any.TypeUrl = MsgTypeURL(x) +// AminoPacker is an alias for gogoproto.AminoPacker. It provides functionality +// for packing and unpacking data using the Amino encoding. +type AminoPacker = gogoproto.AminoPacker - var ( - bz []byte - err error - ) - if msg, ok := x.(protov2.Message); ok { - protov2MarshalOpts := protov2.MarshalOptions{Deterministic: true} - bz, err = protov2MarshalOpts.Marshal(msg) - } else { - bz, err = proto.Marshal(x) - } - if err != nil { - return err - } +// AminoUnpacker is an alias for gogoproto.AminoUnpacker. It is used for +// unpacking Amino-encoded data into Go types. +type AminoUnpacker = gogoproto.AminoUnpacker - any.Value = bz - any.cachedValue = x +// AminoJSONPacker is an alias for gogoproto.AminoJSONPacker. It allows for +// packing data into a JSON format using Amino encoding rules. +type AminoJSONPacker = gogoproto.AminoJSONPacker - return nil -} +// AminoJSONUnpacker is an alias for gogoproto.AminoJSONUnpacker. It provides +// the ability to unpack JSON data encoded with Amino encoding rules. +type AminoJSONUnpacker = gogoproto.AminoJSONUnpacker -// GetCachedValue returns the cached value from the Any if present -func (any *Any) GetCachedValue() interface{} { - return any.cachedValue -} +// ProtoJSONPacker is an alias for gogoproto.ProtoJSONPacker. This is used for +// packing protocol buffer messages into a JSON format. +type ProtoJSONPacker = gogoproto.ProtoJSONPacker -// GoString returns a string representing valid go code to reproduce the current state of -// the struct. -func (any *Any) GoString() string { - if any == nil { - return "nil" - } - extra := "" - if any.XXX_unrecognized != nil { - extra = fmt.Sprintf(",\n XXX_unrecognized: %#v,\n", any.XXX_unrecognized) - } - return fmt.Sprintf("&Any{TypeUrl: %#v,\n Value: %#v%s\n}", - any.TypeUrl, any.Value, extra) -} +// NewAnyWithValue is an alias for gogoproto.NewAnyWithCacheWithValue. This function +// creates a new Any instance containing the provided value, with caching +// mechanisms to improve performance. +var NewAnyWithValue = gogoproto.NewAnyWithCacheWithValue -// String implements the stringer interface -func (any *Any) String() string { - if any == nil { - return "nil" - } - return fmt.Sprintf("&Any{TypeUrl:%v,Value:%v,XXX_unrecognized:%v}", - any.TypeUrl, any.Value, any.XXX_unrecognized) -} +// UnsafePackAny is an alias for gogoproto.UnsafePackAnyWithCache. This function +// packs a given message into an Any type without performing safety checks. +var UnsafePackAny = gogoproto.UnsafePackAnyWithCache diff --git a/codec/types/any.pb.go b/codec/types/any.pb.go deleted file mode 100644 index 8dc80f395291..000000000000 --- a/codec/types/any.pb.go +++ /dev/null @@ -1,535 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: google/protobuf/any.proto - -package types - -import ( - bytes "bytes" - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -func (m *Any) Reset() { *m = Any{} } -func (*Any) ProtoMessage() {} -func (*Any) Descriptor() ([]byte, []int) { - return fileDescriptor_b53526c13ae22eb4, []int{0} -} -func (*Any) XXX_WellKnownType() string { return "Any" } -func (m *Any) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Any) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Any.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 *Any) XXX_Merge(src proto.Message) { - xxx_messageInfo_Any.Merge(m, src) -} -func (m *Any) XXX_Size() int { - return m.Size() -} -func (m *Any) XXX_DiscardUnknown() { - xxx_messageInfo_Any.DiscardUnknown(m) -} - -var xxx_messageInfo_Any proto.InternalMessageInfo - -func (m *Any) GetTypeUrl() string { - if m != nil { - return m.TypeUrl - } - return "" -} - -func (m *Any) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -func (*Any) XXX_MessageName() string { - return "google.protobuf.Any" -} -func init() { -} - -func init() { proto.RegisterFile("google/protobuf/any.proto", fileDescriptor_b53526c13ae22eb4) } - -var fileDescriptor_b53526c13ae22eb4 = []byte{ - // 248 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4c, 0xcf, 0xcf, 0x4f, - 0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0xcc, 0xab, 0xd4, - 0x03, 0x73, 0x84, 0xf8, 0x21, 0x52, 0x7a, 0x30, 0x29, 0x29, 0x91, 0xf4, 0xfc, 0xf4, 0x7c, 0x30, - 0x4f, 0x1f, 0xc4, 0x82, 0x48, 0x28, 0x79, 0x70, 0x31, 0x3b, 0xe6, 0x55, 0x0a, 0x49, 0x72, 0x71, - 0x94, 0x54, 0x16, 0xa4, 0xc6, 0x97, 0x16, 0xe5, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0xb1, - 0x83, 0xf8, 0xa1, 0x45, 0x39, 0x42, 0x22, 0x5c, 0xac, 0x65, 0x89, 0x39, 0xa5, 0xa9, 0x12, 0x4c, - 0x0a, 0x8c, 0x1a, 0x3c, 0x41, 0x10, 0x8e, 0x95, 0xc0, 0x8c, 0x05, 0xf2, 0x0c, 0x1b, 0x16, 0xc8, - 0x33, 0x7c, 0x58, 0x28, 0xcf, 0xd0, 0x70, 0x47, 0x81, 0xc1, 0xa9, 0x99, 0xf1, 0xc6, 0x43, 0x39, - 0x86, 0x0f, 0x0f, 0xe5, 0x18, 0x7f, 0x3c, 0x94, 0x63, 0x6c, 0x78, 0x24, 0xc7, 0xb8, 0xe2, 0x91, - 0x1c, 0xe3, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0xf8, 0xe2, - 0x91, 0x1c, 0xc3, 0x07, 0x90, 0xf8, 0x63, 0x39, 0xc6, 0x03, 0x8f, 0xe5, 0x18, 0x4e, 0x3c, 0x96, - 0x63, 0xe4, 0x12, 0x4e, 0xce, 0xcf, 0xd5, 0x43, 0x73, 0xab, 0x13, 0x87, 0x63, 0x5e, 0x65, 0x00, - 0x88, 0x13, 0xc0, 0x18, 0xc5, 0x0a, 0x72, 0x48, 0xf1, 0x22, 0x26, 0x66, 0xf7, 0x00, 0xa7, 0x55, - 0x4c, 0x72, 0xee, 0x10, 0xa5, 0x01, 0x50, 0xa5, 0x7a, 0xe1, 0xa9, 0x39, 0x39, 0xde, 0x79, 0xf9, - 0xe5, 0x79, 0x21, 0x20, 0x65, 0x49, 0x6c, 0x60, 0x33, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, - 0x4d, 0x91, 0x00, 0xa0, 0x1a, 0x01, 0x00, 0x00, -} - -func (this *Any) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*Any) - if !ok { - that2, ok := that.(Any) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if this.TypeUrl != that1.TypeUrl { - if this.TypeUrl < that1.TypeUrl { - return -1 - } - return 1 - } - if c := bytes.Compare(this.Value, that1.Value); c != 0 { - return c - } - if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { - return c - } - return 0 -} -func (this *Any) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Any) - if !ok { - that2, ok := that.(Any) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.TypeUrl != that1.TypeUrl { - return false - } - if !bytes.Equal(this.Value, that1.Value) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (m *Any) 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 *Any) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Any) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintAny(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x12 - } - if len(m.TypeUrl) > 0 { - i -= len(m.TypeUrl) - copy(dAtA[i:], m.TypeUrl) - i = encodeVarintAny(dAtA, i, uint64(len(m.TypeUrl))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintAny(dAtA []byte, offset int, v uint64) int { - offset -= sovAny(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func NewPopulatedAny(r randyAny, easy bool) *Any { - this := &Any{} - this.TypeUrl = string(randStringAny(r)) - v1 := r.Intn(100) - this.Value = make([]byte, v1) - for i := 0; i < v1; i++ { - this.Value[i] = byte(r.Intn(256)) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedAny(r, 3) - } - return this -} - -type randyAny interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneAny(r randyAny) rune { - ru := r.Intn(62) - if ru < 10 { - return rune(ru + 48) - } else if ru < 36 { - return rune(ru + 55) - } - return rune(ru + 61) -} -func randStringAny(r randyAny) string { - v2 := r.Intn(100) - tmps := make([]rune, v2) - for i := 0; i < v2; i++ { - tmps[i] = randUTF8RuneAny(r) - } - return string(tmps) -} -func randUnrecognizedAny(r randyAny, maxFieldNumber int) (dAtA []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - dAtA = randFieldAny(dAtA, r, fieldNumber, wire) - } - return dAtA -} -func randFieldAny(dAtA []byte, r randyAny, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - dAtA = encodeVarintPopulateAny(dAtA, uint64(key)) - v3 := r.Int63() - if r.Intn(2) == 0 { - v3 *= -1 - } - dAtA = encodeVarintPopulateAny(dAtA, uint64(v3)) - case 1: - dAtA = encodeVarintPopulateAny(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - dAtA = encodeVarintPopulateAny(dAtA, uint64(key)) - ll := r.Intn(100) - dAtA = encodeVarintPopulateAny(dAtA, uint64(ll)) - for j := 0; j < ll; j++ { - dAtA = append(dAtA, byte(r.Intn(256))) - } - default: - dAtA = encodeVarintPopulateAny(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - } - return dAtA -} -func encodeVarintPopulateAny(dAtA []byte, v uint64) []byte { - for v >= 1<<7 { - dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 - } - dAtA = append(dAtA, uint8(v)) - return dAtA -} -func (m *Any) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.TypeUrl) - if l > 0 { - n += 1 + l + sovAny(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovAny(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovAny(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozAny(x uint64) (n int) { - return sovAny(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Any) 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 ErrIntOverflowAny - } - 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: Any: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Any: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TypeUrl", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAny - } - 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 ErrInvalidLengthAny - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAny - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TypeUrl = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAny - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthAny - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthAny - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAny(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAny - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipAny(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, ErrIntOverflowAny - } - 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, ErrIntOverflowAny - } - 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, ErrIntOverflowAny - } - 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, ErrInvalidLengthAny - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupAny - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthAny - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthAny = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowAny = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupAny = fmt.Errorf("proto: unexpected end of group") -) diff --git a/codec/types/any_internal_test.go b/codec/types/any_internal_test.go index 0b3c155821b7..282380b1d63d 100644 --- a/codec/types/any_internal_test.go +++ b/codec/types/any_internal_test.go @@ -48,7 +48,7 @@ func TestAnyPackUnpack(t *testing.T) { require.Equal(t, spot, animal) // without cache - any.cachedValue = nil + any.ResetCachedValue() err = registry.UnpackAny(any, &animal) require.NoError(t, err) require.Equal(t, spot, animal) diff --git a/codec/types/compat.go b/codec/types/compat.go deleted file mode 100644 index bb4dff0bf438..000000000000 --- a/codec/types/compat.go +++ /dev/null @@ -1,210 +0,0 @@ -package types - -import ( - "fmt" - "reflect" - "runtime/debug" - - "github.com/cosmos/gogoproto/jsonpb" - "github.com/cosmos/gogoproto/proto" - amino "github.com/tendermint/go-amino" -) - -type anyCompat struct { - aminoBz []byte - jsonBz []byte - err error -} - -var Debug = true - -func anyCompatError(errType string, x interface{}) error { - if Debug { - debug.PrintStack() - } - return fmt.Errorf( - "%s marshaling error for %+v, this is likely because "+ - "amino is being used directly (instead of codec.LegacyAmino which is preferred) "+ - "or UnpackInterfacesMessage is not defined for some type which contains "+ - "a protobuf Any either directly or via one of its members. To see a "+ - "stacktrace of where the error is coming from, set the var Debug = true "+ - "in codec/types/compat.go", - errType, x, - ) -} - -func (any Any) MarshalAmino() ([]byte, error) { - ac := any.compat - if ac == nil { - return nil, anyCompatError("amino binary marshal", any) - } - return ac.aminoBz, ac.err -} - -func (any *Any) UnmarshalAmino(bz []byte) error { - any.compat = &anyCompat{ - aminoBz: bz, - err: nil, - } - return nil -} - -func (any *Any) MarshalJSON() ([]byte, error) { - ac := any.compat - if ac == nil { - return nil, anyCompatError("JSON marshal", any) - } - return ac.jsonBz, ac.err -} - -func (any *Any) UnmarshalJSON(bz []byte) error { - any.compat = &anyCompat{ - jsonBz: bz, - err: nil, - } - return nil -} - -// AminoUnpacker is an AnyUnpacker provided for backwards compatibility with -// amino for the binary un-marshaling phase -type AminoUnpacker struct { - Cdc *amino.Codec -} - -var _ AnyUnpacker = AminoUnpacker{} - -func (a AminoUnpacker) UnpackAny(any *Any, iface interface{}) error { - ac := any.compat - if ac == nil { - return anyCompatError("amino binary unmarshal", reflect.TypeOf(iface)) - } - err := a.Cdc.UnmarshalBinaryBare(ac.aminoBz, iface) - if err != nil { - return err - } - val := reflect.ValueOf(iface).Elem().Interface() - err = UnpackInterfaces(val, a) - if err != nil { - return err - } - if m, ok := val.(proto.Message); ok { - if err = any.pack(m); err != nil { - return err - } - } else { - any.cachedValue = val - } - - // this is necessary for tests that use reflect.DeepEqual and compare - // proto vs amino marshaled values - any.compat = nil - - return nil -} - -// AminoPacker is provided for backwards compatibility with -// amino for the binary marshaling phase -type AminoPacker struct { - Cdc *amino.Codec -} - -var _ AnyUnpacker = AminoPacker{} - -func (a AminoPacker) UnpackAny(any *Any, _ interface{}) error { - err := UnpackInterfaces(any.cachedValue, a) - if err != nil { - return err - } - bz, err := a.Cdc.MarshalBinaryBare(any.cachedValue) - any.compat = &anyCompat{ - aminoBz: bz, - err: err, - } - return err -} - -// AminoJSONUnpacker is an AnyUnpacker provided for backwards compatibility with -// amino for the JSON marshaling phase -type AminoJSONUnpacker struct { - Cdc *amino.Codec -} - -var _ AnyUnpacker = AminoJSONUnpacker{} - -func (a AminoJSONUnpacker) UnpackAny(any *Any, iface interface{}) error { - ac := any.compat - if ac == nil { - return anyCompatError("JSON unmarshal", reflect.TypeOf(iface)) - } - err := a.Cdc.UnmarshalJSON(ac.jsonBz, iface) - if err != nil { - return err - } - val := reflect.ValueOf(iface).Elem().Interface() - err = UnpackInterfaces(val, a) - if err != nil { - return err - } - if m, ok := val.(proto.Message); ok { - if err = any.pack(m); err != nil { - return err - } - } else { - any.cachedValue = val - } - - // this is necessary for tests that use reflect.DeepEqual and compare - // proto vs amino marshaled values - any.compat = nil - - return nil -} - -// AminoJSONPacker is an AnyUnpacker provided for backwards compatibility with -// amino for the JSON un-marshaling phase -type AminoJSONPacker struct { - Cdc *amino.Codec -} - -var _ AnyUnpacker = AminoJSONPacker{} - -func (a AminoJSONPacker) UnpackAny(any *Any, _ interface{}) error { - err := UnpackInterfaces(any.cachedValue, a) - if err != nil { - return err - } - bz, err := a.Cdc.MarshalJSON(any.cachedValue) - any.compat = &anyCompat{ - jsonBz: bz, - err: err, - } - return err -} - -// ProtoJSONPacker is an AnyUnpacker provided for compatibility with jsonpb -type ProtoJSONPacker struct { - JSONPBMarshaler *jsonpb.Marshaler -} - -var _ AnyUnpacker = ProtoJSONPacker{} - -func (a ProtoJSONPacker) UnpackAny(any *Any, _ interface{}) error { - if any == nil { - return nil - } - - if any.cachedValue != nil { - err := UnpackInterfaces(any.cachedValue, a) - if err != nil { - return err - } - } - - bz, err := a.JSONPBMarshaler.MarshalToString(any) - any.compat = &anyCompat{ - jsonBz: []byte(bz), - err: err, - } - - return err -} diff --git a/codec/types/compat_test.go b/codec/types/compat_test.go deleted file mode 100644 index 56cb32e82cc0..000000000000 --- a/codec/types/compat_test.go +++ /dev/null @@ -1,132 +0,0 @@ -package types_test - -import ( - "testing" - - "github.com/stretchr/testify/suite" - amino "github.com/tendermint/go-amino" - - "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/testutil/testdata" -) - -type TypeWithInterface struct { - Animal testdata.Animal `json:"animal"` - X int64 `json:"x,omitempty"` -} - -type Suite struct { - suite.Suite - cdc *amino.Codec - a TypeWithInterface - b testdata.HasAnimal - spot *testdata.Dog -} - -func (s *Suite) SetupTest() { - s.cdc = amino.NewCodec() - s.cdc.RegisterInterface((*testdata.Animal)(nil), nil) - s.cdc.RegisterConcrete(&testdata.Dog{}, "testdata/Dog", nil) - - s.spot = &testdata.Dog{Size_: "small", Name: "Spot"} - s.a = TypeWithInterface{Animal: s.spot} - - any, err := types.NewAnyWithValue(s.spot) - s.Require().NoError(err) - s.b = testdata.HasAnimal{Animal: any} -} - -func (s *Suite) TestAminoBinary() { - bz, err := s.cdc.MarshalBinaryBare(s.a) - s.Require().NoError(err) - - // expect plain amino marshal to fail - _, err = s.cdc.MarshalBinaryBare(s.b) - s.Require().Error(err) - - // expect unpack interfaces before amino marshal to succeed - err = types.UnpackInterfaces(s.b, types.AminoPacker{Cdc: s.cdc}) - s.Require().NoError(err) - bz2, err := s.cdc.MarshalBinaryBare(s.b) - s.Require().NoError(err) - s.Require().Equal(bz, bz2) - - var c testdata.HasAnimal - err = s.cdc.UnmarshalBinaryBare(bz, &c) - s.Require().NoError(err) - err = types.UnpackInterfaces(c, types.AminoUnpacker{Cdc: s.cdc}) - s.Require().NoError(err) - s.Require().Equal(s.spot, c.Animal.GetCachedValue()) -} - -func (s *Suite) TestAminoJSON() { - bz, err := s.cdc.MarshalJSON(s.a) - s.Require().NoError(err) - - // expect plain amino marshal to fail - _, err = s.cdc.MarshalJSON(s.b) - s.Require().Error(err) - - // expect unpack interfaces before amino marshal to succeed - err = types.UnpackInterfaces(s.b, types.AminoJSONPacker{Cdc: s.cdc}) - s.Require().NoError(err) - bz2, err := s.cdc.MarshalJSON(s.b) - s.Require().NoError(err) - s.Require().Equal(string(bz), string(bz2)) - - var c testdata.HasAnimal - err = s.cdc.UnmarshalJSON(bz, &c) - s.Require().NoError(err) - err = types.UnpackInterfaces(c, types.AminoJSONUnpacker{Cdc: s.cdc}) - s.Require().NoError(err) - s.Require().Equal(s.spot, c.Animal.GetCachedValue()) -} - -func (s *Suite) TestNested() { - s.cdc.RegisterInterface((*testdata.HasAnimalI)(nil), nil) - s.cdc.RegisterInterface((*testdata.HasHasAnimalI)(nil), nil) - s.cdc.RegisterConcrete(&testdata.HasAnimal{}, "testdata/HasAnimal", nil) - s.cdc.RegisterConcrete(&testdata.HasHasAnimal{}, "testdata/HasHasAnimal", nil) - s.cdc.RegisterConcrete(&testdata.HasHasHasAnimal{}, "testdata/HasHasHasAnimal", nil) - - any, err := types.NewAnyWithValue(&s.b) - s.Require().NoError(err) - hha := testdata.HasHasAnimal{HasAnimal: any} - any2, err := types.NewAnyWithValue(&hha) - s.Require().NoError(err) - hhha := testdata.HasHasHasAnimal{HasHasAnimal: any2} - - // marshal - err = types.UnpackInterfaces(hhha, types.AminoPacker{Cdc: s.cdc}) - s.Require().NoError(err) - bz, err := s.cdc.MarshalBinaryBare(hhha) - s.Require().NoError(err) - - // unmarshal - var hhha2 testdata.HasHasHasAnimal - err = s.cdc.UnmarshalBinaryBare(bz, &hhha2) - s.Require().NoError(err) - err = types.UnpackInterfaces(hhha2, types.AminoUnpacker{Cdc: s.cdc}) - s.Require().NoError(err) - - s.Require().Equal(s.spot, hhha2.TheHasHasAnimal().TheHasAnimal().TheAnimal()) - - // json marshal - err = types.UnpackInterfaces(hhha, types.AminoJSONPacker{Cdc: s.cdc}) - s.Require().NoError(err) - jsonBz, err := s.cdc.MarshalJSON(hhha) - s.Require().NoError(err) - - // json unmarshal - var hhha3 testdata.HasHasHasAnimal - err = s.cdc.UnmarshalJSON(jsonBz, &hhha3) - s.Require().NoError(err) - err = types.UnpackInterfaces(hhha3, types.AminoJSONUnpacker{Cdc: s.cdc}) - s.Require().NoError(err) - - s.Require().Equal(s.spot, hhha3.TheHasHasAnimal().TheHasAnimal().TheAnimal()) -} - -func TestSuite(t *testing.T) { - suite.Run(t, &Suite{}) -} diff --git a/codec/types/interface_registry.go b/codec/types/interface_registry.go index b621d7a19856..ca1d1e61e60b 100644 --- a/codec/types/interface_registry.go +++ b/codec/types/interface_registry.go @@ -15,8 +15,6 @@ import ( "cosmossdk.io/x/tx/signing" ) -var protoMessageType = reflect.TypeOf((*proto.Message)(nil)).Elem() - // AnyUnpacker is an interface which allows safely unpacking types packed // in Any's against a whitelist of registered types type AnyUnpacker interface { @@ -30,6 +28,41 @@ type AnyUnpacker interface { UnpackAny(any *Any, iface interface{}) error } +// UnpackInterfacesMessage is meant to extend protobuf types (which implement +// proto.Message) to support a post-deserialization phase which unpacks +// types packed within Any's using the whitelist provided by AnyUnpacker +type UnpackInterfacesMessage interface { + // UnpackInterfaces is implemented in order to unpack values packed within + // Any's using the AnyUnpacker. It should generally be implemented as + // follows: + // func (s *MyStruct) UnpackInterfaces(unpacker AnyUnpacker) error { + // var x AnyInterface + // // where X is an Any field on MyStruct + // err := unpacker.UnpackAny(s.X, &x) + // if err != nil { + // return nil + // } + // // where Y is a field on MyStruct that implements UnpackInterfacesMessage itself + // err = s.Y.UnpackInterfaces(unpacker) + // if err != nil { + // return nil + // } + // return nil + // } + UnpackInterfaces(unpacker AnyUnpacker) error +} + +// UnpackInterfaces is a convenience function that calls UnpackInterfaces +// on x if x implements UnpackInterfacesMessage +func UnpackInterfaces(x interface{}, unpacker AnyUnpacker) error { + if msg, ok := x.(UnpackInterfacesMessage); ok { + return msg.UnpackInterfaces(unpacker) + } + return nil +} + +var protoMessageType = reflect.TypeOf((*proto.Message)(nil)).Elem() + // InterfaceRegistry provides a mechanism for registering interfaces and // implementations that can be safely unpacked from Any type InterfaceRegistry interface { @@ -62,30 +95,6 @@ type InterfaceRegistry interface { mustEmbedInterfaceRegistry() } -// UnpackInterfacesMessage is meant to extend protobuf types (which implement -// proto.Message) to support a post-deserialization phase which unpacks -// types packed within Any's using the whitelist provided by AnyUnpacker -type UnpackInterfacesMessage interface { - // UnpackInterfaces is implemented in order to unpack values packed within - // Any's using the AnyUnpacker. It should generally be implemented as - // follows: - // func (s *MyStruct) UnpackInterfaces(unpacker AnyUnpacker) error { - // var x AnyInterface - // // where X is an Any field on MyStruct - // err := unpacker.UnpackAny(s.X, &x) - // if err != nil { - // return nil - // } - // // where Y is a field on MyStruct that implements UnpackInterfacesMessage itself - // err = s.Y.UnpackInterfaces(unpacker) - // if err != nil { - // return nil - // } - // return nil - // } - UnpackInterfaces(unpacker AnyUnpacker) error -} - type interfaceRegistry struct { signing.ProtoFileResolver interfaceNames map[string]reflect.Type @@ -275,7 +284,7 @@ func (registry *interfaceRegistry) UnpackAny(any *Any, iface interface{}) error rt := rv.Elem().Type() - cachedValue := any.cachedValue + cachedValue := any.GetCachedValue() if cachedValue != nil { if reflect.TypeOf(cachedValue).AssignableTo(rt) { rv.Elem().Set(reflect.ValueOf(cachedValue)) @@ -312,8 +321,12 @@ func (registry *interfaceRegistry) UnpackAny(any *Any, iface interface{}) error rv.Elem().Set(reflect.ValueOf(msg)) - any.cachedValue = msg + newAnyWithCache, err := NewAnyWithValue(msg) + if err != nil { + return err + } + *any = *newAnyWithCache return nil } @@ -340,15 +353,6 @@ func (registry *interfaceRegistry) SigningContext() *signing.Context { func (registry *interfaceRegistry) mustEmbedInterfaceRegistry() {} -// UnpackInterfaces is a convenience function that calls UnpackInterfaces -// on x if x implements UnpackInterfacesMessage -func UnpackInterfaces(x interface{}, unpacker AnyUnpacker) error { - if msg, ok := x.(UnpackInterfacesMessage); ok { - return msg.UnpackInterfaces(unpacker) - } - return nil -} - type failingAddressCodec struct{} func (f failingAddressCodec) StringToBytes(string) ([]byte, error) { diff --git a/codec/types/types_test.go b/codec/types/types_test.go index dddacfe18b0f..f8a26769db9e 100644 --- a/codec/types/types_test.go +++ b/codec/types/types_test.go @@ -6,23 +6,45 @@ import ( "github.com/cosmos/gogoproto/jsonpb" "github.com/cosmos/gogoproto/proto" + testdata "github.com/cosmos/gogoproto/types/any/test" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/testutil/testdata" + test "github.com/cosmos/cosmos-sdk/testutil/testdata" ) func TestAnyPackUnpack(t *testing.T) { - registry := testdata.NewTestInterfaceRegistry() + registry := test.NewTestInterfaceRegistry() spot := &testdata.Dog{Name: "Spot"} var animal testdata.Animal // with cache - any, err := types.NewAnyWithValue(spot) + anyWithCache, err := types.NewAnyWithValue(spot) require.NoError(t, err) - require.Equal(t, spot, any.GetCachedValue()) - err = registry.UnpackAny(any, &animal) + require.Equal(t, spot, anyWithCache.GetCachedValue()) + err = registry.UnpackAny(anyWithCache, &animal) + require.NoError(t, err) + require.Equal(t, spot, animal) +} + +func TestAnyResetCache(t *testing.T) { + registry := test.NewTestInterfaceRegistry() + + spot := &test.Dog{Name: "Spot"} + var animal test.Animal + + // with cache + anyWithCache, err := types.NewAnyWithValue(spot) + require.NoError(t, err) + require.Equal(t, spot, anyWithCache.GetCachedValue()) + + // delete cache + anyWithCache.ResetCachedValue() + require.Nil(t, anyWithCache.GetCachedValue()) + + // restore cache + err = registry.UnpackAny(anyWithCache, &animal) require.NoError(t, err) require.Equal(t, spot, animal) } @@ -80,7 +102,7 @@ func TestRegister(t *testing.T) { // Duplicate registration with different concrete type on same typeURL. require.PanicsWithError( t, - "concrete type *testdata.Dog has already been registered under typeURL /testpb.Dog, cannot register *types_test.FakeDog under same typeURL. "+ + "concrete type *test.Dog has already been registered under typeURL /test.Dog, cannot register *types_test.FakeDog under same typeURL. "+ "This usually means that there are conflicting modules registering different concrete types for a same interface implementation", func() { registry.RegisterImplementations((*testdata.Animal)(nil), &FakeDog{}) @@ -89,20 +111,20 @@ func TestRegister(t *testing.T) { } func TestUnpackInterfaces(t *testing.T) { - registry := testdata.NewTestInterfaceRegistry() + registry := test.NewTestInterfaceRegistry() - spot := &testdata.Dog{Name: "Spot"} + spot := &test.Dog{Name: "Spot"} any, err := types.NewAnyWithValue(spot) require.NoError(t, err) - hasAny := testdata.HasAnimal{ + hasAny := test.HasAnimal{ Animal: any, X: 1, } bz, err := hasAny.Marshal() require.NoError(t, err) - var hasAny2 testdata.HasAnimal + var hasAny2 test.HasAnimal err = hasAny2.Unmarshal(bz) require.NoError(t, err) @@ -113,28 +135,28 @@ func TestUnpackInterfaces(t *testing.T) { } func TestNested(t *testing.T) { - registry := testdata.NewTestInterfaceRegistry() + registry := test.NewTestInterfaceRegistry() - spot := &testdata.Dog{Name: "Spot"} + spot := &test.Dog{Name: "Spot"} any, err := types.NewAnyWithValue(spot) require.NoError(t, err) - ha := &testdata.HasAnimal{Animal: any} + ha := &test.HasAnimal{Animal: any} any2, err := types.NewAnyWithValue(ha) require.NoError(t, err) - hha := &testdata.HasHasAnimal{HasAnimal: any2} + hha := &test.HasHasAnimal{HasAnimal: any2} any3, err := types.NewAnyWithValue(hha) require.NoError(t, err) - hhha := testdata.HasHasHasAnimal{HasHasAnimal: any3} + hhha := test.HasHasHasAnimal{HasHasAnimal: any3} // marshal bz, err := hhha.Marshal() require.NoError(t, err) // unmarshal - var hhha2 testdata.HasHasHasAnimal + var hhha2 test.HasHasHasAnimal err = hhha2.Unmarshal(bz) require.NoError(t, err) err = types.UnpackInterfaces(hhha2, registry) @@ -144,7 +166,7 @@ func TestNested(t *testing.T) { } func TestAny_ProtoJSON(t *testing.T) { - spot := &testdata.Dog{Name: "Spot"} + spot := &test.Dog{Name: "Spot"} any, err := types.NewAnyWithValue(spot) require.NoError(t, err) @@ -153,17 +175,17 @@ func TestAny_ProtoJSON(t *testing.T) { require.NoError(t, err) require.Equal(t, "{\"@type\":\"/testpb.Dog\",\"name\":\"Spot\"}", json) - registry := testdata.NewTestInterfaceRegistry() + registry := test.NewTestInterfaceRegistry() jum := &jsonpb.Unmarshaler{} var any2 types.Any err = jum.Unmarshal(strings.NewReader(json), &any2) require.NoError(t, err) - var animal testdata.Animal + var animal test.Animal err = registry.UnpackAny(&any2, &animal) require.NoError(t, err) require.Equal(t, spot, animal) - ha := &testdata.HasAnimal{ + ha := &test.HasAnimal{ Animal: any, } err = ha.UnpackInterfaces(types.ProtoJSONPacker{JSONPBMarshaler: jm}) @@ -173,7 +195,7 @@ func TestAny_ProtoJSON(t *testing.T) { require.Equal(t, "{\"animal\":{\"@type\":\"/testpb.Dog\",\"name\":\"Spot\"}}", json) require.NoError(t, err) - var ha2 testdata.HasAnimal + var ha2 test.HasAnimal err = jum.Unmarshal(strings.NewReader(json), &ha2) require.NoError(t, err) err = ha2.UnpackInterfaces(registry) diff --git a/codec/yaml_test.go b/codec/yaml_test.go index 6d9445fe97b9..99808603b199 100644 --- a/codec/yaml_test.go +++ b/codec/yaml_test.go @@ -3,6 +3,7 @@ package codec_test import ( "testing" + "github.com/cosmos/gogoproto/types/any/test" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/codec" @@ -11,7 +12,7 @@ import ( ) func TestMarshalYAML(t *testing.T) { - dog := &testdata.Dog{ + dog := &test.Dog{ Size_: "small", Name: "Spot", } @@ -27,7 +28,7 @@ func TestMarshalYAML(t *testing.T) { bz, err := codec.MarshalYAML(protoCdc, hasAnimal) require.NoError(t, err) require.Equal(t, `animal: - '@type': /testpb.Dog + '@type': /test.Dog name: Spot size: small x: "0" @@ -37,12 +38,10 @@ x: "0" aminoCdc := codec.NewAminoCodec(&codec.LegacyAmino{testdata.NewTestAmino()}) bz, err = codec.MarshalYAML(aminoCdc, hasAnimal) require.NoError(t, err) - require.Equal(t, `type: testpb/HasAnimal + require.Equal(t, `type: test/HasAnimal value: animal: - type: testpb/Dog - value: - name: Spot - size: small + name: Spot + size: small `, string(bz)) } diff --git a/collections/collections.go b/collections/collections.go index 0f6b32253340..6a7b2a093423 100644 --- a/collections/collections.go +++ b/collections/collections.go @@ -29,7 +29,7 @@ var ( Uint64Key = codec.NewUint64Key[uint64]() // Int32Key can be used to encode int32 keys. Encoding retains ordering by toggling the MSB. Int32Key = codec.NewInt32Key[int32]() - // Int64Key can be used to encode int64. Encoding retains ordering by toggling the MSB. + // Int64Key can be used to encode int64 keys. Encoding retains ordering by toggling the MSB. Int64Key = codec.NewInt64Key[int64]() // StringKey can be used to encode string keys. The encoding just converts the string // to bytes. diff --git a/collections/go.mod b/collections/go.mod index bc89bc4cecc5..b038cc18a2b4 100644 --- a/collections/go.mod +++ b/collections/go.mod @@ -25,29 +25,28 @@ require ( github.com/fsnotify/fsnotify v1.6.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 github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.1.2 // indirect github.com/klauspost/compress v1.17.7 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/onsi/gomega v1.20.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.50.0 // indirect + github.com/prometheus/common v0.52.2 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/spf13/cast v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - golang.org/x/net v0.22.0 // indirect - golang.org/x/sys v0.18.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect - google.golang.org/grpc v1.62.1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/grpc v1.63.2 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/collections/go.sum b/collections/go.sum index cbf31d88daf8..6976956fbf7c 100644 --- a/collections/go.sum +++ b/collections/go.sum @@ -56,8 +56,6 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= -github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= @@ -79,8 +77,8 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= @@ -107,8 +105,8 @@ github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7km github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= -github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= -github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= @@ -141,8 +139,8 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/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= @@ -166,8 +164,8 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc 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.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.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= @@ -186,10 +184,10 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index d44c84f4c1a0..15de1f38e2df 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -38,6 +38,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Features +* [#19953](https://github.com/cosmos/cosmos-sdk/pull/19953) Add transaction service. * [#18379](https://github.com/cosmos/cosmos-sdk/pull/18379) Add branch service. * [#18457](https://github.com/cosmos/cosmos-sdk/pull/18457) Add branch.ExecuteWithGasLimit. * [#19041](https://github.com/cosmos/cosmos-sdk/pull/19041) Add `appmodule.Environment` interface to fetch different services diff --git a/core/appmodule/module.go b/core/appmodule/module.go index 60c4f80c3558..a0b6e7f02cb6 100644 --- a/core/appmodule/module.go +++ b/core/appmodule/module.go @@ -29,6 +29,9 @@ type HasEndBlocker = appmodule.HasEndBlocker // HasRegisterInterfaces is the interface for modules to register their msg types. type HasRegisterInterfaces = appmodule.HasRegisterInterfaces +// ValidatorUpdate defines a validator update. +type ValidatorUpdate = appmodule.ValidatorUpdate + // HasServices is the extension interface that modules should implement to register // implementations of services defined in .proto files. type HasServices interface { diff --git a/core/appmodule/v2/environment.go b/core/appmodule/v2/environment.go index eccc7eb297af..e3592eb210ad 100644 --- a/core/appmodule/v2/environment.go +++ b/core/appmodule/v2/environment.go @@ -7,6 +7,7 @@ import ( "cosmossdk.io/core/header" "cosmossdk.io/core/router" "cosmossdk.io/core/store" + "cosmossdk.io/core/transaction" "cosmossdk.io/log" ) @@ -14,11 +15,12 @@ import ( type Environment struct { Logger log.Logger - BranchService branch.Service - EventService event.Service - GasService gas.Service - HeaderService header.Service - RouterService router.Service + BranchService branch.Service + EventService event.Service + GasService gas.Service + HeaderService header.Service + RouterService router.Service + TransactionService transaction.Service KVStoreService store.KVStoreService MemStoreService store.MemoryStoreService diff --git a/core/appmodule/v2/module.go b/core/appmodule/v2/module.go index 47d581257753..4a3dece06ed9 100644 --- a/core/appmodule/v2/module.go +++ b/core/appmodule/v2/module.go @@ -47,10 +47,10 @@ type HasEndBlocker interface { EndBlock(context.Context) error } -// HasTxValidation is the extension interface that modules should implement to run +// HasTxValidator is the extension interface that modules should implement to run // custom logic for validating transactions. // It was previously known as AnteHandler/Decorator. -type HasTxValidation[T transaction.Tx] interface { +type HasTxValidator[T transaction.Tx] interface { AppModule // TxValidator is a method that will be run on each transaction. diff --git a/core/appmodule/v2/tx_validator.go b/core/appmodule/v2/tx_validator.go new file mode 100644 index 000000000000..0ef877af00a8 --- /dev/null +++ b/core/appmodule/v2/tx_validator.go @@ -0,0 +1,13 @@ +package appmodule + +import ( + "context" + + "cosmossdk.io/core/transaction" +) + +// TxValidator represent the method that a TxValidator should implement. +// It was previously known as AnteHandler/Decorator.AnteHandle +type TxValidator[T transaction.Tx] interface { + ValidateTx(ctx context.Context, tx T) error +} diff --git a/core/go.mod b/core/go.mod index 3dd081281858..1ab3065f5c50 100644 --- a/core/go.mod +++ b/core/go.mod @@ -4,15 +4,14 @@ go 1.20 require ( cosmossdk.io/log v1.3.1 - github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/gogoproto v1.4.12 github.com/stretchr/testify v1.9.0 - google.golang.org/grpc v1.62.1 + google.golang.org/grpc v1.63.2 google.golang.org/protobuf v1.33.0 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/golang/protobuf v1.5.4 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/mattn/go-colorable v0.1.13 // indirect @@ -21,11 +20,11 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rogpeppe/go-internal v1.11.0 // indirect github.com/rs/zerolog v1.32.0 // indirect - golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/sys v0.17.0 // indirect + golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/core/go.sum b/core/go.sum index d0992068e935..027e38b2c7cb 100644 --- a/core/go.sum +++ b/core/go.sum @@ -1,14 +1,12 @@ cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= -github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -37,21 +35,21 @@ github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb h1:mIKbk8weKhSeLH2GmUTrvx8CjkyJmnU1wFmg59CUjFA= -golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/core/store/changeset.go b/core/store/changeset.go index 624e95b2cd6a..f521432ec6b8 100644 --- a/core/store/changeset.go +++ b/core/store/changeset.go @@ -1,11 +1,23 @@ package store +import ( + "bytes" +) + +// Changeset is a list of changes to be written to disk +type Changeset struct { + Changes []StateChanges +} + // StateChanges represents a set of changes to the state of an actor in storage. type StateChanges struct { - Actor []byte // actor represents the space in storage where state is stored, previously this was called a "storekey" - StateChanges []KVPair // StateChanges is a list of key-value pairs representing the changes to the state. + Actor []byte // actor represents the space in storage where state is stored, previously this was called a "storekey" + StateChanges KVPairs // StateChanges is a list of key-value pairs representing the changes to the state. } +// KVPairs represents a set of key-value pairs. +type KVPairs = []KVPair + // KVPair represents a change in a key and value of state. // Remove being true signals the key must be removed from state. type KVPair struct { @@ -16,3 +28,76 @@ type KVPair struct { // Remove is true when the key must be removed from state. Remove bool } + +func NewChangeset() *Changeset { + return &Changeset{} +} + +func NewChangesetWithPairs(pairs map[string]KVPairs) *Changeset { + changes := make([]StateChanges, len(pairs)) + i := 0 + for storeKey, kvPairs := range pairs { + changes[i] = StateChanges{ + Actor: []byte(storeKey), + StateChanges: kvPairs, + } + i++ + } + return &Changeset{ + Changes: changes, + } +} + +// Size returns the number of key-value pairs in the batch. +func (cs *Changeset) Size() int { + cnt := 0 + for _, pairs := range cs.Changes { + cnt += len(pairs.StateChanges) + } + + return cnt +} + +// Add adds a key-value pair to the ChangeSet. +func (cs *Changeset) Add(storeKey, key, value []byte, remove bool) { + found := false + for i, pairs := range cs.Changes { + if bytes.Equal(storeKey, pairs.Actor) { + pairs.StateChanges = append(pairs.StateChanges, KVPair{ + Key: key, + Value: value, + Remove: remove, + }) + cs.Changes[i] = pairs + found = true + break + } + } + + if !found { + cs.Changes = append(cs.Changes, StateChanges{ + Actor: storeKey, + StateChanges: []KVPair{{Key: key, Value: value, Remove: remove}}, + }) + } +} + +// AddKVPair adds a KVPair to the ChangeSet. +func (cs *Changeset) AddKVPair(storeKey []byte, pair KVPair) { + found := false + for i, pairs := range cs.Changes { + if bytes.Equal(storeKey, pairs.Actor) { + pairs.StateChanges = append(pairs.StateChanges, pair) + cs.Changes[i] = pairs + found = true + break + } + } + + if !found { + cs.Changes = append(cs.Changes, StateChanges{ + Actor: storeKey, + StateChanges: []KVPair{pair}, + }) + } +} diff --git a/core/transaction/service.go b/core/transaction/service.go new file mode 100644 index 000000000000..627fb3f85dc3 --- /dev/null +++ b/core/transaction/service.go @@ -0,0 +1,24 @@ +package transaction + +import "context" + +// ExecMode defines the execution mode +type ExecMode uint8 + +// All possible execution modes. +// For backwards compatibility and easier casting, the exec mode values must be the same as in cosmos/cosmos-sdk/types package. +const ( + ExecModeCheck ExecMode = iota + ExecModeReCheck + ExecModeSimulate + _ + _ + _ + _ + ExecModeFinalize +) + +// Service creates a transaction service. +type Service interface { + ExecMode(ctx context.Context) ExecMode +} diff --git a/crypto/keyring/record.pb.go b/crypto/keyring/record.pb.go index 081b456bea20..1af36b46c31e 100644 --- a/crypto/keyring/record.pb.go +++ b/crypto/keyring/record.pb.go @@ -5,9 +5,9 @@ package keyring import ( fmt "fmt" - types "github.com/cosmos/cosmos-sdk/codec/types" hd "github.com/cosmos/cosmos-sdk/crypto/hd" _ "github.com/cosmos/gogoproto/gogoproto" + any "github.com/cosmos/gogoproto/types/any" proto "github.com/golang/protobuf/proto" io "io" math "math" @@ -30,7 +30,7 @@ type Record struct { // name represents a name of Record Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // pub_key represents a public key in any format - PubKey *types.Any `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` + PubKey *any.Any `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` // Record contains one of the following items // // Types that are valid to be assigned to Item: @@ -146,7 +146,7 @@ func (*Record) XXX_OneofWrappers() []interface{} { // Item is a keyring item stored in a keyring backend. // Local item type Record_Local struct { - PrivKey *types.Any `protobuf:"bytes,1,opt,name=priv_key,json=privKey,proto3" json:"priv_key,omitempty"` + PrivKey *any.Any `protobuf:"bytes,1,opt,name=priv_key,json=privKey,proto3" json:"priv_key,omitempty"` } func (m *Record_Local) Reset() { *m = Record_Local{} } @@ -807,7 +807,7 @@ func (m *Record) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.PubKey == nil { - m.PubKey = &types.Any{} + m.PubKey = &any.Any{} } if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1033,7 +1033,7 @@ func (m *Record_Local) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.PrivKey == nil { - m.PrivKey = &types.Any{} + m.PrivKey = &any.Any{} } if err := m.PrivKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/crypto/keys/multisig/keys.pb.go b/crypto/keys/multisig/keys.pb.go index b181232634fd..b66ca1df3eb3 100644 --- a/crypto/keys/multisig/keys.pb.go +++ b/crypto/keys/multisig/keys.pb.go @@ -5,10 +5,10 @@ package multisig import ( fmt "fmt" - types "github.com/cosmos/cosmos-sdk/codec/types" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" + any "github.com/cosmos/gogoproto/types/any" io "io" math "math" math_bits "math/bits" @@ -29,8 +29,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // which nests multiple public keys and a threshold, // it uses legacy amino address rules. type LegacyAminoPubKey struct { - Threshold uint32 `protobuf:"varint,1,opt,name=threshold,proto3" json:"threshold,omitempty"` - PubKeys []*types.Any `protobuf:"bytes,2,rep,name=public_keys,json=publicKeys,proto3" json:"public_keys,omitempty"` + Threshold uint32 `protobuf:"varint,1,opt,name=threshold,proto3" json:"threshold,omitempty"` + PubKeys []*any.Any `protobuf:"bytes,2,rep,name=public_keys,json=publicKeys,proto3" json:"public_keys,omitempty"` } func (m *LegacyAminoPubKey) Reset() { *m = LegacyAminoPubKey{} } @@ -250,7 +250,7 @@ func (m *LegacyAminoPubKey) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.PubKeys = append(m.PubKeys, &types.Any{}) + m.PubKeys = append(m.PubKeys, &any.Any{}) if err := m.PubKeys[len(m.PubKeys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/crypto/keys/secp256r1/privkey.go b/crypto/keys/secp256r1/privkey.go index 0e8ef46ca310..463a7c063c8d 100644 --- a/crypto/keys/secp256r1/privkey.go +++ b/crypto/keys/secp256r1/privkey.go @@ -1,10 +1,14 @@ package secp256r1 import ( + "encoding/base64" + "github.com/cosmos/cosmos-sdk/crypto/keys/internal/ecdsa" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" ) +var _ customProtobufType = (*ecdsaSK)(nil) + // GenPrivKey generates a new secp256r1 private key. It uses operating system randomness. func GenPrivKey() (*PrivKey, error) { key, err := ecdsa.GenPrivKey(secp256r1) @@ -52,6 +56,27 @@ type ecdsaSK struct { ecdsa.PrivKey } +// Marshal implements customProtobufType. +func (sk ecdsaSK) Marshal() ([]byte, error) { + return sk.PrivKey.Bytes(), nil +} + +// MarshalJSON implements customProtobufType. +func (sk ecdsaSK) MarshalJSON() ([]byte, error) { + b64 := base64.StdEncoding.EncodeToString(sk.PrivKey.Bytes()) + return []byte(b64), nil +} + +// UnmarshalJSON implements customProtobufType. +func (sk *ecdsaSK) UnmarshalJSON(data []byte) error { + bz, err := base64.StdEncoding.DecodeString(string(data)) + if err != nil { + return err + } + + return sk.PrivKey.Unmarshal(bz, secp256r1, fieldSize) +} + // Size implements proto.Marshaler interface func (sk *ecdsaSK) Size() int { if sk == nil { diff --git a/crypto/keys/secp256r1/privkey_internal_test.go b/crypto/keys/secp256r1/privkey_internal_test.go index 902ee6dafbf8..52ea3239dac6 100644 --- a/crypto/keys/secp256r1/privkey_internal_test.go +++ b/crypto/keys/secp256r1/privkey_internal_test.go @@ -113,3 +113,14 @@ func (suite *SKSuite) TestSize() { var nilPk *ecdsaSK require.Equal(0, nilPk.Size(), "nil value must have zero size") } + +func (suite *SKSuite) TestJson() { + require := suite.Require() + asd := suite.sk.(*PrivKey) + bz, err := asd.Secret.MarshalJSON() + require.NoError(err) + + sk := &ecdsaSK{} + require.NoError(sk.UnmarshalJSON(bz)) + require.Equal(suite.sk.(*PrivKey).Secret, sk) +} diff --git a/crypto/keys/secp256r1/pubkey.go b/crypto/keys/secp256r1/pubkey.go index cacec514c3d7..c0d4cfc956b8 100644 --- a/crypto/keys/secp256r1/pubkey.go +++ b/crypto/keys/secp256r1/pubkey.go @@ -1,6 +1,8 @@ package secp256r1 import ( + "encoding/base64" + cmtcrypto "github.com/cometbft/cometbft/crypto" "github.com/cosmos/gogoproto/proto" @@ -8,6 +10,20 @@ import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" ) +// customProtobufType is here to make sure that ecdsaPK and ecdsaSK implement the +// gogoproto customtype interface. +type customProtobufType interface { + Marshal() ([]byte, error) + MarshalTo(data []byte) (n int, err error) + Unmarshal(data []byte) error + Size() int + + MarshalJSON() ([]byte, error) + UnmarshalJSON(data []byte) error +} + +var _ customProtobufType = (*ecdsaPK)(nil) + // String implements proto.Message interface. func (m *PubKey) String() string { return m.Key.String(name) @@ -49,6 +65,27 @@ type ecdsaPK struct { ecdsa.PubKey } +// Marshal implements customProtobufType. +func (pk ecdsaPK) Marshal() ([]byte, error) { + return pk.PubKey.Bytes(), nil +} + +// MarshalJSON implements customProtobufType. +func (pk ecdsaPK) MarshalJSON() ([]byte, error) { + b64 := base64.StdEncoding.EncodeToString(pk.PubKey.Bytes()) + return []byte(b64), nil +} + +// UnmarshalJSON implements customProtobufType. +func (pk *ecdsaPK) UnmarshalJSON(data []byte) error { + bz, err := base64.StdEncoding.DecodeString(string(data)) + if err != nil { + return err + } + + return pk.PubKey.Unmarshal(bz, secp256r1, pubKeySize) +} + // Size implements proto.Marshaler interface func (pk *ecdsaPK) Size() int { if pk == nil { diff --git a/crypto/keys/secp256r1/pubkey_internal_test.go b/crypto/keys/secp256r1/pubkey_internal_test.go index d3d2ed3823eb..77f4a66e5114 100644 --- a/crypto/keys/secp256r1/pubkey_internal_test.go +++ b/crypto/keys/secp256r1/pubkey_internal_test.go @@ -126,3 +126,14 @@ func (suite *PKSuite) TestSize() { var nilPk *ecdsaPK require.Equal(0, nilPk.Size(), "nil value must have zero size") } + +func (suite *PKSuite) TestJson() { + require := suite.Require() + + bz, err := suite.pk.Key.MarshalJSON() + require.NoError(err) + + pk := &ecdsaPK{} + require.NoError(pk.UnmarshalJSON(bz)) + require.Equal(suite.pk.Key, pk) +} diff --git a/depinject/go.mod b/depinject/go.mod index d0e49bf080a0..c8b46d0814be 100644 --- a/depinject/go.mod +++ b/depinject/go.mod @@ -19,17 +19,16 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/getsentry/sentry-go v0.23.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/protobuf v1.5.4 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rogpeppe/go-internal v1.11.0 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/sys v0.17.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect - google.golang.org/grpc v1.62.1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/grpc v1.63.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/depinject/go.sum b/depinject/go.sum index a8103e2c69a0..f1a0532baad2 100644 --- a/depinject/go.sum +++ b/depinject/go.sum @@ -16,8 +16,6 @@ github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= -github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -51,16 +49,16 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= @@ -73,10 +71,10 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/docs/architecture/PROCESS.md b/docs/architecture/PROCESS.md index ff6ba408b3e6..a237d0c65360 100644 --- a/docs/architecture/PROCESS.md +++ b/docs/architecture/PROCESS.md @@ -8,7 +8,7 @@ ## What is an ADR? -An ADR is a document to document an implementation and design that may or may not have been discussed in an RFC. While an RFC is meant to replace synchronous communication in a distributed environment, an ADR is meant to document an already made decision. An ADR won't come with much of a communication overhead because the discussion was recorded in an RFC or a synchronous discussion. If the consensus came from a synchoronus discussion then a short excerpt should be added to the ADR to explain the goals. +An ADR is a document to document an implementation and design that may or may not have been discussed in an RFC. While an RFC is meant to replace synchronous communication in a distributed environment, an ADR is meant to document an already made decision. An ADR won't come with much of a communication overhead because the discussion was recorded in an RFC or a synchronous discussion. If the consensus came from a synchronous discussion then a short excerpt should be added to the ADR to explain the goals. ## ADR life cycle diff --git a/docs/architecture/adr-050-sign-mode-textual-annex1.md b/docs/architecture/adr-050-sign-mode-textual-annex1.md index ff3acc8c597d..64b143bf5b97 100644 --- a/docs/architecture/adr-050-sign-mode-textual-annex1.md +++ b/docs/architecture/adr-050-sign-mode-textual-annex1.md @@ -272,7 +272,7 @@ Examples: The number 35 was chosen because it is the longest length where the hashed-and-prefixed representation is longer than the original data directly formatted, using the 3 rules above. More specifically: - a 35-byte array will have 70 hex characters, plus 17 space characters, resulting in 87 characters. -- byte arrays starting from length 36 will be be hashed to 32 bytes, which is 64 hex characters plus 15 spaces, and with the `SHA-256=` prefix, it takes 87 characters. +- byte arrays starting from length 36 will be hashed to 32 bytes, which is 64 hex characters plus 15 spaces, and with the `SHA-256=` prefix, it takes 87 characters. Also, secp256k1 public keys have length 33, so their Textual representation is not their hashed value, which we would like to avoid. Note: Data longer than 35 bytes are not rendered in a way that can be inverted. See ADR-050's [section about invertability](./adr-050-sign-mode-textual.md#invertible-rendering) for a discussion. diff --git a/docs/build/building-apps/05-app-testnet.md b/docs/build/building-apps/05-app-testnet.md index c799236872d7..01c1267142d1 100644 --- a/docs/build/building-apps/05-app-testnet.md +++ b/docs/build/building-apps/05-app-testnet.md @@ -195,8 +195,8 @@ Before we can run the testnet we must plug everything together. in `root.go`, in the `initRootCmd` function we add: ```diff - server.AddCommands(rootCmd, simapp.DefaultNodeHome, newApp, createMerlinAppAndExport, addModuleInitFlags) - ++ server.AddTestnetCreatorCommand(rootCmd, simapp.DefaultNodeHome, newTestnetApp, addModuleInitFlags) +server.AddCommands(rootCmd, simapp.DefaultNodeHome, newApp, createMerlinAppAndExport) ++server.AddTestnetCreatorCommand(rootCmd, simapp.DefaultNodeHome, newTestnetApp) ``` Next we will add a newTestnetApp helper function: diff --git a/docs/build/building-modules/05-protobuf-annotations.md b/docs/build/building-modules/05-protobuf-annotations.md index d25f6abcf634..fe212f726b0e 100644 --- a/docs/build/building-modules/05-protobuf-annotations.md +++ b/docs/build/building-modules/05-protobuf-annotations.md @@ -125,3 +125,22 @@ Encoding instructs the amino json marshaler how to encode certain fields that ma ```proto reference https://github.com/cosmos/cosmos-sdk/blob/e8f28bf5db18b8d6b7e0d94b542ce4cf48fed9d6/proto/cosmos/bank/v1beta1/genesis.proto#L23 ``` + +Another example is a protobuf `bytes` that contains a valid JSON document. +The `inline_json` option tells the json marshaler to embed the JSON bytes into the wrapping document without escaping. + +```proto +(amino.encoding) = "inline_json", +``` + +E.g. the bytes containing `{"foo":123}` in the `envelope` field would lead to the following JSON: + +```json +{ + "envelope": { + "foo": 123 + } +} +``` + +If the bytes are not valid JSON, this leads to JSON broken documents. Thus a JSON validity check needs to be in place at some point of the process. diff --git a/docs/rfc/PROCESS.md b/docs/rfc/PROCESS.md index f6e96f16787b..9517868b5568 100644 --- a/docs/rfc/PROCESS.md +++ b/docs/rfc/PROCESS.md @@ -14,7 +14,7 @@ The main difference the Cosmos SDK is defining as a differentiation between RFC ## RFC life cycle -RFC creation is an **iterative** process. An RFC is meant as a distributed colloboration session, it may have many comments and is usually the bi-product of no working group or synchronous communication +RFC creation is an **iterative** process. An RFC is meant as a distributed collaboration session, it may have many comments and is usually the bi-product of no working group or synchronous communication 1. Proposals could start with a new GitHub Issue, be a result of existing Issues or a discussion. diff --git a/docs/spec/SPEC_STANDARD.md b/docs/spec/SPEC_STANDARD.md index f6dc07b852f5..51797dfaf907 100644 --- a/docs/spec/SPEC_STANDARD.md +++ b/docs/spec/SPEC_STANDARD.md @@ -31,7 +31,7 @@ This section should include a motivation sub-section and a definitions sub-secti ### System model and properties -This section should include an assumptions sub-section if any, the mandatory properties sub-section, and a dependencies sub-section. Note that the first two sub-section are are tightly coupled: how to enforce a property will depend directly on the assumptions made. This sub-section is important to capture the interactions of the specified feature with the "rest-of-the-world", i.e., with other features of the ecosystem. +This section should include an assumptions sub-section if any, the mandatory properties sub-section, and a dependencies sub-section. Note that the first two sub-section are tightly coupled: how to enforce a property will depend directly on the assumptions made. This sub-section is important to capture the interactions of the specified feature with the "rest-of-the-world", i.e., with other features of the ecosystem. * *Assumptions* - A list of any assumptions made by the feature designer. It should capture which features are used by the feature under specification, and what do we expect from them. * *Properties* - A list of the desired properties or characteristics of the feature specified, and expected effects or failures when the properties are violated. In case it is relevant, it can also include a list of properties that the feature does not guarantee. diff --git a/errors/go.mod b/errors/go.mod index 3b5938a80445..78f22579af0c 100644 --- a/errors/go.mod +++ b/errors/go.mod @@ -5,18 +5,17 @@ go 1.20 require ( github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.9.0 - google.golang.org/grpc v1.62.1 + google.golang.org/grpc v1.63.2 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/golang/protobuf v1.5.4 // indirect github.com/kr/pretty v0.3.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rogpeppe/go-internal v1.8.1 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/sys v0.17.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sys v0.19.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/errors/go.sum b/errors/go.sum index 24e6b1e83195..85b28b69c8d0 100644 --- a/errors/go.sum +++ b/errors/go.sum @@ -1,8 +1,6 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= -github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -22,15 +20,15 @@ github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XF github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/flake.lock b/flake.lock index add9e6fa014f..d77907f2f43c 100644 --- a/flake.lock +++ b/flake.lock @@ -20,19 +20,19 @@ }, "gomod2nix": { "inputs": { + "flake-utils": [ + "flake-utils" + ], "nixpkgs": [ "nixpkgs" - ], - "utils": [ - "flake-utils" ] }, "locked": { - "lastModified": 1677459247, - "narHash": "sha256-JbakfAiPYmCCV224yAMq/XO0udN5coWv/oazblMKdoY=", + "lastModified": 1710154385, + "narHash": "sha256-4c3zQ2YY4BZOufaBJB4v9VBBeN2dH7iVdoJw8SDNCfI=", "owner": "nix-community", "repo": "gomod2nix", - "rev": "3cbf3a51fe32e2f57af4c52744e7228bab22983d", + "rev": "872b63ddd28f318489c929d25f1f0a3c6039c971", "type": "github" }, "original": { @@ -43,16 +43,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1708682383, - "narHash": "sha256-w8zFWDDRKbf/9PDbkAXrEG+Ehb6K0f5utjfXfti/CHM=", + "lastModified": 1710889954, + "narHash": "sha256-Pr6F5Pmd7JnNEMHHmspZ0qVqIBVxyZ13ik1pJtm2QXk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f305ff3011bbbac55d894a865343a656fe77ee62", + "rev": "7872526e9c5332274ea5932a0c3270d6e4724f3b", "type": "github" }, "original": { "owner": "NixOS", - "ref": "master", + "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index 6ce78209ce3d..bd895939147c 100644 --- a/flake.nix +++ b/flake.nix @@ -1,25 +1,26 @@ { inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/master"; + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; flake-utils.url = "github:numtide/flake-utils"; gomod2nix = { url = "github:nix-community/gomod2nix"; inputs.nixpkgs.follows = "nixpkgs"; - inputs.utils.follows = "flake-utils"; + inputs.flake-utils.follows = "flake-utils"; }; }; - outputs = { self, nixpkgs, gomod2nix, flake-utils }: + outputs = { self, nixpkgs, flake-utils, ... }@inputs: { - overlays.default = self: super: { + overlays.default = self: super: rec { simd = self.callPackage ./simapp { rev = self.shortRev or "dev"; }; + go = simd.go; # to build the tools (e.g. gomod2nix) using the same go version rocksdb = super.rocksdb.overrideAttrs (_: rec { - version = "8.9.1"; + version = "8.11.3"; src = self.fetchFromGitHub { owner = "facebook"; repo = "rocksdb"; rev = "v${version}"; - sha256 = "sha256-Pl7t4FVOvnORWFS+gjy2EEUQlPxjLukWW5I5gzCQwkI="; + sha256 = "sha256-OpEiMwGxZuxb9o3RQuSrwZMQGLhe9xLT1aa3HpI4KPs="; }; }); }; @@ -35,7 +36,7 @@ inherit system; config = { }; overlays = [ - gomod2nix.overlays.default + inputs.gomod2nix.overlays.default self.overlays.default ]; }; @@ -50,11 +51,11 @@ simd = mkApp pkgs.simd; }; devShells = rec { - default = simd; - simd = with pkgs; mkShell { + default = with pkgs; mkShell { buildInputs = [ - go_1_22 # Use Go 1.22 version + simd.go rocksdb + gomod2nix ]; }; }; diff --git a/go.mod b/go.mod index 895c17bbd0ae..f93893a1aac3 100644 --- a/go.mod +++ b/go.mod @@ -11,6 +11,7 @@ require ( cosmossdk.io/log v1.3.1 cosmossdk.io/math v1.3.0 cosmossdk.io/store v1.0.2 + cosmossdk.io/x/accounts v0.0.0-00010101000000-000000000000 cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 cosmossdk.io/x/bank v0.0.0-00010101000000-000000000000 cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 @@ -18,15 +19,15 @@ require ( github.com/99designs/keyring v1.2.2 github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 github.com/cockroachdb/errors v1.11.1 - github.com/cometbft/cometbft v0.38.6 + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 github.com/cosmos/btcutil v1.0.5 github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.4 github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/gogogateway v1.2.0 - github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/gogoproto v1.4.12 github.com/cosmos/ledger-cosmos-go v0.13.3 - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 github.com/google/go-cmp v0.6.0 @@ -45,7 +46,7 @@ require ( github.com/mdp/qrterminal/v3 v3.2.0 github.com/muesli/termenv v0.15.2 github.com/prometheus/client_golang v1.19.0 - github.com/prometheus/common v0.50.0 + github.com/prometheus/common v0.52.2 github.com/rs/zerolog v1.32.0 github.com/spf13/cast v1.6.0 github.com/spf13/cobra v1.8.0 @@ -54,11 +55,11 @@ require ( github.com/stretchr/testify v1.9.0 github.com/tendermint/go-amino v0.16.0 gitlab.com/yawning/secp256k1-voi v0.0.0-20230925100816-f2616030848b - golang.org/x/crypto v0.21.0 + golang.org/x/crypto v0.22.0 golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 - golang.org/x/sync v0.6.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 - google.golang.org/grpc v1.62.1 + golang.org/x/sync v0.7.0 + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de + google.golang.org/grpc v1.63.2 google.golang.org/protobuf v1.33.0 gotest.tools/v3 v3.5.1 pgregory.net/rapid v1.1.0 @@ -68,7 +69,6 @@ require ( require ( buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.32.0-20230509103710-5e5b9fdd0180.1 // indirect buf.build/gen/go/tendermint/tendermint/protocolbuffers/go v1.32.0-20231117195010-33ed361a9051.1 // indirect - cosmossdk.io/x/accounts v0.0.0-00010101000000-000000000000 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/DataDog/datadog-go v4.8.3+incompatible // indirect @@ -125,7 +125,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-runewidth v0.0.14 // indirect @@ -136,7 +136,7 @@ require ( github.com/nxadm/tail v1.4.8 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.0 // indirect github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect @@ -160,13 +160,13 @@ require ( go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.22.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.18.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect diff --git a/go.sum b/go.sum index 57522eaf4005..d3832279849a 100644 --- a/go.sum +++ b/go.sum @@ -121,8 +121,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -144,8 +144,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/cosmos/iavl v1.0.1 h1:D+mYbcRO2wptYzOM1Hxl9cpmmHU1ZEt9T2Wv5nZTeUw= github.com/cosmos/iavl v1.0.1/go.mod h1:8xIUkgVvwvVrBu81scdPty+/Dx9GqwHnAvXz4cwF7RY= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= @@ -167,8 +167,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= @@ -450,8 +450,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= @@ -559,8 +559,8 @@ github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144T github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= @@ -601,8 +601,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= -github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -766,8 +766,8 @@ golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= @@ -822,8 +822,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -837,8 +837,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -896,15 +896,15 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -962,12 +962,12 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -985,8 +985,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/go.work.example b/go.work.example index ab3bf2096a3f..a28ae1c798ac 100644 --- a/go.work.example +++ b/go.work.example @@ -38,5 +38,6 @@ use ( ./x/staking ./x/tx ./x/upgrade + ./x/epochs ./x/accounts/defaults/lockup ) diff --git a/orm/go.mod b/orm/go.mod index 69c05a4f41b8..2e0cd499cd30 100644 --- a/orm/go.mod +++ b/orm/go.mod @@ -12,10 +12,10 @@ require ( github.com/golang/mock v1.6.0 github.com/google/go-cmp v0.6.0 github.com/iancoleman/strcase v0.3.0 - github.com/regen-network/gocuke v1.1.0 + github.com/regen-network/gocuke v1.1.1 github.com/stretchr/testify v1.9.0 golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 - google.golang.org/grpc v1.62.1 + google.golang.org/grpc v1.63.2 google.golang.org/protobuf v1.33.0 gotest.tools/v3 v3.5.1 pgregory.net/rapid v1.1.0 @@ -32,39 +32,37 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cosmos/gogoproto v1.4.11 // indirect - github.com/cucumber/common/messages/go/v19 v19.1.2 // indirect - github.com/cucumber/gherkin/go/v26 v26.2.0 // indirect - github.com/cucumber/messages/go/v21 v21.0.1 // indirect - github.com/cucumber/tag-expressions/go/v5 v5.0.6 // indirect + github.com/cosmos/gogoproto v1.4.12 // indirect + github.com/cucumber/gherkin/go/v27 v27.0.0 // indirect + 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.1 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/gofrs/uuid v4.4.0+incompatible // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.1.2 // indirect github.com/klauspost/compress v1.17.7 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/onsi/gomega v1.20.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.50.0 // indirect + github.com/prometheus/common v0.52.2 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/spf13/cast v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect - golang.org/x/net v0.22.0 // indirect - golang.org/x/sys v0.18.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect gopkg.in/yaml.v3 v3.0.1 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) diff --git a/orm/go.sum b/orm/go.sum index de6d487869be..738c7a92d6a0 100644 --- a/orm/go.sum +++ b/orm/go.sum @@ -33,17 +33,15 @@ github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAK github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU= github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cucumber/common/messages/go/v19 v19.1.2 h1:8/ZkW9rj3KQo/regmI8kcy48tk57m427Olb7Y0lXcN4= -github.com/cucumber/common/messages/go/v19 v19.1.2/go.mod h1:0KLDvMVmmkEZcWUSKxFHSUSLS1gjujBbPN0p41IwwJ4= -github.com/cucumber/gherkin/go/v26 v26.2.0 h1:EgIjePLWiPeslwIWmNQ3XHcypPsWAHoMCz/YEBKP4GI= -github.com/cucumber/gherkin/go/v26 v26.2.0/go.mod h1:t2GAPnB8maCT4lkHL99BDCVNzCh1d7dBhCLt150Nr/0= -github.com/cucumber/messages/go/v21 v21.0.1 h1:wzA0LxwjlWQYZd32VTlAVDTkW6inOFmSM+RuOwHZiMI= -github.com/cucumber/messages/go/v21 v21.0.1/go.mod h1:zheH/2HS9JLVFukdrsPWoPdmUtmYQAQPLk7w5vWsk5s= -github.com/cucumber/tag-expressions/go/v5 v5.0.6 h1:F0mqsu69cG/3MTTZqy+PlaPcU/MMl936OJjxKgdFgWs= -github.com/cucumber/tag-expressions/go/v5 v5.0.6/go.mod h1:/sHRc0Vt+pPjgQdNZjH8W2cnmb+tiVYp19VESzpGQsw= +github.com/cucumber/gherkin/go/v27 v27.0.0 h1:waJh5eeq7rrKn5Gf3/FI4G34ypduPRaV8e370dnupDI= +github.com/cucumber/gherkin/go/v27 v27.0.0/go.mod h1:2JxwYskO0sO4kumc/Nv1g6bMncT5w0lShuKZnmUIhhk= +github.com/cucumber/messages/go/v22 v22.0.0 h1:hk3ITpEWQ+KWDe619zYcqtaLOfcu9jgClSeps3DlNWI= +github.com/cucumber/messages/go/v22 v22.0.0/go.mod h1:aZipXTKc0JnjCsXrJnuZpWhtay93k7Rn3Dee7iyPJjs= +github.com/cucumber/tag-expressions/go/v6 v6.1.0 h1:YOhnlISh/lyPZrLojFbJVzocv7TGhzOhB9aULN8A7Sg= +github.com/cucumber/tag-expressions/go/v6 v6.1.0/go.mod h1:6scGHUy3RLnbNq8un7XNoopF2qR/0RMgqolQH/TkycY= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -59,7 +57,6 @@ github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -75,8 +72,6 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= -github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= @@ -103,8 +98,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= @@ -131,23 +126,20 @@ github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7km github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= -github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= -github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= -github.com/regen-network/gocuke v1.1.0 h1:gxlkRTfpR9gJ0mwqQZIpoXHZGx+KPshKQpKE0jtUH5s= -github.com/regen-network/gocuke v1.1.0/go.mod h1:nVBO9DEnZNUB/GjmJgAIojKxcEu9a0EZwry0qKW24Mk= +github.com/regen-network/gocuke v1.1.1 h1:13D3n5xLbpzA/J2ELHC9jXYq0+XyEr64A3ehjvfmBbE= +github.com/regen-network/gocuke v1.1.1/go.mod h1:Nl9EbhLmTzdLqb52fr/Fvf8LcoVuTjjf8FlLmXz1zHo= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= -github.com/stretchr/testify v1.7.4/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= @@ -173,8 +165,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/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= @@ -201,8 +193,8 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc 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.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.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= @@ -222,14 +214,14 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -250,7 +242,6 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= diff --git a/proto/buf.gen.gogo.yaml b/proto/buf.gen.gogo.yaml index e3cd0b1acb5a..820d0b5bd29a 100644 --- a/proto/buf.gen.gogo.yaml +++ b/proto/buf.gen.gogo.yaml @@ -2,7 +2,7 @@ version: v1 plugins: - name: gocosmos out: .. - opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types,Mcosmos/orm/v1/orm.proto=cosmossdk.io/orm + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any,Mcosmos/orm/v1/orm.proto=cosmossdk.io/orm - name: grpc-gateway out: .. opt: logtostderr=true,allow_colon_final_segments=true diff --git a/proto/buf.lock b/proto/buf.lock index 6ea1b634f7b0..80de36dcab73 100644 --- a/proto/buf.lock +++ b/proto/buf.lock @@ -14,8 +14,8 @@ deps: - remote: buf.build owner: googleapis repository: googleapis - commit: 7e6f6e774e29406da95bd61cdcdbc8bc - digest: shake256:fe43dd2265ea0c07d76bd925eeba612667cf4c948d2ce53d6e367e1b4b3cb5fa69a51e6acb1a6a50d32f894f054a35e6c0406f6808a483f2752e10c866ffbf73 + commit: 7a6bc1e3207144b38e9066861e1de0ff + digest: shake256:d646836485c34192401253703c4e7ce899c826fceec060bf4b2a62c4749bd9976dc960833e134a1f814725e1ffd60b1bb3cf0335a7e99ef0e8cec34b070ffb66 - remote: buf.build owner: protocolbuffers repository: wellknowntypes diff --git a/runtime/app.go b/runtime/app.go index ced302636a9e..6ea1b4075bea 100644 --- a/runtime/app.go +++ b/runtime/app.go @@ -68,7 +68,9 @@ func (a *App) RegisterModules(modules ...module.AppModule) error { } a.ModuleManager.Modules[name] = appModule - appModule.RegisterInterfaces(a.interfaceRegistry) + if mod, ok := appModule.(appmodule.HasRegisterInterfaces); ok { + mod.RegisterInterfaces(a.interfaceRegistry) + } if mod, ok := appModule.(module.HasAminoCodec); ok { mod.RegisterLegacyAminoCodec(a.amino) diff --git a/runtime/autocli.go b/runtime/autocli.go deleted file mode 100644 index a942a3bee2fa..000000000000 --- a/runtime/autocli.go +++ /dev/null @@ -1,33 +0,0 @@ -package runtime - -import ( - autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" -) - -func (m appModule) AutoCLIOptions() *autocliv1.ModuleOptions { - return &autocliv1.ModuleOptions{ - Query: &autocliv1.ServiceCommandDescriptor{ - SubCommands: map[string]*autocliv1.ServiceCommandDescriptor{ - "autocli": { - Service: autocliv1.Query_ServiceDesc.ServiceName, - RpcCommandOptions: []*autocliv1.RpcCommandOptions{ - { - RpcMethod: "AppOptions", - Short: "Query the custom autocli options", - }, - }, - }, - "reflection": { - Service: reflectionv1.ReflectionService_ServiceDesc.ServiceName, - RpcCommandOptions: []*autocliv1.RpcCommandOptions{ - { - RpcMethod: "FileDescriptors", - Short: "Query the app's protobuf file descriptors", - }, - }, - }, - }, - }, - } -} diff --git a/runtime/environment.go b/runtime/environment.go index 38500ecb6b35..6fce64b35dec 100644 --- a/runtime/environment.go +++ b/runtime/environment.go @@ -17,12 +17,13 @@ func NewEnvironment( opts ...EnvOption, ) appmodule.Environment { env := appmodule.Environment{ - Logger: logger, - EventService: EventService{}, - HeaderService: HeaderService{}, - BranchService: BranchService{}, - GasService: GasService{}, - KVStoreService: kvService, + Logger: logger, + EventService: EventService{}, + HeaderService: HeaderService{}, + BranchService: BranchService{}, + GasService: GasService{}, + TransactionService: TransactionService{}, + KVStoreService: kvService, } for _, opt := range opts { diff --git a/runtime/module.go b/runtime/module.go index 41b6b55318d0..65a3ddcf4ec2 100644 --- a/runtime/module.go +++ b/runtime/module.go @@ -11,6 +11,8 @@ import ( runtimev1alpha1 "cosmossdk.io/api/cosmos/app/runtime/v1alpha1" appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1" + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" stakingmodulev1 "cosmossdk.io/api/cosmos/staking/module/v1" "cosmossdk.io/core/address" "cosmossdk.io/core/appmodule" @@ -31,10 +33,14 @@ import ( "github.com/cosmos/cosmos-sdk/types/msgservice" ) +// appModule defines runtime as an AppModule type appModule struct { app *App } +func (m appModule) IsOnePerModuleType() {} +func (m appModule) IsAppModule() {} + func (m appModule) RegisterServices(configurator module.Configurator) { // nolint:staticcheck // SA1019: Configurator is deprecated but still used in runtime v1. err := m.app.registerRuntimeServices(configurator) if err != nil { @@ -42,8 +48,32 @@ func (m appModule) RegisterServices(configurator module.Configurator) { // nolin } } -func (m appModule) IsOnePerModuleType() {} -func (m appModule) IsAppModule() {} +func (m appModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + SubCommands: map[string]*autocliv1.ServiceCommandDescriptor{ + "autocli": { + Service: autocliv1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "AppOptions", + Short: "Query the custom autocli options", + }, + }, + }, + "reflection": { + Service: reflectionv1.ReflectionService_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "FileDescriptors", + Short: "Query the app's protobuf file descriptors", + }, + }, + }, + }, + }, + } +} var ( _ appmodule.AppModule = appModule{} diff --git a/runtime/transaction.go b/runtime/transaction.go new file mode 100644 index 000000000000..27b4734661d1 --- /dev/null +++ b/runtime/transaction.go @@ -0,0 +1,19 @@ +package runtime + +import ( + "context" + + "cosmossdk.io/core/transaction" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var _ transaction.Service = TransactionService{} + +type TransactionService struct{} + +// ExecMode implements transaction.Service. +func (t TransactionService) ExecMode(ctx context.Context) transaction.ExecMode { + sdkCtx := sdk.UnwrapSDKContext(ctx) + return transaction.ExecMode(sdkCtx.ExecMode()) +} diff --git a/scripts/go-mod-tidy-all.sh b/scripts/go-mod-tidy-all.sh index 0f4e655bcddf..41b020217b77 100755 --- a/scripts/go-mod-tidy-all.sh +++ b/scripts/go-mod-tidy-all.sh @@ -8,10 +8,18 @@ for modfile in $(find . -name go.mod); do (cd $DIR; go mod tidy) done -if ! command -v gomod2nix &> /dev/null +# update gomod2nix.toml for simapp +# NOTE: gomod2nix should be built using the same go version as the project, the nix flake will make sure of that +# automatically. +cd simapp +if command -v nix &> /dev/null then - echo "gomod2nix could not be found in PATH, installing..." - go install github.com/nix-community/gomod2nix@latest + nix develop .. -c gomod2nix + + if ! command -v gomod2nix &> /dev/null + then + echo "gomod2nix could not be found in PATH, installing..." + go install github.com/nix-community/gomod2nix@latest + fi + gomod2nix fi -# update gomod2nix.toml for simapp -cd simapp; gomod2nix diff --git a/server/api/server_test.go b/server/api/server_test.go index 1dbc7e6677cb..d867678883aa 100644 --- a/server/api/server_test.go +++ b/server/api/server_test.go @@ -18,6 +18,7 @@ import ( "github.com/stretchr/testify/suite" "google.golang.org/grpc/codes" + _ "cosmossdk.io/x/accounts" _ "cosmossdk.io/x/auth" _ "cosmossdk.io/x/auth/tx/config" _ "cosmossdk.io/x/bank" diff --git a/server/cmt_cmds.go b/server/cmt_cmds.go index a565ebfa831b..5416e5ee964d 100644 --- a/server/cmt_cmds.go +++ b/server/cmt_cmds.go @@ -381,7 +381,7 @@ func BootstrapStateCmd[T types.Application](appCreator types.AppCreator[T]) *cob height = app.CommitMultiStore().LastCommitID().Version } - return node.BootstrapState(cmd.Context(), cfg, cmtcfg.DefaultDBProvider, uint64(height), nil) + return node.BootstrapStateWithGenProvider(cmd.Context(), cfg, cmtcfg.DefaultDBProvider, getGenDocProvider(cfg), uint64(height), nil) }, } diff --git a/server/config/config.go b/server/config/config.go index f3e5b04913bf..9099fdb3e5bc 100644 --- a/server/config/config.go +++ b/server/config/config.go @@ -263,7 +263,7 @@ func DefaultConfig() *Config { }, }, Mempool: MempoolConfig{ - MaxTxs: 5_000, + MaxTxs: -1, }, } } diff --git a/server/config/toml.go b/server/config/toml.go index f06ece5071f8..016cd36643e4 100644 --- a/server/config/toml.go +++ b/server/config/toml.go @@ -240,7 +240,7 @@ stop-node-on-err = {{ .Streaming.ABCI.StopNodeOnErr }} [mempool] # Setting max-txs to 0 will allow for a unbounded amount of transactions in the mempool. -# Setting max_txs to negative 1 (-1) will disable transactions from being inserted into the mempool. +# Setting max_txs to negative 1 (-1) will disable transactions from being inserted into the mempool (no-op mempool). # Setting max_txs to a positive number (> 0) will limit the number of transactions in the mempool, by the specified amount. # # Note, this configuration only applies to SDK built-in app-side mempool diff --git a/server/start.go b/server/start.go index 85d0fca57a8c..4c2d39022053 100644 --- a/server/start.go +++ b/server/start.go @@ -124,6 +124,8 @@ type StartCmdOptions[T types.Application] struct { PostSetupStandalone func(app T, svrCtx *Context, clientCtx client.Context, ctx context.Context, g *errgroup.Group) error // AddFlags add custom flags to start cmd AddFlags func(cmd *cobra.Command) + // StartCommandHanlder can be used to customize the start command handler + StartCommandHandler func(svrCtx *Context, clientCtx client.Context, appCreator types.AppCreator[T], inProcessConsensus bool, opts StartCmdOptions[T]) error } // StartCmd runs the service passed in, either stand-alone or in-process with @@ -139,6 +141,10 @@ func StartCmdWithOptions[T types.Application](appCreator types.AppCreator[T], op opts.DBOpener = OpenDB } + if opts.StartCommandHandler == nil { + opts.StartCommandHandler = start + } + cmd := &cobra.Command{ Use: "start", Short: "Run the full node", @@ -187,7 +193,7 @@ is performed. Note, when enabled, gRPC will also be automatically enabled. } err = wrapCPUProfile(serverCtx, func() error { - return start(serverCtx, clientCtx, appCreator, withCMT, opts) + return opts.StartCommandHandler(serverCtx, clientCtx, appCreator, withCMT, opts) }) serverCtx.Logger.Debug("received quit signal") @@ -270,10 +276,7 @@ func startStandAlone[T types.Application](svrCtx *Context, svrCfg serverconfig.C return err } - cmtCfg := svrCtx.Config - home := cmtCfg.RootDir - - err = startAPIServer(ctx, g, cmtCfg, svrCfg, clientCtx, svrCtx, app, home, grpcSrv, metrics) + err = startAPIServer(ctx, g, svrCfg, clientCtx, svrCtx, app, svrCtx.Config.RootDir, grpcSrv, metrics) if err != nil { return err } @@ -304,8 +307,6 @@ func startInProcess[T types.Application](svrCtx *Context, svrCfg serverconfig.Co metrics *telemetry.Metrics, opts StartCmdOptions[T], ) error { cmtCfg := svrCtx.Config - home := cmtCfg.RootDir - gRPCOnly := svrCtx.Viper.GetBool(flagGRPCOnly) g, ctx := getCtx(svrCtx, true) @@ -341,7 +342,7 @@ func startInProcess[T types.Application](svrCtx *Context, svrCfg serverconfig.Co return err } - err = startAPIServer(ctx, g, cmtCfg, svrCfg, clientCtx, svrCtx, app, home, grpcSrv, metrics) + err = startAPIServer(ctx, g, svrCfg, clientCtx, svrCtx, app, cmtCfg.RootDir, grpcSrv, metrics) if err != nil { return err } @@ -472,7 +473,7 @@ func startGrpcServer( } // if gRPC is enabled, configure gRPC client for gRPC gateway - grpcClient, err := grpc.Dial( + grpcClient, err := grpc.NewClient( config.Address, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithDefaultCallOptions( @@ -504,7 +505,6 @@ func startGrpcServer( func startAPIServer( ctx context.Context, g *errgroup.Group, - cmtCfg *cmtcfg.Config, svrCfg serverconfig.Config, clientCtx client.Context, svrCtx *Context, @@ -533,10 +533,6 @@ func startAPIServer( } func startTelemetry(cfg serverconfig.Config) (*telemetry.Metrics, error) { - if !cfg.Telemetry.Enabled { - return nil, nil - } - return telemetry.New(cfg.Telemetry) } @@ -612,7 +608,7 @@ func startApp[T types.Application](svrCtx *Context, appCreator types.AppCreator[ if isTestnet, ok := svrCtx.Viper.Get(KeyIsTestnet).(bool); ok && isTestnet { var appPtr *T - appPtr, err = testnetify[T](svrCtx, home, appCreator, db, traceWriter) + appPtr, err = testnetify[T](svrCtx, appCreator, db, traceWriter) if err != nil { return app, traceCleanupFn, err } @@ -639,6 +635,10 @@ func InPlaceTestnetCreator[T types.Application](testnetAppCreator types.AppCreat opts.DBOpener = OpenDB } + if opts.StartCommandHandler == nil { + opts.StartCommandHandler = start + } + cmd := &cobra.Command{ Use: "in-place-testnet [newChainID] [newOperatorAddress]", Short: "Create and start a testnet from current local state", @@ -703,7 +703,7 @@ you want to test the upgrade handler itself. serverCtx.Viper.Set(KeyNewOpAddr, newOperatorAddress) err = wrapCPUProfile(serverCtx, func() error { - return start(serverCtx, clientCtx, testnetAppCreator, withCMT, opts) + return opts.StartCommandHandler(serverCtx, clientCtx, testnetAppCreator, withCMT, opts) }) serverCtx.Logger.Debug("received quit signal") @@ -726,7 +726,7 @@ you want to test the upgrade handler itself. // testnetify modifies both state and blockStore, allowing the provided operator address and local validator key to control the network // that the state in the data folder represents. The chainID of the local genesis file is modified to match the provided chainID. -func testnetify[T types.Application](ctx *Context, home string, testnetAppCreator types.AppCreator[T], db dbm.DB, traceWriter io.WriteCloser) (*T, error) { +func testnetify[T types.Application](ctx *Context, testnetAppCreator types.AppCreator[T], db dbm.DB, traceWriter io.WriteCloser) (*T, error) { config := ctx.Config newChainID, ok := ctx.Viper.Get(KeyNewChainID).(string) @@ -772,9 +772,6 @@ func testnetify[T types.Application](ctx *Context, home string, testnetAppCreato return nil, err } validatorAddress := userPubKey.Address() - if err != nil { - return nil, err - } stateStore := sm.NewStore(stateDB, sm.StoreOptions{ DiscardABCIResponses: config.Storage.DiscardABCIResponses, diff --git a/server/types/app.go b/server/types/app.go index 8d73f69e13f1..8a0944afca05 100644 --- a/server/types/app.go +++ b/server/types/app.go @@ -8,7 +8,6 @@ import ( cmttypes "github.com/cometbft/cometbft/types" dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/gogoproto/grpc" - "github.com/spf13/cobra" "cosmossdk.io/log" "cosmossdk.io/store/snapshots" @@ -68,9 +67,6 @@ type ( // application using various configurations. AppCreator[T Application] func(log.Logger, dbm.DB, io.Writer, AppOptions) T - // ModuleInitFlags takes a start command and adds modules specific init flags. - ModuleInitFlags func(startCmd *cobra.Command) - // ExportedApp represents an exported app state, along with // validators, consensus params and latest app height. ExportedApp struct { diff --git a/server/util.go b/server/util.go index de48b0bad343..4262c288afd5 100644 --- a/server/util.go +++ b/server/util.go @@ -324,7 +324,7 @@ func interceptConfigs(rootViper *viper.Viper, customAppTemplate string, customCo } // AddCommands add server commands -func AddCommands[T types.Application](rootCmd *cobra.Command, appCreator types.AppCreator[T], addStartFlags types.ModuleInitFlags) { +func AddCommands[T types.Application](rootCmd *cobra.Command, appCreator types.AppCreator[T], opts StartCmdOptions[T]) { cometCmd := &cobra.Command{ Use: "comet", Aliases: []string{"cometbft", "tendermint"}, @@ -341,11 +341,7 @@ func AddCommands[T types.Application](rootCmd *cobra.Command, appCreator types.A BootstrapStateCmd(appCreator), ) - startCmd := StartCmd(appCreator) - if addStartFlags != nil { - addStartFlags(startCmd) - } - + startCmd := StartCmdWithOptions(appCreator, opts) rootCmd.AddCommand( startCmd, cometCmd, @@ -354,10 +350,15 @@ func AddCommands[T types.Application](rootCmd *cobra.Command, appCreator types.A ) } +// AddCommandsWithStartCmdOptions adds server commands with the provided StartCmdOptions. +// Deprecated: Use AddCommands directly instead. +func AddCommandsWithStartCmdOptions[T types.Application](rootCmd *cobra.Command, appCreator types.AppCreator[T], opts StartCmdOptions[T]) { + AddCommands(rootCmd, appCreator, opts) +} + // AddTestnetCreatorCommand allows chains to create a testnet from the state existing in their node's data directory. -func AddTestnetCreatorCommand[T types.Application](rootCmd *cobra.Command, appCreator types.AppCreator[T], addStartFlags types.ModuleInitFlags) { +func AddTestnetCreatorCommand[T types.Application](rootCmd *cobra.Command, appCreator types.AppCreator[T]) { testnetCreateCmd := InPlaceTestnetCreator(appCreator) - addStartFlags(testnetCreateCmd) rootCmd.AddCommand(testnetCreateCmd) } diff --git a/simapp/ante.go b/simapp/ante.go index 8fde65c79aee..713c342b8bcf 100644 --- a/simapp/ante.go +++ b/simapp/ante.go @@ -37,9 +37,9 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first circuitante.NewCircuitBreakerDecorator(options.CircuitKeeper), ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker), - ante.NewValidateBasicDecorator(), + ante.NewValidateBasicDecorator(options.AccountKeeper.Environment()), ante.NewTxTimeoutHeightDecorator(), - ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxUnOrderedTTL, options.TxManager), + ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxUnOrderedTTL, options.TxManager, options.AccountKeeper.Environment()), ante.NewValidateMemoDecorator(options.AccountKeeper), ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper), ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.TxFeeChecker), diff --git a/simapp/app.go b/simapp/app.go index 471c901f2d16..ea359a1a1ddb 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -6,6 +6,7 @@ import ( "encoding/json" "fmt" "io" + "maps" "os" "path/filepath" @@ -22,7 +23,7 @@ import ( "cosmossdk.io/x/accounts" "cosmossdk.io/x/accounts/accountstd" baseaccount "cosmossdk.io/x/accounts/defaults/base" - lockup "cosmossdk.io/x/accounts/lockup" + lockup "cosmossdk.io/x/accounts/defaults/lockup" "cosmossdk.io/x/accounts/testing/account_abstraction" "cosmossdk.io/x/accounts/testing/counter" "cosmossdk.io/x/auth" @@ -49,6 +50,9 @@ import ( distr "cosmossdk.io/x/distribution" distrkeeper "cosmossdk.io/x/distribution/keeper" distrtypes "cosmossdk.io/x/distribution/types" + "cosmossdk.io/x/epochs" + epochskeeper "cosmossdk.io/x/epochs/keeper" + epochstypes "cosmossdk.io/x/epochs/types" "cosmossdk.io/x/evidence" evidencekeeper "cosmossdk.io/x/evidence/keeper" evidencetypes "cosmossdk.io/x/evidence/types" @@ -166,6 +170,7 @@ type SimApp struct { ConsensusParamsKeeper consensusparamkeeper.Keeper CircuitKeeper circuitkeeper.Keeper PoolKeeper poolkeeper.Keeper + EpochsKeeper epochskeeper.Keeper // managers ModuleManager *module.Manager @@ -258,7 +263,7 @@ func NewSimApp( govtypes.StoreKey, consensusparamtypes.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey, evidencetypes.StoreKey, circuittypes.StoreKey, authzkeeper.StoreKey, nftkeeper.StoreKey, group.StoreKey, pooltypes.StoreKey, - accounts.StoreKey, + accounts.StoreKey, epochstypes.StoreKey, ) // register streaming services @@ -284,7 +289,6 @@ func NewSimApp( appCodec, runtime.NewEnvironment(runtime.NewKVStoreService(keys[accounts.StoreKey]), logger), signingCtx.AddressCodec(), - appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter(), appCodec.InterfaceRegistry(), @@ -304,7 +308,7 @@ func NewSimApp( } app.AccountsKeeper = accountsKeeper - app.AuthKeeper = authkeeper.NewAccountKeeper(runtime.NewEnvironment(runtime.NewKVStoreService(keys[authtypes.StoreKey]), logger), appCodec, authtypes.ProtoBaseAccount, maccPerms, signingCtx.AddressCodec(), sdk.Bech32MainPrefix, authtypes.NewModuleAddress(govtypes.ModuleName).String()) + app.AuthKeeper = authkeeper.NewAccountKeeper(runtime.NewEnvironment(runtime.NewKVStoreService(keys[authtypes.StoreKey]), logger), appCodec, authtypes.ProtoBaseAccount, accountsKeeper, maccPerms, signingCtx.AddressCodec(), sdk.Bech32MainPrefix, authtypes.NewModuleAddress(govtypes.ModuleName).String()) app.BankKeeper = bankkeeper.NewBaseKeeper( runtime.NewEnvironment(runtime.NewKVStoreService(keys[banktypes.StoreKey]), logger), @@ -408,6 +412,17 @@ func NewSimApp( // If evidence needs to be handled for the app, set routes in router here and seal app.EvidenceKeeper = *evidenceKeeper + app.EpochsKeeper = epochskeeper.NewKeeper( + runtime.NewEnvironment(runtime.NewKVStoreService(keys[epochstypes.StoreKey]), logger), + appCodec, + ) + + app.EpochsKeeper.SetHooks( + epochstypes.NewMultiEpochHooks( + // insert epoch hooks receivers here + ), + ) + /**** Module Options ****/ // NOTE: Any module instantiated in the module manager that is later modified @@ -415,7 +430,7 @@ func NewSimApp( app.ModuleManager = module.NewManager( genutil.NewAppModule(appCodec, app.AuthKeeper, app.StakingKeeper, app, txConfig, genutiltypes.DefaultMessageValidator), accounts.NewAppModule(appCodec, app.AccountsKeeper), - auth.NewAppModule(appCodec, app.AuthKeeper, authsims.RandomGenesisAccounts), + auth.NewAppModule(appCodec, app.AuthKeeper, app.AccountsKeeper, authsims.RandomGenesisAccounts), vesting.NewAppModule(app.AuthKeeper, app.BankKeeper), bank.NewAppModule(appCodec, app.BankKeeper, app.AuthKeeper), feegrantmodule.NewAppModule(appCodec, app.AuthKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), @@ -432,6 +447,7 @@ func NewSimApp( consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper), circuit.NewAppModule(appCodec, app.CircuitKeeper), protocolpool.NewAppModule(appCodec, app.PoolKeeper, app.AuthKeeper, app.BankKeeper), + epochs.NewAppModule(appCodec, app.EpochsKeeper), ) app.ModuleManager.RegisterLegacyAminoCodec(legacyAmino) app.ModuleManager.RegisterInterfaces(interfaceRegistry) @@ -452,6 +468,7 @@ func NewSimApp( stakingtypes.ModuleName, genutiltypes.ModuleName, authz.ModuleName, + epochstypes.ModuleName, ) app.ModuleManager.SetOrderEndBlockers( govtypes.ModuleName, @@ -471,6 +488,7 @@ func NewSimApp( minttypes.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, authz.ModuleName, feegrant.ModuleName, nft.ModuleName, group.ModuleName, upgradetypes.ModuleName, vestingtypes.ModuleName, consensusparamtypes.ModuleName, circuittypes.ModuleName, pooltypes.ModuleName, + epochstypes.ModuleName, } app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...) app.ModuleManager.SetOrderExportGenesis(genesisModuleOrder...) @@ -504,7 +522,7 @@ func NewSimApp( // NOTE: this is not required apps that don't use the simulator for fuzz testing // transactions overrideModules := map[string]module.AppModuleSimulation{ - authtypes.ModuleName: auth.NewAppModule(app.appCodec, app.AuthKeeper, authsims.RandomGenesisAccounts), + authtypes.ModuleName: auth.NewAppModule(app.appCodec, app.AuthKeeper, app.AccountsKeeper, authsims.RandomGenesisAccounts), } app.sm = module.NewSimulationManagerFromAppModules(app.ModuleManager.Modules, overrideModules) @@ -764,12 +782,7 @@ func (app *SimApp) RegisterNodeService(clientCtx client.Context, cfg config.Conf // // NOTE: This is solely to be used for testing purposes. func GetMaccPerms() map[string][]string { - dupMaccPerms := make(map[string][]string) - for k, v := range maccPerms { - dupMaccPerms[k] = v - } - - return dupMaccPerms + return maps.Clone(maccPerms) } // BlockedAddresses returns all the app's blocked account addresses. diff --git a/simapp/app_config.go b/simapp/app_config.go index 2208330f8ee1..1ac042beaa76 100644 --- a/simapp/app_config.go +++ b/simapp/app_config.go @@ -6,6 +6,7 @@ import ( "google.golang.org/protobuf/types/known/durationpb" + accountsmodulev1 "cosmossdk.io/api/cosmos/accounts/module/v1" runtimev1alpha1 "cosmossdk.io/api/cosmos/app/runtime/v1alpha1" appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1" @@ -14,6 +15,7 @@ import ( circuitmodulev1 "cosmossdk.io/api/cosmos/circuit/module/v1" consensusmodulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" distrmodulev1 "cosmossdk.io/api/cosmos/distribution/module/v1" + epochsmodulev1 "cosmossdk.io/api/cosmos/epochs/module/v1" evidencemodulev1 "cosmossdk.io/api/cosmos/evidence/module/v1" feegrantmodulev1 "cosmossdk.io/api/cosmos/feegrant/module/v1" genutilmodulev1 "cosmossdk.io/api/cosmos/genutil/module/v1" @@ -28,6 +30,8 @@ import ( upgrademodulev1 "cosmossdk.io/api/cosmos/upgrade/module/v1" vestingmodulev1 "cosmossdk.io/api/cosmos/vesting/module/v1" "cosmossdk.io/depinject/appconfig" + "cosmossdk.io/x/accounts" + _ "cosmossdk.io/x/accounts" // import for side-effects _ "cosmossdk.io/x/auth/tx/config" // import for side-effects authtypes "cosmossdk.io/x/auth/types" _ "cosmossdk.io/x/auth/vesting" // import for side-effects @@ -40,6 +44,8 @@ import ( circuittypes "cosmossdk.io/x/circuit/types" _ "cosmossdk.io/x/distribution" // import for side-effects distrtypes "cosmossdk.io/x/distribution/types" + _ "cosmossdk.io/x/epochs" // import for side-effects + epochstypes "cosmossdk.io/x/epochs/types" _ "cosmossdk.io/x/evidence" // import for side-effects evidencetypes "cosmossdk.io/x/evidence/types" "cosmossdk.io/x/feegrant" @@ -116,6 +122,7 @@ var ( evidencetypes.ModuleName, stakingtypes.ModuleName, authz.ModuleName, + epochstypes.ModuleName, }, EndBlockers: []string{ govtypes.ModuleName, @@ -134,6 +141,7 @@ var ( // properly initialized with tokens from genesis accounts. // NOTE: The genutils module must also occur after auth so that it can access the params from auth. InitGenesis: []string{ + accounts.ModuleName, authtypes.ModuleName, banktypes.ModuleName, distrtypes.ModuleName, @@ -151,6 +159,7 @@ var ( vestingtypes.ModuleName, circuittypes.ModuleName, pooltypes.ModuleName, + epochstypes.ModuleName, }, // When ExportGenesis is not specified, the export genesis module order // is equal to the init genesis order @@ -193,8 +202,10 @@ var ( Config: appconfig.WrapAny(&slashingmodulev1.Module{}), }, { - Name: "tx", - Config: appconfig.WrapAny(&txconfigv1.Config{}), + Name: "tx", + Config: appconfig.WrapAny(&txconfigv1.Config{ + SkipAnteHandler: true, // SimApp is using non default AnteHandler such as circuit and unorderedtx decorators + }), }, { Name: genutiltypes.ModuleName, @@ -251,6 +262,14 @@ var ( Name: pooltypes.ModuleName, Config: appconfig.WrapAny(&poolmodulev1.Module{}), }, + { + Name: accounts.ModuleName, + Config: appconfig.WrapAny(&accountsmodulev1.Module{}), + }, + { + Name: epochstypes.ModuleName, + Config: appconfig.WrapAny(&epochsmodulev1.Module{}), + }, }, }) ) diff --git a/simapp/app_di.go b/simapp/app_di.go index 25d2c78ff3c7..2630778ebbc2 100644 --- a/simapp/app_di.go +++ b/simapp/app_di.go @@ -15,7 +15,9 @@ import ( "cosmossdk.io/depinject" "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" + "cosmossdk.io/x/accounts" "cosmossdk.io/x/auth" + "cosmossdk.io/x/auth/ante" "cosmossdk.io/x/auth/ante/unorderedtx" authkeeper "cosmossdk.io/x/auth/keeper" authsims "cosmossdk.io/x/auth/simulation" @@ -24,6 +26,7 @@ import ( bankkeeper "cosmossdk.io/x/bank/keeper" circuitkeeper "cosmossdk.io/x/circuit/keeper" distrkeeper "cosmossdk.io/x/distribution/keeper" + epochskeeper "cosmossdk.io/x/epochs/keeper" evidencekeeper "cosmossdk.io/x/evidence/keeper" feegrantkeeper "cosmossdk.io/x/feegrant/keeper" govkeeper "cosmossdk.io/x/gov/keeper" @@ -72,6 +75,7 @@ type SimApp struct { UnorderedTxManager *unorderedtx.Manager // keepers + AccountsKeeper accounts.Keeper AuthKeeper authkeeper.AccountKeeper BankKeeper bankkeeper.Keeper StakingKeeper *stakingkeeper.Keeper @@ -88,6 +92,7 @@ type SimApp struct { ConsensusParamsKeeper consensuskeeper.Keeper CircuitBreakerKeeper circuitkeeper.Keeper PoolKeeper poolkeeper.Keeper + EpochsKeeper epochskeeper.Keeper // simulation manager sm *module.SimulationManager @@ -181,6 +186,7 @@ func NewSimApp( &app.txConfig, &app.interfaceRegistry, &app.AuthKeeper, + &app.AccountsKeeper, &app.BankKeeper, &app.StakingKeeper, &app.SlashingKeeper, @@ -196,6 +202,7 @@ func NewSimApp( &app.ConsensusParamsKeeper, &app.CircuitBreakerKeeper, &app.PoolKeeper, + &app.EpochsKeeper, ); err != nil { panic(err) } @@ -253,7 +260,7 @@ func NewSimApp( // NOTE: this is not required apps that don't use the simulator for fuzz testing // transactions overrideModules := map[string]module.AppModuleSimulation{ - authtypes.ModuleName: auth.NewAppModule(app.appCodec, app.AuthKeeper, authsims.RandomGenesisAccounts), + authtypes.ModuleName: auth.NewAppModule(app.appCodec, app.AuthKeeper, &app.AccountsKeeper, authsims.RandomGenesisAccounts), } app.sm = module.NewSimulationManagerFromAppModules(app.ModuleManager.Modules, overrideModules) @@ -289,6 +296,9 @@ func NewSimApp( } } + // set custom ante handlers + app.setCustomAnteHandler() + if err := app.Load(loadLatest); err != nil { panic(err) } @@ -296,6 +306,30 @@ func NewSimApp( return app } +// overwritte default ante handlers with custom ante handlers +// set SkipAnteHandler to true in app config and set custom ante handler on baseapp +func (app *SimApp) setCustomAnteHandler() { + anteHandler, err := NewAnteHandler( + HandlerOptions{ + ante.HandlerOptions{ + AccountKeeper: app.AuthKeeper, + BankKeeper: app.BankKeeper, + SignModeHandler: app.txConfig.SignModeHandler(), + FeegrantKeeper: app.FeeGrantKeeper, + SigGasConsumer: ante.DefaultSigVerificationGasConsumer, + }, + &app.CircuitBreakerKeeper, + app.UnorderedTxManager, + }, + ) + if err != nil { + panic(err) + } + + // Set the AnteHandler for the app + app.SetAnteHandler(anteHandler) +} + // Close implements the Application interface and closes all necessary application // resources. func (app *SimApp) Close() error { diff --git a/simapp/app_test.go b/simapp/app_test.go index b378c2c5e48e..437ba69e7a9c 100644 --- a/simapp/app_test.go +++ b/simapp/app_test.go @@ -23,6 +23,7 @@ import ( "cosmossdk.io/x/bank" banktypes "cosmossdk.io/x/bank/types" "cosmossdk.io/x/distribution" + "cosmossdk.io/x/epochs" "cosmossdk.io/x/evidence" feegrantmodule "cosmossdk.io/x/feegrant/module" "cosmossdk.io/x/gov" @@ -212,6 +213,7 @@ func TestRunMigrations(t *testing.T) { "evidence": evidence.AppModule{}.ConsensusVersion(), "genutil": genutil.AppModule{}.ConsensusVersion(), "protocolpool": protocolpool.AppModule{}.ConsensusVersion(), + "epochs": epochs.AppModule{}.ConsensusVersion(), }, ) if tc.expRunErr { diff --git a/simapp/go.mod b/simapp/go.mod index 13a5a71b5320..c2984a192b7a 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -10,15 +10,16 @@ require ( cosmossdk.io/depinject v1.0.0-alpha.4 cosmossdk.io/log v1.3.1 cosmossdk.io/math v1.3.0 - cosmossdk.io/store v1.0.2 + cosmossdk.io/store v1.1.0 cosmossdk.io/tools/confix v0.0.0-20230613133644-0a778132a60f cosmossdk.io/x/accounts v0.0.0-20240226161501-23359a0b6d91 - cosmossdk.io/x/accounts/lockup v0.0.0-00010101000000-000000000000 + cosmossdk.io/x/accounts/defaults/lockup v0.0.0-00010101000000-000000000000 cosmossdk.io/x/auth v0.0.0-20240226161501-23359a0b6d91 cosmossdk.io/x/authz v0.0.0-00010101000000-000000000000 cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 cosmossdk.io/x/circuit v0.0.0-20230613133644-0a778132a60f cosmossdk.io/x/distribution v0.0.0-20240227221813-a248d05f70f4 + cosmossdk.io/x/epochs v0.0.0-00010101000000-000000000000 cosmossdk.io/x/evidence v0.0.0-20230613133644-0a778132a60f cosmossdk.io/x/feegrant v0.0.0-20230613133644-0a778132a60f cosmossdk.io/x/gov v0.0.0-20231113122742-912390d5fc4a @@ -30,11 +31,11 @@ require ( cosmossdk.io/x/staking v0.0.0-20240226161501-23359a0b6d91 cosmossdk.io/x/tx v0.13.1 cosmossdk.io/x/upgrade v0.0.0-20230613133644-0a778132a60f - github.com/cometbft/cometbft v0.38.6 + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 github.com/cosmos/cosmos-db v1.0.2 // this version is not used as it is always replaced by the latest Cosmos SDK version github.com/cosmos/cosmos-sdk v0.51.0 - github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/gogoproto v1.4.12 github.com/golang/mock v1.6.0 github.com/spf13/cast v1.6.0 github.com/spf13/cobra v1.8.0 @@ -81,14 +82,14 @@ require ( github.com/cosmos/cosmos-proto v1.0.0-beta.4 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.0.1 // indirect + github.com/cosmos/iavl v1.1.1 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect - github.com/creachadair/atomicfile v0.3.3 // indirect + github.com/creachadair/atomicfile v0.3.4 // indirect github.com/creachadair/tomledit v0.0.26 // indirect github.com/danieljoos/wincred v1.2.1 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect @@ -148,7 +149,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect @@ -164,14 +165,14 @@ require ( github.com/muesli/termenv v0.15.2 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.0 // indirect github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.50.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/common v0.52.2 // indirect + github.com/prometheus/procfs v0.13.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rivo/uniseg v0.2.0 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect @@ -199,23 +200,23 @@ require ( go.opentelemetry.io/otel/metric v1.22.0 // indirect go.opentelemetry.io/otel/trace v1.22.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.21.0 // indirect - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.22.0 // indirect + golang.org/x/crypto v0.22.0 // indirect + golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81 // indirect + golang.org/x/mod v0.16.0 // indirect + golang.org/x/net v0.24.0 // indirect golang.org/x/oauth2 v0.18.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.18.0 // indirect + golang.org/x/tools v0.19.0 // indirect google.golang.org/api v0.162.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20240221002015-b0ce06bbee7c // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect - google.golang.org/grpc v1.62.1 // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/grpc v1.63.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect @@ -240,12 +241,13 @@ replace ( cosmossdk.io/depinject => ../depinject cosmossdk.io/tools/confix => ../tools/confix cosmossdk.io/x/accounts => ../x/accounts - cosmossdk.io/x/accounts/lockup => ../x/accounts/defaults/lockup + cosmossdk.io/x/accounts/defaults/lockup => ../x/accounts/defaults/lockup cosmossdk.io/x/auth => ../x/auth cosmossdk.io/x/authz => ../x/authz cosmossdk.io/x/bank => ../x/bank cosmossdk.io/x/circuit => ../x/circuit cosmossdk.io/x/distribution => ../x/distribution + cosmossdk.io/x/epochs => ../x/epochs cosmossdk.io/x/evidence => ../x/evidence cosmossdk.io/x/feegrant => ../x/feegrant cosmossdk.io/x/gov => ../x/gov diff --git a/simapp/go.sum b/simapp/go.sum index 782ba1545a22..776fb1fa8566 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -195,8 +195,8 @@ cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= -cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= +cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= +cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -325,8 +325,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.11.0 h1:M3Lscmpogx5NTbb1EGyGDaFRdsoLWrUWimFEyf7jej8= github.com/cometbft/cometbft-db v0.11.0/go.mod h1:GDPJAC/iFHNjmZZPN8V8C1yr/eyityhi2W1hz2MGKSc= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -348,10 +348,10 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= -github.com/cosmos/iavl v1.0.1 h1:D+mYbcRO2wptYzOM1Hxl9cpmmHU1ZEt9T2Wv5nZTeUw= -github.com/cosmos/iavl v1.0.1/go.mod h1:8xIUkgVvwvVrBu81scdPty+/Dx9GqwHnAvXz4cwF7RY= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= +github.com/cosmos/iavl v1.1.1 h1:64nTi8s3gEoGqhA8TyAWFWfz7/pg0anKzHNSc1ETc7Q= +github.com/cosmos/iavl v1.1.1/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= @@ -361,10 +361,10 @@ github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5X github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creachadair/atomicfile v0.3.3 h1:yJlDq8qk9QmD/6ol+jq1X4bcoLNVdYq95+owOnauziE= -github.com/creachadair/atomicfile v0.3.3/go.mod h1:X1r9P4wigJlGkYJO1HXZREdkVn+b1yHrsBBMLSj7tak= -github.com/creachadair/mtest v0.0.0-20231015022703-31f2ea539dce h1:BFjvg2Oq88/2DOcUFu1ScIwKUn7KJYYvLr6AeuCJD54= -github.com/creachadair/mtest v0.0.0-20231015022703-31f2ea539dce/go.mod h1:okn1ft6DY+qjPmnvYynyq7ufIQKJ2x2qwOCJZecei1k= +github.com/creachadair/atomicfile v0.3.4 h1:AjNK7To+S1p+nk7uJXJMZFpcV9XHOyAaULyDeU6LEqM= +github.com/creachadair/atomicfile v0.3.4/go.mod h1:ByEUbfQyms+tRtE7Wk7WdS6PZeyMzfSFlNX1VoKEh6E= +github.com/creachadair/mds v0.13.3 h1:OqXNRorXKsuvfjor+0ixtrpA4IINApH8zgm23XLlngk= +github.com/creachadair/mds v0.13.3/go.mod h1:4vrFYUzTXMJpMBU+OA292I6IUxKWCCfZkgXg+/kBZMo= github.com/creachadair/tomledit v0.0.26 h1:MoDdgHIHZ5PctBVsAZDjxdxreWUEa9ObPKTRkk5PPwA= github.com/creachadair/tomledit v0.0.26/go.mod h1:SJi1OxKpMyR141tq1lzsbPtIg3j8TeVPM/ZftfieD7o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= @@ -377,8 +377,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= @@ -739,8 +739,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= @@ -850,8 +850,8 @@ github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144T github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= @@ -892,16 +892,16 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= -github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= +github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -1080,8 +1080,8 @@ golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1093,8 +1093,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81 h1:6R2FC06FonbXQ8pK11/PDFY6N6LWlf9KlzibaCapmqc= +golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81/go.mod h1:CQ1k9gNrJ50XIzaKCRR2hssIjF07kZFEiieALBM/ARQ= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1122,8 +1122,8 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= +golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1186,8 +1186,8 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1230,8 +1230,8 @@ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1331,16 +1331,16 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1426,8 +1426,8 @@ golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= -golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= +golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= +golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1605,12 +1605,12 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20240221002015-b0ce06bbee7c h1:Zmyn5CV/jxzKnF+3d+xzbomACPwLQqVpLTpyXN5uTaQ= -google.golang.org/genproto v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= -google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c h1:9g7erC9qu44ks7UK4gDNlnk4kOxZG707xKm4jVniy6o= -google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1652,8 +1652,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/simapp/gomod2nix.toml b/simapp/gomod2nix.toml index 5db89e2c8b78..3e9e098d664d 100644 --- a/simapp/gomod2nix.toml +++ b/simapp/gomod2nix.toml @@ -32,8 +32,8 @@ schema = 3 version = "v1.3.0" hash = "sha256-EEFK43Cr0g0ndhQhkIKher0FqV3mvkmE9z0sP7uVSHg=" [mod."cosmossdk.io/store"] - version = "v1.0.2" - hash = "sha256-mEaBNfU892M3V6qTMEDXb1GLaywlyouTRC5XfVqNSMs=" + version = "v1.1.0" + hash = "sha256-CMV+5pn1BP5ixj9pICPlbIQ9Ezy6uP7mwG7SSTXkb3k=" [mod."cosmossdk.io/x/tx"] version = "v0.13.1" hash = "sha256-dHv2Zx8xbqfv1Gq0syh33G7TFJOVx4857QMH4b8Jj9k=" @@ -108,8 +108,8 @@ schema = 3 version = "v0.0.0-20230807174530-cc333fc44b06" hash = "sha256-yZdBXkTVzPxRYntI9I2Gu4gkI11m52Nwl8RNNdlXSrA=" [mod."github.com/cometbft/cometbft"] - version = "v0.38.6" - hash = "sha256-2boDIBhWeQM7c9mAKB23cJ7bHYGf1+Dl0QeFDtO8Usk=" + version = "v0.38.7-0.20240412124004-1f67e396cf45" + hash = "sha256-BYBhYbEiifnEfYzTDnV994yue23vM0wBgfDb18teVV8=" [mod."github.com/cometbft/cometbft-db"] version = "v0.11.0" hash = "sha256-qs3J+9ZW7gStN2W+5SQf/JSmgX5Q5kmIau1BLxze5iE=" @@ -129,11 +129,11 @@ schema = 3 version = "v1.2.0" hash = "sha256-Hd19V0RCiMoCL67NsqvWIsvWF8KM3LnuJTbYjWtQkEo=" [mod."github.com/cosmos/gogoproto"] - version = "v1.4.11" - hash = "sha256-hXJIGN8Arg09ldCgrSyYZK+xMelYavEj2I3ltxJfAqE=" + version = "v1.4.12" + hash = "sha256-e2tbfaZtzLijq+EMnNG9GWKDCG4sBj8wIVnn6/R26iM=" [mod."github.com/cosmos/iavl"] - version = "v1.0.1" - hash = "sha256-owSjZEVLrFoLjO/wm8bxbVLhqRv/uX+8usdVMnbOn/s=" + version = "v1.1.1" + hash = "sha256-jeL74lBAld+9etm3mvcGNG8eHrjrMGdUsm69nb+yDcE=" [mod."github.com/cosmos/ics23/go"] version = "v0.10.0" hash = "sha256-KYEv727BO/ht63JO02xiKFGFAddg41Ve9l2vSSZZBq0=" @@ -141,8 +141,8 @@ schema = 3 version = "v0.13.3" hash = "sha256-4f73odipfgWku0/gK2UtXbrBXvj8kT9sg4IhnfAP/S0=" [mod."github.com/creachadair/atomicfile"] - version = "v0.3.3" - hash = "sha256-sm0lJGGjpm27HQlOc8C3QgWHjlyjJZ/tKIO5qpSNH7E=" + version = "v0.3.4" + hash = "sha256-iV1Q8QAp3Y28bUa198jXnvV5wpITvuqUkU4aRIytVDI=" [mod."github.com/creachadair/tomledit"] version = "v0.0.26" hash = "sha256-kpn/KpzYdlYMV9vq+AYEJq80S2tbT3xdU1gp6H4WoA8=" @@ -153,8 +153,8 @@ schema = 3 version = "v1.1.2-0.20180830191138-d8f796af33cc" hash = "sha256-fV9oI51xjHdOmEx6+dlq7Ku2Ag+m/bmbzPo6A4Y74qc=" [mod."github.com/decred/dcrd/dcrec/secp256k1/v4"] - version = "v4.2.0" - hash = "sha256-Mw+axGW3RzaRFzcYc7/9/gpqZgWXZHeyT2c4USFtAQA=" + version = "v4.3.0" + hash = "sha256-ADbhI5Ad+q3OxooIiYeLAq5mMONk1gPIAnTch9zKsIM=" [mod."github.com/desertbit/timer"] version = "v0.0.0-20180107155436-c41aec40b27f" hash = "sha256-abLOtEcomAqCWLphd2X6WkD/ED764w6sa6unox4BXss=" @@ -336,8 +336,8 @@ schema = 3 version = "v0.1.0" hash = "sha256-wQqGTtRWsfR9n0O/SXHVgECebbnNmHddxJIbG63OJBQ=" [mod."github.com/linxGnu/grocksdb"] - version = "v1.8.12" - hash = "sha256-1tlgs/JnopLI8eoWJlv9hP4jf0OTm1qMZTSg0jAkG7A=" + version = "v1.8.14" + hash = "sha256-dT647UzB25Ye1Gv6b9JEtJZjuWKdJo4D8kw9cB0W8gA=" [mod."github.com/lucasb-eyer/go-colorful"] version = "v1.2.0" hash = "sha256-Gg9dDJFCTaHrKHRR1SrJgZ8fWieJkybljybkI9x0gyE=" @@ -384,8 +384,8 @@ schema = 3 version = "v1.1.0" hash = "sha256-U4IS0keJa4BSBSeEBqtIV1Zg6N4b0zFiKfzN9ua4pWQ=" [mod."github.com/pelletier/go-toml/v2"] - version = "v2.1.1" - hash = "sha256-BQtflYQ8Dt7FL/yFI9OnxwvsRk0oEO37ZXuGXFveVpo=" + version = "v2.2.0" + hash = "sha256-hbjvVGN0puPwpMq2bDlixeuUj8+we3BOgwZuY7/SM+Y=" [mod."github.com/petermattis/goid"] version = "v0.0.0-20231207134359-e60b3f734c67" hash = "sha256-73DbyhUTwYhqmvbcI96CNblTrfl6uz9OvM6z/h8j5TM=" @@ -402,11 +402,11 @@ schema = 3 version = "v0.6.0" hash = "sha256-TAD0mm7msYHo99yoNijeYzlDD0i1Vg3uTetpkDUWQo8=" [mod."github.com/prometheus/common"] - version = "v0.50.0" - hash = "sha256-zDhmdO4gGiyKyLuNrMnsoY3pkb9fGZIAHcjP8j26HQI=" + version = "v0.52.2" + hash = "sha256-XQUvk9/Kwf9NDlDUVl7mOWRD7z7z9QEbLH/rNU4D2nI=" [mod."github.com/prometheus/procfs"] - version = "v0.12.0" - hash = "sha256-Y4ZZmxIpVCO67zN3pGwSk2TcI88zvmGJkgwq9DRTwFw=" + version = "v0.13.0" + hash = "sha256-J31K36TkIiQU2EGOcmqDa+dkoKXiVuxafPVT4rKbEsg=" [mod."github.com/rcrowley/go-metrics"] version = "v0.0.0-20201227073835-cf1acfcdf475" hash = "sha256-10ytHQ1SpMKYTiKuOPdEMuOVa8HVvv9ryYSIF9BHEBI=" @@ -505,29 +505,29 @@ schema = 3 version = "v1.11.0" hash = "sha256-Lb6rHHfR62Ozg2j2JZy3MKOMKdsfzd1IYTR57r3Mhp0=" [mod."golang.org/x/crypto"] - version = "v0.21.0" - hash = "sha256-Z4k1LvFh4Jai7HUe6TTuXSG3VnuiRpMwdARIdZZqSYk=" + version = "v0.22.0" + hash = "sha256-2+u9nd32+Bi7EEv7QFc12CRTbfV7DApNv+yKIr7+lTw=" [mod."golang.org/x/exp"] - version = "v0.0.0-20240222234643-814bf88cf225" - hash = "sha256-DM6/KUjyqyuqXai7UH1vMsoKXQAlYfcHTwK1dHqjRAc=" + version = "v0.0.0-20240318143956-a85f2c67cd81" + hash = "sha256-HjEmpjgXqIuGc5rsTVkg6OPAN2fGhfkska7cwRu1qaw=" [mod."golang.org/x/mod"] - version = "v0.15.0" - hash = "sha256-ANSnGmd525BfnkMZpCmu6deMPFGADtnZx3lmZpdm2aM=" + version = "v0.16.0" + hash = "sha256-aN1Cz5Wqd9YCjK8nFW6JWn+n1HfFoEcgYZmGO/FYtbw=" [mod."golang.org/x/net"] - version = "v0.22.0" - hash = "sha256-pcefO4noO9I6mATKBWF6shgIjZvFg0kDsV1Jo/NsFns=" + version = "v0.24.0" + hash = "sha256-w1c21ljta5wNIyel9CSIn/crPzwOCRofNKhqmfs4aEQ=" [mod."golang.org/x/oauth2"] version = "v0.18.0" hash = "sha256-TX4CvtvHU+SGSmqlxaQqlgJjlJiOtLGYAZa0zeBfZak=" [mod."golang.org/x/sync"] - version = "v0.6.0" - hash = "sha256-LLims/wjDZtIqlYCVHREewcUOX4hwRwplEuZKPOJ/HI=" + version = "v0.7.0" + hash = "sha256-2ETllEu2GDWoOd/yMkOkLC2hWBpKzbVZ8LhjLu0d2A8=" [mod."golang.org/x/sys"] - version = "v0.18.0" - hash = "sha256-bIFhfFp7Sj0E1gcE3X3l/jecCfSRLgrkb8f0Yr6tVR0=" + version = "v0.19.0" + hash = "sha256-cmuL31TYLJmDm/fDnI2Sn0wB88cpdOHV1+urorsJWx4=" [mod."golang.org/x/term"] - version = "v0.18.0" - hash = "sha256-lpze9arFZIhBV8Ht3VZyoiUwqPkeH2IwfXt8M3xljiM=" + version = "v0.19.0" + hash = "sha256-wFwEMwhtsr0C4mqjxukjMM7lxJLYPvb7gAPO95xyhyg=" [mod."golang.org/x/text"] version = "v0.14.0" hash = "sha256-yh3B0tom1RfzQBf1RNmfdNWF1PtiqxV41jW1GVS6JAg=" @@ -535,8 +535,8 @@ schema = 3 version = "v0.5.0" hash = "sha256-W6RgwgdYTO3byIPOFxrP2IpAZdgaGowAaVfYby7AULU=" [mod."golang.org/x/tools"] - version = "v0.18.0" - hash = "sha256-JVz7W13vMPfpGQ1yW+LBlT6INu3ebpjvXyChmAkm5bQ=" + version = "v0.19.0" + hash = "sha256-Xf05Ao398gBzxn5C8H6x+XsLjFLIm+UUfpDekQYA0cw=" [mod."google.golang.org/api"] version = "v0.162.0" hash = "sha256-+AsT4DPjefEmPPelZoSHuQ8nCHhmhhUWU4UGnJ/8+fg=" @@ -544,17 +544,17 @@ schema = 3 version = "v1.6.8" hash = "sha256-decMa0MiWfW/Bzr8QPPzzpeya0YWGHhZAt4Cr/bD1wQ=" [mod."google.golang.org/genproto"] - version = "v0.0.0-20240221002015-b0ce06bbee7c" - hash = "sha256-XxWl5Ejw/HOet2bm+hqiYj6ZzBCMq6qT6PhVHRsDazk=" + version = "v0.0.0-20240227224415-6ceb2ff114de" + hash = "sha256-G+tvsCTXxzk3sS6HbBxPN1DYaN1tPOqKsa60mI05Feg=" [mod."google.golang.org/genproto/googleapis/api"] - version = "v0.0.0-20240221002015-b0ce06bbee7c" + version = "v0.0.0-20240227224415-6ceb2ff114de" hash = "sha256-H3d2ZhPJI9RH5EK9NsxUAFmT6tr2DgGV9SjZgqJ80r4=" [mod."google.golang.org/genproto/googleapis/rpc"] - version = "v0.0.0-20240221002015-b0ce06bbee7c" - hash = "sha256-XF1eaB8Uwjuii1SVpiZABBhrpszJy5ujOtN+7qAAouM=" + version = "v0.0.0-20240401170217-c3f982113cda" + hash = "sha256-P5SBku16dYnK4koUQxTeGwPxAAWH8rxbDm2pOzFLo/Q=" [mod."google.golang.org/grpc"] - version = "v1.62.1" - hash = "sha256-1su6X0YT7MUflrTJijbq1CiisADZHudEx5sJq01TEaE=" + version = "v1.63.2" + hash = "sha256-RmtVjYLam97k7IHTHU7Gn16xNX+GvA9AiLKlQwOiZXU=" [mod."google.golang.org/protobuf"] version = "v1.33.0" hash = "sha256-cWwQjtUwSIEkAlAadrlxK1PYZXTRrV4NKzt7xDpJgIU=" diff --git a/simapp/sim_test.go b/simapp/sim_test.go index 1ff1daa615b5..b4f9802830e9 100644 --- a/simapp/sim_test.go +++ b/simapp/sim_test.go @@ -194,7 +194,7 @@ func TestAppImportExport(t *testing.T) { stakingtypes.StoreKey: { stakingtypes.UnbondingQueueKey, stakingtypes.RedelegationQueueKey, stakingtypes.ValidatorQueueKey, stakingtypes.HistoricalInfoKey, stakingtypes.UnbondingIDKey, stakingtypes.UnbondingIndexKey, - stakingtypes.UnbondingTypeKey, stakingtypes.ValidatorUpdatesKey, + stakingtypes.UnbondingTypeKey, }, authzkeeper.StoreKey: {authzkeeper.GrantQueuePrefix}, feegrant.StoreKey: {feegrant.FeeAllowanceQueueKeyPrefix}, diff --git a/simapp/simd/cmd/commands.go b/simapp/simd/cmd/commands.go index 40de6d208cf8..c48b2c0dadf7 100644 --- a/simapp/simd/cmd/commands.go +++ b/simapp/simd/cmd/commands.go @@ -23,8 +23,6 @@ import ( "github.com/cosmos/cosmos-sdk/client/pruning" "github.com/cosmos/cosmos-sdk/client/rpc" "github.com/cosmos/cosmos-sdk/client/snapshot" - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/server" servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -35,8 +33,6 @@ import ( func initRootCmd( rootCmd *cobra.Command, txConfig client.TxConfig, - interfaceRegistry codectypes.InterfaceRegistry, - appCodec codec.Codec, moduleManager *module.Manager, ) { cfg := sdk.GetConfig() @@ -51,7 +47,7 @@ func initRootCmd( snapshot.Cmd(newApp), ) - server.AddCommands(rootCmd, newApp, func(startCmd *cobra.Command) {}) + server.AddCommands(rootCmd, newApp, server.StartCmdOptions[servertypes.Application]{}) // add keybase, auxiliary RPC, query, genesis, and tx child commands rootCmd.AddCommand( @@ -85,7 +81,7 @@ func queryCommand() *cobra.Command { } cmd.AddCommand( - rpc.QueryEventForTxCmd(), + rpc.WaitTxCmd(), server.QueryBlockCmd(), authcmd.QueryTxsByEventsCmd(), server.QueryBlocksCmd(), diff --git a/simapp/simd/cmd/root.go b/simapp/simd/cmd/root.go index e2c0fec47604..2b66d8cbe577 100644 --- a/simapp/simd/cmd/root.go +++ b/simapp/simd/cmd/root.go @@ -110,7 +110,7 @@ func NewRootCmd() *cobra.Command { }, } - initRootCmd(rootCmd, encodingConfig.TxConfig, encodingConfig.InterfaceRegistry, encodingConfig.Codec, tempApp.ModuleManager) + initRootCmd(rootCmd, encodingConfig.TxConfig, tempApp.ModuleManager) // autocli opts customClientTemplate, customClientConfig := initClientConfig() diff --git a/simapp/simd/cmd/root_di.go b/simapp/simd/cmd/root_di.go index 8f5a535a62cf..cfc8407edc11 100644 --- a/simapp/simd/cmd/root_di.go +++ b/simapp/simd/cmd/root_di.go @@ -87,7 +87,7 @@ func NewRootCmd() *cobra.Command { }, } - initRootCmd(rootCmd, clientCtx.TxConfig, clientCtx.InterfaceRegistry, clientCtx.Codec, moduleManager) + initRootCmd(rootCmd, clientCtx.TxConfig, moduleManager) if err := autoCliOpts.EnhanceRootCommand(rootCmd); err != nil { panic(err) diff --git a/simapp/simd/cmd/testnet.go b/simapp/simd/cmd/testnet.go index f481372f1eb3..957cc455e51a 100644 --- a/simapp/simd/cmd/testnet.go +++ b/simapp/simd/cmd/testnet.go @@ -13,7 +13,6 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" - "cosmossdk.io/core/address" "cosmossdk.io/math" "cosmossdk.io/math/unsafe" "cosmossdk.io/simapp" @@ -148,7 +147,7 @@ Example: args.numValidators, _ = cmd.Flags().GetInt(flagNumValidators) args.algo, _ = cmd.Flags().GetString(flags.FlagKeyType) - return initTestnetFiles(clientCtx, cmd, config, mm, genBalIterator, clientCtx.TxConfig.SigningContext().ValidatorAddressCodec(), args) + return initTestnetFiles(clientCtx, cmd, config, mm, genBalIterator, args) }, } @@ -209,7 +208,6 @@ func initTestnetFiles( nodeConfig *cmtconfig.Config, mm *module.Manager, genBalIterator banktypes.GenesisBalancesIterator, - valAddrCodec address.ValidatorAddressCodec, args initArgs, ) error { if args.chainID == "" { @@ -301,7 +299,7 @@ func initTestnetFiles( genBalances = append(genBalances, banktypes.Balance{Address: addr.String(), Coins: coins.Sort()}) genAccounts = append(genAccounts, authtypes.NewBaseAccount(addr, nil, 0, 0)) - valStr, err := valAddrCodec.BytesToString(sdk.ValAddress(addr)) + valStr, err := clientCtx.ValidatorAddressCodec.BytesToString(sdk.ValAddress(addr)) if err != nil { return err } @@ -360,7 +358,7 @@ func initTestnetFiles( err := collectGenFiles( clientCtx, nodeConfig, args.chainID, nodeIDs, valPubKeys, args.numValidators, - args.outputDir, args.nodeDirPrefix, args.nodeDaemonHome, genBalIterator, valAddrCodec, + args.outputDir, args.nodeDirPrefix, args.nodeDaemonHome, genBalIterator, ) if err != nil { return err @@ -393,7 +391,10 @@ func initGenFiles( var bankGenState banktypes.GenesisState clientCtx.Codec.MustUnmarshalJSON(appGenState[banktypes.ModuleName], &bankGenState) - bankGenState.Balances = banktypes.SanitizeGenesisBalances(genBalances) + bankGenState.Balances, err = banktypes.SanitizeGenesisBalances(genBalances, clientCtx.AddressCodec) + if err != nil { + return err + } for _, bal := range bankGenState.Balances { bankGenState.Supply = bankGenState.Supply.Add(bal.Coins...) } @@ -417,7 +418,7 @@ func initGenFiles( func collectGenFiles( clientCtx client.Context, nodeConfig *cmtconfig.Config, chainID string, nodeIDs []string, valPubKeys []cryptotypes.PubKey, numValidators int, - outputDir, nodeDirPrefix, nodeDaemonHome string, genBalIterator banktypes.GenesisBalancesIterator, valAddrCodec address.ValidatorAddressCodec, + outputDir, nodeDirPrefix, nodeDaemonHome string, genBalIterator banktypes.GenesisBalancesIterator, ) error { var appState json.RawMessage genTime := cmttime.Now() @@ -439,7 +440,7 @@ func collectGenFiles( } nodeAppState, err := genutil.GenAppStateFromConfig(clientCtx.Codec, clientCtx.TxConfig, nodeConfig, initCfg, appGenesis, genBalIterator, genutiltypes.DefaultMessageValidator, - valAddrCodec) + clientCtx.ValidatorAddressCodec, clientCtx.AddressCodec) if err != nil { return err } diff --git a/simapp/simd/cmd/testnet_test.go b/simapp/simd/cmd/testnet_test.go index c78f3408dc9c..58e93e130d52 100644 --- a/simapp/simd/cmd/testnet_test.go +++ b/simapp/simd/cmd/testnet_test.go @@ -27,6 +27,7 @@ import ( func Test_TestnetCmd(t *testing.T) { config := configurator.NewAppConfig( + configurator.AccountsModule(), configurator.AuthModule(), configurator.BankModule(), configurator.GenutilModule(), @@ -44,10 +45,11 @@ func Test_TestnetCmd(t *testing.T) { ) require.NoError(t, err) require.NotNil(t, moduleManager) - require.Len(t, moduleManager.Modules, 7) + require.Len(t, moduleManager.Modules, 8) home := t.TempDir() - encodingConfig := moduletestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{}, auth.AppModule{}, staking.AppModule{}) + cdcOpts := codectestutil.CodecOptions{} + encodingConfig := moduletestutil.MakeTestEncodingConfig(cdcOpts, auth.AppModule{}, staking.AppModule{}) logger := log.NewNopLogger() cfg, err := genutiltest.CreateDefaultCometConfig(home) require.NoError(t, err) @@ -59,7 +61,9 @@ func Test_TestnetCmd(t *testing.T) { clientCtx := client.Context{}. WithCodec(encodingConfig.Codec). WithHomeDir(home). - WithTxConfig(encodingConfig.TxConfig) + WithTxConfig(encodingConfig.TxConfig). + WithAddressCodec(cdcOpts.GetAddressCodec()). + WithValidatorAddressCodec(cdcOpts.GetValidatorCodec()) ctx := context.Background() ctx = context.WithValue(ctx, server.ServerContextKey, serverCtx) diff --git a/simapp/upgrades.go b/simapp/upgrades.go index eb83e948f23b..4351e99f1063 100644 --- a/simapp/upgrades.go +++ b/simapp/upgrades.go @@ -5,9 +5,9 @@ import ( storetypes "cosmossdk.io/store/types" "cosmossdk.io/x/accounts" + epochstypes "cosmossdk.io/x/epochs/types" protocolpooltypes "cosmossdk.io/x/protocolpool/types" upgradetypes "cosmossdk.io/x/upgrade/types" - "github.com/cosmos/cosmos-sdk/types/module" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" ) @@ -36,11 +36,12 @@ func (app SimApp) RegisterUpgradeHandlers() { if upgradeInfo.Name == UpgradeName && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { storeUpgrades := storetypes.StoreUpgrades{ Added: []string{ - accounts.ModuleName, - protocolpooltypes.ModuleName, + accounts.StoreKey, + protocolpooltypes.StoreKey, + epochstypes.StoreKey, }, Deleted: []string{ - crisistypes.ModuleName, // The SDK discontinued the crisis module in v0.51.0 + crisistypes.StoreKey, // The SDK discontinued the crisis module in v0.51.0 }, } diff --git a/store/batch.go b/store/batch.go index 752a7147f52b..36178a6a6327 100644 --- a/store/batch.go +++ b/store/batch.go @@ -13,7 +13,7 @@ type Batch interface { Write() error // Reset resets the batch. - Reset() + Reset() error } // RawBatch represents a group of writes. They may or may not be written atomically depending on the diff --git a/store/changeset.go b/store/changeset.go deleted file mode 100644 index 7c5d88a864a3..000000000000 --- a/store/changeset.go +++ /dev/null @@ -1,63 +0,0 @@ -package store - -// KVPair defines a key-value pair with additional metadata that is used to -// track writes. Deletion can be denoted by a nil value or explicitly by the -// Delete field. -type KVPair struct { - Key []byte - Value []byte - StoreKey string // Optional for snapshot restore -} - -type KVPairs []KVPair - -// Changeset defines a set of KVPair entries by maintaining a map from store key -// to a slice of KVPair objects. -type Changeset struct { - Pairs map[string]KVPairs -} - -func NewChangeset() *Changeset { - return &Changeset{ - Pairs: make(map[string]KVPairs), - } -} - -func NewChangesetWithPairs(pairs map[string]KVPairs) *Changeset { - return &Changeset{ - Pairs: pairs, - } -} - -// Size returns the number of key-value pairs in the batch. -func (cs *Changeset) Size() int { - cnt := 0 - for _, pairs := range cs.Pairs { - cnt += len(pairs) - } - - return cnt -} - -// Add adds a key-value pair to the ChangeSet. -func (cs *Changeset) Add(storeKey string, key, value []byte) { - cs.Pairs[storeKey] = append(cs.Pairs[storeKey], KVPair{ - Key: key, - Value: value, - StoreKey: storeKey, - }) -} - -// AddKVPair adds a KVPair to the ChangeSet. -func (cs *Changeset) AddKVPair(storeKey string, pair KVPair) { - cs.Pairs[storeKey] = append(cs.Pairs[storeKey], pair) -} - -// Merge merges the provided Changeset argument into the receiver. This may be -// useful when you have a Changeset that only pertains to a single store key, -// i.e. a map of size one, and you want to merge it into another. -func (cs *Changeset) Merge(other *Changeset) { - for storeKey, pairs := range other.Pairs { - cs.Pairs[storeKey] = append(cs.Pairs[storeKey], pairs...) - } -} diff --git a/store/commitment/iavl/tree.go b/store/commitment/iavl/tree.go index f4dd62bfc07c..944b7408593e 100644 --- a/store/commitment/iavl/tree.go +++ b/store/commitment/iavl/tree.go @@ -131,5 +131,5 @@ func (t *IavlTree) Import(version uint64) (commitment.Importer, error) { // Close closes the iavl tree. func (t *IavlTree) Close() error { - return nil + return t.tree.Close() } diff --git a/store/commitment/store.go b/store/commitment/store.go index fe13f8673914..4b2756fec206 100644 --- a/store/commitment/store.go +++ b/store/commitment/store.go @@ -9,8 +9,10 @@ import ( protoio "github.com/cosmos/gogoproto/io" + corestore "cosmossdk.io/core/store" "cosmossdk.io/log" "cosmossdk.io/store/v2" + internal "cosmossdk.io/store/v2/internal/conv" "cosmossdk.io/store/v2/internal/encoding" "cosmossdk.io/store/v2/proof" "cosmossdk.io/store/v2/snapshots" @@ -42,7 +44,7 @@ type CommitStore struct { } // NewCommitStore creates a new CommitStore instance. -func NewCommitStore(multiTrees map[string]Tree, db store.RawDB, pruneOpts *store.PruneOptions, logger log.Logger) (*CommitStore, error) { +func NewCommitStore(trees map[string]Tree, db store.RawDB, pruneOpts *store.PruneOptions, logger log.Logger) (*CommitStore, error) { if pruneOpts == nil { pruneOpts = store.DefaultPruneOptions() } @@ -50,19 +52,22 @@ func NewCommitStore(multiTrees map[string]Tree, db store.RawDB, pruneOpts *store return &CommitStore{ logger: logger, db: db, - multiTrees: multiTrees, + multiTrees: trees, pruneOptions: pruneOpts, }, nil } -func (c *CommitStore) WriteBatch(cs *store.Changeset) error { - for storeKey, pairs := range cs.Pairs { - tree, ok := c.multiTrees[storeKey] +func (c *CommitStore) WriteBatch(cs *corestore.Changeset) error { + for _, pairs := range cs.Changes { + + key := internal.UnsafeBytesToStr(pairs.Actor) + + tree, ok := c.multiTrees[key] if !ok { - return fmt.Errorf("store key %s not found in multiTrees", storeKey) + return fmt.Errorf("store key %s not found in multiTrees", key) } - for _, kv := range pairs { - if kv.Value == nil { + for _, kv := range pairs.StateChanges { + if kv.Remove { if err := tree.Remove(kv.Key); err != nil { return err } @@ -78,8 +83,9 @@ func (c *CommitStore) WriteBatch(cs *store.Changeset) error { func (c *CommitStore) WorkingCommitInfo(version uint64) *proof.CommitInfo { storeInfos := make([]proof.StoreInfo, 0, len(c.multiTrees)) for storeKey, tree := range c.multiTrees { + bz := []byte(storeKey) storeInfos = append(storeInfos, proof.StoreInfo{ - Name: storeKey, + Name: bz, CommitID: proof.CommitID{ Version: version, Hash: tree.WorkingHash(), @@ -210,7 +216,7 @@ func (c *CommitStore) Commit(version uint64) (*proof.CommitInfo, error) { } } storeInfos = append(storeInfos, proof.StoreInfo{ - Name: storeKey, + Name: []byte(storeKey), CommitID: commitID, }) } @@ -244,8 +250,8 @@ func (c *CommitStore) SetInitialVersion(version uint64) error { return nil } -func (c *CommitStore) GetProof(storeKey string, version uint64, key []byte) ([]proof.CommitmentOp, error) { - tree, ok := c.multiTrees[storeKey] +func (c *CommitStore) GetProof(storeKey []byte, version uint64, key []byte) ([]proof.CommitmentOp, error) { + tree, ok := c.multiTrees[internal.UnsafeBytesToStr(storeKey)] if !ok { return nil, fmt.Errorf("store %s not found", storeKey) } @@ -270,8 +276,8 @@ func (c *CommitStore) GetProof(storeKey string, version uint64, key []byte) ([]p return []proof.CommitmentOp{commitOp, *storeCommitmentOp}, nil } -func (c *CommitStore) Get(storeKey string, version uint64, key []byte) ([]byte, error) { - tree, ok := c.multiTrees[storeKey] +func (c *CommitStore) Get(storeKey []byte, version uint64, key []byte) ([]byte, error) { + tree, ok := c.multiTrees[internal.UnsafeBytesToStr(storeKey)] if !ok { return nil, fmt.Errorf("store %s not found", storeKey) } @@ -370,7 +376,7 @@ func (c *CommitStore) Snapshot(version uint64, protoWriter protoio.Writer) error } // Restore implements snapshotstypes.CommitSnapshotter. -func (c *CommitStore) Restore(version uint64, format uint32, protoReader protoio.Reader, chStorage chan<- *store.KVPair) (snapshotstypes.SnapshotItem, error) { +func (c *CommitStore) Restore(version uint64, format uint32, protoReader protoio.Reader, chStorage chan<- *corestore.StateChanges) (snapshotstypes.SnapshotItem, error) { var ( importer Importer snapshotItem snapshotstypes.SnapshotItem @@ -395,8 +401,9 @@ loop: } importer.Close() } + storeKey = item.Store.Name - tree := c.multiTrees[storeKey] + tree := c.multiTrees[item.Store.Name] if tree == nil { return snapshotstypes.SnapshotItem{}, fmt.Errorf("store %s not found", storeKey) } @@ -424,11 +431,18 @@ loop: if node.Value == nil { node.Value = []byte{} } + + key := []byte(storeKey) // If the node is a leaf node, it will be written to the storage. - chStorage <- &store.KVPair{ - Key: node.Key, - Value: node.Value, - StoreKey: storeKey, + chStorage <- &corestore.StateChanges{ + Actor: key, + StateChanges: []corestore.KVPair{ + { + Key: node.Key, + Value: node.Value, + Remove: false, + }, + }, } } err := importer.Add(node) diff --git a/store/commitment/store_test_suite.go b/store/commitment/store_test_suite.go index 37e88f18487f..aad3e923ecf3 100644 --- a/store/commitment/store_test_suite.go +++ b/store/commitment/store_test_suite.go @@ -1,12 +1,14 @@ package commitment import ( + "bytes" "fmt" "io" "sync" "github.com/stretchr/testify/suite" + corestore "cosmossdk.io/core/store" "cosmossdk.io/log" "cosmossdk.io/store/v2" dbm "cosmossdk.io/store/v2/db" @@ -34,16 +36,16 @@ func (s *CommitStoreTestSuite) TestStore_Snapshotter() { latestVersion := uint64(10) kvCount := 10 for i := uint64(1); i <= latestVersion; i++ { - kvPairs := make(map[string]store.KVPairs) + kvPairs := make(map[string]corestore.KVPairs) for _, storeKey := range storeKeys { - kvPairs[storeKey] = store.KVPairs{} + kvPairs[storeKey] = corestore.KVPairs{} for j := 0; j < kvCount; j++ { key := []byte(fmt.Sprintf("key-%d-%d", i, j)) value := []byte(fmt.Sprintf("value-%d-%d", i, j)) - kvPairs[storeKey] = append(kvPairs[storeKey], store.KVPair{Key: key, Value: value}) + kvPairs[storeKey] = append(kvPairs[storeKey], corestore.KVPair{Key: key, Value: value}) } } - s.Require().NoError(commitStore.WriteBatch(store.NewChangesetWithPairs(kvPairs))) + s.Require().NoError(commitStore.WriteBatch(corestore.NewChangesetWithPairs(kvPairs))) _, err = commitStore.Commit(i) s.Require().NoError(err) @@ -79,13 +81,15 @@ func (s *CommitStoreTestSuite) TestStore_Snapshotter() { streamReader, err := snapshots.NewStreamReader(chunks) s.Require().NoError(err) - chStorage := make(chan *store.KVPair, 100) + chStorage := make(chan *corestore.StateChanges, 100) leaves := make(map[string]string) wg := sync.WaitGroup{} wg.Add(1) go func() { for kv := range chStorage { - leaves[fmt.Sprintf("%s_%s", kv.StoreKey, kv.Key)] = string(kv.Value) + for _, actor := range kv.StateChanges { + leaves[fmt.Sprintf("%s_%s", kv.Actor, actor.Key)] = string(actor.Value) + } } wg.Done() }() @@ -110,7 +114,7 @@ func (s *CommitStoreTestSuite) TestStore_Snapshotter() { for _, storeInfo := range targetCommitInfo.StoreInfos { matched := false for _, latestStoreInfo := range cInfo.StoreInfos { - if storeInfo.Name == latestStoreInfo.Name { + if bytes.Equal(storeInfo.Name, latestStoreInfo.Name) { s.Require().Equal(latestStoreInfo.GetHash(), storeInfo.GetHash()) matched = true } @@ -131,16 +135,16 @@ func (s *CommitStoreTestSuite) TestStore_Pruning() { latestVersion := uint64(100) kvCount := 10 for i := uint64(1); i <= latestVersion; i++ { - kvPairs := make(map[string]store.KVPairs) + kvPairs := make(map[string]corestore.KVPairs) for _, storeKey := range storeKeys { - kvPairs[storeKey] = store.KVPairs{} + kvPairs[storeKey] = corestore.KVPairs{} for j := 0; j < kvCount; j++ { key := []byte(fmt.Sprintf("key-%d-%d", i, j)) value := []byte(fmt.Sprintf("value-%d-%d", i, j)) - kvPairs[storeKey] = append(kvPairs[storeKey], store.KVPair{Key: key, Value: value}) + kvPairs[storeKey] = append(kvPairs[storeKey], corestore.KVPair{Key: key, Value: value}) } } - s.Require().NoError(commitStore.WriteBatch(store.NewChangesetWithPairs(kvPairs))) + s.Require().NoError(commitStore.WriteBatch(corestore.NewChangesetWithPairs(kvPairs))) _, err = commitStore.Commit(i) s.Require().NoError(err) diff --git a/store/database.go b/store/database.go index b3957592ae79..0ff83ef3401f 100644 --- a/store/database.go +++ b/store/database.go @@ -12,13 +12,13 @@ type Reader interface { // Has retrieves if a key is present in the key-value data store. // // Note: is safe to modify and read after calling Has. - Has(storeKey string, key []byte) (bool, error) + Has(storeKey, key []byte) (bool, error) // Get retrieves the given key if it's present in the key-value data store. // // Note: is safe to modify and read after calling Get. // The returned byte slice is safe to read, but cannot be modified. - Get(storeKey string, key []byte) ([]byte, error) + Get(storeKey, key []byte) ([]byte, error) } // Writer wraps the Set method of a backing data store. @@ -26,12 +26,12 @@ type Writer interface { // Set inserts the given value into the key-value data store. // // Note: are safe to modify and read after calling Set. - Set(storeKey string, key, value []byte) error + Set(storeKey, key, value []byte) error // Delete removes the key from the backing key-value data store. // // Note: is safe to modify and read after calling Delete. - Delete(storeKey string, key []byte) error + Delete(storeKey, key []byte) error } // Database contains all the methods required to allow handling different @@ -46,15 +46,15 @@ type Database interface { // VersionedDatabase defines an API for a versioned database that allows reads, // writes, iteration and commitment over a series of versions. type VersionedDatabase interface { - Has(storeKey string, version uint64, key []byte) (bool, error) - Get(storeKey string, version uint64, key []byte) ([]byte, error) + Has(storeKey []byte, version uint64, key []byte) (bool, error) + Get(storeKey []byte, version uint64, key []byte) ([]byte, error) GetLatestVersion() (uint64, error) SetLatestVersion(version uint64) error - Iterator(storeKey string, version uint64, start, end []byte) (corestore.Iterator, error) - ReverseIterator(storeKey string, version uint64, start, end []byte) (corestore.Iterator, error) + Iterator(storeKey []byte, version uint64, start, end []byte) (corestore.Iterator, error) + ReverseIterator(storeKey []byte, version uint64, start, end []byte) (corestore.Iterator, error) - ApplyChangeset(version uint64, cs *Changeset) error + ApplyChangeset(version uint64, cs *corestore.Changeset) error // Prune attempts to prune all versions up to and including the provided // version argument. The operation should be idempotent. An error should be @@ -69,7 +69,7 @@ type VersionedDatabase interface { // Committer defines an API for committing state. type Committer interface { // WriteBatch writes a batch of key-value pairs to the tree. - WriteBatch(cs *Changeset) error + WriteBatch(cs *corestore.Changeset) error // WorkingCommitInfo returns the CommitInfo for the working tree. WorkingCommitInfo(version uint64) *proof.CommitInfo @@ -84,13 +84,13 @@ type Committer interface { Commit(version uint64) (*proof.CommitInfo, error) // GetProof returns the proof of existence or non-existence for the given key. - GetProof(storeKey string, version uint64, key []byte) ([]proof.CommitmentOp, error) + GetProof(storeKey []byte, version uint64, key []byte) ([]proof.CommitmentOp, error) // Get returns the value for the given key at the given version. // // NOTE: This method only exists to support migration from IAVL v0/v1 to v2. // Once migration is complete, this method should be removed and/or not used. - Get(storeKey string, version uint64, key []byte) ([]byte, error) + Get(storeKey []byte, version uint64, key []byte) ([]byte, error) // SetInitialVersion sets the initial version of the tree. SetInitialVersion(version uint64) error diff --git a/store/db/pebbledb.go b/store/db/pebbledb.go index bc7d77c99660..fd661f9ff5d9 100644 --- a/store/db/pebbledb.go +++ b/store/db/pebbledb.go @@ -7,11 +7,12 @@ import ( "path/filepath" "slices" + "github.com/cockroachdb/pebble" + "github.com/spf13/cast" + corestore "cosmossdk.io/core/store" "cosmossdk.io/store/v2" storeerrors "cosmossdk.io/store/v2/errors" - "github.com/cockroachdb/pebble" - "github.com/spf13/cast" ) var _ store.RawDB = (*PebbleDB)(nil) @@ -24,9 +25,7 @@ type PebbleDB struct { } func NewPebbleDB(name, dataDir string) (*PebbleDB, error) { - return NewPebbleDBWithOpts(name, dataDir, nil) - } func NewPebbleDBWithOpts(name, dataDir string, opts store.DBOptions) (*PebbleDB, error) { diff --git a/store/db/rocksdb_noflag.go b/store/db/rocksdb_noflag.go index f5b8f98df595..100171a077ce 100644 --- a/store/db/rocksdb_noflag.go +++ b/store/db/rocksdb_noflag.go @@ -6,22 +6,17 @@ package db import ( corestore "cosmossdk.io/core/store" "cosmossdk.io/store/v2" - "github.com/linxGnu/grocksdb" ) -var ( - _ store.RawDB = (*RocksDB)(nil) -) +var _ store.RawDB = (*RocksDB)(nil) // RocksDB implements RawDB using RocksDB as the underlying storage engine. // It is used for only store v2 migration, since some clients use RocksDB as // the IAVL v0/v1 backend. -type RocksDB struct { -} +type RocksDB struct{} -func NewRocksDB(dataDir string) (*RocksDB, error) { +func NewRocksDB(name, dataDir string) (*RocksDB, error) { panic("rocksdb must be built with -tags rocksdb") - } func NewRocksDBWithOpts(dataDir string, opts store.DBOptions) (*RocksDB, error) { @@ -58,12 +53,7 @@ func (db *RocksDB) NewBatchWithSize(_ int) store.RawBatch { var _ corestore.Iterator = (*rocksDBIterator)(nil) -type rocksDBIterator struct { -} - -func newRocksDBIterator(src *grocksdb.Iterator, start, end []byte, reverse bool) *rocksDBIterator { - panic("rocksdb must be built with -tags rocksdb") -} +type rocksDBIterator struct{} func (itr *rocksDBIterator) Domain() (start, end []byte) { panic("rocksdb must be built with -tags rocksdb") @@ -96,40 +86,3 @@ func (itr *rocksDBIterator) Close() error { func (itr *rocksDBIterator) assertIsValid() { panic("rocksdb must be built with -tags rocksdb") } - -type rocksDBBatch struct { -} - -func (b *rocksDBBatch) Set(key, value []byte) error { - panic("rocksdb must be built with -tags rocksdb") -} - -func (b *rocksDBBatch) Delete(key []byte) error { - panic("rocksdb must be built with -tags rocksdb") -} - -func (b *rocksDBBatch) Write() error { - panic("rocksdb must be built with -tags rocksdb") -} - -func (b *rocksDBBatch) WriteSync() error { - panic("rocksdb must be built with -tags rocksdb") -} - -func (b *rocksDBBatch) Close() error { - panic("rocksdb must be built with -tags rocksdb") -} - -func (b *rocksDBBatch) GetByteSize() (int, error) { - panic("rocksdb must be built with -tags rocksdb") -} - -func readOnlySlice(s *grocksdb.Slice) []byte { - panic("rocksdb must be built with -tags rocksdb") -} - -// copyAndFreeSlice will copy a given RocksDB slice and free it. If the slice -// does not exist, will be returned. -func copyAndFreeSlice(s *grocksdb.Slice) []byte { - panic("rocksdb must be built with -tags rocksdb") -} diff --git a/store/go.mod b/store/go.mod index 2a29bf6bd820..0446be569f85 100644 --- a/store/go.mod +++ b/store/go.mod @@ -8,19 +8,18 @@ require ( cosmossdk.io/log v1.3.1 github.com/cockroachdb/errors v1.11.1 github.com/cockroachdb/pebble v1.1.0 - github.com/cometbft/cometbft v0.38.5 - github.com/cosmos/gogoproto v1.4.11 + github.com/cometbft/cometbft v0.38.6 + github.com/cosmos/gogoproto v1.4.12 github.com/cosmos/iavl v1.1.1 github.com/cosmos/ics23/go v0.10.0 github.com/google/btree v1.1.2 github.com/hashicorp/go-metrics v0.5.3 - github.com/linxGnu/grocksdb v1.8.12 + github.com/linxGnu/grocksdb v1.8.14 github.com/mattn/go-sqlite3 v1.14.22 github.com/spf13/cast v1.6.0 github.com/stretchr/testify v1.9.0 github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 - golang.org/x/sync v0.6.0 + golang.org/x/sync v0.7.0 ) require ( @@ -33,7 +32,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/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/emicklei/dot v1.6.1 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -41,29 +40,31 @@ require ( github.com/golang/snappy v0.0.4 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/hashicorp/go-immutable-radix v1.0.0 // indirect - github.com/hashicorp/golang-lru v0.5.0 // indirect + github.com/hashicorp/go-uuid v1.0.1 // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/klauspost/compress v1.17.7 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20220708102147-0a8a51822cae // indirect - github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect + github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.50.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/common v0.52.2 // indirect + github.com/prometheus/procfs v0.13.0 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/zerolog v1.32.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect - golang.org/x/crypto v0.21.0 // indirect - golang.org/x/net v0.22.0 // indirect - golang.org/x/sys v0.18.0 // indirect + golang.org/x/crypto v0.22.0 // indirect + golang.org/x/exp v0.0.0-20240314144324-c7f7c6466f7f // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect - google.golang.org/grpc v1.62.1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/grpc v1.63.2 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/store/go.sum b/store/go.sum index ab1fec1cae4c..b626978b5d70 100644 --- a/store/go.sum +++ b/store/go.sum @@ -39,15 +39,13 @@ github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwP github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= -github.com/cometbft/cometbft v0.38.5 h1:4lOcK5VTPrfbLOhNHmPYe6c7eDXHtBdMCQuKbAfFJdU= -github.com/cometbft/cometbft v0.38.5/go.mod h1:0tqKin+KQs8zDwzYD8rPHzSBIDNPuB4NrwwGDNb/hUg= +github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= +github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= -github.com/cosmos/iavl v1.1.0 h1:YRdPLKCPoJQDXoZu0BToQ6PADswLkhNzyt7DZLgK0xY= -github.com/cosmos/iavl v1.1.0/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/cosmos/iavl v1.1.1 h1:64nTi8s3gEoGqhA8TyAWFWfz7/pg0anKzHNSc1ETc7Q= github.com/cosmos/iavl v1.1.1/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= @@ -57,10 +55,10 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= -github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= +github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= +github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/emicklei/dot v1.6.1 h1:ujpDlBkkwgWUY+qPId5IwapRW/xEoligRSYjioR6DFI= github.com/emicklei/dot v1.6.1/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= @@ -117,10 +115,12 @@ github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjh github.com/hashicorp/go-metrics v0.5.3 h1:M5uADWMOGCTUNU1YuC4hfknOeHNaX54LDm4oYSucoNE= github.com/hashicorp/go-metrics v0.5.3/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-uuid v1.0.0 h1:RS8zrF7PhGwyNPOtxSClXXj9HA8feRnJzgnI1RJCSnM= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo= +github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= @@ -139,8 +139,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= @@ -174,8 +174,9 @@ github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= +github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d h1:htwtWgtQo8YS6JFWWi2DNgY0RwSGJ1ruMoxY6CUUclk= +github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= @@ -198,13 +199,13 @@ github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZ github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= -github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= +github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= @@ -235,10 +236,10 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= +golang.org/x/exp v0.0.0-20240314144324-c7f7c6466f7f h1:3CW0unweImhOzd5FmYuRsD4Y4oQFKZIjAnKbjV4WIrw= +golang.org/x/exp v0.0.0-20240314144324-c7f7c6466f7f/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -252,16 +253,16 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= 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-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -285,8 +286,8 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.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= @@ -305,10 +306,10 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/store/internal/conv/doc.go b/store/internal/conv/doc.go new file mode 100644 index 000000000000..4b45d1ab53f9 --- /dev/null +++ b/store/internal/conv/doc.go @@ -0,0 +1,2 @@ +// Package conv provides internal functions for conversions and data manipulation +package conv diff --git a/store/internal/conv/string.go b/store/internal/conv/string.go new file mode 100644 index 000000000000..96d89c3a5fff --- /dev/null +++ b/store/internal/conv/string.go @@ -0,0 +1,19 @@ +package conv + +import ( + "unsafe" +) + +// UnsafeStrToBytes uses unsafe to convert string into byte array. Returned bytes +// must not be altered after this function is called as it will cause a segmentation fault. +func UnsafeStrToBytes(s string) []byte { + return unsafe.Slice(unsafe.StringData(s), len(s)) // ref https://github.com/golang/go/issues/53003#issuecomment-1140276077 +} + +// UnsafeBytesToStr is meant to make a zero allocation conversion +// from []byte -> string to speed up operations, it is not meant +// to be used generally, but for a specific pattern to delete keys +// from a map. +func UnsafeBytesToStr(b []byte) string { + return *(*string)(unsafe.Pointer(&b)) +} diff --git a/store/internal/conv/string_test.go b/store/internal/conv/string_test.go new file mode 100644 index 000000000000..3a1451753188 --- /dev/null +++ b/store/internal/conv/string_test.go @@ -0,0 +1,54 @@ +package conv + +import ( + "runtime" + "strconv" + "testing" + "time" + + "github.com/stretchr/testify/suite" +) + +func TestStringSuite(t *testing.T) { + suite.Run(t, new(StringSuite)) +} + +type StringSuite struct{ suite.Suite } + +func unsafeConvertStr() []byte { + return UnsafeStrToBytes("abc") +} + +func (s *StringSuite) TestUnsafeStrToBytes() { + // we convert in other function to trigger GC. We want to check that + // the underlying array in []bytes is accessible after GC will finish swapping. + for i := 0; i < 5; i++ { + b := unsafeConvertStr() + runtime.GC() + <-time.NewTimer(2 * time.Millisecond).C + b2 := append(b, 'd') + s.Equal("abc", string(b)) + s.Equal("abcd", string(b2)) + } +} + +func unsafeConvertBytes() string { + return UnsafeBytesToStr([]byte("abc")) +} + +func (s *StringSuite) TestUnsafeBytesToStr() { + // we convert in other function to trigger GC. We want to check that + // the underlying array in []bytes is accessible after GC will finish swapping. + for i := 0; i < 5; i++ { + str := unsafeConvertBytes() + runtime.GC() + <-time.NewTimer(2 * time.Millisecond).C + s.Equal("abc", str) + } +} + +func BenchmarkUnsafeStrToBytes(b *testing.B) { + for i := 0; i < b.N; i++ { + UnsafeStrToBytes(strconv.Itoa(i)) + } +} diff --git a/store/internal/encoding/changeset.go b/store/internal/encoding/changeset.go new file mode 100644 index 000000000000..8aefed75c327 --- /dev/null +++ b/store/internal/encoding/changeset.go @@ -0,0 +1,125 @@ +package encoding + +import ( + "bytes" + "fmt" + + corestore "cosmossdk.io/core/store" +) + +// encodedSize returns the size of the encoded Changeset. +func encodedSize(cs *corestore.Changeset) int { + size := EncodeUvarintSize(uint64(len(cs.Changes))) + for _, changes := range cs.Changes { + size += EncodeBytesSize(changes.Actor) + size += EncodeUvarintSize(uint64(len(changes.StateChanges))) + for _, pair := range changes.StateChanges { + size += EncodeBytesSize(pair.Key) + size += EncodeUvarintSize(1) // pair.Remove + if !pair.Remove { + size += EncodeBytesSize(pair.Value) + } + } + } + return size +} + +// MarshalChangeset returns the encoded byte representation of Changeset. +// NOTE: The Changeset is encoded as follows: +// - number of store keys (uvarint) +// - for each store key: +// -- store key (bytes) +// -- number of pairs (uvarint) +// -- for each pair: +// --- key (bytes) +// --- remove (1 byte) +// --- value (bytes) +func MarshalChangeset(cs *corestore.Changeset) ([]byte, error) { + var buf bytes.Buffer + buf.Grow(encodedSize(cs)) + + if err := EncodeUvarint(&buf, uint64(len(cs.Changes))); err != nil { + return nil, err + } + for _, changes := range cs.Changes { + if err := EncodeBytes(&buf, changes.Actor); err != nil { + return nil, err + } + if err := EncodeUvarint(&buf, uint64(len(changes.StateChanges))); err != nil { + return nil, err + } + for _, pair := range changes.StateChanges { + if err := EncodeBytes(&buf, pair.Key); err != nil { + return nil, err + } + if pair.Remove { + if err := EncodeUvarint(&buf, 1); err != nil { + return nil, err + } + } else { + if err := EncodeUvarint(&buf, 0); err != nil { + return nil, err + } + if err := EncodeBytes(&buf, pair.Value); err != nil { + return nil, err + } + } + } + } + + return buf.Bytes(), nil +} + +// UnmarshalChangeset decodes the Changeset from the given byte slice. +func UnmarshalChangeset(cs *corestore.Changeset, buf []byte) error { + storeCount, n, err := DecodeUvarint(buf) + if err != nil { + return err + } + buf = buf[n:] + changes := make([]corestore.StateChanges, storeCount) + for i := uint64(0); i < storeCount; i++ { + storeKey, n, err := DecodeBytes(buf) + if err != nil { + return err + } + buf = buf[n:] + + pairCount, n, err := DecodeUvarint(buf) + if err != nil { + return err + } + buf = buf[n:] + + pairs := make([]corestore.KVPair, pairCount) + for j := uint64(0); j < pairCount; j++ { + pairs[j].Key, n, err = DecodeBytes(buf) + if err != nil { + return err + } + buf = buf[n:] + + remove, n, err := DecodeUvarint(buf) + if err != nil { + return err + } + buf = buf[n:] + if remove == 0 { + pairs[j].Remove = false + pairs[j].Value, n, err = DecodeBytes(buf) + if err != nil { + return err + } + buf = buf[n:] + } else if remove == 1 { + pairs[j].Remove = true + } else { + return fmt.Errorf("invalid remove flag: %d", remove) + } + } + changes[i] = corestore.StateChanges{Actor: storeKey, StateChanges: pairs} + } + cs.Changes = changes + + return nil +} diff --git a/store/internal/encoding/changeset_test.go b/store/internal/encoding/changeset_test.go new file mode 100644 index 000000000000..03313936b9ea --- /dev/null +++ b/store/internal/encoding/changeset_test.go @@ -0,0 +1,95 @@ +package encoding + +import ( + "testing" + + "github.com/stretchr/testify/require" + + corestore "cosmossdk.io/core/store" +) + +func TestChangesetMarshal(t *testing.T) { + testcases := []struct { + name string + changeset *corestore.Changeset + encodedSize int + encodedBytes []byte + }{ + { + name: "empty", + changeset: corestore.NewChangeset(), + encodedSize: 1, + encodedBytes: []byte{0x0}, + }, + { + name: "one store", + changeset: &corestore.Changeset{Changes: []corestore.StateChanges{ + { + Actor: []byte("storekey"), + StateChanges: corestore.KVPairs{ + {Key: []byte("key"), Value: []byte("value"), Remove: false}, + }, + }, + }}, + encodedSize: 1 + 1 + 8 + 1 + 1 + 3 + 1 + 1 + 5, + encodedBytes: []byte{0x1, 0x8, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x6b, 0x65, 0x79, 0x1, 0x3, 0x6b, 0x65, 0x79, 0x0, 0x5, 0x76, 0x61, 0x6c, 0x75, 0x65}, + }, + { + name: "one remove store", + changeset: &corestore.Changeset{Changes: []corestore.StateChanges{ + { + Actor: []byte("storekey"), + StateChanges: corestore.KVPairs{ + {Key: []byte("key"), Remove: true}, + }, + }, + }}, + encodedSize: 1 + 1 + 8 + 1 + 1 + 3 + 1, + encodedBytes: []byte{0x1, 0x8, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x6b, 0x65, 0x79, 0x1, 0x3, 0x6b, 0x65, 0x79, 0x1}, + }, + { + name: "two stores", + changeset: &corestore.Changeset{Changes: []corestore.StateChanges{ + { + Actor: []byte("storekey1"), + StateChanges: corestore.KVPairs{ + {Key: []byte("key1"), Value: []byte("value1"), Remove: false}, + }, + }, + { + Actor: []byte("storekey2"), + StateChanges: corestore.KVPairs{ + {Key: []byte("key2"), Value: []byte("value2"), Remove: false}, + {Key: []byte("key1"), Remove: true}, + }, + }, + }}, + encodedSize: 2 + 1 + 9 + 1 + 1 + 4 + 1 + 6 + 1 + 9 + 1 + 1 + 4 + 1 + 1 + 6 + 1 + 4 + 1, + // encodedBytes: it is not deterministic, + }, + } + + for _, tc := range testcases { + t.Run(tc.name, func(t *testing.T) { + // check the encoded size + require.Equal(t, encodedSize(tc.changeset), tc.encodedSize, "encoded size mismatch") + // check the encoded bytes + encodedBytes, err := MarshalChangeset(tc.changeset) + require.NoError(t, err, "marshal error") + if len(tc.encodedBytes) != 0 { + require.Equal(t, encodedBytes, tc.encodedBytes, "encoded bytes mismatch") + } + // check the unmarshaled changeset + cs := corestore.NewChangeset() + require.NoError(t, UnmarshalChangeset(cs, encodedBytes), "unmarshal error") + require.Equal(t, len(tc.changeset.Changes), len(cs.Changes), "unmarshaled changeset store size mismatch") + for i, changes := range tc.changeset.Changes { + require.Equal(t, changes.Actor, cs.Changes[i].Actor, "unmarshaled changeset store key mismatch") + require.Equal(t, len(changes.StateChanges), len(cs.Changes[i].StateChanges), "unmarshaled changeset StateChanges size mismatch") + for j, pair := range changes.StateChanges { + require.Equal(t, pair, cs.Changes[i].StateChanges[j], "unmarshaled changeset pair mismatch") + } + } + }) + } +} diff --git a/store/migration/manager.go b/store/migration/manager.go index 48537664a3f4..43dc7dffc033 100644 --- a/store/migration/manager.go +++ b/store/migration/manager.go @@ -1,11 +1,20 @@ package migration import ( + "encoding/binary" + "fmt" + "sync" + "time" + "golang.org/x/sync/errgroup" + corestore "cosmossdk.io/core/store" "cosmossdk.io/log" "cosmossdk.io/store/v2" + "cosmossdk.io/store/v2/commitment" + "cosmossdk.io/store/v2/internal/encoding" "cosmossdk.io/store/v2/snapshots" + "cosmossdk.io/store/v2/storage" ) const ( @@ -13,25 +22,69 @@ const ( defaultChannelBufferSize = 1024 // defaultStorageBufferSize is the default buffer size for the storage snapshotter. defaultStorageBufferSize = 1024 + + migrateChangesetKeyFmt = "m/cs_%x" // m/cs_ ) +// VersionedChangeset is a pair of version and Changeset. +type VersionedChangeset struct { + Version uint64 + Changeset *corestore.Changeset +} + // Manager manages the migration of the whole state from store/v1 to store/v2. type Manager struct { logger log.Logger snapshotsManager *snapshots.Manager - storageSnapshotter snapshots.StorageSnapshotter - commitSnapshotter snapshots.CommitSnapshotter + stateStorage *storage.StorageStore + stateCommitment *commitment.CommitStore + + db store.RawDB + mtx sync.Mutex // mutex for migratedVersion + migratedVersion uint64 + + chChangeset <-chan *VersionedChangeset + chDone <-chan struct{} } // NewManager returns a new Manager. -func NewManager(sm *snapshots.Manager, ss snapshots.StorageSnapshotter, cs snapshots.CommitSnapshotter, logger log.Logger) *Manager { +func NewManager(db store.RawDB, sm *snapshots.Manager, ss *storage.StorageStore, sc *commitment.CommitStore, logger log.Logger) *Manager { return &Manager{ - logger: logger, - snapshotsManager: sm, - storageSnapshotter: ss, - commitSnapshotter: cs, + logger: logger, + snapshotsManager: sm, + stateStorage: ss, + stateCommitment: sc, + db: db, + } +} + +// Start starts the whole migration process. +// It migrates the whole state at the given version to the new store/v2 (both SC and SS). +// It also catches up the Changesets which are committed while the migration is in progress. +// `chChangeset` is the channel to receive the committed Changesets from the RootStore. +// `chDone` is the channel to receive the done signal from the RootStore. +// NOTE: It should be called by the RootStore, running in the background. +func (m *Manager) Start(version uint64, chChangeset <-chan *VersionedChangeset, chDone <-chan struct{}) error { + m.chChangeset = chChangeset + m.chDone = chDone + + go func() { + if err := m.writeChangeset(); err != nil { + m.logger.Error("failed to write changeset", "err", err) + } + }() + + if err := m.Migrate(version); err != nil { + return fmt.Errorf("failed to migrate state: %w", err) } + + return m.Sync() +} + +// GetStateCommitment returns the state commitment. +func (m *Manager) GetStateCommitment() *commitment.CommitStore { + return m.stateCommitment } // Migrate migrates the whole state at the given height to the new store/v2. @@ -45,17 +98,121 @@ func (m *Manager) Migrate(height uint64) error { } // restore the snapshot - chStorage := make(chan *store.KVPair, defaultStorageBufferSize) + chStorage := make(chan *corestore.StateChanges, defaultStorageBufferSize) eg := new(errgroup.Group) eg.Go(func() error { - return m.storageSnapshotter.Restore(height, chStorage) + return m.stateStorage.Restore(height, chStorage) }) eg.Go(func() error { defer close(chStorage) - _, err := m.commitSnapshotter.Restore(height, 0, ms, chStorage) + _, err := m.stateCommitment.Restore(height, 0, ms, chStorage) return err }) - return eg.Wait() + if err := eg.Wait(); err != nil { + return err + } + + m.mtx.Lock() + m.migratedVersion = height + m.mtx.Unlock() + + return nil +} + +// writeChangeset writes the Changeset to the db. +func (m *Manager) writeChangeset() error { + for vc := range m.chChangeset { + cs := vc.Changeset + buf := make([]byte, 8) + binary.BigEndian.PutUint64(buf, vc.Version) + csKey := []byte(fmt.Sprintf(migrateChangesetKeyFmt, buf)) + csBytes, err := encoding.MarshalChangeset(cs) + if err != nil { + return fmt.Errorf("failed to marshal changeset: %w", err) + } + + batch := m.db.NewBatch() + defer batch.Close() + + if err := batch.Set(csKey, csBytes); err != nil { + return fmt.Errorf("failed to write changeset to db.Batch: %w", err) + } + if err := batch.Write(); err != nil { + return fmt.Errorf("failed to write changeset to db: %w", err) + } + } + + return nil +} + +// GetMigratedVersion returns the migrated version. +// It is used to check the migrated version in the RootStore. +func (m *Manager) GetMigratedVersion() uint64 { + m.mtx.Lock() + defer m.mtx.Unlock() + return m.migratedVersion +} + +// Sync catches up the Changesets which are committed while the migration is in progress. +// It should be called after the migration is done. +func (m *Manager) Sync() error { + version := m.GetMigratedVersion() + if version == 0 { + return fmt.Errorf("migration is not done yet") + } + version += 1 + + for { + select { + case <-m.chDone: + return nil + default: + buf := make([]byte, 8) + binary.BigEndian.PutUint64(buf, version) + csKey := []byte(fmt.Sprintf(migrateChangesetKeyFmt, buf)) + csBytes, err := m.db.Get(csKey) + if err != nil { + return fmt.Errorf("failed to get changeset from db: %w", err) + } + if csBytes == nil { + // wait for the next changeset + time.Sleep(100 * time.Millisecond) + continue + } + + cs := corestore.NewChangeset() + if err := encoding.UnmarshalChangeset(cs, csBytes); err != nil { + return fmt.Errorf("failed to unmarshal changeset: %w", err) + } + + if err := m.stateCommitment.WriteBatch(cs); err != nil { + return fmt.Errorf("failed to write changeset to commitment: %w", err) + } + if _, err := m.stateCommitment.Commit(version); err != nil { + return fmt.Errorf("failed to commit changeset to commitment: %w", err) + } + if err := m.stateStorage.ApplyChangeset(version, cs); err != nil { + return fmt.Errorf("failed to write changeset to storage: %w", err) + } + + m.mtx.Lock() + m.migratedVersion = version + m.mtx.Unlock() + + version += 1 + } + } +} + +// Close closes the manager. It should be called after the migration is done. +// It will close the db and notify the snapshotsManager that the migration is done. +func (m *Manager) Close() error { + if err := m.db.Close(); err != nil { + return fmt.Errorf("failed to close db: %w", err) + } + m.snapshotsManager.EndMigration(m.stateCommitment) + + return nil } diff --git a/store/migration/manager_test.go b/store/migration/manager_test.go index c60a2376d4bd..0985dd561550 100644 --- a/store/migration/manager_test.go +++ b/store/migration/manager_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/require" + corestore "cosmossdk.io/core/store" "cosmossdk.io/log" - "cosmossdk.io/store/v2" "cosmossdk.io/store/v2/commitment" "cosmossdk.io/store/v2/commitment/iavl" dbm "cosmossdk.io/store/v2/db" @@ -50,7 +50,7 @@ func setupMigrationManager(t *testing.T) (*Manager, *commitment.CommitStore) { newCommitStore, err := commitment.NewCommitStore(multiTrees1, db1, nil, log.NewNopLogger()) // for store/v2 require.NoError(t, err) - return NewManager(snapshotsManager, newStorageStore, newCommitStore, log.NewNopLogger()), commitStore + return NewManager(db, snapshotsManager, newStorageStore, newCommitStore, log.NewNopLogger()), commitStore } func TestMigrateState(t *testing.T) { @@ -60,10 +60,10 @@ func TestMigrateState(t *testing.T) { toVersion := uint64(100) keyCount := 10 for version := uint64(1); version <= toVersion; version++ { - cs := store.NewChangeset() + cs := corestore.NewChangeset() for _, storeKey := range storeKeys { for i := 0; i < keyCount; i++ { - cs.Add(storeKey, []byte(fmt.Sprintf("key-%d-%d", version, i)), []byte(fmt.Sprintf("value-%d-%d", version, i))) + cs.Add([]byte(storeKey), []byte(fmt.Sprintf("key-%d-%d", version, i)), []byte(fmt.Sprintf("value-%d-%d", version, i)), false) } } require.NoError(t, orgCommitStore.WriteBatch(cs)) @@ -78,17 +78,17 @@ func TestMigrateState(t *testing.T) { for version := uint64(1); version < toVersion; version++ { for _, storeKey := range storeKeys { for i := 0; i < keyCount; i++ { - val, err := m.commitSnapshotter.(*commitment.CommitStore).Get(storeKey, toVersion-1, []byte(fmt.Sprintf("key-%d-%d", version, i))) + val, err := m.stateCommitment.Get([]byte(storeKey), toVersion-1, []byte(fmt.Sprintf("key-%d-%d", version, i))) require.NoError(t, err) require.Equal(t, []byte(fmt.Sprintf("value-%d-%d", version, i)), val) } } } // check the latest state - val, err := m.commitSnapshotter.(*commitment.CommitStore).Get("store1", toVersion-1, []byte("key-100-1")) + val, err := m.stateCommitment.Get([]byte("store1"), toVersion-1, []byte("key-100-1")) require.NoError(t, err) require.Nil(t, val) - val, err = m.commitSnapshotter.(*commitment.CommitStore).Get("store2", toVersion-1, []byte("key-100-0")) + val, err = m.stateCommitment.Get([]byte("store2"), toVersion-1, []byte("key-100-0")) require.NoError(t, err) require.Nil(t, val) @@ -96,7 +96,7 @@ func TestMigrateState(t *testing.T) { for version := uint64(1); version < toVersion; version++ { for _, storeKey := range storeKeys { for i := 0; i < keyCount; i++ { - val, err := m.storageSnapshotter.(*storage.StorageStore).Get(storeKey, toVersion-1, []byte(fmt.Sprintf("key-%d-%d", version, i))) + val, err := m.stateStorage.Get([]byte(storeKey), toVersion-1, []byte(fmt.Sprintf("key-%d-%d", version, i))) require.NoError(t, err) require.Equal(t, []byte(fmt.Sprintf("value-%d-%d", version, i)), val) } diff --git a/store/proof/commit_info.go b/store/proof/commit_info.go index 308bbdcc3b6b..91299ddca2c0 100644 --- a/store/proof/commit_info.go +++ b/store/proof/commit_info.go @@ -22,7 +22,7 @@ type ( // StoreInfo defines store-specific commit information. It contains a reference // between a store name/key and the commit ID. StoreInfo struct { - Name string + Name []byte CommitID CommitID } @@ -49,14 +49,14 @@ func (ci *CommitInfo) Hash() []byte { return ci.CommitHash } - rootHash, _, _ := ci.GetStoreProof("") + rootHash, _, _ := ci.GetStoreProof([]byte{}) return rootHash } // GetStoreCommitID returns the CommitID for the given store key. -func (ci *CommitInfo) GetStoreCommitID(storeKey string) CommitID { +func (ci *CommitInfo) GetStoreCommitID(storeKey []byte) CommitID { for _, si := range ci.StoreInfos { - if si.Name == storeKey { + if bytes.Equal(si.Name, storeKey) { return si.CommitID } } @@ -66,26 +66,26 @@ func (ci *CommitInfo) GetStoreCommitID(storeKey string) CommitID { // GetStoreProof takes in a storeKey and returns a proof of the store key in addition // to the root hash it should be proved against. If an empty string is provided, the first // store based on lexographical ordering will be proved. -func (ci *CommitInfo) GetStoreProof(storeKey string) ([]byte, *CommitmentOp, error) { +func (ci *CommitInfo) GetStoreProof(storeKey []byte) ([]byte, *CommitmentOp, error) { sort.Slice(ci.StoreInfos, func(i, j int) bool { - return ci.StoreInfos[i].Name < ci.StoreInfos[j].Name + return bytes.Compare(ci.StoreInfos[i].Name, ci.StoreInfos[j].Name) < 0 }) index := 0 leaves := make([][]byte, len(ci.StoreInfos)) for i, si := range ci.StoreInfos { var err error - leaves[i], err = LeafHash([]byte(si.Name), si.GetHash()) + leaves[i], err = LeafHash(si.Name, si.GetHash()) if err != nil { return nil, nil, err } - if si.Name == storeKey { + if bytes.Equal(si.Name, storeKey) { index = i } } rootHash, inners := ProofFromByteSlices(leaves, index) - commitmentOp := ConvertCommitmentOp(inners, []byte(storeKey), ci.StoreInfos[index].GetHash()) + commitmentOp := ConvertCommitmentOp(inners, storeKey, ci.StoreInfos[index].GetHash()) return rootHash, &commitmentOp, nil } @@ -96,7 +96,7 @@ func (ci *CommitInfo) encodedSize() int { size += encoding.EncodeVarintSize(ci.Timestamp.UnixNano()) size += encoding.EncodeUvarintSize(uint64(len(ci.StoreInfos))) for _, storeInfo := range ci.StoreInfos { - size += encoding.EncodeBytesSize([]byte(storeInfo.Name)) + size += encoding.EncodeBytesSize(storeInfo.Name) size += encoding.EncodeBytesSize(storeInfo.CommitID.Hash) } return size @@ -124,7 +124,7 @@ func (ci *CommitInfo) Marshal() ([]byte, error) { return nil, err } for _, si := range ci.StoreInfos { - if err := encoding.EncodeBytes(&buf, []byte(si.Name)); err != nil { + if err := encoding.EncodeBytes(&buf, si.Name); err != nil { return nil, err } if err := encoding.EncodeBytes(&buf, si.CommitID.Hash); err != nil { @@ -165,7 +165,7 @@ func (ci *CommitInfo) Unmarshal(buf []byte) error { return err } buf = buf[n:] - ci.StoreInfos[i].Name = string(name) + ci.StoreInfos[i].Name = name // CommitID hash, n, err := encoding.DecodeBytes(buf) if err != nil { diff --git a/store/proof/commit_info_test.go b/store/proof/commit_info_test.go index a890ccc4bebf..328f82869dde 100644 --- a/store/proof/commit_info_test.go +++ b/store/proof/commit_info_test.go @@ -12,27 +12,27 @@ func TestGetStoreProof(t *testing.T) { storeInfos []StoreInfo }{ {[]StoreInfo{ - {"key1", CommitID{1, []byte("value1")}}, + {[]byte("key1"), CommitID{1, []byte("value1")}}, }}, {[]StoreInfo{ - {"key2", CommitID{1, []byte("value2")}}, - {"key1", CommitID{1, []byte("value1")}}, + {[]byte("key2"), CommitID{1, []byte("value2")}}, + {[]byte("key1"), CommitID{1, []byte("value1")}}, }}, {[]StoreInfo{ - {"key3", CommitID{1, []byte("value3")}}, - {"key2", CommitID{1, []byte("value2")}}, - {"key1", CommitID{1, []byte("value1")}}, + {[]byte("key3"), CommitID{1, []byte("value3")}}, + {[]byte("key2"), CommitID{1, []byte("value2")}}, + {[]byte("key1"), CommitID{1, []byte("value1")}}, }}, {[]StoreInfo{ - {"key2", CommitID{1, []byte("value2")}}, - {"key1", CommitID{1, []byte("value1")}}, - {"key3", CommitID{1, []byte("value3")}}, + {[]byte("key2"), CommitID{1, []byte("value2")}}, + {[]byte("key1"), CommitID{1, []byte("value1")}}, + {[]byte("key3"), CommitID{1, []byte("value3")}}, }}, {[]StoreInfo{ - {"key4", CommitID{1, []byte("value4")}}, - {"key1", CommitID{1, []byte("value1")}}, - {"key3", CommitID{1, []byte("value3")}}, - {"key2", CommitID{1, []byte("value2")}}, + {[]byte("key4"), CommitID{1, []byte("value4")}}, + {[]byte("key1"), CommitID{1, []byte("value1")}}, + {[]byte("key3"), CommitID{1, []byte("value3")}}, + {[]byte("key2"), CommitID{1, []byte("value2")}}, }}, } @@ -45,7 +45,7 @@ func TestGetStoreProof(t *testing.T) { } commitHash := ci.Hash() // make sure the store infos are sorted - require.Equal(t, ci.StoreInfos[0].Name, "key1") + require.Equal(t, ci.StoreInfos[0].Name, []byte("key1")) for _, si := range tc.storeInfos { // get the proof _, proof, err := ci.GetStoreProof(si.Name) diff --git a/store/root/migrate_test.go b/store/root/migrate_test.go new file mode 100644 index 000000000000..5999fd053e66 --- /dev/null +++ b/store/root/migrate_test.go @@ -0,0 +1,160 @@ +package root + +import ( + "fmt" + "testing" + "time" + + "github.com/stretchr/testify/suite" + + corestore "cosmossdk.io/core/store" + "cosmossdk.io/log" + "cosmossdk.io/store/v2" + "cosmossdk.io/store/v2/commitment" + "cosmossdk.io/store/v2/commitment/iavl" + dbm "cosmossdk.io/store/v2/db" + "cosmossdk.io/store/v2/migration" + "cosmossdk.io/store/v2/snapshots" + "cosmossdk.io/store/v2/storage" + "cosmossdk.io/store/v2/storage/sqlite" +) + +var storeKeys = []string{"store1", "store2", "store3"} + +type MigrateStoreTestSuite struct { + suite.Suite + + rootStore store.RootStore +} + +func TestMigrateStoreTestSuite(t *testing.T) { + suite.Run(t, &MigrateStoreTestSuite{}) +} + +func (s *MigrateStoreTestSuite) SetupTest() { + testLog := log.NewTestLogger(s.T()) + nopLog := log.NewNopLogger() + + mdb := dbm.NewMemDB() + multiTrees := make(map[string]commitment.Tree) + for _, storeKey := range storeKeys { + prefixDB := dbm.NewPrefixDB(mdb, []byte(storeKey)) + multiTrees[storeKey] = iavl.NewIavlTree(prefixDB, nopLog, iavl.DefaultConfig()) + } + orgSC, err := commitment.NewCommitStore(multiTrees, mdb, nil, testLog) + s.Require().NoError(err) + + // apply changeset against the original store + toVersion := uint64(200) + keyCount := 10 + for version := uint64(1); version <= toVersion; version++ { + cs := corestore.NewChangeset() + for _, storeKey := range storeKeys { + for i := 0; i < keyCount; i++ { + cs.Add([]byte(storeKey), []byte(fmt.Sprintf("key-%d-%d", version, i)), []byte(fmt.Sprintf("value-%d-%d", version, i)), false) + } + } + s.Require().NoError(orgSC.WriteBatch(cs)) + _, err = orgSC.Commit(version) + s.Require().NoError(err) + } + + // create a new storage and commitment stores + sqliteDB, err := sqlite.New(s.T().TempDir()) + s.Require().NoError(err) + ss := storage.NewStorageStore(sqliteDB, nil, testLog) + + multiTrees1 := make(map[string]commitment.Tree) + for _, storeKey := range storeKeys { + multiTrees1[storeKey] = iavl.NewIavlTree(dbm.NewMemDB(), nopLog, iavl.DefaultConfig()) + } + sc, err := commitment.NewCommitStore(multiTrees1, dbm.NewMemDB(), nil, testLog) + s.Require().NoError(err) + + snapshotsStore, err := snapshots.NewStore(s.T().TempDir()) + s.Require().NoError(err) + snapshotManager := snapshots.NewManager(snapshotsStore, snapshots.NewSnapshotOptions(1500, 2), orgSC, nil, nil, testLog) + migrationManager := migration.NewManager(dbm.NewMemDB(), snapshotManager, ss, sc, testLog) + + // assume no storage store, simulate the migration process + s.rootStore, err = New(testLog, ss, orgSC, migrationManager, nil) + s.Require().NoError(err) +} + +func (s *MigrateStoreTestSuite) TestMigrateState() { + err := s.rootStore.LoadLatestVersion() + s.Require().NoError(err) + originalLatestVersion, err := s.rootStore.GetLatestVersion() + s.Require().NoError(err) + + // start the migration process + s.Require().NoError(s.rootStore.StartMigration()) + + // continue to apply changeset against the original store + latestVersion := originalLatestVersion + 1 + keyCount := 10 + for ; latestVersion < 2*originalLatestVersion; latestVersion++ { + cs := corestore.NewChangeset() + for _, storeKey := range storeKeys { + for i := 0; i < keyCount; i++ { + cs.Add([]byte(storeKey), []byte(fmt.Sprintf("key-%d-%d", latestVersion, i)), []byte(fmt.Sprintf("value-%d-%d", latestVersion, i)), false) + } + } + _, err := s.rootStore.WorkingHash(cs) + s.Require().NoError(err) + _, err = s.rootStore.Commit(cs) + s.Require().NoError(err) + + // check if the migration is completed + ver, err := s.rootStore.GetStateStorage().GetLatestVersion() + s.Require().NoError(err) + if ver == latestVersion { + break + } + + // add some delay to simulate the consensus process + time.Sleep(100 * time.Millisecond) + } + + // check if the migration is successful + version, err := s.rootStore.GetLatestVersion() + s.Require().NoError(err) + s.Require().Equal(latestVersion, version) + + // query against the migrated store + for version := uint64(1); version <= latestVersion; version++ { + for _, storeKey := range storeKeys { + for i := 0; i < keyCount; i++ { + targetVersion := version + if version < originalLatestVersion { + targetVersion = originalLatestVersion + } + res, err := s.rootStore.Query([]byte(storeKey), targetVersion, []byte(fmt.Sprintf("key-%d-%d", version, i)), true) + s.Require().NoError(err) + s.Require().Equal([]byte(fmt.Sprintf("value-%d-%d", version, i)), res.Value) + } + } + } + + // prune the old versions + err = s.rootStore.Prune(latestVersion - 1) + s.Require().NoError(err) + + // apply changeset against the migrated store + for version := latestVersion + 1; version <= latestVersion+10; version++ { + cs := corestore.NewChangeset() + for _, storeKey := range storeKeys { + for i := 0; i < keyCount; i++ { + cs.Add([]byte(storeKey), []byte(fmt.Sprintf("key-%d-%d", version, i)), []byte(fmt.Sprintf("value-%d-%d", version, i)), false) + } + } + _, err := s.rootStore.WorkingHash(cs) + s.Require().NoError(err) + _, err = s.rootStore.Commit(cs) + s.Require().NoError(err) + } + + version, err = s.rootStore.GetLatestVersion() + s.Require().NoError(err) + s.Require().Equal(latestVersion+10, version) +} diff --git a/store/root/reader.go b/store/root/reader.go index 51d798ba7518..39737f812266 100644 --- a/store/root/reader.go +++ b/store/root/reader.go @@ -2,12 +2,13 @@ package root import ( corestore "cosmossdk.io/core/store" - "cosmossdk.io/store/v2" ) -var _ corestore.Reader = (*Reader)(nil) -var _ corestore.ReaderMap = (*ReaderMap)(nil) +var ( + _ corestore.Reader = (*Reader)(nil) + _ corestore.ReaderMap = (*ReaderMap)(nil) +) // ReaderMap defines an adapter around a RootStore that only exposes read-only // operations. This is useful for exposing a read-only view of the RootStore at @@ -44,7 +45,7 @@ func NewReader(v uint64, rs store.RootStore, actor []byte) *Reader { } func (roa *Reader) Has(key []byte) (bool, error) { - val, err := roa.rootStore.GetStateStorage().Has(string(roa.actor), roa.version, key) // TODO: move storekeys to []byte + val, err := roa.rootStore.GetStateStorage().Has(roa.actor, roa.version, key) if err != nil { return false, err } @@ -53,7 +54,7 @@ func (roa *Reader) Has(key []byte) (bool, error) { } func (roa *Reader) Get(key []byte) ([]byte, error) { - result, err := roa.rootStore.GetStateStorage().Get(string(roa.actor), roa.version, key) // TODO: move storekeys to []byte + result, err := roa.rootStore.GetStateStorage().Get(roa.actor, roa.version, key) if err != nil { return nil, err } @@ -62,9 +63,9 @@ func (roa *Reader) Get(key []byte) ([]byte, error) { } func (roa *Reader) Iterator(start, end []byte) (corestore.Iterator, error) { - return roa.rootStore.GetStateStorage().Iterator(string(roa.actor), roa.version, start, end) + return roa.rootStore.GetStateStorage().Iterator(roa.actor, roa.version, start, end) } func (roa *Reader) ReverseIterator(start, end []byte) (corestore.Iterator, error) { - return roa.rootStore.GetStateStorage().ReverseIterator(string(roa.actor), roa.version, start, end) + return roa.rootStore.GetStateStorage().ReverseIterator(roa.actor, roa.version, start, end) } diff --git a/store/root/store.go b/store/root/store.go index 38e69bb5f4a9..91d007bd7dbb 100644 --- a/store/root/store.go +++ b/store/root/store.go @@ -4,6 +4,7 @@ import ( "bytes" "fmt" "slices" + "sync" "time" "github.com/cockroachdb/errors" @@ -14,6 +15,7 @@ import ( "cosmossdk.io/log" "cosmossdk.io/store/v2" "cosmossdk.io/store/v2/metrics" + "cosmossdk.io/store/v2/migration" "cosmossdk.io/store/v2/proof" ) @@ -27,8 +29,8 @@ type Store struct { logger log.Logger initialVersion uint64 - // stateStore reflects the state storage backend - stateStore store.VersionedDatabase + // stateStorage reflects the state storage backend + stateStorage store.VersionedDatabase // stateCommitment reflects the state commitment (SC) backend stateCommitment store.Committer @@ -44,30 +46,43 @@ type Store struct { // telemetry reflects a telemetry agent responsible for emitting metrics (if any) telemetry metrics.StoreMetrics + + // Migration related fields + // migrationManager reflects the migration manager used to migrate state from v1 to v2 + migrationManager *migration.Manager + // chChangeset reflects the channel used to send the changeset to the migration manager + chChangeset chan *migration.VersionedChangeset + // chDone reflects the channel used to signal the migration manager that the migration + // is done + chDone chan struct{} + // isMigrating reflects whether the store is currently migrating + isMigrating bool } func New( logger log.Logger, ss store.VersionedDatabase, sc store.Committer, + mm *migration.Manager, m metrics.StoreMetrics, ) (store.RootStore, error) { return &Store{ - logger: logger.With("module", "root_store"), - initialVersion: 1, - stateStore: ss, - stateCommitment: sc, - telemetry: m, + logger: logger.With("module", "root_store"), + initialVersion: 1, + stateStorage: ss, + stateCommitment: sc, + migrationManager: mm, + telemetry: m, }, nil } // Close closes the store and resets all internal fields. Note, Close() is NOT // idempotent and should only be called once. func (s *Store) Close() (err error) { - err = errors.Join(err, s.stateStore.Close()) + err = errors.Join(err, s.stateStorage.Close()) err = errors.Join(err, s.stateCommitment.Close()) - s.stateStore = nil + s.stateStorage = nil s.stateCommitment = nil s.lastCommitInfo = nil s.commitHeader = nil @@ -107,7 +122,7 @@ func (s *Store) StateAt(v uint64) (corestore.ReaderMap, error) { } func (s *Store) GetStateStorage() store.VersionedDatabase { - return s.stateStore + return s.stateStorage } func (s *Store) GetStateCommitment() store.Committer { @@ -116,32 +131,17 @@ func (s *Store) GetStateCommitment() store.Committer { // LastCommitID returns a CommitID based off of the latest internal CommitInfo. // If an internal CommitInfo is not set, a new one will be returned with only the -// latest version set, which is based off of the SS view. +// latest version set, which is based off of the SC view. func (s *Store) LastCommitID() (proof.CommitID, error) { if s.lastCommitInfo != nil { return s.lastCommitInfo.CommitID(), nil } - // XXX/TODO: We cannot use SS to get the latest version when lastCommitInfo - // is nil if SS is flushed asynchronously. This is because the latest version - // in SS might not be the latest version in the SC stores. - // - // Ref: https://github.com/cosmos/cosmos-sdk/issues/17314 - latestVersion, err := s.stateStore.GetLatestVersion() - if err != nil { - return proof.CommitID{}, err - } - - // sanity check: ensure integrity of latest version against SC - scVersion, err := s.stateCommitment.GetLatestVersion() + latestVersion, err := s.stateCommitment.GetLatestVersion() if err != nil { return proof.CommitID{}, err } - if scVersion != latestVersion { - return proof.CommitID{}, fmt.Errorf("SC and SS version mismatch; got: %d, expected: %d", scVersion, latestVersion) - } - return proof.CommitID{Version: latestVersion}, nil } @@ -157,13 +157,13 @@ func (s *Store) GetLatestVersion() (uint64, error) { return lastCommitID.Version, nil } -func (s *Store) Query(storeKey string, version uint64, key []byte, prove bool) (store.QueryResult, error) { +func (s *Store) Query(storeKey []byte, version uint64, key []byte, prove bool) (store.QueryResult, error) { if s.telemetry != nil { now := time.Now() defer s.telemetry.MeasureSince(now, "root_store", "query") } - val, err := s.stateStore.Get(storeKey, version, key) + val, err := s.stateStorage.Get(storeKey, version, key) if err != nil || val == nil { // fallback to querying SC backend if not found in SS backend // @@ -249,7 +249,7 @@ func (s *Store) SetCommitHeader(h *coreheader.Info) { // If working hash is nil, then we need to compute and set it on the root store // by constructing a CommitInfo object, which in turn creates and writes a batch // of the current changeset to the SC tree. -func (s *Store) WorkingHash(cs *store.Changeset) ([]byte, error) { +func (s *Store) WorkingHash(cs *corestore.Changeset) ([]byte, error) { if s.telemetry != nil { now := time.Now() defer s.telemetry.MeasureSince(now, "root_store", "working_hash") @@ -271,7 +271,7 @@ func (s *Store) WorkingHash(cs *store.Changeset) ([]byte, error) { // with the same Changeset, which internally sets the working hash, retrieved by // writing a batch of the changeset to the SC tree, and CommitInfo on the root // store. -func (s *Store) Commit(cs *store.Changeset) ([]byte, error) { +func (s *Store) Commit(cs *corestore.Changeset) ([]byte, error) { if s.telemetry != nil { now := time.Now() defer s.telemetry.MeasureSince(now, "root_store", "commit") @@ -291,7 +291,13 @@ func (s *Store) Commit(cs *store.Changeset) ([]byte, error) { // commit SS async eg.Go(func() error { - if err := s.stateStore.ApplyChangeset(version, cs); err != nil { + // if we're migrating, we don't want to commit to the state storage + // to avoid parallel writes + if s.isMigrating { + return nil + } + + if err := s.stateStorage.ApplyChangeset(version, cs); err != nil { return fmt.Errorf("failed to commit SS: %w", err) } @@ -327,7 +333,7 @@ func (s *Store) Prune(version uint64) error { defer s.telemetry.MeasureSince(now, "root_store", "prune") } - if err := s.stateStore.Prune(version); err != nil { + if err := s.stateStorage.Prune(version); err != nil { return fmt.Errorf("failed to prune SS store: %w", err) } @@ -338,11 +344,67 @@ func (s *Store) Prune(version uint64) error { return nil } +// StartMigration starts the migration process and initializes the channels. +// An error is returned if migration is already in progress. +// NOTE: This method should only be called once after loadVersion. +func (s *Store) StartMigration() error { + if s.isMigrating { + return fmt.Errorf("migration already in progress") + } + + // buffer at most 1 changeset, if the receiver is behind attempting to buffer + // more than 1 will block. + s.chChangeset = make(chan *migration.VersionedChangeset, 1) + // it is used to signal the migration manager that the migration is done + s.chDone = make(chan struct{}) + + s.isMigrating = true + + mtx := sync.Mutex{} + mtx.Lock() + go func() { + version := s.lastCommitInfo.Version + s.logger.Info("starting migration", "version", version) + mtx.Unlock() + if err := s.migrationManager.Start(version, s.chChangeset, s.chDone); err != nil { + s.logger.Error("failed to start migration", "err", err) + } + }() + + // wait for the migration manager to start + mtx.Lock() + defer mtx.Unlock() + + return nil +} + // writeSC accepts a Changeset and writes that as a batch to the underlying SC // tree, which allows us to retrieve the working hash of the SC tree. Finally, // we construct a *CommitInfo and set that as lastCommitInfo. Note, this should // only be called once per block! -func (s *Store) writeSC(cs *store.Changeset) error { +// If migration is in progress, the changeset is sent to the migration manager. +func (s *Store) writeSC(cs *corestore.Changeset) error { + if s.isMigrating { + // if the migration manager has already migrated to the version, close the + // channels and replace the state commitment + if s.migrationManager.GetMigratedVersion() == s.lastCommitInfo.Version { + close(s.chDone) + close(s.chChangeset) + s.isMigrating = false + // close the old state commitment and replace it with the new one + if err := s.stateCommitment.Close(); err != nil { + return fmt.Errorf("failed to close the old SC store: %w", err) + } + s.stateCommitment = s.migrationManager.GetStateCommitment() + if err := s.migrationManager.Close(); err != nil { + return fmt.Errorf("failed to close migration manager: %w", err) + } + s.logger.Info("migration completed", "version", s.lastCommitInfo.Version) + } else { + s.chChangeset <- &migration.VersionedChangeset{Version: s.lastCommitInfo.Version + 1, Changeset: cs} + } + } + if err := s.stateCommitment.WriteBatch(cs); err != nil { return fmt.Errorf("failed to write batch to SC store: %w", err) } @@ -372,7 +434,7 @@ func (s *Store) writeSC(cs *store.Changeset) error { // should have already been written to the SC via WorkingHash(). This method // solely commits that batch. An error is returned if commit fails or if the // resulting commit hash is not equivalent to the working hash. -func (s *Store) commitSC(cs *store.Changeset) error { +func (s *Store) commitSC(cs *corestore.Changeset) error { cInfo, err := s.stateCommitment.Commit(s.lastCommitInfo.Version) if err != nil { return fmt.Errorf("failed to commit SC store: %w", err) diff --git a/store/root/store_test.go b/store/root/store_test.go index 7974425d47dd..d6c52367a265 100644 --- a/store/root/store_test.go +++ b/store/root/store_test.go @@ -7,6 +7,7 @@ import ( "github.com/stretchr/testify/suite" coreheader "cosmossdk.io/core/header" + corestore "cosmossdk.io/core/store" "cosmossdk.io/log" "cosmossdk.io/store/v2" "cosmossdk.io/store/v2/commitment" @@ -22,6 +23,12 @@ const ( testStoreKey3 = "test_store_key3" ) +var ( + testStoreKeyBytes = []byte(testStoreKey) + testStoreKey2Bytes = []byte(testStoreKey2) + testStoreKey3Bytes = []byte(testStoreKey3) +) + type RootStoreTestSuite struct { suite.Suite @@ -45,7 +52,7 @@ func (s *RootStoreTestSuite) SetupTest() { sc, err := commitment.NewCommitStore(map[string]commitment.Tree{testStoreKey: tree, testStoreKey2: tree2, testStoreKey3: tree3}, dbm.NewMemDB(), nil, noopLog) s.Require().NoError(err) - rs, err := New(noopLog, ss, sc, nil) + rs, err := New(noopLog, ss, sc, nil, nil) s.Require().NoError(err) s.rootStore = rs @@ -61,7 +68,7 @@ func (s *RootStoreTestSuite) TestGetStateCommitment() { } func (s *RootStoreTestSuite) TestGetStateStorage() { - s.Require().Equal(s.rootStore.GetStateStorage(), s.rootStore.(*Store).stateStore) + s.Require().Equal(s.rootStore.GetStateStorage(), s.rootStore.(*Store).stateStorage) } func (s *RootStoreTestSuite) TestSetInitialVersion() { @@ -80,12 +87,12 @@ func (s *RootStoreTestSuite) TestSetCommitHeader() { } func (s *RootStoreTestSuite) TestQuery() { - _, err := s.rootStore.Query("", 1, []byte("foo"), true) + _, err := s.rootStore.Query([]byte{}, 1, []byte("foo"), true) s.Require().Error(err) // write and commit a changeset - cs := store.NewChangeset() - cs.Add(testStoreKey, []byte("foo"), []byte("bar")) + cs := corestore.NewChangeset() + cs.Add(testStoreKeyBytes, []byte("foo"), []byte("bar"), false) workingHash, err := s.rootStore.WorkingHash(cs) s.Require().NoError(err) @@ -97,7 +104,7 @@ func (s *RootStoreTestSuite) TestQuery() { s.Require().Equal(workingHash, commitHash) // ensure the proof is non-nil for the corresponding version - result, err := s.rootStore.Query(testStoreKey, 1, []byte("foo"), true) + result, err := s.rootStore.Query([]byte(testStoreKey), 1, []byte("foo"), true) s.Require().NoError(err) s.Require().NotNil(result.ProofOps) s.Require().Equal([]byte("foo"), result.ProofOps[0].Key) @@ -107,8 +114,8 @@ func (s *RootStoreTestSuite) TestGetFallback() { sc := s.rootStore.GetStateCommitment() // create a changeset and commit it to SC ONLY - cs := store.NewChangeset() - cs.Add(testStoreKey, []byte("foo"), []byte("bar")) + cs := corestore.NewChangeset() + cs.Add(testStoreKeyBytes, []byte("foo"), []byte("bar"), false) err := sc.WriteBatch(cs) s.Require().NoError(err) @@ -118,25 +125,25 @@ func (s *RootStoreTestSuite) TestGetFallback() { s.Require().NoError(err) // ensure we can query for the key, which should fallback to SC - qResult, err := s.rootStore.Query(testStoreKey, 1, []byte("foo"), false) + qResult, err := s.rootStore.Query(testStoreKeyBytes, 1, []byte("foo"), false) s.Require().NoError(err) s.Require().Equal([]byte("bar"), qResult.Value) // non-existent key - qResult, err = s.rootStore.Query(testStoreKey, 1, []byte("non_existent_key"), false) + qResult, err = s.rootStore.Query(testStoreKeyBytes, 1, []byte("non_existent_key"), false) s.Require().NoError(err) s.Require().Nil(qResult.Value) } func (s *RootStoreTestSuite) TestQueryProof() { - cs := store.NewChangeset() + cs := corestore.NewChangeset() // testStoreKey - cs.Add(testStoreKey, []byte("key1"), []byte("value1")) - cs.Add(testStoreKey, []byte("key2"), []byte("value2")) + cs.Add(testStoreKeyBytes, []byte("key1"), []byte("value1"), false) + cs.Add(testStoreKeyBytes, []byte("key2"), []byte("value2"), false) // testStoreKey2 - cs.Add(testStoreKey2, []byte("key3"), []byte("value3")) + cs.Add(testStoreKey2Bytes, []byte("key3"), []byte("value3"), false) // testStoreKey3 - cs.Add(testStoreKey3, []byte("key4"), []byte("value4")) + cs.Add(testStoreKey3Bytes, []byte("key4"), []byte("value4"), false) // commit _, err := s.rootStore.WorkingHash(cs) @@ -145,12 +152,12 @@ func (s *RootStoreTestSuite) TestQueryProof() { s.Require().NoError(err) // query proof for testStoreKey - result, err := s.rootStore.Query(testStoreKey, 1, []byte("key1"), true) + result, err := s.rootStore.Query(testStoreKeyBytes, 1, []byte("key1"), true) s.Require().NoError(err) s.Require().NotNil(result.ProofOps) cInfo, err := s.rootStore.GetStateCommitment().GetCommitInfo(1) s.Require().NoError(err) - storeHash := cInfo.GetStoreCommitID(testStoreKey).Hash + storeHash := cInfo.GetStoreCommitID(testStoreKeyBytes).Hash treeRoots, err := result.ProofOps[0].Run([][]byte{[]byte("value1")}) s.Require().NoError(err) s.Require().Equal(treeRoots[0], storeHash) @@ -164,8 +171,8 @@ func (s *RootStoreTestSuite) TestLoadVersion() { for v := 1; v <= 5; v++ { val := fmt.Sprintf("val%03d", v) // val001, val002, ..., val005 - cs := store.NewChangeset() - cs.Add(testStoreKey, []byte("key"), []byte(val)) + cs := corestore.NewChangeset() + cs.Add(testStoreKeyBytes, []byte("key"), []byte(val), false) workingHash, err := s.rootStore.WorkingHash(cs) s.Require().NoError(err) @@ -199,7 +206,7 @@ func (s *RootStoreTestSuite) TestLoadVersion() { _, ro, err := s.rootStore.StateLatest() s.Require().NoError(err) - reader, err := ro.GetReader([]byte(testStoreKey)) + reader, err := ro.GetReader(testStoreKeyBytes) s.Require().NoError(err) val, err := reader.Get([]byte("key")) s.Require().NoError(err) @@ -209,8 +216,8 @@ func (s *RootStoreTestSuite) TestLoadVersion() { for v := 4; v <= 5; v++ { val := fmt.Sprintf("overwritten_val%03d", v) // overwritten_val004, overwritten_val005 - cs := store.NewChangeset() - cs.Add(testStoreKey, []byte("key"), []byte(val)) + cs := corestore.NewChangeset() + cs.Add(testStoreKeyBytes, []byte("key"), []byte(val), false) workingHash, err := s.rootStore.WorkingHash(cs) s.Require().NoError(err) @@ -231,7 +238,7 @@ func (s *RootStoreTestSuite) TestLoadVersion() { _, ro, err = s.rootStore.StateLatest() s.Require().NoError(err) - reader, err = ro.GetReader([]byte(testStoreKey)) + reader, err = ro.GetReader(testStoreKeyBytes) s.Require().NoError(err) val, err = reader.Get([]byte("key")) s.Require().NoError(err) @@ -244,12 +251,12 @@ func (s *RootStoreTestSuite) TestCommit() { s.Require().Zero(lv) // perform changes - cs := store.NewChangeset() + cs := corestore.NewChangeset() for i := 0; i < 100; i++ { key := fmt.Sprintf("key%03d", i) // key000, key001, ..., key099 val := fmt.Sprintf("val%03d", i) // val000, val001, ..., val099 - cs.Add(testStoreKey, []byte(key), []byte(val)) + cs.Add(testStoreKeyBytes, []byte(key), []byte(val), false) } // committing w/o calling WorkingHash should error @@ -277,7 +284,7 @@ func (s *RootStoreTestSuite) TestCommit() { key := fmt.Sprintf("key%03d", i) // key000, key001, ..., key099 val := fmt.Sprintf("val%03d", i) // val000, val001, ..., val099 - reader, err := ro.GetReader([]byte(testStoreKey)) + reader, err := ro.GetReader(testStoreKeyBytes) s.Require().NoError(err) result, err := reader.Get([]byte(key)) s.Require().NoError(err) @@ -290,12 +297,12 @@ func (s *RootStoreTestSuite) TestStateAt() { // write keys over multiple versions for v := uint64(1); v <= 5; v++ { // perform changes - cs := store.NewChangeset() + cs := corestore.NewChangeset() for i := 0; i < 100; i++ { key := fmt.Sprintf("key%03d", i) // key000, key001, ..., key099 val := fmt.Sprintf("val%03d_%03d", i, v) // val000_1, val001_1, ..., val099_1 - cs.Add(testStoreKey, []byte(key), []byte(val)) + cs.Add(testStoreKeyBytes, []byte(key), []byte(val), false) } // execute WorkingHash and Commit @@ -320,7 +327,7 @@ func (s *RootStoreTestSuite) TestStateAt() { key := fmt.Sprintf("key%03d", i) // key000, key001, ..., key099 val := fmt.Sprintf("val%03d_%03d", i, v) // val000_1, val001_1, ..., val099_1 - reader, err := ro.GetReader([]byte(testStoreKey)) + reader, err := ro.GetReader(testStoreKeyBytes) s.Require().NoError(err) result, err := reader.Get([]byte(key)) s.Require().NoError(err) diff --git a/store/snapshots/helpers_test.go b/store/snapshots/helpers_test.go index f01a2b635252..156014af5d8a 100644 --- a/store/snapshots/helpers_test.go +++ b/store/snapshots/helpers_test.go @@ -13,9 +13,9 @@ import ( protoio "github.com/cosmos/gogoproto/io" "github.com/stretchr/testify/require" + corestore "cosmossdk.io/core/store" errorsmod "cosmossdk.io/errors" "cosmossdk.io/log" - "cosmossdk.io/store/v2" "cosmossdk.io/store/v2/snapshots" snapshotstypes "cosmossdk.io/store/v2/snapshots/types" ) @@ -109,7 +109,7 @@ type mockCommitSnapshotter struct { } func (m *mockCommitSnapshotter) Restore( - height uint64, format uint32, protoReader protoio.Reader, chStorage chan<- *store.KVPair, + height uint64, format uint32, protoReader protoio.Reader, chStorage chan<- *corestore.StateChanges, ) (snapshotstypes.SnapshotItem, error) { if format == 0 { return snapshotstypes.SnapshotItem{}, snapshotstypes.ErrUnknownFormat @@ -157,7 +157,7 @@ func (m *mockCommitSnapshotter) SupportedFormats() []uint32 { type mockStorageSnapshotter struct{} -func (m *mockStorageSnapshotter) Restore(version uint64, chStorage <-chan *store.KVPair) error { +func (m *mockStorageSnapshotter) Restore(version uint64, chStorage <-chan *corestore.StateChanges) error { return nil } @@ -170,7 +170,7 @@ func (m *mockErrorCommitSnapshotter) Snapshot(height uint64, protoWriter protoio } func (m *mockErrorCommitSnapshotter) Restore( - height uint64, format uint32, protoReader protoio.Reader, chStorage chan<- *store.KVPair, + height uint64, format uint32, protoReader protoio.Reader, chStorage chan<- *corestore.StateChanges, ) (snapshotstypes.SnapshotItem, error) { return snapshotstypes.SnapshotItem{}, errors.New("mock restore error") } @@ -234,7 +234,7 @@ func (m *hungCommitSnapshotter) Snapshot(height uint64, protoWriter protoio.Writ } func (m *hungCommitSnapshotter) Restore( - height uint64, format uint32, protoReader protoio.Reader, chStorage chan<- *store.KVPair, + height uint64, format uint32, protoReader protoio.Reader, chStorage chan<- *corestore.StateChanges, ) (snapshotstypes.SnapshotItem, error) { panic("not implemented") } diff --git a/store/snapshots/manager.go b/store/snapshots/manager.go index c4a4bead3633..4c54ac4c6bae 100644 --- a/store/snapshots/manager.go +++ b/store/snapshots/manager.go @@ -11,9 +11,9 @@ import ( "sort" "sync" + corestore "cosmossdk.io/core/store" errorsmod "cosmossdk.io/errors" "cosmossdk.io/log" - "cosmossdk.io/store/v2" storeerrors "cosmossdk.io/store/v2/errors" "cosmossdk.io/store/v2/snapshots/types" ) @@ -73,7 +73,7 @@ const ( snapshotMaxItemSize = int(64e6) // SDK has no key/value size limit, so we set an arbitrary limit ) -var ErrOptsZeroSnapshotInterval = errors.New("snaphot-interval must not be 0") +var ErrOptsZeroSnapshotInterval = errors.New("snapshot-interval must not be 0") // NewManager creates a new manager. func NewManager(store *Store, opts SnapshotOptions, commitSnapshotter CommitSnapshotter, storageSnapshotter StorageSnapshotter, extensions map[string]ExtensionSnapshotter, logger log.Logger) *Manager { @@ -245,7 +245,7 @@ func (m *Manager) CreateMigration(height uint64, protoWriter WriteCloser) error if err != nil { return err } - defer m.end() + // m.end() will be called by the migration manager with EndMigration(). go func() { if err := m.commitSnapshotter.Snapshot(height, protoWriter); err != nil { @@ -258,6 +258,13 @@ func (m *Manager) CreateMigration(height uint64, protoWriter WriteCloser) error return nil } +// EndMigration ends the migration operation. +// It will replace the current commitSnapshotter with the new one. +func (m *Manager) EndMigration(commitSnapshotter CommitSnapshotter) { + defer m.end() + m.commitSnapshotter = commitSnapshotter +} + // List lists snapshots, mirroring ABCI ListSnapshots. It can be concurrent with other operations. func (m *Manager) List() ([]*types.Snapshot, error) { return m.store.List() @@ -392,7 +399,7 @@ func (m *Manager) doRestoreSnapshot(snapshot types.Snapshot, chChunks <-chan io. } // chStorage is the channel to pass the KV pairs to the storage snapshotter. - chStorage := make(chan *store.KVPair, defaultStorageChannelBufferSize) + chStorage := make(chan *corestore.StateChanges, defaultStorageChannelBufferSize) defer close(chStorage) storageErrs := make(chan error, 1) diff --git a/store/snapshots/manager_test.go b/store/snapshots/manager_test.go index b06c28216320..8295bdf5f665 100644 --- a/store/snapshots/manager_test.go +++ b/store/snapshots/manager_test.go @@ -232,6 +232,17 @@ func TestManager_Restore(t *testing.T) { Metadata: types.Metadata{ChunkHashes: checksums(chunks)}, }) require.NoError(t, err) + + // Feeding the chunks should work + for i, chunk := range chunks { + done, err := manager.RestoreChunk(chunk) + require.NoError(t, err) + if i == len(chunks)-1 { + assert.True(t, done) + } else { + assert.False(t, done) + } + } } func TestManager_TakeError(t *testing.T) { diff --git a/store/snapshots/snapshotter.go b/store/snapshots/snapshotter.go index 7c8321f3c838..9b054060a36d 100644 --- a/store/snapshots/snapshotter.go +++ b/store/snapshots/snapshotter.go @@ -3,7 +3,7 @@ package snapshots import ( protoio "github.com/cosmos/gogoproto/io" - "cosmossdk.io/store/v2" + corestore "cosmossdk.io/core/store" "cosmossdk.io/store/v2/snapshots/types" ) @@ -14,13 +14,13 @@ type CommitSnapshotter interface { Snapshot(version uint64, protoWriter protoio.Writer) error // Restore restores the commitment state from the snapshot reader. - Restore(version uint64, format uint32, protoReader protoio.Reader, chStorage chan<- *store.KVPair) (types.SnapshotItem, error) + Restore(version uint64, format uint32, protoReader protoio.Reader, chStorage chan<- *corestore.StateChanges) (types.SnapshotItem, error) } // StorageSnapshotter defines an API for restoring snapshots of the storage state. type StorageSnapshotter interface { // Restore restores the storage state from the given channel. - Restore(version uint64, chStorage <-chan *store.KVPair) error + Restore(version uint64, chStorage <-chan *corestore.StateChanges) error } // ExtensionPayloadReader read extension payloads, diff --git a/store/storage/README.md b/store/storage/README.md index 3a05d77864b1..1cc47b347b9a 100644 --- a/store/storage/README.md +++ b/store/storage/README.md @@ -100,7 +100,7 @@ with only the necessary methods. The `StorageStore` interface is meant to wrap o accept this `Database` type, e.g. RocksDB. The `StorageStore` interface is an abstraction or wrapper around the backing SS -engine can be seen as the the main entry point to using SS. +engine can be seen as the main entry point to using SS. Higher up the stack, there should exist a `root.Store` implementation. The `root.Store` is meant to encapsulate both an SS backend and an SC backend. The SS backend is diff --git a/store/storage/database.go b/store/storage/database.go index 05a7fedcf119..fba599839594 100644 --- a/store/storage/database.go +++ b/store/storage/database.go @@ -12,13 +12,13 @@ import ( // backends, such as restoring snapshots. type Database interface { NewBatch(version uint64) (store.Batch, error) - Has(storeKey string, version uint64, key []byte) (bool, error) - Get(storeKey string, version uint64, key []byte) ([]byte, error) + Has(storeKey []byte, version uint64, key []byte) (bool, error) + Get(storeKey []byte, version uint64, key []byte) ([]byte, error) GetLatestVersion() (uint64, error) SetLatestVersion(version uint64) error - Iterator(storeKey string, version uint64, start, end []byte) (corestore.Iterator, error) - ReverseIterator(storeKey string, version uint64, start, end []byte) (corestore.Iterator, error) + Iterator(storeKey []byte, version uint64, start, end []byte) (corestore.Iterator, error) + ReverseIterator(storeKey []byte, version uint64, start, end []byte) (corestore.Iterator, error) Prune(version uint64) error diff --git a/store/storage/pebbledb/batch.go b/store/storage/pebbledb/batch.go index 5e9548d97c25..101986878c81 100644 --- a/store/storage/pebbledb/batch.go +++ b/store/storage/pebbledb/batch.go @@ -41,11 +41,12 @@ func (b *Batch) Size() int { return b.batch.Len() } -func (b *Batch) Reset() { +func (b *Batch) Reset() error { b.batch.Reset() + return nil } -func (b *Batch) set(storeKey string, tombstone uint64, key, value []byte) error { +func (b *Batch) set(storeKey []byte, tombstone uint64, key, value []byte) error { prefixedKey := MVCCEncode(prependStoreKey(storeKey, key), b.version) prefixedVal := MVCCEncode(value, tombstone) @@ -56,11 +57,11 @@ func (b *Batch) set(storeKey string, tombstone uint64, key, value []byte) error return nil } -func (b *Batch) Set(storeKey string, key, value []byte) error { +func (b *Batch) Set(storeKey, key, value []byte) error { return b.set(storeKey, 0, key, value) } -func (b *Batch) Delete(storeKey string, key []byte) error { +func (b *Batch) Delete(storeKey, key []byte) error { return b.set(storeKey, b.version, key, []byte(tombstoneVal)) } diff --git a/store/storage/pebbledb/db.go b/store/storage/pebbledb/db.go index 8d502d46cf27..bc6b4c988f0d 100644 --- a/store/storage/pebbledb/db.go +++ b/store/storage/pebbledb/db.go @@ -138,7 +138,7 @@ func (db *Database) setPruneHeight(pruneVersion uint64) error { return db.storage.Set([]byte(pruneHeightKey), ts[:], &pebble.WriteOptions{Sync: db.sync}) } -func (db *Database) Has(storeKey string, version uint64, key []byte) (bool, error) { +func (db *Database) Has(storeKey []byte, version uint64, key []byte) (bool, error) { val, err := db.Get(storeKey, version, key) if err != nil { return false, err @@ -147,7 +147,7 @@ func (db *Database) Has(storeKey string, version uint64, key []byte) (bool, erro return val != nil, nil } -func (db *Database) Get(storeKey string, targetVersion uint64, key []byte) ([]byte, error) { +func (db *Database) Get(storeKey []byte, targetVersion uint64, key []byte) ([]byte, error) { if targetVersion < db.earliestVersion { return nil, storeerrors.ErrVersionPruned{EarliestVersion: db.earliestVersion} } @@ -267,7 +267,7 @@ func (db *Database) Prune(version uint64) error { return db.setPruneHeight(version) } -func (db *Database) Iterator(storeKey string, version uint64, start, end []byte) (corestore.Iterator, error) { +func (db *Database) Iterator(storeKey []byte, version uint64, start, end []byte) (corestore.Iterator, error) { if (start != nil && len(start) == 0) || (end != nil && len(end) == 0) { return nil, storeerrors.ErrKeyEmpty } @@ -291,7 +291,7 @@ func (db *Database) Iterator(storeKey string, version uint64, start, end []byte) return newPebbleDBIterator(itr, storePrefix(storeKey), start, end, version, db.earliestVersion, false), nil } -func (db *Database) ReverseIterator(storeKey string, version uint64, start, end []byte) (corestore.Iterator, error) { +func (db *Database) ReverseIterator(storeKey []byte, version uint64, start, end []byte) (corestore.Iterator, error) { if (start != nil && len(start) == 0) || (end != nil && len(end) == 0) { return nil, storeerrors.ErrKeyEmpty } @@ -315,11 +315,11 @@ func (db *Database) ReverseIterator(storeKey string, version uint64, start, end return newPebbleDBIterator(itr, storePrefix(storeKey), start, end, version, db.earliestVersion, true), nil } -func storePrefix(storeKey string) []byte { - return []byte(fmt.Sprintf(StorePrefixTpl, storeKey)) +func storePrefix(storeKey []byte) []byte { + return append([]byte(StorePrefixTpl), storeKey...) } -func prependStoreKey(storeKey string, key []byte) []byte { +func prependStoreKey(storeKey, key []byte) []byte { return append(storePrefix(storeKey), key...) } @@ -362,7 +362,7 @@ func valTombstoned(value []byte) bool { return true } -func getMVCCSlice(db *pebble.DB, storeKey string, key []byte, version uint64) ([]byte, error) { +func getMVCCSlice(db *pebble.DB, storeKey, key []byte, version uint64) ([]byte, error) { // end domain is exclusive, so we need to increment the version by 1 if version < math.MaxUint64 { version++ diff --git a/store/storage/rocksdb/batch.go b/store/storage/rocksdb/batch.go index e780b8059c78..98d7d33f152e 100644 --- a/store/storage/rocksdb/batch.go +++ b/store/storage/rocksdb/batch.go @@ -44,17 +44,18 @@ func (b Batch) Size() int { return len(b.batch.Data()) } -func (b Batch) Reset() { +func (b Batch) Reset() error { b.batch.Clear() + return nil } -func (b Batch) Set(storeKey string, key, value []byte) error { +func (b Batch) Set(storeKey []byte, key, value []byte) error { prefixedKey := prependStoreKey(storeKey, key) b.batch.PutCFWithTS(b.cfHandle, prefixedKey, b.ts[:], value) return nil } -func (b Batch) Delete(storeKey string, key []byte) error { +func (b Batch) Delete(storeKey []byte, key []byte) error { prefixedKey := prependStoreKey(storeKey, key) b.batch.DeleteCFWithTS(b.cfHandle, prefixedKey, b.ts[:]) return nil diff --git a/store/storage/rocksdb/db.go b/store/storage/rocksdb/db.go index 32ece55de926..5538d2ee08bd 100644 --- a/store/storage/rocksdb/db.go +++ b/store/storage/rocksdb/db.go @@ -98,7 +98,7 @@ func (db *Database) NewBatch(version uint64) (store.Batch, error) { return NewBatch(db, version), nil } -func (db *Database) getSlice(storeKey string, version uint64, key []byte) (*grocksdb.Slice, error) { +func (db *Database) getSlice(storeKey []byte, version uint64, key []byte) (*grocksdb.Slice, error) { if version < db.tsLow { return nil, errors.ErrVersionPruned{EarliestVersion: db.tsLow} } @@ -131,7 +131,7 @@ func (db *Database) GetLatestVersion() (uint64, error) { return binary.LittleEndian.Uint64(bz), nil } -func (db *Database) Has(storeKey string, version uint64, key []byte) (bool, error) { +func (db *Database) Has(storeKey []byte, version uint64, key []byte) (bool, error) { slice, err := db.getSlice(storeKey, version, key) if err != nil { return false, err @@ -140,7 +140,7 @@ func (db *Database) Has(storeKey string, version uint64, key []byte) (bool, erro return slice.Exists(), nil } -func (db *Database) Get(storeKey string, version uint64, key []byte) ([]byte, error) { +func (db *Database) Get(storeKey []byte, version uint64, key []byte) ([]byte, error) { slice, err := db.getSlice(storeKey, version, key) if err != nil { return nil, fmt.Errorf("failed to get RocksDB slice: %w", err) @@ -165,7 +165,7 @@ func (db *Database) Prune(version uint64) error { return nil } -func (db *Database) Iterator(storeKey string, version uint64, start, end []byte) (corestore.Iterator, error) { +func (db *Database) Iterator(storeKey []byte, version uint64, start, end []byte) (corestore.Iterator, error) { if (start != nil && len(start) == 0) || (end != nil && len(end) == 0) { return nil, errors.ErrKeyEmpty } @@ -181,7 +181,7 @@ func (db *Database) Iterator(storeKey string, version uint64, start, end []byte) return newRocksDBIterator(itr, prefix, start, end, false), nil } -func (db *Database) ReverseIterator(storeKey string, version uint64, start, end []byte) (corestore.Iterator, error) { +func (db *Database) ReverseIterator(storeKey []byte, version uint64, start, end []byte) (corestore.Iterator, error) { if (start != nil && len(start) == 0) || (end != nil && len(end) == 0) { return nil, errors.ErrKeyEmpty } @@ -208,11 +208,11 @@ func newTSReadOptions(version uint64) *grocksdb.ReadOptions { return readOpts } -func storePrefix(storeKey string) []byte { - return []byte(fmt.Sprintf(StorePrefixTpl, storeKey)) +func storePrefix(storeKey []byte) []byte { + return append([]byte(StorePrefixTpl), storeKey...) } -func prependStoreKey(storeKey string, key []byte) []byte { +func prependStoreKey(storeKey []byte, key []byte) []byte { return append(storePrefix(storeKey), key...) } diff --git a/store/storage/rocksdb/db_test.go b/store/storage/rocksdb/db_test.go index 1c9817134e9b..776918bb7468 100644 --- a/store/storage/rocksdb/db_test.go +++ b/store/storage/rocksdb/db_test.go @@ -15,8 +15,8 @@ import ( "cosmossdk.io/store/v2/storage" ) -const ( - storeKey1 = "store1" +var ( + storeKey1 = []byte("store1") ) func TestStorageTestSuite(t *testing.T) { diff --git a/store/storage/sqlite/batch.go b/store/storage/sqlite/batch.go index 82e8f3e5b306..783b597e04af 100644 --- a/store/storage/sqlite/batch.go +++ b/store/storage/sqlite/batch.go @@ -18,24 +18,26 @@ const ( type batchOp struct { action batchAction - storeKey string + storeKey []byte key, value []byte } type Batch struct { + db *sql.DB tx *sql.Tx ops []batchOp size int version uint64 } -func NewBatch(storage *sql.DB, version uint64) (*Batch, error) { - tx, err := storage.Begin() +func NewBatch(db *sql.DB, version uint64) (*Batch, error) { + tx, err := db.Begin() if err != nil { return nil, fmt.Errorf("failed to create SQL transaction: %w", err) } return &Batch{ + db: db, tx: tx, ops: make([]batchOp, 0), version: version, @@ -46,19 +48,27 @@ func (b *Batch) Size() int { return b.size } -func (b *Batch) Reset() { +func (b *Batch) Reset() error { b.ops = nil b.ops = make([]batchOp, 0) b.size = 0 + + tx, err := b.db.Begin() + if err != nil { + return err + } + + b.tx = tx + return nil } -func (b *Batch) Set(storeKey string, key, value []byte) error { +func (b *Batch) Set(storeKey, key, value []byte) error { b.size += len(key) + len(value) b.ops = append(b.ops, batchOp{action: batchActionSet, storeKey: storeKey, key: key, value: value}) return nil } -func (b *Batch) Delete(storeKey string, key []byte) error { +func (b *Batch) Delete(storeKey, key []byte) error { b.size += len(key) b.ops = append(b.ops, batchOp{action: batchActionDel, storeKey: storeKey, key: key}) return nil diff --git a/store/storage/sqlite/db.go b/store/storage/sqlite/db.go index c114dc6ef06c..fb8351291041 100644 --- a/store/storage/sqlite/db.go +++ b/store/storage/sqlite/db.go @@ -128,7 +128,7 @@ func (db *Database) SetLatestVersion(version uint64) error { return nil } -func (db *Database) Has(storeKey string, version uint64, key []byte) (bool, error) { +func (db *Database) Has(storeKey []byte, version uint64, key []byte) (bool, error) { val, err := db.Get(storeKey, version, key) if err != nil { return false, err @@ -137,7 +137,7 @@ func (db *Database) Has(storeKey string, version uint64, key []byte) (bool, erro return val != nil, nil } -func (db *Database) Get(storeKey string, targetVersion uint64, key []byte) ([]byte, error) { +func (db *Database) Get(storeKey []byte, targetVersion uint64, key []byte) ([]byte, error) { if targetVersion < db.earliestVersion { return nil, storeerrors.ErrVersionPruned{EarliestVersion: db.earliestVersion} } @@ -216,7 +216,7 @@ func (db *Database) Prune(version uint64) error { return nil } -func (db *Database) Iterator(storeKey string, version uint64, start, end []byte) (corestore.Iterator, error) { +func (db *Database) Iterator(storeKey []byte, version uint64, start, end []byte) (corestore.Iterator, error) { if (start != nil && len(start) == 0) || (end != nil && len(end) == 0) { return nil, storeerrors.ErrKeyEmpty } @@ -228,7 +228,7 @@ func (db *Database) Iterator(storeKey string, version uint64, start, end []byte) return newIterator(db, storeKey, version, start, end, false) } -func (db *Database) ReverseIterator(storeKey string, version uint64, start, end []byte) (corestore.Iterator, error) { +func (db *Database) ReverseIterator(storeKey []byte, version uint64, start, end []byte) (corestore.Iterator, error) { if (start != nil && len(start) == 0) || (end != nil && len(end) == 0) { return nil, storeerrors.ErrKeyEmpty } @@ -256,7 +256,7 @@ func (db *Database) PrintRowsDebug() { var sb strings.Builder for rows.Next() { var ( - storeKey string + storeKey []byte key []byte value []byte version uint64 diff --git a/store/storage/sqlite/db_test.go b/store/storage/sqlite/db_test.go index eb059dcd93bc..96c50e9b56fa 100644 --- a/store/storage/sqlite/db_test.go +++ b/store/storage/sqlite/db_test.go @@ -13,9 +13,7 @@ import ( "cosmossdk.io/store/v2/storage" ) -const ( - storeKey1 = "store1" -) +var storeKey1 = []byte("store1") func TestStorageTestSuite(t *testing.T) { s := &storage.StorageTestSuite{ diff --git a/store/storage/sqlite/iterator.go b/store/storage/sqlite/iterator.go index 3dd2875c1e18..f786275a4c0d 100644 --- a/store/storage/sqlite/iterator.go +++ b/store/storage/sqlite/iterator.go @@ -21,7 +21,7 @@ type iterator struct { err error } -func newIterator(db *Database, storeKey string, targetVersion uint64, start, end []byte, reverse bool) (*iterator, error) { +func newIterator(db *Database, storeKey []byte, targetVersion uint64, start, end []byte, reverse bool) (*iterator, error) { if targetVersion < db.earliestVersion { return &iterator{ start: start, diff --git a/store/storage/storage_bench_test.go b/store/storage/storage_bench_test.go index b66343d21500..e977913f37b5 100644 --- a/store/storage/storage_bench_test.go +++ b/store/storage/storage_bench_test.go @@ -12,6 +12,7 @@ import ( "github.com/stretchr/testify/require" + corestore "cosmossdk.io/core/store" "cosmossdk.io/log" "cosmossdk.io/store/v2" "cosmossdk.io/store/v2/storage" @@ -20,8 +21,8 @@ import ( "cosmossdk.io/store/v2/storage/sqlite" ) -const ( - storeKey1 = "store1" +var ( + storeKey1 = []byte("store1") ) var ( @@ -70,9 +71,9 @@ func BenchmarkGet(b *testing.B) { _ = db.Close() }() - cs := store.NewChangesetWithPairs(map[string]store.KVPairs{storeKey1: {}}) + cs := corestore.NewChangesetWithPairs(map[string]corestore.KVPairs{string(storeKey1): {}}) for i := 0; i < numKeyVals; i++ { - cs.AddKVPair(storeKey1, store.KVPair{Key: keys[i], Value: vals[i]}) + cs.AddKVPair(storeKey1, corestore.KVPair{Key: keys[i], Value: vals[i]}) } require.NoError(b, db.ApplyChangeset(1, cs)) @@ -106,7 +107,7 @@ func BenchmarkApplyChangeset(b *testing.B) { for i := 0; i < b.N; i++ { b.StopTimer() - cs := store.NewChangesetWithPairs(map[string]store.KVPairs{storeKey1: {}}) + cs := corestore.NewChangesetWithPairs(map[string]corestore.KVPairs{string(storeKey1): {}}) for j := 0; j < 1000; j++ { key := make([]byte, 128) val := make([]byte, 128) @@ -116,7 +117,7 @@ func BenchmarkApplyChangeset(b *testing.B) { _, err = rng.Read(val) require.NoError(b, err) - cs.AddKVPair(storeKey1, store.KVPair{Key: key, Value: val}) + cs.AddKVPair(storeKey1, corestore.KVPair{Key: key, Value: val}) } b.StartTimer() @@ -153,9 +154,9 @@ func BenchmarkIterate(b *testing.B) { b.StopTimer() - cs := store.NewChangesetWithPairs(map[string]store.KVPairs{storeKey1: {}}) + cs := corestore.NewChangesetWithPairs(map[string]corestore.KVPairs{string(storeKey1): {}}) for i := 0; i < numKeyVals; i++ { - cs.AddKVPair(storeKey1, store.KVPair{Key: keys[i], Value: vals[i]}) + cs.AddKVPair(storeKey1, corestore.KVPair{Key: keys[i], Value: vals[i]}) } require.NoError(b, db.ApplyChangeset(1, cs)) diff --git a/store/storage/storage_test_suite.go b/store/storage/storage_test_suite.go index 28be858d5096..23c93f46c85e 100644 --- a/store/storage/storage_test_suite.go +++ b/store/storage/storage_test_suite.go @@ -8,6 +8,7 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + corestore "cosmossdk.io/core/store" "cosmossdk.io/store/v2" ) @@ -15,6 +16,8 @@ const ( storeKey1 = "store1" ) +var storeKey1Bytes = []byte(storeKey1) + // StorageTestSuite defines a reusable test suite for all storage backends. type StorageTestSuite struct { suite.Suite @@ -58,15 +61,15 @@ func (s *StorageTestSuite) TestDatabase_VersionedKeys() { defer db.Close() for i := uint64(1); i <= 100; i++ { - s.Require().NoError(db.ApplyChangeset(i, store.NewChangesetWithPairs( - map[string]store.KVPairs{ + s.Require().NoError(db.ApplyChangeset(i, corestore.NewChangesetWithPairs( + map[string]corestore.KVPairs{ storeKey1: {{Key: []byte("key"), Value: []byte(fmt.Sprintf("value%03d", i))}}, }, ))) } for i := uint64(1); i <= 100; i++ { - bz, err := db.Get(storeKey1, i, []byte("key")) + bz, err := db.Get(storeKey1Bytes, i, []byte("key")) s.Require().NoError(err) s.Require().Equal(fmt.Sprintf("value%03d", i), string(bz)) } @@ -78,69 +81,69 @@ func (s *StorageTestSuite) TestDatabase_GetVersionedKey() { defer db.Close() // store a key at version 1 - s.Require().NoError(db.ApplyChangeset(1, store.NewChangesetWithPairs( - map[string]store.KVPairs{ + s.Require().NoError(db.ApplyChangeset(1, corestore.NewChangesetWithPairs( + map[string]corestore.KVPairs{ storeKey1: {{Key: []byte("key"), Value: []byte("value001")}}, }, ))) // assume chain progresses to version 10 w/o any changes to key - bz, err := db.Get(storeKey1, 10, []byte("key")) + bz, err := db.Get(storeKey1Bytes, 10, []byte("key")) s.Require().NoError(err) s.Require().Equal([]byte("value001"), bz) - ok, err := db.Has(storeKey1, 10, []byte("key")) + ok, err := db.Has(storeKey1Bytes, 10, []byte("key")) s.Require().NoError(err) s.Require().True(ok) // chain progresses to version 11 with an update to key - s.Require().NoError(db.ApplyChangeset(11, store.NewChangesetWithPairs( - map[string]store.KVPairs{ + s.Require().NoError(db.ApplyChangeset(11, corestore.NewChangesetWithPairs( + map[string]corestore.KVPairs{ storeKey1: {{Key: []byte("key"), Value: []byte("value011")}}, }, ))) - bz, err = db.Get(storeKey1, 10, []byte("key")) + bz, err = db.Get(storeKey1Bytes, 10, []byte("key")) s.Require().NoError(err) s.Require().Equal([]byte("value001"), bz) - ok, err = db.Has(storeKey1, 10, []byte("key")) + ok, err = db.Has(storeKey1Bytes, 10, []byte("key")) s.Require().NoError(err) s.Require().True(ok) for i := uint64(11); i <= 14; i++ { - bz, err = db.Get(storeKey1, i, []byte("key")) + bz, err = db.Get(storeKey1Bytes, i, []byte("key")) s.Require().NoError(err) s.Require().Equal([]byte("value011"), bz) - ok, err = db.Has(storeKey1, i, []byte("key")) + ok, err = db.Has(storeKey1Bytes, i, []byte("key")) s.Require().NoError(err) s.Require().True(ok) } // chain progresses to version 15 with a delete to key - s.Require().NoError(db.ApplyChangeset(15, store.NewChangesetWithPairs( - map[string]store.KVPairs{storeKey1: {{Key: []byte("key")}}}, + s.Require().NoError(db.ApplyChangeset(15, corestore.NewChangesetWithPairs( + map[string]corestore.KVPairs{storeKey1: {{Key: []byte("key"), Remove: true}}}, ))) // all queries up to version 14 should return the latest value for i := uint64(1); i <= 14; i++ { - bz, err = db.Get(storeKey1, i, []byte("key")) + bz, err = db.Get(storeKey1Bytes, i, []byte("key")) s.Require().NoError(err) s.Require().NotNil(bz) - ok, err = db.Has(storeKey1, i, []byte("key")) + ok, err = db.Has(storeKey1Bytes, i, []byte("key")) s.Require().NoError(err) s.Require().True(ok) } // all queries after version 15 should return nil for i := uint64(15); i <= 17; i++ { - bz, err = db.Get(storeKey1, i, []byte("key")) + bz, err = db.Get(storeKey1Bytes, i, []byte("key")) s.Require().NoError(err) s.Require().Nil(bz) - ok, err = db.Has(storeKey1, i, []byte("key")) + ok, err = db.Has(storeKey1Bytes, i, []byte("key")) s.Require().NoError(err) s.Require().False(ok) } @@ -151,14 +154,14 @@ func (s *StorageTestSuite) TestDatabase_ApplyChangeset() { s.Require().NoError(err) defer db.Close() - cs := store.NewChangesetWithPairs(map[string]store.KVPairs{storeKey1: {}}) + cs := corestore.NewChangesetWithPairs(map[string]corestore.KVPairs{storeKey1: {}}) for i := 0; i < 100; i++ { - cs.AddKVPair(storeKey1, store.KVPair{Key: []byte(fmt.Sprintf("key%03d", i)), Value: []byte("value")}) + cs.AddKVPair(storeKey1Bytes, corestore.KVPair{Key: []byte(fmt.Sprintf("key%03d", i)), Value: []byte("value")}) } for i := 0; i < 100; i++ { if i%10 == 0 { - cs.AddKVPair(storeKey1, store.KVPair{Key: []byte(fmt.Sprintf("key%03d", i))}) + cs.AddKVPair(storeKey1Bytes, corestore.KVPair{Key: []byte(fmt.Sprintf("key%03d", i)), Remove: true}) } } @@ -169,7 +172,7 @@ func (s *StorageTestSuite) TestDatabase_ApplyChangeset() { s.Require().Equal(uint64(1), lv) for i := 0; i < 1; i++ { - ok, err := db.Has(storeKey1, 1, []byte(fmt.Sprintf("key%03d", i))) + ok, err := db.Has(storeKey1Bytes, 1, []byte(fmt.Sprintf("key%03d", i))) s.Require().NoError(err) if i%10 == 0 { @@ -185,7 +188,7 @@ func (s *StorageTestSuite) TestDatabase_IteratorEmptyDomain() { s.Require().NoError(err) defer db.Close() - iter, err := db.Iterator(storeKey1, 1, []byte{}, []byte{}) + iter, err := db.Iterator(storeKey1Bytes, 1, []byte{}, []byte{}) s.Require().Error(err) s.Require().Nil(iter) } @@ -195,7 +198,7 @@ func (s *StorageTestSuite) TestDatabase_IteratorClose() { s.Require().NoError(err) defer db.Close() - iter, err := db.Iterator(storeKey1, 1, []byte("key000"), nil) + iter, err := db.Iterator(storeKey1Bytes, 1, []byte("key000"), nil) s.Require().NoError(err) iter.Close() @@ -221,7 +224,7 @@ func (s *StorageTestSuite) TestDatabase_IteratorDomain() { for name, tc := range testCases { s.Run(name, func() { - iter, err := db.Iterator(storeKey1, 1, tc.start, tc.end) + iter, err := db.Iterator(storeKey1Bytes, 1, tc.start, tc.end) s.Require().NoError(err) defer iter.Close() @@ -238,19 +241,19 @@ func (s *StorageTestSuite) TestDatabase_Iterator() { s.Require().NoError(err) defer db.Close() - cs := store.NewChangesetWithPairs(map[string]store.KVPairs{storeKey1: {}}) + cs := corestore.NewChangesetWithPairs(map[string]corestore.KVPairs{storeKey1: {}}) for i := 0; i < 100; i++ { key := fmt.Sprintf("key%03d", i) // key000, key001, ..., key099 val := fmt.Sprintf("val%03d", i) // val000, val001, ..., val099 - cs.AddKVPair(storeKey1, store.KVPair{Key: []byte(key), Value: []byte(val)}) + cs.AddKVPair(storeKey1Bytes, corestore.KVPair{Key: []byte(key), Value: []byte(val), Remove: false}) } s.Require().NoError(db.ApplyChangeset(1, cs)) // iterator without an end key over multiple versions for v := uint64(1); v < 5; v++ { - itr, err := db.Iterator(storeKey1, v, []byte("key000"), nil) + itr, err := db.Iterator(storeKey1Bytes, v, []byte("key000"), nil) s.Require().NoError(err) defer itr.Close() @@ -263,8 +266,8 @@ func (s *StorageTestSuite) TestDatabase_Iterator() { i++ count++ } - s.Require().Equal(100, count) s.Require().NoError(itr.Error()) + s.Require().Equal(100, count) // seek past domain, which should make the iterator invalid and produce an error s.Require().False(itr.Valid()) @@ -272,7 +275,7 @@ func (s *StorageTestSuite) TestDatabase_Iterator() { // iterator with with a start and end domain over multiple versions for v := uint64(1); v < 5; v++ { - itr2, err := db.Iterator(storeKey1, v, []byte("key010"), []byte("key019")) + itr2, err := db.Iterator(storeKey1Bytes, v, []byte("key010"), []byte("key019")) s.Require().NoError(err) defer itr2.Close() @@ -293,7 +296,7 @@ func (s *StorageTestSuite) TestDatabase_Iterator() { } // start must be <= end - iter3, err := db.Iterator(storeKey1, 1, []byte("key020"), []byte("key019")) + iter3, err := db.Iterator(storeKey1Bytes, 1, []byte("key020"), []byte("key019")) s.Require().Error(err) s.Require().Nil(iter3) } @@ -303,28 +306,28 @@ func (s *StorageTestSuite) TestDatabase_Iterator_RangedDeletes() { s.Require().NoError(err) defer db.Close() - s.Require().NoError(db.ApplyChangeset(1, store.NewChangesetWithPairs( - map[string]store.KVPairs{ + s.Require().NoError(db.ApplyChangeset(1, corestore.NewChangesetWithPairs( + map[string]corestore.KVPairs{ storeKey1: { - {Key: []byte("key001"), Value: []byte("value001")}, - {Key: []byte("key002"), Value: []byte("value001")}, + {Key: []byte("key001"), Value: []byte("value001"), Remove: false}, + {Key: []byte("key002"), Value: []byte("value001"), Remove: false}, }, }, ))) - s.Require().NoError(db.ApplyChangeset(5, store.NewChangesetWithPairs( - map[string]store.KVPairs{ - storeKey1: {{Key: []byte("key002"), Value: []byte("value002")}}, + s.Require().NoError(db.ApplyChangeset(5, corestore.NewChangesetWithPairs( + map[string]corestore.KVPairs{ + storeKey1: {{Key: []byte("key002"), Value: []byte("value002"), Remove: false}}, }, ))) - s.Require().NoError(db.ApplyChangeset(10, store.NewChangesetWithPairs( - map[string]store.KVPairs{ - storeKey1: {{Key: []byte("key002")}}, + s.Require().NoError(db.ApplyChangeset(10, corestore.NewChangesetWithPairs( + map[string]corestore.KVPairs{ + storeKey1: {{Key: []byte("key002"), Remove: true}}, }, ))) - itr, err := db.Iterator(storeKey1, 11, []byte("key001"), nil) + itr, err := db.Iterator(storeKey1Bytes, 11, []byte("key001"), nil) s.Require().NoError(err) defer itr.Close() @@ -346,12 +349,12 @@ func (s *StorageTestSuite) TestDatabase_IteratorMultiVersion() { // for versions 1-49, set all 10 keys for v := uint64(1); v < 50; v++ { - cs := store.NewChangesetWithPairs(map[string]store.KVPairs{storeKey1: {}}) + cs := corestore.NewChangesetWithPairs(map[string]corestore.KVPairs{storeKey1: {}}) for i := 0; i < 10; i++ { key := fmt.Sprintf("key%03d", i) val := fmt.Sprintf("val%03d-%03d", i, v) - cs.AddKVPair(storeKey1, store.KVPair{Key: []byte(key), Value: []byte(val)}) + cs.AddKVPair(storeKey1Bytes, corestore.KVPair{Key: []byte(key), Value: []byte(val)}) } s.Require().NoError(db.ApplyChangeset(v, cs)) @@ -359,20 +362,20 @@ func (s *StorageTestSuite) TestDatabase_IteratorMultiVersion() { // for versions 50-100, only update even keys for v := uint64(50); v <= 100; v++ { - cs := store.NewChangesetWithPairs(map[string]store.KVPairs{storeKey1: {}}) + cs := corestore.NewChangesetWithPairs(map[string]corestore.KVPairs{storeKey1: {}}) for i := 0; i < 10; i++ { if i%2 == 0 { key := fmt.Sprintf("key%03d", i) val := fmt.Sprintf("val%03d-%03d", i, v) - cs.AddKVPair(storeKey1, store.KVPair{Key: []byte(key), Value: []byte(val)}) + cs.AddKVPair(storeKey1Bytes, corestore.KVPair{Key: []byte(key), Value: []byte(val), Remove: false}) } } s.Require().NoError(db.ApplyChangeset(v, cs)) } - itr, err := db.Iterator(storeKey1, 69, []byte("key000"), nil) + itr, err := db.Iterator(storeKey1Bytes, 69, []byte("key000"), nil) s.Require().NoError(err) defer itr.Close() @@ -394,8 +397,8 @@ func (s *StorageTestSuite) TestDatabase_IteratorMultiVersion() { count++ } - s.Require().Equal(10, count) s.Require().NoError(itr.Error()) + s.Require().Equal(10, count) } func (s *StorageTestSuite) TestDatabaseIterator_SkipVersion() { @@ -410,7 +413,7 @@ func (s *StorageTestSuite) TestDatabaseIterator_SkipVersion() { DBApplyChangeset(s.T(), db, 58833605, storeKey1, [][]byte{[]byte("keyC")}, [][]byte{[]byte("value004")}) DBApplyChangeset(s.T(), db, 58833606, storeKey1, [][]byte{[]byte("keyD")}, [][]byte{[]byte("value006")}) - itr, err := db.Iterator(storeKey1, 58831525, []byte("key"), nil) + itr, err := db.Iterator(storeKey1Bytes, 58831525, []byte("key"), nil) s.Require().NoError(err) defer itr.Close() @@ -419,6 +422,7 @@ func (s *StorageTestSuite) TestDatabaseIterator_SkipVersion() { count[string(itr.Key())] = struct{}{} } + s.Require().NoError(itr.Error()) s.Require().Equal(3, len(count)) } @@ -437,7 +441,7 @@ func (s *StorageTestSuite) TestDatabaseIterator_ForwardIteration() { DBApplyChangeset(s.T(), db, 4, storeKey1, [][]byte{[]byte("keyF")}, [][]byte{[]byte("value009")}) DBApplyChangeset(s.T(), db, 5, storeKey1, [][]byte{[]byte("keyH")}, [][]byte{[]byte("value010")}) - itr, err := db.Iterator(storeKey1, 6, nil, []byte("keyZ")) + itr, err := db.Iterator(storeKey1Bytes, 6, nil, []byte("keyZ")) s.Require().NoError(err) defer itr.Close() @@ -446,6 +450,7 @@ func (s *StorageTestSuite) TestDatabaseIterator_ForwardIteration() { count++ } + s.Require().NoError(itr.Error()) s.Require().Equal(4, count) } @@ -463,7 +468,7 @@ func (s *StorageTestSuite) TestDatabaseIterator_ForwardIterationHigher() { DBApplyChangeset(s.T(), db, 14, storeKey1, [][]byte{[]byte("keyF")}, [][]byte{[]byte("value009")}) DBApplyChangeset(s.T(), db, 15, storeKey1, [][]byte{[]byte("keyH")}, [][]byte{[]byte("value010")}) - itr, err := db.Iterator(storeKey1, 6, nil, []byte("keyZ")) + itr, err := db.Iterator(storeKey1Bytes, 6, nil, []byte("keyZ")) s.Require().NoError(err) defer itr.Close() @@ -483,19 +488,19 @@ func (s *StorageTestSuite) TestDatabase_IteratorNoDomain() { // for versions 1-50, set all 10 keys for v := uint64(1); v <= 50; v++ { - cs := store.NewChangesetWithPairs(map[string]store.KVPairs{storeKey1: {}}) + cs := corestore.NewChangesetWithPairs(map[string]corestore.KVPairs{storeKey1: {}}) for i := 0; i < 10; i++ { key := fmt.Sprintf("key%03d", i) val := fmt.Sprintf("val%03d-%03d", i, v) - cs.AddKVPair(storeKey1, store.KVPair{Key: []byte(key), Value: []byte(val)}) + cs.AddKVPair(storeKey1Bytes, corestore.KVPair{Key: []byte(key), Value: []byte(val), Remove: false}) } s.Require().NoError(db.ApplyChangeset(v, cs)) } // create an iterator over the entire domain - itr, err := db.Iterator(storeKey1, 50, nil, nil) + itr, err := db.Iterator(storeKey1Bytes, 50, nil, nil) s.Require().NoError(err) defer itr.Close() @@ -508,8 +513,8 @@ func (s *StorageTestSuite) TestDatabase_IteratorNoDomain() { i++ count++ } - s.Require().Equal(10, count) s.Require().NoError(itr.Error()) + s.Require().Equal(10, count) } func (s *StorageTestSuite) TestDatabase_Prune() { @@ -523,12 +528,12 @@ func (s *StorageTestSuite) TestDatabase_Prune() { // for versions 1-50, set 10 keys for v := uint64(1); v <= 50; v++ { - cs := store.NewChangesetWithPairs(map[string]store.KVPairs{storeKey1: {}}) + cs := corestore.NewChangesetWithPairs(map[string]corestore.KVPairs{storeKey1: {}}) for i := 0; i < 10; i++ { key := fmt.Sprintf("key%03d", i) val := fmt.Sprintf("val%03d-%03d", i, v) - cs.AddKVPair(storeKey1, store.KVPair{Key: []byte(key), Value: []byte(val)}) + cs.AddKVPair(storeKey1Bytes, corestore.KVPair{Key: []byte(key), Value: []byte(val)}) } s.Require().NoError(db.ApplyChangeset(v, cs)) @@ -548,7 +553,7 @@ func (s *StorageTestSuite) TestDatabase_Prune() { key := fmt.Sprintf("key%03d", i) val := fmt.Sprintf("val%03d-%03d", i, v) - bz, err := db.Get(storeKey1, v, []byte(key)) + bz, err := db.Get(storeKey1Bytes, v, []byte(key)) if v <= 25 { s.Require().Error(err) s.Require().Nil(bz) @@ -559,7 +564,7 @@ func (s *StorageTestSuite) TestDatabase_Prune() { } } - itr, err := db.Iterator(storeKey1, 25, []byte("key000"), nil) + itr, err := db.Iterator(storeKey1Bytes, 25, []byte("key000"), nil) s.Require().NoError(err) s.Require().False(itr.Valid()) @@ -570,7 +575,7 @@ func (s *StorageTestSuite) TestDatabase_Prune() { for i := 0; i < 10; i++ { key := fmt.Sprintf("key%03d", i) - bz, err := db.Get(storeKey1, v, []byte(key)) + bz, err := db.Get(storeKey1Bytes, v, []byte(key)) s.Require().Error(err) s.Require().Nil(bz) } @@ -589,44 +594,44 @@ func (s *StorageTestSuite) TestDatabase_Prune_KeepRecent() { key := []byte("key") // write a key at three different versions - s.Require().NoError(db.ApplyChangeset(1, store.NewChangesetWithPairs( - map[string]store.KVPairs{storeKey1: {{Key: key, Value: []byte("val001")}}}, + s.Require().NoError(db.ApplyChangeset(1, corestore.NewChangesetWithPairs( + map[string]corestore.KVPairs{storeKey1: {{Key: key, Value: []byte("val001"), Remove: false}}}, ))) - s.Require().NoError(db.ApplyChangeset(100, store.NewChangesetWithPairs( - map[string]store.KVPairs{storeKey1: {{Key: key, Value: []byte("val100")}}}, + s.Require().NoError(db.ApplyChangeset(100, corestore.NewChangesetWithPairs( + map[string]corestore.KVPairs{storeKey1: {{Key: key, Value: []byte("val100"), Remove: false}}}, ))) - s.Require().NoError(db.ApplyChangeset(200, store.NewChangesetWithPairs( - map[string]store.KVPairs{storeKey1: {{Key: key, Value: []byte("val200")}}}, + s.Require().NoError(db.ApplyChangeset(200, corestore.NewChangesetWithPairs( + map[string]corestore.KVPairs{storeKey1: {{Key: key, Value: []byte("val200"), Remove: false}}}, ))) // prune version 50 s.Require().NoError(db.Prune(50)) // ensure queries for versions 50 and older return nil - bz, err := db.Get(storeKey1, 49, key) + bz, err := db.Get(storeKey1Bytes, 49, key) s.Require().Error(err) s.Require().Nil(bz) - itr, err := db.Iterator(storeKey1, 49, nil, nil) + itr, err := db.Iterator(storeKey1Bytes, 49, nil, nil) s.Require().NoError(err) s.Require().False(itr.Valid()) defer itr.Close() // ensure the value previously at version 1 is still there for queries greater than 50 - bz, err = db.Get(storeKey1, 51, key) + bz, err = db.Get(storeKey1Bytes, 51, key) s.Require().NoError(err) s.Require().Equal([]byte("val001"), bz) // ensure the correct value at a greater height - bz, err = db.Get(storeKey1, 200, key) + bz, err = db.Get(storeKey1Bytes, 200, key) s.Require().NoError(err) s.Require().Equal([]byte("val200"), bz) // prune latest height and ensure we have the previous version when querying above it s.Require().NoError(db.Prune(200)) - bz, err = db.Get(storeKey1, 201, key) + bz, err = db.Get(storeKey1Bytes, 201, key) s.Require().NoError(err) s.Require().Equal([]byte("val200"), bz) } @@ -643,9 +648,14 @@ func DBApplyChangeset( require.Greater(t, version, uint64(0)) require.Equal(t, len(keys), len(vals)) - cs := store.NewChangeset() + cs := corestore.NewChangeset() for i := 0; i < len(keys); i++ { - cs.AddKVPair(storeKey, store.KVPair{Key: keys[i], Value: vals[i]}) + remove := false + if vals[i] == nil { + remove = true + } + + cs.AddKVPair([]byte(storeKey), corestore.KVPair{Key: keys[i], Value: vals[i], Remove: remove}) } require.NoError(t, db.ApplyChangeset(version, cs)) diff --git a/store/storage/store.go b/store/storage/store.go index 28ed550be6e7..436682c7f500 100644 --- a/store/storage/store.go +++ b/store/storage/store.go @@ -42,30 +42,30 @@ func NewStorageStore(db Database, pruneOpts *store.PruneOptions, logger log.Logg } // Has returns true if the key exists in the store. -func (ss *StorageStore) Has(storeKey string, version uint64, key []byte) (bool, error) { +func (ss *StorageStore) Has(storeKey []byte, version uint64, key []byte) (bool, error) { return ss.db.Has(storeKey, version, key) } // Get returns the value associated with the given key. -func (ss *StorageStore) Get(storeKey string, version uint64, key []byte) ([]byte, error) { +func (ss *StorageStore) Get(storeKey []byte, version uint64, key []byte) ([]byte, error) { return ss.db.Get(storeKey, version, key) } // ApplyChangeset applies the given changeset to the storage. -func (ss *StorageStore) ApplyChangeset(version uint64, cs *store.Changeset) error { +func (ss *StorageStore) ApplyChangeset(version uint64, cs *corestore.Changeset) error { b, err := ss.db.NewBatch(version) if err != nil { return err } - for storeKey, pairs := range cs.Pairs { - for _, kvPair := range pairs { - if kvPair.Value == nil { - if err := b.Delete(storeKey, kvPair.Key); err != nil { + for _, pairs := range cs.Changes { + for _, kvPair := range pairs.StateChanges { + if kvPair.Remove { + if err := b.Delete(pairs.Actor, kvPair.Key); err != nil { return err } } else { - if err := b.Set(storeKey, kvPair.Key, kvPair.Value); err != nil { + if err := b.Set(pairs.Actor, kvPair.Key, kvPair.Value); err != nil { return err } } @@ -96,12 +96,12 @@ func (ss *StorageStore) SetLatestVersion(version uint64) error { } // Iterator returns an iterator over the specified domain and prefix. -func (ss *StorageStore) Iterator(storeKey string, version uint64, start, end []byte) (corestore.Iterator, error) { +func (ss *StorageStore) Iterator(storeKey []byte, version uint64, start, end []byte) (corestore.Iterator, error) { return ss.db.Iterator(storeKey, version, start, end) } // ReverseIterator returns an iterator over the specified domain and prefix in reverse. -func (ss *StorageStore) ReverseIterator(storeKey string, version uint64, start, end []byte) (corestore.Iterator, error) { +func (ss *StorageStore) ReverseIterator(storeKey []byte, version uint64, start, end []byte) (corestore.Iterator, error) { return ss.db.ReverseIterator(storeKey, version, start, end) } @@ -111,7 +111,7 @@ func (ss *StorageStore) Prune(version uint64) error { } // Restore restores the store from the given channel. -func (ss *StorageStore) Restore(version uint64, chStorage <-chan *store.KVPair) error { +func (ss *StorageStore) Restore(version uint64, chStorage <-chan *corestore.StateChanges) error { latestVersion, err := ss.db.GetLatestVersion() if err != nil { return fmt.Errorf("failed to get latest version: %w", err) @@ -126,14 +126,18 @@ func (ss *StorageStore) Restore(version uint64, chStorage <-chan *store.KVPair) } for kvPair := range chStorage { - if err := b.Set(kvPair.StoreKey, kvPair.Key, kvPair.Value); err != nil { - return err - } - - if b.Size() > defaultBatchBufferSize { - if err := b.Write(); err != nil { + for _, kv := range kvPair.StateChanges { + if err := b.Set(kvPair.Actor, kv.Key, kv.Value); err != nil { return err } + if b.Size() > defaultBatchBufferSize { + if err := b.Write(); err != nil { + return err + } + if err := b.Reset(); err != nil { + return err + } + } } } @@ -143,7 +147,7 @@ func (ss *StorageStore) Restore(version uint64, chStorage <-chan *store.KVPair) } } - return ss.db.SetLatestVersion(version) + return nil } // Close closes the store. diff --git a/store/store.go b/store/store.go index 6e2edf092565..bffede6ec3a4 100644 --- a/store/store.go +++ b/store/store.go @@ -29,7 +29,7 @@ type RootStore interface { // Query performs a query on the RootStore for a given store key, version (height), // and key tuple. Queries should be routed to the underlying SS engine. - Query(storeKey string, version uint64, key []byte, prove bool) (QueryResult, error) + Query(storeKey []byte, version uint64, key []byte, prove bool) (QueryResult, error) // LoadVersion loads the RootStore to the given version. LoadVersion(version uint64) error @@ -55,7 +55,7 @@ type RootStore interface { // is responsible for writing the Changeset to the SC backend and returning the // resulting root hash. Then, Commit() would return this hash and flush writes // to disk. - WorkingHash(cs *Changeset) ([]byte, error) + WorkingHash(cs *corestore.Changeset) ([]byte, error) // Commit should be responsible for taking the provided changeset and flushing // it to disk. Note, depending on the implementation, the changeset, at this @@ -63,7 +63,7 @@ type RootStore interface { // the changeset is committed to all SC and SC backends and flushed to disk. // It must return a hash of the merkle-ized committed state. This hash should // be the same as the hash returned by WorkingHash() prior to calling Commit(). - Commit(cs *Changeset) ([]byte, error) + Commit(cs *corestore.Changeset) ([]byte, error) // LastCommitID returns a CommitID pertaining to the last commitment. LastCommitID() (proof.CommitID, error) @@ -72,6 +72,12 @@ type RootStore interface { // old versions of the RootStore by the CLI. Prune(version uint64) error + // StartMigration starts a migration process to migrate the RootStore/v1 to the + // SS and SC backends of store/v2. + // It runs in a separate goroutine and replaces the current RootStore with the + // migrated new backends once the migration is complete. + StartMigration() error + // SetMetrics sets the telemetry handler on the RootStore. SetMetrics(m metrics.Metrics) diff --git a/store/trace.go b/store/trace.go index b67aec347254..a4d309a8f4a1 100644 --- a/store/trace.go +++ b/store/trace.go @@ -1,6 +1,6 @@ package store -import "golang.org/x/exp/maps" +import "maps" // TraceContext contains KVStore context data. It will be written with every // trace operation. @@ -17,9 +17,7 @@ func (tc TraceContext) Merge(newTc TraceContext) TraceContext { tc = TraceContext{} } - for k, v := range newTc { - tc[k] = v - } + maps.Copy(tc, newTc) return tc } diff --git a/telemetry/metrics.go b/telemetry/metrics.go index 502fdb611209..07d1020eb892 100644 --- a/telemetry/metrics.go +++ b/telemetry/metrics.go @@ -14,6 +14,15 @@ import ( "github.com/prometheus/common/expfmt" ) +// globalTelemetryEnabled is a private variable that stores the telemetry enabled state. +// It is set on initialization and does not change for the lifetime of the program. +var globalTelemetryEnabled bool + +// IsTelemetryEnabled provides controlled access to check if telemetry is enabled. +func IsTelemetryEnabled() bool { + return globalTelemetryEnabled +} + // globalLabels defines the set of global labels that will be applied to all // metrics emitted using the telemetry package function wrappers. var globalLabels = []metrics.Label{} @@ -95,6 +104,7 @@ type GatherResponse struct { // New creates a new instance of Metrics func New(cfg Config) (_ *Metrics, rerr error) { + globalTelemetryEnabled = cfg.Enabled if !cfg.Enabled { return nil, nil } diff --git a/telemetry/wrapper.go b/telemetry/wrapper.go index 4cd96b78f715..da11f1fa0450 100644 --- a/telemetry/wrapper.go +++ b/telemetry/wrapper.go @@ -24,6 +24,10 @@ func NewLabel(name, value string) metrics.Label { // metric for a module with a given set of keys. If any global labels are defined, // they will be added to the module label. func ModuleMeasureSince(module string, start time.Time, keys ...string) { + if !IsTelemetryEnabled() { + return + } + metrics.MeasureSinceWithLabels( keys, start.UTC(), @@ -35,6 +39,10 @@ func ModuleMeasureSince(module string, start time.Time, keys ...string) { // module with a given set of keys. If any global labels are defined, they will // be added to the module label. func ModuleSetGauge(module string, val float32, keys ...string) { + if !IsTelemetryEnabled() { + return + } + metrics.SetGaugeWithLabels( keys, val, @@ -45,29 +53,58 @@ func ModuleSetGauge(module string, val float32, keys ...string) { // IncrCounter provides a wrapper functionality for emitting a counter metric with // global labels (if any). func IncrCounter(val float32, keys ...string) { + if !IsTelemetryEnabled() { + return + } + metrics.IncrCounterWithLabels(keys, val, globalLabels) } // IncrCounterWithLabels provides a wrapper functionality for emitting a counter // metric with global labels (if any) along with the provided labels. func IncrCounterWithLabels(keys []string, val float32, labels []metrics.Label) { + if !IsTelemetryEnabled() { + return + } + metrics.IncrCounterWithLabels(keys, val, append(labels, globalLabels...)) } // SetGauge provides a wrapper functionality for emitting a gauge metric with // global labels (if any). func SetGauge(val float32, keys ...string) { + if !IsTelemetryEnabled() { + return + } + metrics.SetGaugeWithLabels(keys, val, globalLabels) } // SetGaugeWithLabels provides a wrapper functionality for emitting a gauge // metric with global labels (if any) along with the provided labels. func SetGaugeWithLabels(keys []string, val float32, labels []metrics.Label) { + if !IsTelemetryEnabled() { + return + } + metrics.SetGaugeWithLabels(keys, val, append(labels, globalLabels...)) } // MeasureSince provides a wrapper functionality for emitting a a time measure // metric with global labels (if any). func MeasureSince(start time.Time, keys ...string) { + if !IsTelemetryEnabled() { + return + } + metrics.MeasureSinceWithLabels(keys, start.UTC(), globalLabels) } + +// Now return the current time if telemetry is enabled or a zero time if it's not +func Now() time.Time { + if !IsTelemetryEnabled() { + return time.Time{} + } + + return time.Now() +} diff --git a/telemetry/wrapper_test.go b/telemetry/wrapper_test.go new file mode 100644 index 000000000000..5388839874bc --- /dev/null +++ b/telemetry/wrapper_test.go @@ -0,0 +1,51 @@ +package telemetry + +import ( + "sync" + "testing" + "time" + + "github.com/stretchr/testify/assert" +) + +var mu sync.Mutex + +func initTelemetry(v bool) { + globalTelemetryEnabled = v +} + +// Reset the global state to a known disabled state before each test. +func setupTest(t *testing.T) { + t.Helper() + mu.Lock() // Ensure no other test can modify global state at the same time. + defer mu.Unlock() + initTelemetry(false) +} + +// TestNow tests the Now function when telemetry is enabled and disabled. +func TestNow(t *testing.T) { + setupTest(t) // Locks the mutex to avoid race condition. + + initTelemetry(true) + telemetryTime := Now() + assert.NotEqual(t, time.Time{}, telemetryTime, "Now() should not return zero time when telemetry is enabled") + + setupTest(t) // Reset the global state and lock the mutex again. + + initTelemetry(false) + telemetryTime = Now() + assert.Equal(t, time.Time{}, telemetryTime, "Now() should return zero time when telemetry is disabled") +} + +// TestIsTelemetryEnabled tests the IsTelemetryEnabled function. +func TestIsTelemetryEnabled(t *testing.T) { + setupTest(t) // Locks the mutex to avoid race condition. + + initTelemetry(true) + assert.True(t, IsTelemetryEnabled(), "IsTelemetryEnabled() should return true when globalTelemetryEnabled is set to true") + + setupTest(t) // Reset the global state and lock the mutex again. + + initTelemetry(false) + assert.False(t, IsTelemetryEnabled(), "IsTelemetryEnabled() should return false when globalTelemetryEnabled is set to false") +} diff --git a/tests/e2e/baseapp/block_gas_test.go b/tests/e2e/baseapp/block_gas_test.go index 134771884df1..0098c2d48650 100644 --- a/tests/e2e/baseapp/block_gas_test.go +++ b/tests/e2e/baseapp/block_gas_test.go @@ -17,6 +17,7 @@ import ( "cosmossdk.io/log" sdkmath "cosmossdk.io/math" store "cosmossdk.io/store/types" + _ "cosmossdk.io/x/accounts" xauthsigning "cosmossdk.io/x/auth/signing" "github.com/cosmos/cosmos-sdk/baseapp" @@ -85,6 +86,7 @@ func TestBaseApp_BlockGas(t *testing.T) { err = depinject.Inject( depinject.Configs( configurator.NewAppConfig( + configurator.AccountsModule(), configurator.AuthModule(), configurator.TxModule(), configurator.ConsensusModule(), diff --git a/tests/go.mod b/tests/go.mod index 4ecb03a9df76..04bf403684a9 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -13,23 +13,23 @@ require ( cosmossdk.io/log v1.3.1 cosmossdk.io/math v1.3.0 cosmossdk.io/simapp v0.0.0-20230309163709-87da587416ba - cosmossdk.io/store v1.0.2 + cosmossdk.io/store v1.1.0 cosmossdk.io/x/evidence v0.0.0-20230613133644-0a778132a60f cosmossdk.io/x/feegrant v0.0.0-20230613133644-0a778132a60f cosmossdk.io/x/nft v0.0.0-20230613133644-0a778132a60f cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190 cosmossdk.io/x/tx v0.13.1 cosmossdk.io/x/upgrade v0.0.0-20230613133644-0a778132a60f - github.com/cometbft/cometbft v0.38.6 + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.4 // this version is not used as it is always replaced by the latest Cosmos SDK version github.com/cosmos/cosmos-sdk v0.51.0 - github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/gogoproto v1.4.12 github.com/golang/mock v1.6.0 github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.9.0 - google.golang.org/grpc v1.62.1 + google.golang.org/grpc v1.63.2 google.golang.org/protobuf v1.33.0 gotest.tools/v3 v3.5.1 pgregory.net/rapid v1.1.0 @@ -59,8 +59,9 @@ require ( cloud.google.com/go/iam v1.1.6 // indirect cloud.google.com/go/storage v1.36.0 // indirect cosmossdk.io/client/v2 v2.0.0-20230630094428-02b760776860 // indirect - cosmossdk.io/x/accounts/lockup v0.0.0-00010101000000-000000000000 // indirect + cosmossdk.io/x/accounts/defaults/lockup v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/circuit v0.0.0-20230613133644-0a778132a60f // indirect + cosmossdk.io/x/epochs v0.0.0-00010101000000-000000000000 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect @@ -88,12 +89,12 @@ require ( github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.0.1 // indirect + github.com/cosmos/iavl v1.1.1 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect @@ -152,7 +153,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect @@ -164,14 +165,14 @@ require ( github.com/mtibben/percent v0.2.1 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.0 // indirect github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.50.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/common v0.52.2 // indirect + github.com/prometheus/procfs v0.13.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.10.1 // indirect @@ -201,22 +202,22 @@ require ( go.opentelemetry.io/otel/metric v1.22.0 // indirect go.opentelemetry.io/otel/trace v1.22.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.21.0 // indirect - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.22.0 // indirect + golang.org/x/crypto v0.22.0 // indirect + golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81 // indirect + golang.org/x/mod v0.16.0 // indirect + golang.org/x/net v0.24.0 // indirect golang.org/x/oauth2 v0.18.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.18.0 // indirect + golang.org/x/tools v0.19.0 // indirect google.golang.org/api v0.162.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20240221002015-b0ce06bbee7c // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.10 // indirect @@ -236,12 +237,13 @@ replace ( cosmossdk.io/core => ../core cosmossdk.io/depinject => ../depinject cosmossdk.io/x/accounts => ../x/accounts - cosmossdk.io/x/accounts/lockup => ../x/accounts/defaults/lockup + cosmossdk.io/x/accounts/defaults/lockup => ../x/accounts/defaults/lockup cosmossdk.io/x/auth => ../x/auth cosmossdk.io/x/authz => ../x/authz cosmossdk.io/x/bank => ../x/bank cosmossdk.io/x/circuit => ../x/circuit cosmossdk.io/x/distribution => ../x/distribution + cosmossdk.io/x/epochs => ../x/epochs cosmossdk.io/x/evidence => ../x/evidence cosmossdk.io/x/feegrant => ../x/feegrant cosmossdk.io/x/gov => ../x/gov diff --git a/tests/go.sum b/tests/go.sum index 6833aa86ce81..137e8d2cd44a 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -197,8 +197,8 @@ cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= -cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= +cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= +cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -321,8 +321,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.11.0 h1:M3Lscmpogx5NTbb1EGyGDaFRdsoLWrUWimFEyf7jej8= github.com/cometbft/cometbft-db v0.11.0/go.mod h1:GDPJAC/iFHNjmZZPN8V8C1yr/eyityhi2W1hz2MGKSc= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -344,10 +344,10 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= -github.com/cosmos/iavl v1.0.1 h1:D+mYbcRO2wptYzOM1Hxl9cpmmHU1ZEt9T2Wv5nZTeUw= -github.com/cosmos/iavl v1.0.1/go.mod h1:8xIUkgVvwvVrBu81scdPty+/Dx9GqwHnAvXz4cwF7RY= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= +github.com/cosmos/iavl v1.1.1 h1:64nTi8s3gEoGqhA8TyAWFWfz7/pg0anKzHNSc1ETc7Q= +github.com/cosmos/iavl v1.1.1/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= @@ -367,8 +367,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= @@ -727,8 +727,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -832,8 +832,8 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= @@ -874,16 +874,16 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= -github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= +github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -1054,8 +1054,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1067,8 +1067,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81 h1:6R2FC06FonbXQ8pK11/PDFY6N6LWlf9KlzibaCapmqc= +golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81/go.mod h1:CQ1k9gNrJ50XIzaKCRR2hssIjF07kZFEiieALBM/ARQ= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1095,8 +1095,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= +golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1156,8 +1156,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1199,8 +1199,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1296,13 +1296,13 @@ golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1385,8 +1385,8 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= -golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= +golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= +golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1564,12 +1564,12 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20240221002015-b0ce06bbee7c h1:Zmyn5CV/jxzKnF+3d+xzbomACPwLQqVpLTpyXN5uTaQ= -google.golang.org/genproto v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= -google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c h1:9g7erC9qu44ks7UK4gDNlnk4kOxZG707xKm4jVniy6o= -google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1611,8 +1611,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/tests/integration/auth/keeper/msg_server_test.go b/tests/integration/auth/keeper/msg_server_test.go new file mode 100644 index 000000000000..b7ae43e00c1d --- /dev/null +++ b/tests/integration/auth/keeper/msg_server_test.go @@ -0,0 +1,287 @@ +package keeper_test + +import ( + "context" + "strings" + "testing" + + "gotest.tools/v3/assert" + + signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/log" + sdkmath "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" + "cosmossdk.io/x/accounts" + baseaccount "cosmossdk.io/x/accounts/defaults/base" + "cosmossdk.io/x/auth" + authkeeper "cosmossdk.io/x/auth/keeper" + authsims "cosmossdk.io/x/auth/simulation" + "cosmossdk.io/x/auth/types" + authtypes "cosmossdk.io/x/auth/types" + "cosmossdk.io/x/bank" + "cosmossdk.io/x/bank/keeper" + bankkeeper "cosmossdk.io/x/bank/keeper" + "cosmossdk.io/x/bank/testutil" + banktypes "cosmossdk.io/x/bank/types" + minttypes "cosmossdk.io/x/mint/types" + "cosmossdk.io/x/tx/signing" + + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/codec" + addresscodec "github.com/cosmos/cosmos-sdk/codec/address" + codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/runtime" + "github.com/cosmos/cosmos-sdk/testutil/integration" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + sdk "github.com/cosmos/cosmos-sdk/types" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" +) + +type fixture struct { + app *integration.App + + cdc codec.Codec + ctx sdk.Context + + authKeeper authkeeper.AccountKeeper + accountsKeeper accounts.Keeper + bankKeeper bankkeeper.Keeper +} + +var _ signing.SignModeHandler = directHandler{} + +type directHandler struct{} + +func (s directHandler) Mode() signingv1beta1.SignMode { + return signingv1beta1.SignMode_SIGN_MODE_DIRECT +} + +func (s directHandler) GetSignBytes(_ context.Context, _ signing.SignerData, _ signing.TxData) ([]byte, error) { + panic("not implemented") +} + +func initFixture(t *testing.T) *fixture { + t.Helper() + keys := storetypes.NewKVStoreKeys( + authtypes.StoreKey, banktypes.StoreKey, accounts.StoreKey, + ) + encodingCfg := moduletestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{}, auth.AppModule{}, bank.AppModule{}, accounts.AppModule{}) + cdc := encodingCfg.Codec + + logger := log.NewTestLogger(t) + cms := integration.CreateMultiStore(keys, logger) + + newCtx := sdk.NewContext(cms, true, logger) + + router := baseapp.NewMsgServiceRouter() + router.SetInterfaceRegistry(cdc.InterfaceRegistry()) + queryRouter := baseapp.NewGRPCQueryRouter() + queryRouter.SetInterfaceRegistry(cdc.InterfaceRegistry()) + + handler := directHandler{} + account := baseaccount.NewAccount("base", signing.NewHandlerMap(handler)) + accountsKeeper, err := accounts.NewKeeper( + cdc, + runtime.NewEnvironment(runtime.NewKVStoreService(keys[accounts.StoreKey]), log.NewNopLogger()), + addresscodec.NewBech32Codec("cosmos"), + router, + queryRouter, + cdc.InterfaceRegistry(), + account, + ) + assert.NilError(t, err) + + authority := authtypes.NewModuleAddress("gov") + + authKeeper := authkeeper.NewAccountKeeper( + runtime.NewEnvironment(runtime.NewKVStoreService(keys[authtypes.StoreKey]), log.NewNopLogger()), + cdc, + authtypes.ProtoBaseAccount, + accountsKeeper, + map[string][]string{minttypes.ModuleName: {authtypes.Minter}}, + addresscodec.NewBech32Codec(sdk.Bech32MainPrefix), + sdk.Bech32MainPrefix, + authority.String(), + ) + + blockedAddresses := map[string]bool{ + authKeeper.GetAuthority(): false, + } + bankKeeper := keeper.NewBaseKeeper( + runtime.NewEnvironment(runtime.NewKVStoreService(keys[banktypes.StoreKey]), log.NewNopLogger()), + cdc, + authKeeper, + blockedAddresses, + authority.String(), + ) + + params := banktypes.DefaultParams() + assert.NilError(t, bankKeeper.SetParams(newCtx, params)) + + accountsModule := accounts.NewAppModule(cdc, accountsKeeper) + authModule := auth.NewAppModule(cdc, authKeeper, accountsKeeper, authsims.RandomGenesisAccounts) + bankModule := bank.NewAppModule(cdc, bankKeeper, authKeeper) + + integrationApp := integration.NewIntegrationApp(newCtx, logger, keys, cdc, + encodingCfg.InterfaceRegistry.SigningContext().AddressCodec(), + encodingCfg.InterfaceRegistry.SigningContext().ValidatorAddressCodec(), + map[string]appmodule.AppModule{ + accounts.ModuleName: accountsModule, + authtypes.ModuleName: authModule, + banktypes.ModuleName: bankModule, + }) + + authtypes.RegisterInterfaces(cdc.InterfaceRegistry()) + banktypes.RegisterInterfaces(cdc.InterfaceRegistry()) + + authtypes.RegisterMsgServer(integrationApp.MsgServiceRouter(), authkeeper.NewMsgServerImpl(authKeeper)) + authtypes.RegisterQueryServer(integrationApp.QueryHelper(), authkeeper.NewQueryServer(authKeeper)) + + banktypes.RegisterMsgServer(router, bankkeeper.NewMsgServerImpl(bankKeeper)) + + return &fixture{ + app: integrationApp, + cdc: cdc, + ctx: newCtx, + accountsKeeper: accountsKeeper, + authKeeper: authKeeper, + bankKeeper: bankKeeper, + } +} + +func TestAsyncExec(t *testing.T) { + t.Parallel() + f := initFixture(t) + + addrs := simtestutil.CreateIncrementalAccounts(2) + coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10))) + + assert.NilError(t, testutil.FundAccount(f.ctx, f.bankKeeper, addrs[0], sdk.NewCoins(sdk.NewInt64Coin("stake", 50)))) + + msg := &banktypes.MsgSend{ + FromAddress: addrs[0].String(), + ToAddress: addrs[1].String(), + Amount: coins, + } + msg2 := &banktypes.MsgSend{ + FromAddress: addrs[1].String(), + ToAddress: addrs[0].String(), + Amount: coins, + } + failingMsg := &banktypes.MsgSend{ + FromAddress: addrs[0].String(), + ToAddress: addrs[1].String(), + Amount: sdk.NewCoins(sdk.NewCoin("stake", sdkmath.ZeroInt())), // No amount specified + } + + msgAny, err := codectypes.NewAnyWithValue(msg) + assert.NilError(t, err) + + msgAny2, err := codectypes.NewAnyWithValue(msg2) + assert.NilError(t, err) + + failingMsgAny, err := codectypes.NewAnyWithValue(failingMsg) + assert.NilError(t, err) + + testCases := []struct { + name string + req *types.MsgNonAtomicExec + expectErr bool + expErrMsg string + }{ + { + name: "empty signer address", + req: &types.MsgNonAtomicExec{ + Signer: "", + Msgs: []*codectypes.Any{}, + }, + expectErr: true, + expErrMsg: "empty signer address string is not allowed", + }, + { + name: "invalid signer address", + req: &types.MsgNonAtomicExec{ + Signer: "invalid", + Msgs: []*codectypes.Any{}, + }, + expectErr: true, + expErrMsg: "invalid signer address", + }, + { + name: "empty msgs", + req: &types.MsgNonAtomicExec{ + Signer: addrs[0].String(), + Msgs: []*codectypes.Any{}, + }, + expectErr: true, + expErrMsg: "messages cannot be empty", + }, + { + name: "valid msg", + req: &types.MsgNonAtomicExec{ + Signer: addrs[0].String(), + Msgs: []*codectypes.Any{msgAny}, + }, + expectErr: false, + }, + { + name: "multiple messages being executed", + req: &types.MsgNonAtomicExec{ + Signer: addrs[0].String(), + Msgs: []*codectypes.Any{msgAny, msgAny}, + }, + expectErr: false, + }, + { + name: "multiple messages with different signers", + req: &types.MsgNonAtomicExec{ + Signer: addrs[0].String(), + Msgs: []*codectypes.Any{msgAny, msgAny2}, + }, + expectErr: false, + expErrMsg: "unauthorized: sender does not match expected sender", + }, + { + name: "multi msg with one failing being executed", + req: &types.MsgNonAtomicExec{ + Signer: addrs[0].String(), + Msgs: []*codectypes.Any{msgAny, failingMsgAny}, + }, + expectErr: false, + expErrMsg: "invalid coins", + }, + } + + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + res, err := f.app.RunMsg( + tc.req, + integration.WithAutomaticFinalizeBlock(), + integration.WithAutomaticCommit(), + ) + if tc.expectErr { + assert.ErrorContains(t, err, tc.expErrMsg) + } else { + assert.NilError(t, err) + assert.Assert(t, res != nil) + + // check the result + result := authtypes.MsgNonAtomicExecResponse{} + err = f.cdc.Unmarshal(res.Value, &result) + assert.NilError(t, err) + + if tc.expErrMsg != "" { + for _, res := range result.Results { + if res.Error != "" { + assert.Assert(t, strings.Contains(res.Error, tc.expErrMsg)) + } + continue + } + } + } + }) + } +} diff --git a/tests/integration/bank/app_test.go b/tests/integration/bank/app_test.go index eeca54284fff..7043b1eb0be6 100644 --- a/tests/integration/bank/app_test.go +++ b/tests/integration/bank/app_test.go @@ -11,6 +11,7 @@ import ( "cosmossdk.io/depinject" "cosmossdk.io/log" sdkmath "cosmossdk.io/math" + _ "cosmossdk.io/x/accounts" _ "cosmossdk.io/x/auth" _ "cosmossdk.io/x/auth/tx/config" authtypes "cosmossdk.io/x/auth/types" @@ -67,34 +68,6 @@ var ( halfCoins = sdk.Coins{sdk.NewInt64Coin("foocoin", 5)} sendMsg1 = types.NewMsgSend(addr1.String(), addr2.String(), coins) - - multiSendMsg1 = &types.MsgMultiSend{ - Inputs: []types.Input{types.NewInput(addr1, coins)}, - Outputs: []types.Output{types.NewOutput(addr2, coins)}, - } - multiSendMsg2 = &types.MsgMultiSend{ - Inputs: []types.Input{types.NewInput(addr1, coins)}, - Outputs: []types.Output{ - types.NewOutput(addr2, halfCoins), - types.NewOutput(addr3, halfCoins), - }, - } - multiSendMsg3 = &types.MsgMultiSend{ - Inputs: []types.Input{types.NewInput(addr2, coins)}, - Outputs: []types.Output{ - types.NewOutput(addr1, coins), - }, - } - multiSendMsg4 = &types.MsgMultiSend{ - Inputs: []types.Input{types.NewInput(addr1, coins)}, - Outputs: []types.Output{ - types.NewOutput(moduleAccAddr, coins), - }, - } - invalidMultiSendMsg = &types.MsgMultiSend{ - Inputs: []types.Input{types.NewInput(addr1, coins), types.NewInput(addr2, coins)}, - Outputs: []types.Output{}, - } ) type suite struct { @@ -120,6 +93,7 @@ func createTestSuite(t *testing.T, genesisAccounts []authtypes.GenesisAccount) s app, err := simtestutil.SetupWithConfiguration( depinject.Configs( configurator.NewAppConfig( + configurator.AccountsModule(), configurator.AuthModule(), configurator.StakingModule(), configurator.TxModule(), @@ -191,17 +165,25 @@ func TestSendNotEnoughBalance(t *testing.T) { } func TestMsgMultiSendWithAccounts(t *testing.T) { + addr1Str, err := cdctestutil.CodecOptions{}.GetAddressCodec().BytesToString(addr1) + require.NoError(t, err) acc := &authtypes.BaseAccount{ - Address: addr1.String(), + Address: addr1Str, } + addr2Str, err := cdctestutil.CodecOptions{}.GetAddressCodec().BytesToString(addr2) + require.NoError(t, err) + + moduleStrAddr, err := cdctestutil.CodecOptions{}.GetAddressCodec().BytesToString(moduleAccAddr) + require.NoError(t, err) + genAccs := []authtypes.GenesisAccount{acc} s := createTestSuite(t, genAccs) baseApp := s.App.BaseApp ctx := baseApp.NewContext(false) require.NoError(t, testutil.FundAccount(ctx, s.BankKeeper, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 67)))) - _, err := baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: baseApp.LastBlockHeight() + 1}) + _, err = baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: baseApp.LastBlockHeight() + 1}) require.NoError(t, err) _, err = baseApp.Commit() require.NoError(t, err) @@ -212,8 +194,11 @@ func TestMsgMultiSendWithAccounts(t *testing.T) { testCases := []appTestCase{ { - desc: "make a valid tx", - msgs: []sdk.Msg{multiSendMsg1}, + desc: "make a valid tx", + msgs: []sdk.Msg{&types.MsgMultiSend{ + Inputs: []types.Input{types.NewInput(addr1Str, coins)}, + Outputs: []types.Output{types.NewOutput(addr2Str, coins)}, + }}, accNums: []uint64{0}, accSeqs: []uint64{0}, expSimPass: true, @@ -225,8 +210,11 @@ func TestMsgMultiSendWithAccounts(t *testing.T) { }, }, { - desc: "wrong accNum should pass Simulate, but not Deliver", - msgs: []sdk.Msg{multiSendMsg1}, + desc: "wrong accNum should pass Simulate, but not Deliver", + msgs: []sdk.Msg{&types.MsgMultiSend{ + Inputs: []types.Input{types.NewInput(addr1Str, coins)}, + Outputs: []types.Output{types.NewOutput(addr2Str, coins)}, + }}, accNums: []uint64{1}, // wrong account number accSeqs: []uint64{1}, expSimPass: true, // doesn't check signature @@ -234,8 +222,13 @@ func TestMsgMultiSendWithAccounts(t *testing.T) { privKeys: []cryptotypes.PrivKey{priv1}, }, { - desc: "wrong accSeq should not pass Simulate", - msgs: []sdk.Msg{multiSendMsg4}, + desc: "wrong accSeq should not pass Simulate", + msgs: []sdk.Msg{&types.MsgMultiSend{ + Inputs: []types.Input{types.NewInput(addr1Str, coins)}, + Outputs: []types.Output{ + types.NewOutput(moduleStrAddr, coins), + }, + }}, accNums: []uint64{0}, accSeqs: []uint64{0}, // wrong account sequence expSimPass: false, @@ -243,8 +236,11 @@ func TestMsgMultiSendWithAccounts(t *testing.T) { privKeys: []cryptotypes.PrivKey{priv1}, }, { - desc: "multiple inputs not allowed", - msgs: []sdk.Msg{invalidMultiSendMsg}, + desc: "multiple inputs not allowed", + msgs: []sdk.Msg{&types.MsgMultiSend{ + Inputs: []types.Input{types.NewInput(addr1Str, coins), types.NewInput(addr2Str, coins)}, + Outputs: []types.Output{}, + }}, accNums: []uint64{0}, accSeqs: []uint64{0}, expSimPass: false, @@ -272,12 +268,19 @@ func TestMsgMultiSendWithAccounts(t *testing.T) { } func TestMsgMultiSendMultipleOut(t *testing.T) { + ac := cdctestutil.CodecOptions{}.GetAddressCodec() + addr1Str, err := ac.BytesToString(addr1) + require.NoError(t, err) acc1 := &authtypes.BaseAccount{ - Address: addr1.String(), + Address: addr1Str, } + addr2Str, err := ac.BytesToString(addr2) + require.NoError(t, err) acc2 := &authtypes.BaseAccount{ - Address: addr2.String(), + Address: addr2Str, } + addr3Str, err := ac.BytesToString(addr3) + require.NoError(t, err) genAccs := []authtypes.GenesisAccount{acc1, acc2} s := createTestSuite(t, genAccs) @@ -286,14 +289,20 @@ func TestMsgMultiSendMultipleOut(t *testing.T) { require.NoError(t, testutil.FundAccount(ctx, s.BankKeeper, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 42)))) require.NoError(t, testutil.FundAccount(ctx, s.BankKeeper, addr2, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 42)))) - _, err := baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: baseApp.LastBlockHeight() + 1}) + _, err = baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: baseApp.LastBlockHeight() + 1}) require.NoError(t, err) _, err = baseApp.Commit() require.NoError(t, err) testCases := []appTestCase{ { - msgs: []sdk.Msg{multiSendMsg2}, + msgs: []sdk.Msg{&types.MsgMultiSend{ + Inputs: []types.Input{types.NewInput(addr1Str, coins)}, + Outputs: []types.Output{ + types.NewOutput(addr2Str, halfCoins), + types.NewOutput(addr3Str, halfCoins), + }, + }}, accNums: []uint64{0}, accSeqs: []uint64{0}, expSimPass: true, @@ -320,9 +329,15 @@ func TestMsgMultiSendMultipleOut(t *testing.T) { } func TestMsgMultiSendDependent(t *testing.T) { + ac := cdctestutil.CodecOptions{}.GetAddressCodec() + addr1Str, err := ac.BytesToString(addr1) + require.NoError(t, err) + addr2Str, err := ac.BytesToString(addr2) + require.NoError(t, err) + acc1 := authtypes.NewBaseAccountWithAddress(addr1) acc2 := authtypes.NewBaseAccountWithAddress(addr2) - err := acc2.SetAccountNumber(1) + err = acc2.SetAccountNumber(1) require.NoError(t, err) genAccs := []authtypes.GenesisAccount{acc1, acc2} @@ -338,7 +353,10 @@ func TestMsgMultiSendDependent(t *testing.T) { testCases := []appTestCase{ { - msgs: []sdk.Msg{multiSendMsg1}, + msgs: []sdk.Msg{&types.MsgMultiSend{ + Inputs: []types.Input{types.NewInput(addr1Str, coins)}, + Outputs: []types.Output{types.NewOutput(addr2Str, coins)}, + }}, accNums: []uint64{0}, accSeqs: []uint64{0}, expSimPass: true, @@ -350,7 +368,12 @@ func TestMsgMultiSendDependent(t *testing.T) { }, }, { - msgs: []sdk.Msg{multiSendMsg3}, + msgs: []sdk.Msg{&types.MsgMultiSend{ + Inputs: []types.Input{types.NewInput(addr2Str, coins)}, + Outputs: []types.Output{ + types.NewOutput(addr1Str, coins), + }, + }}, accNums: []uint64{1}, accSeqs: []uint64{0}, expSimPass: true, diff --git a/tests/integration/bank/bench_test.go b/tests/integration/bank/bench_test.go index b953a3f39ec9..89b4d458cfee 100644 --- a/tests/integration/bank/bench_test.go +++ b/tests/integration/bank/bench_test.go @@ -12,6 +12,7 @@ import ( authtypes "cosmossdk.io/x/auth/types" _ "cosmossdk.io/x/bank" "cosmossdk.io/x/bank/testutil" + "cosmossdk.io/x/bank/types" stakingtypes "cosmossdk.io/x/staking/types" "github.com/cosmos/cosmos-sdk/client" @@ -123,17 +124,22 @@ func BenchmarkOneBankMultiSendTxPerBlock(b *testing.B) { // b.Skip("Skipping benchmark with buggy code reported at https://github.com/cosmos/cosmos-sdk/issues/10023") b.ReportAllocs() + addr1Str, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(addr1) + require.NoError(b, err) acc := authtypes.BaseAccount{ Address: addr1.String(), } + addr2Str, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(addr2) + require.NoError(b, err) + // construct genesis state genAccs := []authtypes.GenesisAccount{&acc} s := createTestSuite(&testing.T{}, genAccs) baseApp := s.App.BaseApp ctx := baseApp.NewContext(false) - _, err := baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1}) + _, err = baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{Height: 1}) require.NoError(b, err) require.NoError(b, testutil.FundAccount(ctx, s.BankKeeper, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 100000000000)))) @@ -144,8 +150,13 @@ func BenchmarkOneBankMultiSendTxPerBlock(b *testing.B) { txGen := moduletestutil.MakeTestTxConfig(codectestutil.CodecOptions{}) txEncoder := txGen.TxEncoder() + multiSendMsg := &types.MsgMultiSend{ + Inputs: []types.Input{types.NewInput(addr1Str, coins)}, + Outputs: []types.Output{types.NewOutput(addr2Str, coins)}, + } + // pre-compute all txs - txs, err := genSequenceOfTxs(txGen, []sdk.Msg{multiSendMsg1}, []uint64{0}, []uint64{uint64(0)}, b.N, priv1) + txs, err := genSequenceOfTxs(txGen, []sdk.Msg{multiSendMsg}, []uint64{0}, []uint64{uint64(0)}, b.N, priv1) require.NoError(b, err) b.ResetTimer() diff --git a/tests/integration/bank/keeper/deterministic_test.go b/tests/integration/bank/keeper/deterministic_test.go index 635e061dd915..2f126d5ab386 100644 --- a/tests/integration/bank/keeper/deterministic_test.go +++ b/tests/integration/bank/keeper/deterministic_test.go @@ -3,6 +3,7 @@ package keeper_test import ( "testing" + "github.com/golang/mock/gomock" "gotest.tools/v3/assert" "pgregory.net/rapid" @@ -13,6 +14,7 @@ import ( "cosmossdk.io/x/auth" authkeeper "cosmossdk.io/x/auth/keeper" authsims "cosmossdk.io/x/auth/simulation" + authtestutil "cosmossdk.io/x/auth/testutil" _ "cosmossdk.io/x/auth/tx/config" authtypes "cosmossdk.io/x/auth/types" "cosmossdk.io/x/bank" @@ -78,10 +80,15 @@ func initDeterministicFixture(t *testing.T) *deterministicFixture { minttypes.ModuleName: {authtypes.Minter}, } + // gomock initializations + ctrl := gomock.NewController(t) + acctsModKeeper := authtestutil.NewMockAccountsModKeeper(ctrl) + accountKeeper := authkeeper.NewAccountKeeper( runtime.NewEnvironment(runtime.NewKVStoreService(keys[authtypes.StoreKey]), log.NewNopLogger()), cdc, authtypes.ProtoBaseAccount, + acctsModKeeper, maccPerms, addresscodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix, @@ -100,7 +107,7 @@ func initDeterministicFixture(t *testing.T) *deterministicFixture { authority.String(), ) - authModule := auth.NewAppModule(cdc, accountKeeper, authsims.RandomGenesisAccounts) + authModule := auth.NewAppModule(cdc, accountKeeper, acctsModKeeper, authsims.RandomGenesisAccounts) bankModule := bank.NewAppModule(cdc, bankKeeper, accountKeeper) integrationApp := integration.NewIntegrationApp(newCtx, logger, keys, cdc, @@ -150,25 +157,35 @@ func TestGRPCQueryBalance(t *testing.T) { coin := getCoin(rt) fundAccount(f, addr, coin) - req := banktypes.NewQueryBalanceRequest(addr, coin.GetDenom()) + addrStr, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(addr) + assert.NilError(t, err) + + req := banktypes.NewQueryBalanceRequest(addrStr, coin.GetDenom()) testdata.DeterministicIterations(t, f.ctx, req, f.queryClient.Balance, 0, true) }) + addr1Str, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(addr1) + assert.NilError(t, err) + fundAccount(f, addr1, coin1) - req := banktypes.NewQueryBalanceRequest(addr1, coin1.GetDenom()) + req := banktypes.NewQueryBalanceRequest(addr1Str, coin1.GetDenom()) testdata.DeterministicIterations(t, f.ctx, req, f.queryClient.Balance, 1087, false) } func TestGRPCQueryAllBalances(t *testing.T) { t.Parallel() f := initDeterministicFixture(t) + addressCodec := codectestutil.CodecOptions{}.GetAddressCodec() rapid.Check(t, func(rt *rapid.T) { addr := testdata.AddressGenerator(rt).Draw(rt, "address") numCoins := rapid.IntRange(1, 10).Draw(rt, "num-count") coins := make(sdk.Coins, 0, numCoins) + addrStr, err := addressCodec.BytesToString(addr) + assert.NilError(t, err) + for i := 0; i < numCoins; i++ { coin := getCoin(rt) @@ -178,7 +195,7 @@ func TestGRPCQueryAllBalances(t *testing.T) { fundAccount(f, addr, coins...) - req := banktypes.NewQueryAllBalancesRequest(addr, testdata.PaginationGenerator(rt, uint64(numCoins)).Draw(rt, "pagination"), false) + req := banktypes.NewQueryAllBalancesRequest(addrStr, testdata.PaginationGenerator(rt, uint64(numCoins)).Draw(rt, "pagination"), false) testdata.DeterministicIterations(t, f.ctx, req, f.queryClient.AllBalances, 0, true) }) @@ -188,7 +205,10 @@ func TestGRPCQueryAllBalances(t *testing.T) { ) fundAccount(f, addr1, coins...) - req := banktypes.NewQueryAllBalancesRequest(addr1, nil, false) + addr1Str, err := addressCodec.BytesToString(addr1) + assert.NilError(t, err) + + req := banktypes.NewQueryAllBalancesRequest(addr1Str, nil, false) testdata.DeterministicIterations(t, f.ctx, req, f.queryClient.AllBalances, 357, false) } @@ -199,6 +219,8 @@ func TestGRPCQuerySpendableBalances(t *testing.T) { rapid.Check(t, func(rt *rapid.T) { addr := testdata.AddressGenerator(rt).Draw(rt, "address") + addrStr, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(addr) + assert.NilError(t, err) // Denoms must be unique, otherwise sdk.NewCoins will panic. denoms := rapid.SliceOfNDistinct(rapid.StringMatching(denomRegex), 1, 10, rapid.ID[string]).Draw(rt, "denoms") @@ -213,10 +235,10 @@ func TestGRPCQuerySpendableBalances(t *testing.T) { coins = sdk.NewCoins(append(coins, coin)...) } - err := banktestutil.FundAccount(f.ctx, f.bankKeeper, addr, coins) + err = banktestutil.FundAccount(f.ctx, f.bankKeeper, addr, coins) assert.NilError(t, err) - req := banktypes.NewQuerySpendableBalancesRequest(addr, testdata.PaginationGenerator(rt, uint64(len(denoms))).Draw(rt, "pagination")) + req := banktypes.NewQuerySpendableBalancesRequest(addrStr, testdata.PaginationGenerator(rt, uint64(len(denoms))).Draw(rt, "pagination")) testdata.DeterministicIterations(t, f.ctx, req, f.queryClient.SpendableBalances, 0, true) }) @@ -228,7 +250,10 @@ func TestGRPCQuerySpendableBalances(t *testing.T) { err := banktestutil.FundAccount(f.ctx, f.bankKeeper, addr1, coins) assert.NilError(t, err) - req := banktypes.NewQuerySpendableBalancesRequest(addr1, nil) + addr1Str, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(addr1) + assert.NilError(t, err) + + req := banktypes.NewQuerySpendableBalancesRequest(addr1Str, nil) testdata.DeterministicIterations(t, f.ctx, req, f.queryClient.SpendableBalances, 1777, false) } diff --git a/tests/integration/distribution/appconfig.go b/tests/integration/distribution/appconfig.go index 7cf9a5a7436b..c22f15e63fd8 100644 --- a/tests/integration/distribution/appconfig.go +++ b/tests/integration/distribution/appconfig.go @@ -1,6 +1,7 @@ package distribution_test import ( + _ "cosmossdk.io/x/accounts" // import as blank for app wiring _ "cosmossdk.io/x/auth" // import as blank for app wiring _ "cosmossdk.io/x/auth/tx/config" // import as blank for app wiring _ "cosmossdk.io/x/bank" // import as blank for app wiring @@ -15,6 +16,7 @@ import ( ) var AppConfig = configurator.NewAppConfig( + configurator.AccountsModule(), configurator.AuthModule(), configurator.BankModule(), configurator.StakingModule(), diff --git a/tests/integration/distribution/keeper/msg_server_test.go b/tests/integration/distribution/keeper/msg_server_test.go index 962d6c8779e9..cd2d89333f0d 100644 --- a/tests/integration/distribution/keeper/msg_server_test.go +++ b/tests/integration/distribution/keeper/msg_server_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" "gotest.tools/v3/assert" @@ -16,6 +17,7 @@ import ( "cosmossdk.io/x/auth" authkeeper "cosmossdk.io/x/auth/keeper" authsims "cosmossdk.io/x/auth/simulation" + authtestutil "cosmossdk.io/x/auth/testutil" authtypes "cosmossdk.io/x/auth/types" "cosmossdk.io/x/bank" bankkeeper "cosmossdk.io/x/bank/keeper" @@ -85,10 +87,15 @@ func initFixture(t *testing.T) *fixture { stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, } + // gomock initializations + ctrl := gomock.NewController(t) + acctsModKeeper := authtestutil.NewMockAccountsModKeeper(ctrl) + accountKeeper := authkeeper.NewAccountKeeper( runtime.NewEnvironment(runtime.NewKVStoreService(keys[authtypes.StoreKey]), log.NewNopLogger()), cdc, authtypes.ProtoBaseAccount, + acctsModKeeper, maccPerms, addresscodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix, @@ -115,7 +122,7 @@ func initFixture(t *testing.T) *fixture { cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[distrtypes.StoreKey]), logger), accountKeeper, bankKeeper, stakingKeeper, poolKeeper, distrtypes.ModuleName, authority.String(), ) - authModule := auth.NewAppModule(cdc, accountKeeper, authsims.RandomGenesisAccounts) + authModule := auth.NewAppModule(cdc, accountKeeper, acctsModKeeper, authsims.RandomGenesisAccounts) bankModule := bank.NewAppModule(cdc, bankKeeper, accountKeeper) stakingModule := staking.NewAppModule(cdc, stakingKeeper, accountKeeper, bankKeeper) distrModule := distribution.NewAppModule(cdc, distrKeeper, accountKeeper, bankKeeper, stakingKeeper, poolKeeper) diff --git a/tests/integration/evidence/app_config.go b/tests/integration/evidence/app_config.go index 1132ea10e9f1..6a9bba7e164f 100644 --- a/tests/integration/evidence/app_config.go +++ b/tests/integration/evidence/app_config.go @@ -1,6 +1,7 @@ package evidence_test import ( + _ "cosmossdk.io/x/accounts" // import as blank for app wiring _ "cosmossdk.io/x/auth" // import as blank for app wiring _ "cosmossdk.io/x/auth/tx/config" // import as blank for app wiring _ "cosmossdk.io/x/bank" // import as blank for app wiring @@ -14,6 +15,7 @@ import ( ) var AppConfig = configurator.NewAppConfig( + configurator.AccountsModule(), configurator.AuthModule(), configurator.BankModule(), configurator.StakingModule(), diff --git a/tests/integration/evidence/keeper/infraction_test.go b/tests/integration/evidence/keeper/infraction_test.go index 87d5a52c9fa4..62b3a6362d76 100644 --- a/tests/integration/evidence/keeper/infraction_test.go +++ b/tests/integration/evidence/keeper/infraction_test.go @@ -9,6 +9,7 @@ import ( "time" abci "github.com/cometbft/cometbft/abci/types" + "github.com/golang/mock/gomock" "gotest.tools/v3/assert" "cosmossdk.io/collections" @@ -20,6 +21,7 @@ import ( "cosmossdk.io/x/auth" authkeeper "cosmossdk.io/x/auth/keeper" authsims "cosmossdk.io/x/auth/simulation" + authtestutil "cosmossdk.io/x/auth/testutil" authtypes "cosmossdk.io/x/auth/types" "cosmossdk.io/x/bank" bankkeeper "cosmossdk.io/x/bank/keeper" @@ -98,6 +100,10 @@ func initFixture(tb testing.TB) *fixture { authority := authtypes.NewModuleAddress("gov") + // gomock initializations + ctrl := gomock.NewController(tb) + acctsModKeeper := authtestutil.NewMockAccountsModKeeper(ctrl) + maccPerms := map[string][]string{ pooltypes.ModuleName: {}, minttypes.ModuleName: {authtypes.Minter}, @@ -109,6 +115,7 @@ func initFixture(tb testing.TB) *fixture { runtime.NewEnvironment(runtime.NewKVStoreService(keys[authtypes.StoreKey]), log.NewNopLogger()), cdc, authtypes.ProtoBaseAccount, + acctsModKeeper, maccPerms, addresscodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix, @@ -137,7 +144,7 @@ func initFixture(tb testing.TB) *fixture { router = router.AddRoute(evidencetypes.RouteEquivocation, testEquivocationHandler(evidenceKeeper)) evidenceKeeper.SetRouter(router) - authModule := auth.NewAppModule(cdc, accountKeeper, authsims.RandomGenesisAccounts) + authModule := auth.NewAppModule(cdc, accountKeeper, acctsModKeeper, authsims.RandomGenesisAccounts) bankModule := bank.NewAppModule(cdc, bankKeeper, accountKeeper) stakingModule := staking.NewAppModule(cdc, stakingKeeper, accountKeeper, bankKeeper) slashingModule := slashing.NewAppModule(cdc, slashingKeeper, accountKeeper, bankKeeper, stakingKeeper, cdc.InterfaceRegistry()) diff --git a/tests/integration/example/example_test.go b/tests/integration/example/example_test.go index e921c175021b..bc87760e114b 100644 --- a/tests/integration/example/example_test.go +++ b/tests/integration/example/example_test.go @@ -3,7 +3,9 @@ package integration_test import ( "fmt" "io" + "testing" + "github.com/golang/mock/gomock" "github.com/google/go-cmp/cmp" "cosmossdk.io/core/appmodule" @@ -12,6 +14,7 @@ import ( "cosmossdk.io/x/auth" authkeeper "cosmossdk.io/x/auth/keeper" authsims "cosmossdk.io/x/auth/simulation" + authtestutil "cosmossdk.io/x/auth/testutil" authtypes "cosmossdk.io/x/auth/types" "cosmossdk.io/x/mint" mintkeeper "cosmossdk.io/x/mint/keeper" @@ -42,10 +45,15 @@ func Example() { cms := integration.CreateMultiStore(keys, logger) newCtx := sdk.NewContext(cms, true, logger) + // gomock initializations + ctrl := gomock.NewController(&testing.T{}) + acctsModKeeper := authtestutil.NewMockAccountsModKeeper(ctrl) + accountKeeper := authkeeper.NewAccountKeeper( runtime.NewEnvironment(runtime.NewKVStoreService(keys[authtypes.StoreKey]), log.NewNopLogger()), encodingCfg.Codec, authtypes.ProtoBaseAccount, + acctsModKeeper, map[string][]string{minttypes.ModuleName: {authtypes.Minter}}, addresscodec.NewBech32Codec("cosmos"), "cosmos", @@ -53,7 +61,7 @@ func Example() { ) // subspace is nil because we don't test params (which is legacy anyway) - authModule := auth.NewAppModule(encodingCfg.Codec, accountKeeper, authsims.RandomGenesisAccounts) + authModule := auth.NewAppModule(encodingCfg.Codec, accountKeeper, acctsModKeeper, authsims.RandomGenesisAccounts) // here bankkeeper and staking keeper is nil because we are not testing them // subspace is nil because we don't test params (which is legacy anyway) @@ -133,10 +141,15 @@ func Example_oneModule() { cms := integration.CreateMultiStore(keys, logger) newCtx := sdk.NewContext(cms, true, logger) + // gomock initializations + ctrl := gomock.NewController(&testing.T{}) + acctsModKeeper := authtestutil.NewMockAccountsModKeeper(ctrl) + accountKeeper := authkeeper.NewAccountKeeper( runtime.NewEnvironment(runtime.NewKVStoreService(keys[authtypes.StoreKey]), log.NewNopLogger()), encodingCfg.Codec, authtypes.ProtoBaseAccount, + acctsModKeeper, map[string][]string{minttypes.ModuleName: {authtypes.Minter}}, addresscodec.NewBech32Codec("cosmos"), "cosmos", @@ -144,7 +157,7 @@ func Example_oneModule() { ) // subspace is nil because we don't test params (which is legacy anyway) - authModule := auth.NewAppModule(encodingCfg.Codec, accountKeeper, authsims.RandomGenesisAccounts) + authModule := auth.NewAppModule(encodingCfg.Codec, accountKeeper, acctsModKeeper, authsims.RandomGenesisAccounts) // create the application and register all the modules from the previous step integrationApp := integration.NewIntegrationApp( diff --git a/tests/integration/gov/abci_test.go b/tests/integration/gov/abci_test.go index dbe612a20496..733d7236f9b7 100644 --- a/tests/integration/gov/abci_test.go +++ b/tests/integration/gov/abci_test.go @@ -25,12 +25,14 @@ func TestUnregisteredProposal_InactiveProposalFails(t *testing.T) { suite := createTestSuite(t) ctx := suite.app.BaseApp.NewContext(false) addrs := simtestutil.AddTestAddrs(suite.BankKeeper, suite.StakingKeeper, ctx, 10, valTokens) + addr0Str, err := suite.AccountKeeper.AddressCodec().BytesToString(addrs[0]) + require.NoError(t, err) // manually set proposal in store startTime, endTime := time.Now().Add(-4*time.Hour), ctx.BlockHeader().Time proposal, err := v1.NewProposal([]sdk.Msg{ &v1.Proposal{}, // invalid proposal message - }, 1, startTime, startTime, "", "Unsupported proposal", "Unsupported proposal", addrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) + }, 1, startTime, startTime, "", "Unsupported proposal", "Unsupported proposal", addr0Str, v1.ProposalType_PROPOSAL_TYPE_STANDARD) require.NoError(t, err) err = suite.GovKeeper.Proposals.Set(ctx, proposal.Id, proposal) @@ -51,12 +53,13 @@ func TestUnregisteredProposal_ActiveProposalFails(t *testing.T) { suite := createTestSuite(t) ctx := suite.app.BaseApp.NewContext(false) addrs := simtestutil.AddTestAddrs(suite.BankKeeper, suite.StakingKeeper, ctx, 10, valTokens) - + addr0Str, err := suite.AccountKeeper.AddressCodec().BytesToString(addrs[0]) + require.NoError(t, err) // manually set proposal in store startTime, endTime := time.Now().Add(-4*time.Hour), ctx.BlockHeader().Time proposal, err := v1.NewProposal([]sdk.Msg{ &v1.Proposal{}, // invalid proposal message - }, 1, startTime, startTime, "", "Unsupported proposal", "Unsupported proposal", addrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) + }, 1, startTime, startTime, "", "Unsupported proposal", "Unsupported proposal", addr0Str, v1.ProposalType_PROPOSAL_TYPE_STANDARD) require.NoError(t, err) proposal.Status = v1.StatusVotingPeriod proposal.VotingEndTime = &endTime @@ -194,7 +197,9 @@ func TestTickPassedDepositPeriod(t *testing.T) { newHeader.Time = ctx.HeaderInfo().Time.Add(time.Duration(1) * time.Second) ctx = ctx.WithHeaderInfo(newHeader) - newDepositMsg := v1.NewMsgDeposit(addrs[1], proposalID, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 100000)}) + addr1Str, err := suite.AccountKeeper.AddressCodec().BytesToString(addrs[1]) + require.NoError(t, err) + newDepositMsg := v1.NewMsgDeposit(addr1Str, proposalID, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 100000)}) res1, err := govMsgSvr.Deposit(ctx, newDepositMsg) require.NoError(t, err) @@ -293,7 +298,9 @@ func TestTickPassedVotingPeriod(t *testing.T) { newHeader.Time = ctx.HeaderInfo().Time.Add(time.Duration(1) * time.Second) ctx = ctx.WithHeaderInfo(newHeader) - newDepositMsg := v1.NewMsgDeposit(addrs[1], proposalID, proposalCoins) + addr1Str, err := suite.AccountKeeper.AddressCodec().BytesToString(addrs[1]) + require.NoError(t, err) + newDepositMsg := v1.NewMsgDeposit(addr1Str, proposalID, proposalCoins) res1, err := govMsgSvr.Deposit(ctx, newDepositMsg) require.NoError(t, err) @@ -373,7 +380,9 @@ func TestProposalPassedEndblocker(t *testing.T) { require.NoError(t, err) proposalCoins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, suite.StakingKeeper.TokensFromConsensusPower(ctx, 10*depositMultiplier))} - newDepositMsg := v1.NewMsgDeposit(addrs[0], proposal.Id, proposalCoins) + addr0Str, err := suite.AccountKeeper.AddressCodec().BytesToString(addrs[0]) + require.NoError(t, err) + newDepositMsg := v1.NewMsgDeposit(addr0Str, proposal.Id, proposalCoins) res, err := govMsgSvr.Deposit(ctx, newDepositMsg) require.NoError(t, err) @@ -433,7 +442,9 @@ func TestEndBlockerProposalHandlerFailed(t *testing.T) { require.NoError(t, err) proposalCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, suite.StakingKeeper.TokensFromConsensusPower(ctx, 10))) - newDepositMsg := v1.NewMsgDeposit(addrs[0], proposal.Id, proposalCoins) + addr0Str, err := suite.AccountKeeper.AddressCodec().BytesToString(addrs[0]) + require.NoError(t, err) + newDepositMsg := v1.NewMsgDeposit(addr0Str, proposal.Id, proposalCoins) govMsgSvr := keeper.NewMsgServerImpl(suite.GovKeeper) res, err := govMsgSvr.Deposit(ctx, newDepositMsg) @@ -531,7 +542,9 @@ func TestExpeditedProposal_PassAndConversionToRegular(t *testing.T) { newHeader.Time = ctx.HeaderInfo().Time.Add(time.Duration(1) * time.Second) ctx = ctx.WithHeaderInfo(newHeader) - newDepositMsg := v1.NewMsgDeposit(addrs[1], proposalID, proposalCoins) + addr1Str, err := suite.AccountKeeper.AddressCodec().BytesToString(addrs[1]) + require.NoError(t, err) + newDepositMsg := v1.NewMsgDeposit(addr1Str, proposalID, proposalCoins) res1, err := govMsgSvr.Deposit(ctx, newDepositMsg) require.NoError(t, err) diff --git a/tests/integration/gov/common_test.go b/tests/integration/gov/common_test.go index d5243c15e66f..65a66cf52cf4 100644 --- a/tests/integration/gov/common_test.go +++ b/tests/integration/gov/common_test.go @@ -12,6 +12,7 @@ import ( "cosmossdk.io/depinject" sdklog "cosmossdk.io/log" "cosmossdk.io/math" + _ "cosmossdk.io/x/accounts" _ "cosmossdk.io/x/auth" authtypes "cosmossdk.io/x/auth/types" _ "cosmossdk.io/x/bank" @@ -105,6 +106,7 @@ func createTestSuite(t *testing.T) suite { app, err := simtestutil.SetupWithConfiguration( depinject.Configs( configurator.NewAppConfig( + configurator.AccountsModule(), configurator.AuthModule(), configurator.StakingModule(), configurator.BankModule(), diff --git a/tests/integration/gov/genesis_test.go b/tests/integration/gov/genesis_test.go index 6cbe8e7be48c..8959cd3335bb 100644 --- a/tests/integration/gov/genesis_test.go +++ b/tests/integration/gov/genesis_test.go @@ -13,6 +13,7 @@ import ( "cosmossdk.io/depinject" "cosmossdk.io/log" sdkmath "cosmossdk.io/math" + _ "cosmossdk.io/x/accounts" _ "cosmossdk.io/x/auth" authkeeper "cosmossdk.io/x/auth/keeper" authtypes "cosmossdk.io/x/auth/types" @@ -46,6 +47,7 @@ type suite struct { } var appConfig = configurator.NewAppConfig( + configurator.AccountsModule(), configurator.AuthModule(), configurator.StakingModule(), configurator.BankModule(), diff --git a/tests/integration/gov/keeper/keeper_test.go b/tests/integration/gov/keeper/keeper_test.go index 1a7b2608163c..55d3b2154c33 100644 --- a/tests/integration/gov/keeper/keeper_test.go +++ b/tests/integration/gov/keeper/keeper_test.go @@ -3,6 +3,7 @@ package keeper_test import ( "testing" + "github.com/golang/mock/gomock" "gotest.tools/v3/assert" "cosmossdk.io/core/appmodule" @@ -11,6 +12,7 @@ import ( "cosmossdk.io/x/auth" authkeeper "cosmossdk.io/x/auth/keeper" authsims "cosmossdk.io/x/auth/simulation" + authtestutil "cosmossdk.io/x/auth/testutil" authtypes "cosmossdk.io/x/auth/types" "cosmossdk.io/x/bank" bankkeeper "cosmossdk.io/x/bank/keeper" @@ -72,10 +74,15 @@ func initFixture(tb testing.TB) *fixture { types.ModuleName: {authtypes.Burner}, } + // gomock initializations + ctrl := gomock.NewController(tb) + acctsModKeeper := authtestutil.NewMockAccountsModKeeper(ctrl) + accountKeeper := authkeeper.NewAccountKeeper( runtime.NewEnvironment(runtime.NewKVStoreService(keys[authtypes.StoreKey]), log.NewNopLogger()), cdc, authtypes.ProtoBaseAccount, + acctsModKeeper, maccPerms, addresscodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix, @@ -125,7 +132,7 @@ func initFixture(tb testing.TB) *fixture { err = govKeeper.Params.Set(newCtx, v1.DefaultParams()) assert.NilError(tb, err) - authModule := auth.NewAppModule(cdc, accountKeeper, authsims.RandomGenesisAccounts) + authModule := auth.NewAppModule(cdc, accountKeeper, acctsModKeeper, authsims.RandomGenesisAccounts) bankModule := bank.NewAppModule(cdc, bankKeeper, accountKeeper) stakingModule := staking.NewAppModule(cdc, stakingKeeper, accountKeeper, bankKeeper) govModule := gov.NewAppModule(cdc, govKeeper, accountKeeper, bankKeeper, poolKeeper) diff --git a/tests/integration/gov/module_test.go b/tests/integration/gov/module_test.go index c482716aae96..c1d41a0b6cb5 100644 --- a/tests/integration/gov/module_test.go +++ b/tests/integration/gov/module_test.go @@ -7,6 +7,7 @@ import ( "cosmossdk.io/depinject" "cosmossdk.io/log" + _ "cosmossdk.io/x/accounts" authkeeper "cosmossdk.io/x/auth/keeper" authtypes "cosmossdk.io/x/auth/types" "cosmossdk.io/x/gov/types" @@ -22,6 +23,7 @@ func TestItCreatesModuleAccountOnInitBlock(t *testing.T) { app, err := simtestutil.SetupAtGenesis( depinject.Configs( configurator.NewAppConfig( + configurator.AccountsModule(), configurator.AuthModule(), configurator.StakingModule(), configurator.BankModule(), diff --git a/tests/integration/mint/app_config.go b/tests/integration/mint/app_config.go index 1d080c94acbc..5a00b66295cd 100644 --- a/tests/integration/mint/app_config.go +++ b/tests/integration/mint/app_config.go @@ -1,6 +1,7 @@ package mint import ( + _ "cosmossdk.io/x/accounts" // import as blank for app wiring _ "cosmossdk.io/x/auth" // import as blank for app wiring _ "cosmossdk.io/x/auth/tx/config" // import as blank for app wiring _ "cosmossdk.io/x/bank" // import as blank for app wiring @@ -13,6 +14,7 @@ import ( ) var AppConfig = configurator.NewAppConfig( + configurator.AccountsModule(), configurator.AuthModule(), configurator.BankModule(), configurator.StakingModule(), diff --git a/tests/integration/runtime/query_test.go b/tests/integration/runtime/query_test.go index 4ad7a7553aed..de3e3e7457d4 100644 --- a/tests/integration/runtime/query_test.go +++ b/tests/integration/runtime/query_test.go @@ -14,6 +14,7 @@ import ( reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" "cosmossdk.io/depinject" "cosmossdk.io/log" + _ "cosmossdk.io/x/accounts" _ "cosmossdk.io/x/auth" _ "cosmossdk.io/x/auth/tx/config" _ "cosmossdk.io/x/bank" @@ -42,6 +43,7 @@ func initFixture(t assert.TestingT) *fixture { app, err := simtestutil.Setup( depinject.Configs( configurator.NewAppConfig( + configurator.AccountsModule(), configurator.AuthModule(), configurator.TxModule(), configurator.ConsensusModule(), diff --git a/tests/integration/server/grpc/server_test.go b/tests/integration/server/grpc/server_test.go index 925805dbada4..6ea705f42056 100644 --- a/tests/integration/server/grpc/server_test.go +++ b/tests/integration/server/grpc/server_test.go @@ -52,7 +52,7 @@ func (s *IntegrationTestSuite) SetupSuite() { s.Require().NoError(err) val0 := s.network.GetValidators()[0] - s.conn, err = grpc.Dial( + s.conn, err = grpc.NewClient( val0.GetAppConfig().GRPC.Address, grpc.WithInsecure(), //nolint:staticcheck // ignore SA1019, we don't need to use a secure connection for tests grpc.WithDefaultCallOptions(grpc.ForceCodec(codec.NewProtoCodec(s.cfg.InterfaceRegistry).GRPCCodec())), diff --git a/tests/integration/slashing/app_config.go b/tests/integration/slashing/app_config.go index ee2e36f41cbe..7ee06d925aff 100644 --- a/tests/integration/slashing/app_config.go +++ b/tests/integration/slashing/app_config.go @@ -1,6 +1,7 @@ package slashing import ( + _ "cosmossdk.io/x/accounts" // import as blank for app wiring _ "cosmossdk.io/x/auth" // import as blank for app wiring _ "cosmossdk.io/x/auth/tx/config" // import as blank for app wiring _ "cosmossdk.io/x/bank" // import as blank for app wiring @@ -16,6 +17,7 @@ import ( ) var AppConfig = configurator.NewAppConfig( + configurator.AccountsModule(), configurator.AuthModule(), configurator.BankModule(), configurator.StakingModule(), diff --git a/tests/integration/slashing/keeper/keeper_test.go b/tests/integration/slashing/keeper/keeper_test.go index dc14c0284836..a9c325ab348e 100644 --- a/tests/integration/slashing/keeper/keeper_test.go +++ b/tests/integration/slashing/keeper/keeper_test.go @@ -4,6 +4,7 @@ import ( "testing" "time" + "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" "gotest.tools/v3/assert" @@ -14,6 +15,7 @@ import ( storetypes "cosmossdk.io/store/types" "cosmossdk.io/x/auth" authkeeper "cosmossdk.io/x/auth/keeper" + authtestutil "cosmossdk.io/x/auth/testutil" authtypes "cosmossdk.io/x/auth/types" "cosmossdk.io/x/bank" bankkeeper "cosmossdk.io/x/bank/keeper" @@ -73,10 +75,15 @@ func initFixture(tb testing.TB) *fixture { stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, } + // gomock initializations + ctrl := gomock.NewController(&testing.T{}) + acctsModKeeper := authtestutil.NewMockAccountsModKeeper(ctrl) + accountKeeper := authkeeper.NewAccountKeeper( runtime.NewEnvironment(runtime.NewKVStoreService(keys[authtypes.StoreKey]), log.NewNopLogger()), cdc, authtypes.ProtoBaseAccount, + acctsModKeeper, maccPerms, addresscodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix, diff --git a/tests/integration/slashing/slashing_test.go b/tests/integration/slashing/slashing_test.go index 0ac41336231a..bec39e2449f8 100644 --- a/tests/integration/slashing/slashing_test.go +++ b/tests/integration/slashing/slashing_test.go @@ -62,6 +62,7 @@ func TestSlashingMsgs(t *testing.T) { app, err := sims.SetupWithConfiguration( depinject.Configs( configurator.NewAppConfig( + configurator.AccountsModule(), configurator.AuthModule(), configurator.StakingModule(), configurator.SlashingModule(), diff --git a/tests/integration/staking/app_config.go b/tests/integration/staking/app_config.go index 89b85e88b2b0..86972f92e649 100644 --- a/tests/integration/staking/app_config.go +++ b/tests/integration/staking/app_config.go @@ -1,6 +1,7 @@ package staking import ( + _ "cosmossdk.io/x/accounts" // import as blank for app wiring _ "cosmossdk.io/x/auth" // import as blank for app wiring _ "cosmossdk.io/x/auth/tx/config" // import as blank for app wiring _ "cosmossdk.io/x/bank" // import as blank for app wiring @@ -16,6 +17,7 @@ import ( ) var AppConfig = configurator.NewAppConfig( + configurator.AccountsModule(), configurator.AuthModule(), configurator.BankModule(), configurator.StakingModule(), diff --git a/tests/integration/staking/keeper/common_test.go b/tests/integration/staking/keeper/common_test.go index f864019603c0..35b9f6300966 100644 --- a/tests/integration/staking/keeper/common_test.go +++ b/tests/integration/staking/keeper/common_test.go @@ -4,6 +4,7 @@ import ( "math/big" "testing" + "github.com/golang/mock/gomock" "gotest.tools/v3/assert" "cosmossdk.io/core/appmodule" @@ -13,6 +14,7 @@ import ( "cosmossdk.io/x/auth" authkeeper "cosmossdk.io/x/auth/keeper" authsims "cosmossdk.io/x/auth/simulation" + authtestutil "cosmossdk.io/x/auth/testutil" authtypes "cosmossdk.io/x/auth/types" "cosmossdk.io/x/bank" bankkeeper "cosmossdk.io/x/bank/keeper" @@ -122,10 +124,15 @@ func initFixture(tb testing.TB) *fixture { types.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, } + // gomock initializations + ctrl := gomock.NewController(&testing.T{}) + acctsModKeeper := authtestutil.NewMockAccountsModKeeper(ctrl) + accountKeeper := authkeeper.NewAccountKeeper( runtime.NewEnvironment(runtime.NewKVStoreService(keys[authtypes.StoreKey]), log.NewNopLogger()), cdc, authtypes.ProtoBaseAccount, + acctsModKeeper, maccPerms, addresscodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix, @@ -145,7 +152,7 @@ func initFixture(tb testing.TB) *fixture { stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[types.StoreKey]), log.NewNopLogger()), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr)) - authModule := auth.NewAppModule(cdc, accountKeeper, authsims.RandomGenesisAccounts) + authModule := auth.NewAppModule(cdc, accountKeeper, acctsModKeeper, authsims.RandomGenesisAccounts) bankModule := bank.NewAppModule(cdc, bankKeeper, accountKeeper) stakingModule := staking.NewAppModule(cdc, stakingKeeper, accountKeeper, bankKeeper) diff --git a/tests/integration/staking/keeper/deterministic_test.go b/tests/integration/staking/keeper/deterministic_test.go index cc8c2fbae654..12182e992d66 100644 --- a/tests/integration/staking/keeper/deterministic_test.go +++ b/tests/integration/staking/keeper/deterministic_test.go @@ -4,6 +4,7 @@ import ( "testing" "time" + "github.com/golang/mock/gomock" "gotest.tools/v3/assert" "pgregory.net/rapid" @@ -14,6 +15,7 @@ import ( "cosmossdk.io/x/auth" authkeeper "cosmossdk.io/x/auth/keeper" authsims "cosmossdk.io/x/auth/simulation" + authtestutil "cosmossdk.io/x/auth/testutil" authtypes "cosmossdk.io/x/auth/types" "cosmossdk.io/x/bank" bankkeeper "cosmossdk.io/x/bank/keeper" @@ -86,10 +88,15 @@ func initDeterministicFixture(t *testing.T) *deterministicFixture { stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, } + // gomock initializations + ctrl := gomock.NewController(t) + acctsModKeeper := authtestutil.NewMockAccountsModKeeper(ctrl) + accountKeeper := authkeeper.NewAccountKeeper( runtime.NewEnvironment(runtime.NewKVStoreService(keys[authtypes.StoreKey]), log.NewNopLogger()), cdc, authtypes.ProtoBaseAccount, + acctsModKeeper, maccPerms, addresscodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix, @@ -109,7 +116,7 @@ func initDeterministicFixture(t *testing.T) *deterministicFixture { stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), log.NewNopLogger()), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr)) - authModule := auth.NewAppModule(cdc, accountKeeper, authsims.RandomGenesisAccounts) + authModule := auth.NewAppModule(cdc, accountKeeper, acctsModKeeper, authsims.RandomGenesisAccounts) bankModule := bank.NewAppModule(cdc, bankKeeper, accountKeeper) stakingModule := staking.NewAppModule(cdc, stakingKeeper, accountKeeper, bankKeeper) diff --git a/tests/integration/staking/keeper/genesis_test.go b/tests/integration/staking/keeper/genesis_test.go index 41ee5ba758a2..95e34da18485 100644 --- a/tests/integration/staking/keeper/genesis_test.go +++ b/tests/integration/staking/keeper/genesis_test.go @@ -4,10 +4,10 @@ import ( "fmt" "testing" - abci "github.com/cometbft/cometbft/abci/types" "github.com/stretchr/testify/require" "gotest.tools/v3/assert" + "cosmossdk.io/core/appmodule" "cosmossdk.io/math" banktestutil "cosmossdk.io/x/bank/testutil" "cosmossdk.io/x/staking" @@ -128,8 +128,7 @@ func TestInitGenesis(t *testing.T) { assert.Assert(t, found) assert.Equal(t, types.Bonded, resVal.Status) - abcivals := make([]abci.ValidatorUpdate, len(vals)) - validatorUpdates := make([]module.ValidatorUpdate, len(abcivals)) + validatorUpdates := make([]appmodule.ValidatorUpdate, len(vals)) for i, val := range validators { validatorUpdates[i] = val.ModuleValidatorUpdate(f.stakingKeeper.PowerReduction(f.sdkCtx)) } diff --git a/tests/integration/tx/context_test.go b/tests/integration/tx/context_test.go index 7246a2c798d1..ffe21c2053cb 100644 --- a/tests/integration/tx/context_test.go +++ b/tests/integration/tx/context_test.go @@ -8,6 +8,7 @@ import ( "cosmossdk.io/depinject" "cosmossdk.io/log" + _ "cosmossdk.io/x/accounts" "cosmossdk.io/x/tx/signing" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -33,6 +34,7 @@ func TestDefineCustomGetSigners(t *testing.T) { _, err := simtestutil.SetupAtGenesis( depinject.Configs( configurator.NewAppConfig( + configurator.AccountsModule(), configurator.AuthModule(), configurator.StakingModule(), configurator.BankModule(), diff --git a/tests/integration/tx/internal/buf.gen.gogo.yaml b/tests/integration/tx/internal/buf.gen.gogo.yaml index d1b5140d80ad..a7a88a898af4 100644 --- a/tests/integration/tx/internal/buf.gen.gogo.yaml +++ b/tests/integration/tx/internal/buf.gen.gogo.yaml @@ -2,7 +2,7 @@ version: v1 plugins: - name: gocosmos out: ./gogo - opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any - name: grpc-gateway out: ./gogo opt: logtostderr=true,allow_colon_final_segments=true diff --git a/tests/sims/authz/operations_test.go b/tests/sims/authz/operations_test.go index c241d0afcdbd..0a2ef3354859 100644 --- a/tests/sims/authz/operations_test.go +++ b/tests/sims/authz/operations_test.go @@ -11,7 +11,8 @@ import ( "cosmossdk.io/core/header" "cosmossdk.io/depinject" "cosmossdk.io/log" - _ "cosmossdk.io/x/auth" // import as blank for app wiring + _ "cosmossdk.io/x/accounts" // import as blank for app wiring + _ "cosmossdk.io/x/auth" // import as blank for app wiring authkeeper "cosmossdk.io/x/auth/keeper" _ "cosmossdk.io/x/auth/tx/config" // import as blank for app wiring "cosmossdk.io/x/authz" @@ -39,6 +40,7 @@ import ( ) var AppConfig = configurator.NewAppConfig( + configurator.AccountsModule(), configurator.AuthModule(), configurator.BankModule(), configurator.StakingModule(), @@ -169,7 +171,7 @@ func (suite *SimTestSuite) TestSimulateRevoke() { granter := accounts[0] grantee := accounts[1] - a := banktypes.NewSendAuthorization(initCoins, nil) + a := banktypes.NewSendAuthorization(initCoins, nil, suite.accountKeeper.AddressCodec()) expire := time.Now().Add(30 * time.Hour) err := suite.authzKeeper.SaveGrant(suite.ctx, grantee.Address, granter.Address, a, &expire) @@ -200,7 +202,7 @@ func (suite *SimTestSuite) TestSimulateExec() { granter := accounts[0] grantee := accounts[1] - a := banktypes.NewSendAuthorization(initCoins, nil) + a := banktypes.NewSendAuthorization(initCoins, nil, suite.accountKeeper.AddressCodec()) expire := suite.ctx.HeaderInfo().Time.Add(1 * time.Hour) err := suite.authzKeeper.SaveGrant(suite.ctx, grantee.Address, granter.Address, a, &expire) diff --git a/tests/sims/bank/operations_test.go b/tests/sims/bank/operations_test.go index 5d4564af1f11..9ba074f4efee 100644 --- a/tests/sims/bank/operations_test.go +++ b/tests/sims/bank/operations_test.go @@ -9,6 +9,7 @@ import ( "cosmossdk.io/depinject" "cosmossdk.io/log" + _ "cosmossdk.io/x/accounts" _ "cosmossdk.io/x/auth" _ "cosmossdk.io/x/auth/tx/config" _ "cosmossdk.io/x/bank" @@ -47,6 +48,7 @@ func (suite *SimTestSuite) SetupTest() { suite.app, err = simtestutil.Setup( depinject.Configs( configurator.NewAppConfig( + configurator.AccountsModule(), configurator.AuthModule(), configurator.BankModule(), configurator.StakingModule(), diff --git a/tests/sims/distribution/app_config.go b/tests/sims/distribution/app_config.go index 02130ff2387b..efd27dcf1a9d 100644 --- a/tests/sims/distribution/app_config.go +++ b/tests/sims/distribution/app_config.go @@ -1,6 +1,7 @@ package distribution import ( + _ "cosmossdk.io/x/accounts" // import as blank for app wiring _ "cosmossdk.io/x/auth" // import as blank for app wiring _ "cosmossdk.io/x/auth/tx/config" // import as blank for app wiring _ "cosmossdk.io/x/bank" // import as blank for app wiring @@ -15,6 +16,7 @@ import ( ) var AppConfig = configurator.NewAppConfig( + configurator.AccountsModule(), configurator.AuthModule(), configurator.BankModule(), configurator.StakingModule(), diff --git a/tests/sims/feegrant/operations_test.go b/tests/sims/feegrant/operations_test.go index 41e9fb1feb04..21ef34e3aa57 100644 --- a/tests/sims/feegrant/operations_test.go +++ b/tests/sims/feegrant/operations_test.go @@ -11,6 +11,7 @@ import ( "cosmossdk.io/core/header" "cosmossdk.io/depinject" "cosmossdk.io/log" + _ "cosmossdk.io/x/accounts" // import as blank for app wiring _ "cosmossdk.io/x/auth" authkeeper "cosmossdk.io/x/auth/keeper" _ "cosmossdk.io/x/auth/tx/config" @@ -56,6 +57,7 @@ func (suite *SimTestSuite) SetupTest() { suite.app, err = simtestutil.Setup( depinject.Configs( configurator.NewAppConfig( + configurator.AccountsModule(), configurator.AuthModule(), configurator.BankModule(), configurator.StakingModule(), @@ -86,6 +88,8 @@ func (suite *SimTestSuite) getTestingAccounts(r *rand.Rand, n int) []simtypes.Ac // add coins to the accounts for _, account := range accounts { + acc := suite.accountKeeper.NewAccountWithAddress(suite.ctx, account.Address) + suite.accountKeeper.SetAccount(suite.ctx, acc) err := banktestutil.FundAccount(suite.ctx, suite.bankKeeper, account.Address, initCoins) suite.Require().NoError(err) } diff --git a/tests/sims/gov/operations_test.go b/tests/sims/gov/operations_test.go index 972aedec6055..2b81623fac61 100644 --- a/tests/sims/gov/operations_test.go +++ b/tests/sims/gov/operations_test.go @@ -13,6 +13,7 @@ import ( "cosmossdk.io/core/header" "cosmossdk.io/depinject" "cosmossdk.io/log" + _ "cosmossdk.io/x/accounts" _ "cosmossdk.io/x/auth" authkeeper "cosmossdk.io/x/auth/keeper" _ "cosmossdk.io/x/auth/tx/config" @@ -56,7 +57,7 @@ func (m MockWeightedProposals) DefaultWeight() int { } func (m MockWeightedProposals) MsgSimulatorFn() simtypes.MsgSimulatorFn { - return func(r *rand.Rand, _ sdk.Context, _ []simtypes.Account, _ address.Codec) (sdk.Msg, error) { + return func(r *rand.Rand, _ []simtypes.Account, _ address.Codec) (sdk.Msg, error) { return nil, nil } } @@ -207,7 +208,8 @@ func TestSimulateMsgCancelProposal(t *testing.T) { r := rand.New(s) accounts := getTestingAccounts(t, r, suite.AccountKeeper, suite.BankKeeper, suite.StakingKeeper, ctx, 3) // setup a proposal - proposer := accounts[0].Address + proposer, err := suite.AccountKeeper.AddressCodec().BytesToString(accounts[0].Address) + require.NoError(t, err) content := v1beta1.NewTextProposal("Test", "description") contentMsg, err := v1.NewLegacyContent(content, suite.GovKeeper.GetGovernanceAccount(ctx).GetAddress().String()) require.NoError(t, err) @@ -233,7 +235,7 @@ func TestSimulateMsgCancelProposal(t *testing.T) { require.NoError(t, err) require.True(t, operationMsg.OK) require.Equal(t, uint64(1), msg.ProposalId) - require.Equal(t, proposer.String(), msg.Proposer) + require.Equal(t, proposer, msg.Proposer) require.Equal(t, simulation.TypeMsgCancelProposal, sdk.MsgTypeURL(&msg)) } @@ -259,7 +261,7 @@ func TestSimulateMsgDeposit(t *testing.T) { params, _ := suite.GovKeeper.Params.Get(ctx) depositPeriod := params.MaxDepositPeriod - proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod), "", "text proposal", "description", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), v1.ProposalType_PROPOSAL_TYPE_STANDARD) + proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod), "", "text proposal", "description", "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", v1.ProposalType_PROPOSAL_TYPE_STANDARD) require.NoError(t, err) err = suite.GovKeeper.Proposals.Set(ctx, proposal.Id, proposal) @@ -303,7 +305,7 @@ func TestSimulateMsgVote(t *testing.T) { params, _ := suite.GovKeeper.Params.Get(ctx) depositPeriod := params.MaxDepositPeriod - proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod), "", "text proposal", "description", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), v1.ProposalType_PROPOSAL_TYPE_STANDARD) + proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod), "", "text proposal", "description", "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", v1.ProposalType_PROPOSAL_TYPE_STANDARD) require.NoError(t, err) err = suite.GovKeeper.ActivateVotingPeriod(ctx, proposal) @@ -345,7 +347,7 @@ func TestSimulateMsgVoteWeighted(t *testing.T) { params, _ := suite.GovKeeper.Params.Get(ctx) depositPeriod := params.MaxDepositPeriod - proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod), "", "text proposal", "test", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), v1.ProposalType_PROPOSAL_TYPE_STANDARD) + proposal, err := v1.NewProposal([]sdk.Msg{contentMsg}, 1, submitTime, submitTime.Add(*depositPeriod), "", "text proposal", "test", "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", v1.ProposalType_PROPOSAL_TYPE_STANDARD) require.NoError(t, err) err = suite.GovKeeper.ActivateVotingPeriod(ctx, proposal) @@ -383,6 +385,7 @@ func createTestSuite(t *testing.T, isCheckTx bool) (suite, sdk.Context) { app, err := simtestutil.Setup( depinject.Configs( configurator.NewAppConfig( + configurator.AccountsModule(), configurator.AuthModule(), configurator.TxModule(), configurator.BankModule(), diff --git a/tests/sims/nft/app_config.go b/tests/sims/nft/app_config.go index 8ce4a69e09e4..52edcb502b93 100644 --- a/tests/sims/nft/app_config.go +++ b/tests/sims/nft/app_config.go @@ -1,6 +1,7 @@ package nft import ( + _ "cosmossdk.io/x/accounts" // import as blank for app wiring _ "cosmossdk.io/x/auth" // import as blank for app wiring _ "cosmossdk.io/x/auth/tx/config" // import as blank for app wiring _ "cosmossdk.io/x/bank" // import as blank for app wiring @@ -14,6 +15,7 @@ import ( ) var AppConfig = configurator.NewAppConfig( + configurator.AccountsModule(), configurator.AuthModule(), configurator.BankModule(), configurator.StakingModule(), diff --git a/tests/sims/protocolpool/app_config.go b/tests/sims/protocolpool/app_config.go index 7163523f09ea..b0c680cf9572 100644 --- a/tests/sims/protocolpool/app_config.go +++ b/tests/sims/protocolpool/app_config.go @@ -1,6 +1,7 @@ package protocolpool import ( + _ "cosmossdk.io/x/accounts" // import as blank for app wiring _ "cosmossdk.io/x/auth" // import as blank for app wiring _ "cosmossdk.io/x/auth/tx/config" // import as blank for app wiring _ "cosmossdk.io/x/bank" // import as blank for app wiring @@ -15,6 +16,7 @@ import ( ) var AppConfig = configurator.NewAppConfig( + configurator.AccountsModule(), configurator.AuthModule(), configurator.BankModule(), configurator.StakingModule(), diff --git a/tests/sims/slashing/app_config.go b/tests/sims/slashing/app_config.go index ee2e36f41cbe..7ee06d925aff 100644 --- a/tests/sims/slashing/app_config.go +++ b/tests/sims/slashing/app_config.go @@ -1,6 +1,7 @@ package slashing import ( + _ "cosmossdk.io/x/accounts" // import as blank for app wiring _ "cosmossdk.io/x/auth" // import as blank for app wiring _ "cosmossdk.io/x/auth/tx/config" // import as blank for app wiring _ "cosmossdk.io/x/bank" // import as blank for app wiring @@ -16,6 +17,7 @@ import ( ) var AppConfig = configurator.NewAppConfig( + configurator.AccountsModule(), configurator.AuthModule(), configurator.BankModule(), configurator.StakingModule(), diff --git a/tests/starship/tests/go.mod b/tests/starship/tests/go.mod index 1a1910b23588..2105d23fc8f3 100644 --- a/tests/starship/tests/go.mod +++ b/tests/starship/tests/go.mod @@ -20,12 +20,13 @@ replace ( cosmossdk.io/depinject => ../../../depinject cosmossdk.io/simapp => ../../../simapp cosmossdk.io/x/accounts => ../../../x/accounts - cosmossdk.io/x/accounts/lockup => ../../../x/accounts/defaults/lockup + cosmossdk.io/x/accounts/defaults/lockup => ../../../x/accounts/defaults/lockup cosmossdk.io/x/auth => ../../../x/auth cosmossdk.io/x/authz => ../../../x/authz cosmossdk.io/x/bank => ../../../x/bank cosmossdk.io/x/circuit => ../../../x/circuit cosmossdk.io/x/distribution => ../../../x/distribution + cosmossdk.io/x/epochs => ../../../x/epochs cosmossdk.io/x/evidence => ../../../x/evidence cosmossdk.io/x/feegrant => ../../../x/feegrant cosmossdk.io/x/gov => ../../../x/gov @@ -47,7 +48,7 @@ require ( github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-sdk v0.51.0 github.com/stretchr/testify v1.9.0 - google.golang.org/grpc v1.62.1 + google.golang.org/grpc v1.63.2 gopkg.in/yaml.v3 v3.0.1 ) @@ -65,12 +66,13 @@ require ( cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7 // indirect cosmossdk.io/depinject v1.0.0-alpha.4 // indirect cosmossdk.io/errors v1.0.1 // indirect - cosmossdk.io/store v1.0.2 // indirect + cosmossdk.io/store v1.1.0 // indirect cosmossdk.io/x/accounts v0.0.0-20240226161501-23359a0b6d91 // indirect - cosmossdk.io/x/accounts/lockup v0.0.0-00010101000000-000000000000 // indirect + cosmossdk.io/x/accounts/defaults/lockup v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/authz v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/circuit v0.0.0-20230613133644-0a778132a60f // indirect cosmossdk.io/x/distribution v0.0.0-20240227221813-a248d05f70f4 // indirect + cosmossdk.io/x/epochs v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/evidence v0.0.0-20230613133644-0a778132a60f // indirect cosmossdk.io/x/feegrant v0.0.0-20230613133644-0a778132a60f // indirect cosmossdk.io/x/gov v0.0.0-20231113122742-912390d5fc4a // indirect @@ -104,19 +106,19 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.6 // indirect + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 // indirect github.com/cometbft/cometbft-db v0.11.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.4 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/gogoproto v1.4.11 // indirect - github.com/cosmos/iavl v1.0.1 // indirect + github.com/cosmos/gogoproto v1.4.12 // indirect + github.com/cosmos/iavl v1.1.1 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect @@ -177,7 +179,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect @@ -192,14 +194,14 @@ require ( github.com/onsi/gomega v1.27.4 // indirect github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b // indirect github.com/opencontainers/runc v1.1.12 // indirect - github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.0 // indirect github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.50.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/common v0.52.2 // indirect + github.com/prometheus/procfs v0.13.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.10.1 // indirect @@ -231,22 +233,22 @@ require ( go.opentelemetry.io/otel/metric v1.22.0 // indirect go.opentelemetry.io/otel/trace v1.22.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.21.0 // indirect - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.22.0 // indirect + golang.org/x/crypto v0.22.0 // indirect + golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81 // indirect + golang.org/x/mod v0.16.0 // indirect + golang.org/x/net v0.24.0 // indirect golang.org/x/oauth2 v0.18.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.18.0 // indirect + golang.org/x/tools v0.19.0 // indirect google.golang.org/api v0.162.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20240221002015-b0ce06bbee7c // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gotest.tools/v3 v3.5.1 // indirect diff --git a/tests/starship/tests/go.sum b/tests/starship/tests/go.sum index 43a37d79b123..efcd0ff414e9 100644 --- a/tests/starship/tests/go.sum +++ b/tests/starship/tests/go.sum @@ -197,8 +197,8 @@ cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= -cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= +cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= +cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -321,8 +321,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.11.0 h1:M3Lscmpogx5NTbb1EGyGDaFRdsoLWrUWimFEyf7jej8= github.com/cometbft/cometbft-db v0.11.0/go.mod h1:GDPJAC/iFHNjmZZPN8V8C1yr/eyityhi2W1hz2MGKSc= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -344,10 +344,10 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= -github.com/cosmos/iavl v1.0.1 h1:D+mYbcRO2wptYzOM1Hxl9cpmmHU1ZEt9T2Wv5nZTeUw= -github.com/cosmos/iavl v1.0.1/go.mod h1:8xIUkgVvwvVrBu81scdPty+/Dx9GqwHnAvXz4cwF7RY= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= +github.com/cosmos/iavl v1.1.1 h1:64nTi8s3gEoGqhA8TyAWFWfz7/pg0anKzHNSc1ETc7Q= +github.com/cosmos/iavl v1.1.1/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= @@ -367,8 +367,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= @@ -727,8 +727,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -832,8 +832,8 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= @@ -874,16 +874,16 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= -github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= +github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -1054,8 +1054,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1067,8 +1067,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81 h1:6R2FC06FonbXQ8pK11/PDFY6N6LWlf9KlzibaCapmqc= +golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81/go.mod h1:CQ1k9gNrJ50XIzaKCRR2hssIjF07kZFEiieALBM/ARQ= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1095,8 +1095,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= +golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1156,8 +1156,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1199,8 +1199,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1297,13 +1297,13 @@ golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1386,8 +1386,8 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= -golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= +golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= +golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1565,12 +1565,12 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20240221002015-b0ce06bbee7c h1:Zmyn5CV/jxzKnF+3d+xzbomACPwLQqVpLTpyXN5uTaQ= -google.golang.org/genproto v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= -google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c h1:9g7erC9qu44ks7UK4gDNlnk4kOxZG707xKm4jVniy6o= -google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1612,8 +1612,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/tests/starship/tests/suite.go b/tests/starship/tests/suite.go index e9602e215e77..bc9644a29b0a 100644 --- a/tests/starship/tests/suite.go +++ b/tests/starship/tests/suite.go @@ -55,7 +55,7 @@ func (s *TestSuite) SetupTest() { s.cdc = encodingConfig - grpcConn, err := grpc.Dial( + grpcConn, err := grpc.NewClient( fmt.Sprintf("127.0.0.1:%d", config.GetChain(chainID).Ports.Grpc), grpc.WithInsecure(), //nolint:staticcheck // ignore SA1019, we don't need to use a secure connection for tests grpc.WithDefaultCallOptions(grpc.ForceCodec(codec.NewProtoCodec(s.cdc.InterfaceRegistry).GRPCCodec()))) diff --git a/testutil/configurator/configurator.go b/testutil/configurator/configurator.go index 7a93e58d0dad..f1476221d2c3 100644 --- a/testutil/configurator/configurator.go +++ b/testutil/configurator/configurator.go @@ -1,6 +1,7 @@ package configurator import ( + accountsmodulev1 "cosmossdk.io/api/cosmos/accounts/module/v1" runtimev1alpha1 "cosmossdk.io/api/cosmos/app/runtime/v1alpha1" appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1" authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1" @@ -10,6 +11,7 @@ import ( consensusmodulev1 "cosmossdk.io/api/cosmos/consensus/module/v1" countermodulev1 "cosmossdk.io/api/cosmos/counter/module/v1" distrmodulev1 "cosmossdk.io/api/cosmos/distribution/module/v1" + epochsmodulev1 "cosmossdk.io/api/cosmos/epochs/module/v1" evidencemodulev1 "cosmossdk.io/api/cosmos/evidence/module/v1" feegrantmodulev1 "cosmossdk.io/api/cosmos/feegrant/module/v1" genutilmodulev1 "cosmossdk.io/api/cosmos/genutil/module/v1" @@ -64,6 +66,7 @@ func defaultConfig() *Config { testutil.ParamsModuleName, "vesting", testutil.CircuitModuleName, + testutil.EpochsModuleName, }, EndBlockersOrder: []string{ "crisis", @@ -87,6 +90,7 @@ func defaultConfig() *Config { testutil.ProtocolPoolModuleName, }, InitGenesisOrder: []string{ + testutil.AccountsModuleName, testutil.AuthModuleName, testutil.BankModuleName, testutil.DistributionModuleName, @@ -106,6 +110,7 @@ func defaultConfig() *Config { "vesting", testutil.CircuitModuleName, testutil.ProtocolPoolModuleName, + testutil.EpochsModuleName, }, setInitGenesis: true, } @@ -327,6 +332,15 @@ func ProtocolPoolModule() ModuleOption { } } +func AccountsModule() ModuleOption { + return func(config *Config) { + config.ModuleConfigs[testutil.AccountsModuleName] = &appv1alpha1.ModuleConfig{ + Name: testutil.AccountsModuleName, + Config: appconfig.WrapAny(&accountsmodulev1.Module{}), + } + } +} + func CounterModule() ModuleOption { return func(config *Config) { config.ModuleConfigs["counter"] = &appv1alpha1.ModuleConfig{ @@ -336,6 +350,15 @@ func CounterModule() ModuleOption { } } +func EpochsModule() ModuleOption { + return func(config *Config) { + config.ModuleConfigs[testutil.EpochsModuleName] = &appv1alpha1.ModuleConfig{ + Name: testutil.EpochsModuleName, + Config: appconfig.WrapAny(&epochsmodulev1.Module{}), + } + } +} + func OmitInitGenesis() ModuleOption { return func(config *Config) { config.setInitGenesis = false diff --git a/testutil/list.go b/testutil/list.go index ab6e04e2e774..ff9c4994a784 100644 --- a/testutil/list.go +++ b/testutil/list.go @@ -1,6 +1,8 @@ package testutil -import "math/rand" +import ( + "math/rand" +) func RandSliceElem[E any](r *rand.Rand, elems []E) (E, bool) { if len(elems) == 0 { diff --git a/testutil/mock/types_mock_appmodule.go b/testutil/mock/types_mock_appmodule.go index dacba1facdb1..3c9c7908d020 100644 --- a/testutil/mock/types_mock_appmodule.go +++ b/testutil/mock/types_mock_appmodule.go @@ -10,7 +10,6 @@ import ( reflect "reflect" appmodule "cosmossdk.io/core/appmodule" - registry "cosmossdk.io/core/registry" types "github.com/cosmos/cosmos-sdk/types" module "github.com/cosmos/cosmos-sdk/types/module" gomock "github.com/golang/mock/gomock" @@ -149,18 +148,6 @@ func (mr *MockAppModuleWithAllExtensionsMockRecorder) Name() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Name", reflect.TypeOf((*MockAppModuleWithAllExtensions)(nil).Name)) } -// RegisterInterfaces mocks base method. -func (m *MockAppModuleWithAllExtensions) RegisterInterfaces(arg0 registry.InterfaceRegistrar) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "RegisterInterfaces", arg0) -} - -// RegisterInterfaces indicates an expected call of RegisterInterfaces. -func (mr *MockAppModuleWithAllExtensionsMockRecorder) RegisterInterfaces(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInterfaces", reflect.TypeOf((*MockAppModuleWithAllExtensions)(nil).RegisterInterfaces), arg0) -} - // RegisterInvariants mocks base method. func (m *MockAppModuleWithAllExtensions) RegisterInvariants(arg0 types.InvariantRegistry) { m.ctrl.T.Helper() @@ -333,18 +320,6 @@ func (mr *MockAppModuleWithAllExtensionsABCIMockRecorder) Name() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Name", reflect.TypeOf((*MockAppModuleWithAllExtensionsABCI)(nil).Name)) } -// RegisterInterfaces mocks base method. -func (m *MockAppModuleWithAllExtensionsABCI) RegisterInterfaces(arg0 registry.InterfaceRegistrar) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "RegisterInterfaces", arg0) -} - -// RegisterInterfaces indicates an expected call of RegisterInterfaces. -func (mr *MockAppModuleWithAllExtensionsABCIMockRecorder) RegisterInterfaces(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInterfaces", reflect.TypeOf((*MockAppModuleWithAllExtensionsABCI)(nil).RegisterInterfaces), arg0) -} - // RegisterInvariants mocks base method. func (m *MockAppModuleWithAllExtensionsABCI) RegisterInvariants(arg0 types.InvariantRegistry) { m.ctrl.T.Helper() diff --git a/testutil/mock/types_module_module.go b/testutil/mock/types_module_module.go index 2fe80207569f..94a1d56b4f37 100644 --- a/testutil/mock/types_module_module.go +++ b/testutil/mock/types_module_module.go @@ -9,7 +9,6 @@ import ( json "encoding/json" reflect "reflect" - registry "cosmossdk.io/core/registry" client "github.com/cosmos/cosmos-sdk/client" codec "github.com/cosmos/cosmos-sdk/codec" types "github.com/cosmos/cosmos-sdk/types" @@ -67,18 +66,6 @@ func (mr *MockAppModuleBasicMockRecorder) RegisterGRPCGatewayRoutes(arg0, arg1 i return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterGRPCGatewayRoutes", reflect.TypeOf((*MockAppModuleBasic)(nil).RegisterGRPCGatewayRoutes), arg0, arg1) } -// RegisterInterfaces mocks base method. -func (m *MockAppModuleBasic) RegisterInterfaces(arg0 registry.InterfaceRegistrar) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "RegisterInterfaces", arg0) -} - -// RegisterInterfaces indicates an expected call of RegisterInterfaces. -func (mr *MockAppModuleBasicMockRecorder) RegisterInterfaces(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInterfaces", reflect.TypeOf((*MockAppModuleBasic)(nil).RegisterInterfaces), arg0) -} - // RegisterLegacyAminoCodec mocks base method. func (m *MockAppModuleBasic) RegisterLegacyAminoCodec(arg0 *codec.LegacyAmino) { m.ctrl.T.Helper() @@ -152,18 +139,6 @@ func (mr *MockAppModuleMockRecorder) Name() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Name", reflect.TypeOf((*MockAppModule)(nil).Name)) } -// RegisterInterfaces mocks base method. -func (m *MockAppModule) RegisterInterfaces(arg0 registry.InterfaceRegistrar) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "RegisterInterfaces", arg0) -} - -// RegisterInterfaces indicates an expected call of RegisterInterfaces. -func (mr *MockAppModuleMockRecorder) RegisterInterfaces(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInterfaces", reflect.TypeOf((*MockAppModule)(nil).RegisterInterfaces), arg0) -} - // MockHasName is a mock of HasName interface. type MockHasName struct { ctrl *gomock.Controller @@ -576,15 +551,3 @@ func (mr *MockHasABCIEndBlockMockRecorder) Name() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Name", reflect.TypeOf((*MockHasABCIEndBlock)(nil).Name)) } - -// RegisterInterfaces mocks base method. -func (m *MockHasABCIEndBlock) RegisterInterfaces(arg0 registry.InterfaceRegistrar) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "RegisterInterfaces", arg0) -} - -// RegisterInterfaces indicates an expected call of RegisterInterfaces. -func (mr *MockHasABCIEndBlockMockRecorder) RegisterInterfaces(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInterfaces", reflect.TypeOf((*MockHasABCIEndBlock)(nil).RegisterInterfaces), arg0) -} diff --git a/testutil/network/network.go b/testutil/network/network.go index 8dca40ae5473..42e288b614a5 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -25,6 +25,7 @@ import ( sdkmath "cosmossdk.io/math" "cosmossdk.io/math/unsafe" pruningtypes "cosmossdk.io/store/pruning/types" + _ "cosmossdk.io/x/accounts" _ "cosmossdk.io/x/auth" // import auth as a blank _ "cosmossdk.io/x/auth/tx/config" // import auth tx config as a blank authtypes "cosmossdk.io/x/auth/types" @@ -168,6 +169,7 @@ func DefaultConfig(factory TestFixtureFactory) Config { // MinimumAppConfig defines the minimum of modules required for a call to New to succeed func MinimumAppConfig() depinject.Config { return configurator.NewAppConfig( + configurator.AccountsModule(), configurator.AuthModule(), configurator.BankModule(), configurator.GenutilModule(), diff --git a/testutil/network/util.go b/testutil/network/util.go index 702c195aa404..a121e341ab56 100644 --- a/testutil/network/util.go +++ b/testutil/network/util.go @@ -150,7 +150,8 @@ func collectGenFiles(cfg Config, vals []*Validator, outputDir string) error { } appState, err := genutil.GenAppStateFromConfig(cfg.Codec, cfg.TxConfig, - cmtCfg, initCfg, appGenesis, banktypes.GenesisBalancesIterator{}, genutiltypes.DefaultMessageValidator, cfg.TxConfig.SigningContext().ValidatorAddressCodec()) + cmtCfg, initCfg, appGenesis, banktypes.GenesisBalancesIterator{}, genutiltypes.DefaultMessageValidator, + cfg.ValidatorAddressCodec, cfg.AddressCodec) if err != nil { return err } diff --git a/testutil/testdata/buf.gen.yaml b/testutil/testdata/buf.gen.gogo.yaml similarity index 83% rename from testutil/testdata/buf.gen.yaml rename to testutil/testdata/buf.gen.gogo.yaml index 5a8136666e67..6b06e51321b3 100644 --- a/testutil/testdata/buf.gen.yaml +++ b/testutil/testdata/buf.gen.gogo.yaml @@ -3,4 +3,4 @@ plugins: - name: gocosmos out: ../.. opt: - - plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types + - plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any diff --git a/testutil/testdata/codec.go b/testutil/testdata/codec.go index 6e4dcc253b58..ffecb3444435 100644 --- a/testutil/testdata/codec.go +++ b/testutil/testdata/codec.go @@ -43,14 +43,14 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { func NewTestAmino() *amino.Codec { cdc := amino.NewCodec() cdc.RegisterInterface((*Animal)(nil), nil) - cdc.RegisterConcrete(&Dog{}, "testpb/Dog", nil) - cdc.RegisterConcrete(&Cat{}, "testpb/Cat", nil) + cdc.RegisterConcrete(&Dog{}, "test/Dog", nil) + cdc.RegisterConcrete(&Cat{}, "test/Cat", nil) cdc.RegisterInterface((*HasAnimalI)(nil), nil) - cdc.RegisterConcrete(&HasAnimal{}, "testpb/HasAnimal", nil) + cdc.RegisterConcrete(&HasAnimal{}, "test/HasAnimal", nil) cdc.RegisterInterface((*HasHasAnimalI)(nil), nil) - cdc.RegisterConcrete(&HasHasAnimal{}, "testpb/HasHasAnimal", nil) + cdc.RegisterConcrete(&HasHasAnimal{}, "test/HasHasAnimal", nil) return cdc } diff --git a/testutil/testdata/grpc_query.go b/testutil/testdata/grpc_query.go index 510e554d433e..4aec7622a929 100644 --- a/testutil/testdata/grpc_query.go +++ b/testutil/testdata/grpc_query.go @@ -3,6 +3,7 @@ package testdata import ( "context" "fmt" + "github.com/cosmos/gogoproto/types/any/test" "testing" "github.com/cosmos/gogoproto/proto" @@ -22,7 +23,7 @@ type QueryImpl struct{} var _ QueryServer = QueryImpl{} func (e QueryImpl) TestAny(_ context.Context, request *TestAnyRequest) (*TestAnyResponse, error) { - animal, ok := request.AnyAnimal.GetCachedValue().(Animal) + animal, ok := request.AnyAnimal.GetCachedValue().(test.Animal) if !ok { return nil, fmt.Errorf("expected Animal") } @@ -50,7 +51,7 @@ func (e QueryImpl) SayHello(_ context.Context, request *SayHelloRequest) (*SayHe var _ types.UnpackInterfacesMessage = &TestAnyRequest{} func (m *TestAnyRequest) UnpackInterfaces(unpacker types.AnyUnpacker) error { - var animal Animal + var animal test.Animal return unpacker.UnpackAny(m.AnyAnimal, &animal) } diff --git a/testutil/testdata/query.pb.go b/testutil/testdata/query.pb.go index d104840c5dce..935dfad2bf51 100644 --- a/testutil/testdata/query.pb.go +++ b/testutil/testdata/query.pb.go @@ -6,9 +6,9 @@ package testdata import ( context "context" fmt "fmt" - types "github.com/cosmos/cosmos-sdk/codec/types" 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" @@ -205,7 +205,7 @@ func (m *SayHelloResponse) GetGreeting() string { } type TestAnyRequest struct { - AnyAnimal *types.Any `protobuf:"bytes,1,opt,name=any_animal,json=anyAnimal,proto3" json:"any_animal,omitempty"` + AnyAnimal *any.Any `protobuf:"bytes,1,opt,name=any_animal,json=anyAnimal,proto3" json:"any_animal,omitempty"` } func (m *TestAnyRequest) Reset() { *m = TestAnyRequest{} } @@ -241,7 +241,7 @@ func (m *TestAnyRequest) XXX_DiscardUnknown() { var xxx_messageInfo_TestAnyRequest proto.InternalMessageInfo -func (m *TestAnyRequest) GetAnyAnimal() *types.Any { +func (m *TestAnyRequest) GetAnyAnimal() *any.Any { if m != nil { return m.AnyAnimal } @@ -1154,7 +1154,7 @@ func (m *TestAnyRequest) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.AnyAnimal == nil { - m.AnyAnimal = &types.Any{} + m.AnyAnimal = &any.Any{} } if err := m.AnyAnimal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/testutil/testdata/testdata.pb.go b/testutil/testdata/testdata.pb.go index 3db89888b056..98afc44115ad 100644 --- a/testutil/testdata/testdata.pb.go +++ b/testutil/testdata/testdata.pb.go @@ -5,9 +5,9 @@ package testdata import ( fmt "fmt" - types "github.com/cosmos/cosmos-sdk/codec/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" + any "github.com/cosmos/gogoproto/types/any" io "io" math "math" math_bits "math/bits" @@ -181,8 +181,8 @@ func (m *Bird) GetColor() int32 { } type HasAnimal struct { - Animal *types.Any `protobuf:"bytes,1,opt,name=animal,proto3" json:"animal,omitempty"` - X int64 `protobuf:"varint,2,opt,name=x,proto3" json:"x,omitempty"` + Animal *any.Any `protobuf:"bytes,1,opt,name=animal,proto3" json:"animal,omitempty"` + X int64 `protobuf:"varint,2,opt,name=x,proto3" json:"x,omitempty"` } func (m *HasAnimal) Reset() { *m = HasAnimal{} } @@ -218,7 +218,7 @@ func (m *HasAnimal) XXX_DiscardUnknown() { var xxx_messageInfo_HasAnimal proto.InternalMessageInfo -func (m *HasAnimal) GetAnimal() *types.Any { +func (m *HasAnimal) GetAnimal() *any.Any { if m != nil { return m.Animal } @@ -233,7 +233,7 @@ func (m *HasAnimal) GetX() int64 { } type HasHasAnimal struct { - HasAnimal *types.Any `protobuf:"bytes,1,opt,name=has_animal,json=hasAnimal,proto3" json:"has_animal,omitempty"` + HasAnimal *any.Any `protobuf:"bytes,1,opt,name=has_animal,json=hasAnimal,proto3" json:"has_animal,omitempty"` } func (m *HasHasAnimal) Reset() { *m = HasHasAnimal{} } @@ -269,7 +269,7 @@ func (m *HasHasAnimal) XXX_DiscardUnknown() { var xxx_messageInfo_HasHasAnimal proto.InternalMessageInfo -func (m *HasHasAnimal) GetHasAnimal() *types.Any { +func (m *HasHasAnimal) GetHasAnimal() *any.Any { if m != nil { return m.HasAnimal } @@ -277,7 +277,7 @@ func (m *HasHasAnimal) GetHasAnimal() *types.Any { } type HasHasHasAnimal struct { - HasHasAnimal *types.Any `protobuf:"bytes,1,opt,name=has_has_animal,json=hasHasAnimal,proto3" json:"has_has_animal,omitempty"` + HasHasAnimal *any.Any `protobuf:"bytes,1,opt,name=has_has_animal,json=hasHasAnimal,proto3" json:"has_has_animal,omitempty"` } func (m *HasHasHasAnimal) Reset() { *m = HasHasHasAnimal{} } @@ -313,7 +313,7 @@ func (m *HasHasHasAnimal) XXX_DiscardUnknown() { var xxx_messageInfo_HasHasHasAnimal proto.InternalMessageInfo -func (m *HasHasHasAnimal) GetHasHasAnimal() *types.Any { +func (m *HasHasHasAnimal) GetHasHasAnimal() *any.Any { if m != nil { return m.HasHasAnimal } @@ -1322,7 +1322,7 @@ func (m *HasAnimal) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Animal == nil { - m.Animal = &types.Any{} + m.Animal = &any.Any{} } if err := m.Animal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1427,7 +1427,7 @@ func (m *HasHasAnimal) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.HasAnimal == nil { - m.HasAnimal = &types.Any{} + m.HasAnimal = &any.Any{} } if err := m.HasAnimal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1513,7 +1513,7 @@ func (m *HasHasHasAnimal) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.HasHasAnimal == nil { - m.HasHasAnimal = &types.Any{} + m.HasHasAnimal = &any.Any{} } if err := m.HasHasAnimal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/testutil/testdata/unknonwnproto.pb.go b/testutil/testdata/unknonwnproto.pb.go index 406d624a3c24..e80d9745b8cc 100644 --- a/testutil/testdata/unknonwnproto.pb.go +++ b/testutil/testdata/unknonwnproto.pb.go @@ -6,10 +6,10 @@ package testdata import ( encoding_binary "encoding/binary" fmt "fmt" - types "github.com/cosmos/cosmos-sdk/codec/types" tx "github.com/cosmos/cosmos-sdk/types/tx" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" + any "github.com/cosmos/gogoproto/types/any" io "io" math "math" math_bits "math/bits" @@ -135,7 +135,7 @@ type Customer2 struct { Fewer float32 `protobuf:"fixed32,4,opt,name=fewer,proto3" json:"fewer,omitempty"` Reserved int64 `protobuf:"varint,1047,opt,name=reserved,proto3" json:"reserved,omitempty"` City Customer2_City `protobuf:"varint,6,opt,name=city,proto3,enum=testpb.Customer2_City" json:"city,omitempty"` - Miscellaneous *types.Any `protobuf:"bytes,10,opt,name=miscellaneous,proto3" json:"miscellaneous,omitempty"` + Miscellaneous *any.Any `protobuf:"bytes,10,opt,name=miscellaneous,proto3" json:"miscellaneous,omitempty"` } func (m *Customer2) Reset() { *m = Customer2{} } @@ -213,7 +213,7 @@ func (m *Customer2) GetCity() Customer2_City { return Customer2_Laos } -func (m *Customer2) GetMiscellaneous() *types.Any { +func (m *Customer2) GetMiscellaneous() *any.Any { if m != nil { return m.Miscellaneous } @@ -853,7 +853,7 @@ type TestVersion1 struct { // *TestVersion1_E // *TestVersion1_F Sum isTestVersion1_Sum `protobuf_oneof:"sum"` - G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` + G *any.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"` // google.protobuf.Timestamp i = 10; // google.protobuf.Timestamp j = 11; // [(gogoproto.stdtime) = true]; @@ -965,7 +965,7 @@ func (m *TestVersion1) GetF() *TestVersion1 { return nil } -func (m *TestVersion1) GetG() *types.Any { +func (m *TestVersion1) GetG() *any.Any { if m != nil { return m.G } @@ -998,7 +998,7 @@ type TestVersion2 struct { // *TestVersion2_E // *TestVersion2_F Sum isTestVersion2_Sum `protobuf_oneof:"sum"` - G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` + G *any.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"` // google.protobuf.Timestamp i = 10; // google.protobuf.Timestamp j = 11; // [(gogoproto.stdtime) = true]; @@ -1111,7 +1111,7 @@ func (m *TestVersion2) GetF() *TestVersion2 { return nil } -func (m *TestVersion2) GetG() *types.Any { +func (m *TestVersion2) GetG() *any.Any { if m != nil { return m.G } @@ -1151,7 +1151,7 @@ type TestVersion3 struct { // *TestVersion3_E // *TestVersion3_F Sum isTestVersion3_Sum `protobuf_oneof:"sum"` - G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` + G *any.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"` // google.protobuf.Timestamp i = 10; // google.protobuf.Timestamp j = 11; // [(gogoproto.stdtime) = true]; @@ -1264,7 +1264,7 @@ func (m *TestVersion3) GetF() *TestVersion3 { return nil } -func (m *TestVersion3) GetG() *types.Any { +func (m *TestVersion3) GetG() *any.Any { if m != nil { return m.G } @@ -1303,7 +1303,7 @@ type TestVersion3LoneOneOfValue struct { // // *TestVersion3LoneOneOfValue_E Sum isTestVersion3LoneOneOfValue_Sum `protobuf_oneof:"sum"` - G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` + G *any.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"` // google.protobuf.Timestamp i = 10; // google.protobuf.Timestamp j = 11; // [(gogoproto.stdtime) = true]; @@ -1405,7 +1405,7 @@ func (m *TestVersion3LoneOneOfValue) GetE() int32 { return 0 } -func (m *TestVersion3LoneOneOfValue) GetG() *types.Any { +func (m *TestVersion3LoneOneOfValue) GetG() *any.Any { if m != nil { return m.G } @@ -1443,7 +1443,7 @@ type TestVersion3LoneNesting struct { // // *TestVersion3LoneNesting_F Sum isTestVersion3LoneNesting_Sum `protobuf_oneof:"sum"` - G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` + G *any.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"` // google.protobuf.Timestamp i = 10; // google.protobuf.Timestamp j = 11; // [(gogoproto.stdtime) = true]; @@ -1547,7 +1547,7 @@ func (m *TestVersion3LoneNesting) GetF() *TestVersion3LoneNesting { return nil } -func (m *TestVersion3LoneNesting) GetG() *types.Any { +func (m *TestVersion3LoneNesting) GetG() *any.Any { if m != nil { return m.G } @@ -1831,7 +1831,7 @@ type TestVersion4LoneNesting struct { // // *TestVersion4LoneNesting_F Sum isTestVersion4LoneNesting_Sum `protobuf_oneof:"sum"` - G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` + G *any.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"` // google.protobuf.Timestamp i = 10; // google.protobuf.Timestamp j = 11; // [(gogoproto.stdtime) = true]; @@ -1935,7 +1935,7 @@ func (m *TestVersion4LoneNesting) GetF() *TestVersion3LoneNesting { return nil } -func (m *TestVersion4LoneNesting) GetG() *types.Any { +func (m *TestVersion4LoneNesting) GetG() *any.Any { if m != nil { return m.G } @@ -2217,7 +2217,7 @@ type TestVersionFD1 struct { // *TestVersionFD1_E // *TestVersionFD1_F Sum isTestVersionFD1_Sum `protobuf_oneof:"sum"` - G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` + G *any.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"` H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"` } @@ -2305,7 +2305,7 @@ func (m *TestVersionFD1) GetF() *TestVersion1 { return nil } -func (m *TestVersionFD1) GetG() *types.Any { +func (m *TestVersionFD1) GetG() *any.Any { if m != nil { return m.G } @@ -2446,9 +2446,9 @@ func (*TestVersionFD1WithExtraAny) XXX_OneofWrappers() []interface{} { } type AnyWithExtra struct { - *types.Any `protobuf:"bytes,1,opt,name=a,proto3,embedded=a" json:"a,omitempty"` - B int64 `protobuf:"varint,3,opt,name=b,proto3" json:"b,omitempty"` - C int64 `protobuf:"varint,4,opt,name=c,proto3" json:"c,omitempty"` + *any.Any `protobuf:"bytes,1,opt,name=a,proto3,embedded=a" json:"a,omitempty"` + B int64 `protobuf:"varint,3,opt,name=b,proto3" json:"b,omitempty"` + C int64 `protobuf:"varint,4,opt,name=c,proto3" json:"c,omitempty"` } func (m *AnyWithExtra) Reset() { *m = AnyWithExtra{} } @@ -2575,13 +2575,13 @@ func (m *TestUpdatedTxRaw) GetNewField_1024() []byte { } type TestUpdatedTxBody struct { - Messages []*types.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` - Memo string `protobuf:"bytes,2,opt,name=memo,proto3" json:"memo,omitempty"` - TimeoutHeight int64 `protobuf:"varint,3,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height,omitempty"` - SomeNewField uint64 `protobuf:"varint,5,opt,name=some_new_field,json=someNewField,proto3" json:"some_new_field,omitempty"` - SomeNewFieldNonCriticalField string `protobuf:"bytes,1050,opt,name=some_new_field_non_critical_field,json=someNewFieldNonCriticalField,proto3" json:"some_new_field_non_critical_field,omitempty"` - ExtensionOptions []*types.Any `protobuf:"bytes,1023,rep,name=extension_options,json=extensionOptions,proto3" json:"extension_options,omitempty"` - NonCriticalExtensionOptions []*types.Any `protobuf:"bytes,2047,rep,name=non_critical_extension_options,json=nonCriticalExtensionOptions,proto3" json:"non_critical_extension_options,omitempty"` + Messages []*any.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` + Memo string `protobuf:"bytes,2,opt,name=memo,proto3" json:"memo,omitempty"` + TimeoutHeight int64 `protobuf:"varint,3,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height,omitempty"` + SomeNewField uint64 `protobuf:"varint,5,opt,name=some_new_field,json=someNewField,proto3" json:"some_new_field,omitempty"` + SomeNewFieldNonCriticalField string `protobuf:"bytes,1050,opt,name=some_new_field_non_critical_field,json=someNewFieldNonCriticalField,proto3" json:"some_new_field_non_critical_field,omitempty"` + ExtensionOptions []*any.Any `protobuf:"bytes,1023,rep,name=extension_options,json=extensionOptions,proto3" json:"extension_options,omitempty"` + NonCriticalExtensionOptions []*any.Any `protobuf:"bytes,2047,rep,name=non_critical_extension_options,json=nonCriticalExtensionOptions,proto3" json:"non_critical_extension_options,omitempty"` } func (m *TestUpdatedTxBody) Reset() { *m = TestUpdatedTxBody{} } @@ -2617,7 +2617,7 @@ func (m *TestUpdatedTxBody) XXX_DiscardUnknown() { var xxx_messageInfo_TestUpdatedTxBody proto.InternalMessageInfo -func (m *TestUpdatedTxBody) GetMessages() []*types.Any { +func (m *TestUpdatedTxBody) GetMessages() []*any.Any { if m != nil { return m.Messages } @@ -2652,14 +2652,14 @@ func (m *TestUpdatedTxBody) GetSomeNewFieldNonCriticalField() string { return "" } -func (m *TestUpdatedTxBody) GetExtensionOptions() []*types.Any { +func (m *TestUpdatedTxBody) GetExtensionOptions() []*any.Any { if m != nil { return m.ExtensionOptions } return nil } -func (m *TestUpdatedTxBody) GetNonCriticalExtensionOptions() []*types.Any { +func (m *TestUpdatedTxBody) GetNonCriticalExtensionOptions() []*any.Any { if m != nil { return m.NonCriticalExtensionOptions } @@ -6806,7 +6806,7 @@ func (m *Customer2) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Miscellaneous == nil { - m.Miscellaneous = &types.Any{} + m.Miscellaneous = &any.Any{} } if err := m.Miscellaneous.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -8519,7 +8519,7 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.G == nil { - m.G = &types.Any{} + m.G = &any.Any{} } if err := m.G.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -8889,7 +8889,7 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.G == nil { - m.G = &types.Any{} + m.G = &any.Any{} } if err := m.G.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -9278,7 +9278,7 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.G == nil { - m.G = &types.Any{} + m.G = &any.Any{} } if err := m.G.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -9645,7 +9645,7 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.G == nil { - m.G = &types.Any{} + m.G = &any.Any{} } if err := m.G.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -10027,7 +10027,7 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.G == nil { - m.G = &types.Any{} + m.G = &any.Any{} } if err := m.G.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -10996,7 +10996,7 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.G == nil { - m.G = &types.Any{} + m.G = &any.Any{} } if err := m.G.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -11855,7 +11855,7 @@ func (m *TestVersionFD1) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.G == nil { - m.G = &types.Any{} + m.G = &any.Any{} } if err := m.G.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -12205,7 +12205,7 @@ func (m *AnyWithExtra) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Any == nil { - m.Any = &types.Any{} + m.Any = &any.Any{} } if err := m.Any.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -12546,7 +12546,7 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Messages = append(m.Messages, &types.Any{}) + m.Messages = append(m.Messages, &any.Any{}) if err := m.Messages[len(m.Messages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -12650,7 +12650,7 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ExtensionOptions = append(m.ExtensionOptions, &types.Any{}) + m.ExtensionOptions = append(m.ExtensionOptions, &any.Any{}) if err := m.ExtensionOptions[len(m.ExtensionOptions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -12716,7 +12716,7 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.NonCriticalExtensionOptions = append(m.NonCriticalExtensionOptions, &types.Any{}) + m.NonCriticalExtensionOptions = append(m.NonCriticalExtensionOptions, &any.Any{}) if err := m.NonCriticalExtensionOptions[len(m.NonCriticalExtensionOptions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/testutil/types.go b/testutil/types.go index 7f5663167b67..e465524d47a6 100644 --- a/testutil/types.go +++ b/testutil/types.go @@ -22,4 +22,5 @@ const ( StakingModuleName = "staking" TxModuleName = "tx" UpgradeModuleName = "upgrade" + EpochsModuleName = "epochs" ) diff --git a/tools/confix/data/v0.50-app.toml b/tools/confix/data/v0.50-app.toml index 9c801a2d74ae..058f43ec4be1 100644 --- a/tools/confix/data/v0.50-app.toml +++ b/tools/confix/data/v0.50-app.toml @@ -227,9 +227,9 @@ stop-node-on-err = true [mempool] # Setting max-txs to 0 will allow for a unbounded amount of transactions in the mempool. -# Setting max_txs to negative 1 (-1) will disable transactions from being inserted into the mempool. +# Setting max_txs to negative 1 (-1) will disable transactions from being inserted into the mempool (no-op mempool). # Setting max_txs to a positive number (> 0) will limit the number of transactions in the mempool, by the specified amount. # # Note, this configuration only applies to SDK built-in app-side mempool # implementations. -max-txs = 5000 +max-txs = -1 diff --git a/tools/confix/data/v0.51-app.toml b/tools/confix/data/v0.51-app.toml index f725f5bbc5bb..1809e606dba6 100644 --- a/tools/confix/data/v0.51-app.toml +++ b/tools/confix/data/v0.51-app.toml @@ -233,7 +233,7 @@ stop-node-on-err = true # # Note, this configuration only applies to SDK built-in app-side mempool # implementations. -max-txs = 5000 +max-txs = -1 [custom] diff --git a/tools/confix/go.mod b/tools/confix/go.mod index d08990903af6..bd80418bd33e 100644 --- a/tools/confix/go.mod +++ b/tools/confix/go.mod @@ -3,13 +3,13 @@ module cosmossdk.io/tools/confix go 1.21 require ( - github.com/cosmos/cosmos-sdk v0.50.5 - github.com/creachadair/atomicfile v0.3.3 + github.com/cosmos/cosmos-sdk v0.50.6-0.20240403102038-f63e5fdf7c96 + github.com/creachadair/atomicfile v0.3.4 github.com/creachadair/tomledit v0.0.26 - github.com/pelletier/go-toml/v2 v2.1.1 + github.com/pelletier/go-toml/v2 v2.2.0 github.com/spf13/cobra v1.8.0 github.com/spf13/viper v1.18.2 - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 + golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81 gotest.tools/v3 v3.5.1 ) @@ -21,7 +21,7 @@ require ( cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/log v1.3.1 // indirect cosmossdk.io/math v1.3.0 // indirect - cosmossdk.io/store v1.0.2 // indirect + cosmossdk.io/store v1.1.0 // indirect cosmossdk.io/x/tx v0.13.1 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect @@ -39,20 +39,20 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.5 // indirect + github.com/cometbft/cometbft v0.38.6 // indirect github.com/cometbft/cometbft-db v0.9.1 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.4 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/gogoproto v1.4.11 // indirect - github.com/cosmos/iavl v1.0.1 // indirect + github.com/cosmos/gogoproto v1.4.12 // indirect + github.com/cosmos/iavl v1.1.1 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect @@ -101,7 +101,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -114,10 +114,10 @@ require ( github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.18.0 // indirect + github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.47.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/common v0.52.2 // indirect + github.com/prometheus/procfs v0.13.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect @@ -138,16 +138,16 @@ require ( github.com/zondax/ledger-go v0.14.3 // indirect go.etcd.io/bbolt v1.3.8 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.21.0 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/crypto v0.22.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect - google.golang.org/grpc v1.62.1 // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/grpc v1.63.2 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/tools/confix/go.sum b/tools/confix/go.sum index c386cf1cca54..b1dd2c57e532 100644 --- a/tools/confix/go.sum +++ b/tools/confix/go.sum @@ -14,8 +14,8 @@ cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= -cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= +cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= +cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -125,8 +125,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.5 h1:4lOcK5VTPrfbLOhNHmPYe6c7eDXHtBdMCQuKbAfFJdU= -github.com/cometbft/cometbft v0.38.5/go.mod h1:0tqKin+KQs8zDwzYD8rPHzSBIDNPuB4NrwwGDNb/hUg= +github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= +github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M= github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -143,17 +143,17 @@ github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAK github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU= github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co= -github.com/cosmos/cosmos-sdk v0.50.5 h1:MOEi+DKYgW67YaPgB+Pf+nHbD3V9S/ayitRKJYLfGIA= -github.com/cosmos/cosmos-sdk v0.50.5/go.mod h1:oV/k6GJgXV9QPoM2fsYDPPsyPBgQbdotv532O6Mz1OQ= +github.com/cosmos/cosmos-sdk v0.50.6-0.20240403102038-f63e5fdf7c96 h1:o8LxwVBiqvoH0ONhMz87COKPC0s6MgYJysMakThYmhY= +github.com/cosmos/cosmos-sdk v0.50.6-0.20240403102038-f63e5fdf7c96/go.mod h1:sM3HLOjUE6rwAiuwEOEtPd2DUcXG+uCktW+CdID+ZMM= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= -github.com/cosmos/iavl v1.0.1 h1:D+mYbcRO2wptYzOM1Hxl9cpmmHU1ZEt9T2Wv5nZTeUw= -github.com/cosmos/iavl v1.0.1/go.mod h1:8xIUkgVvwvVrBu81scdPty+/Dx9GqwHnAvXz4cwF7RY= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= +github.com/cosmos/iavl v1.1.1 h1:64nTi8s3gEoGqhA8TyAWFWfz7/pg0anKzHNSc1ETc7Q= +github.com/cosmos/iavl v1.1.1/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= @@ -161,10 +161,10 @@ github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5X github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creachadair/atomicfile v0.3.3 h1:yJlDq8qk9QmD/6ol+jq1X4bcoLNVdYq95+owOnauziE= -github.com/creachadair/atomicfile v0.3.3/go.mod h1:X1r9P4wigJlGkYJO1HXZREdkVn+b1yHrsBBMLSj7tak= -github.com/creachadair/mtest v0.0.0-20231015022703-31f2ea539dce h1:BFjvg2Oq88/2DOcUFu1ScIwKUn7KJYYvLr6AeuCJD54= -github.com/creachadair/mtest v0.0.0-20231015022703-31f2ea539dce/go.mod h1:okn1ft6DY+qjPmnvYynyq7ufIQKJ2x2qwOCJZecei1k= +github.com/creachadair/atomicfile v0.3.4 h1:AjNK7To+S1p+nk7uJXJMZFpcV9XHOyAaULyDeU6LEqM= +github.com/creachadair/atomicfile v0.3.4/go.mod h1:ByEUbfQyms+tRtE7Wk7WdS6PZeyMzfSFlNX1VoKEh6E= +github.com/creachadair/mds v0.13.3 h1:OqXNRorXKsuvfjor+0ixtrpA4IINApH8zgm23XLlngk= +github.com/creachadair/mds v0.13.3/go.mod h1:4vrFYUzTXMJpMBU+OA292I6IUxKWCCfZkgXg+/kBZMo= github.com/creachadair/tomledit v0.0.26 h1:MoDdgHIHZ5PctBVsAZDjxdxreWUEa9ObPKTRkk5PPwA= github.com/creachadair/tomledit v0.0.26/go.mod h1:SJi1OxKpMyR141tq1lzsbPtIg3j8TeVPM/ZftfieD7o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= @@ -177,8 +177,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= @@ -464,8 +464,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -570,8 +570,8 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= @@ -596,8 +596,8 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -612,16 +612,16 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.47.0 h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k= -github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= +github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -762,13 +762,13 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81 h1:6R2FC06FonbXQ8pK11/PDFY6N6LWlf9KlzibaCapmqc= +golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81/go.mod h1:CQ1k9gNrJ50XIzaKCRR2hssIjF07kZFEiieALBM/ARQ= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -783,8 +783,8 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= +golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -812,8 +812,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -825,8 +825,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -882,12 +882,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -919,8 +919,8 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= -golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= +golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= +golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -941,12 +941,12 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -964,8 +964,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/tools/cosmovisor/go.mod b/tools/cosmovisor/go.mod index 6f9586bd3cdf..9eed1285d429 100644 --- a/tools/cosmovisor/go.mod +++ b/tools/cosmovisor/go.mod @@ -4,7 +4,7 @@ go 1.21 require ( cosmossdk.io/log v1.3.1 - cosmossdk.io/x/upgrade v0.1.1 + cosmossdk.io/x/upgrade v0.1.2-0.20240403102038-f63e5fdf7c96 github.com/otiai10/copy v1.14.0 github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.9.0 @@ -22,7 +22,7 @@ require ( cosmossdk.io/depinject v1.0.0-alpha.4 // indirect cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/math v1.3.0 // indirect - cosmossdk.io/store v1.0.2 // indirect + cosmossdk.io/store v1.1.0 // indirect cosmossdk.io/x/tx v0.13.1 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect @@ -42,21 +42,21 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.5 // indirect + github.com/cometbft/cometbft v0.38.6 // indirect github.com/cometbft/cometbft-db v0.9.1 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.4 // indirect - github.com/cosmos/cosmos-sdk v0.50.5 // indirect + github.com/cosmos/cosmos-sdk v0.50.6-0.20240403102038-f63e5fdf7c96 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/gogoproto v1.4.11 // indirect - github.com/cosmos/iavl v1.0.1 // indirect + github.com/cosmos/gogoproto v1.4.12 // indirect + github.com/cosmos/iavl v1.1.1 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect @@ -114,7 +114,7 @@ require ( github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -124,14 +124,14 @@ require ( github.com/mtibben/percent v0.2.1 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.0 // indirect github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.18.0 // indirect + github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.47.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/common v0.52.2 // indirect + github.com/prometheus/procfs v0.13.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect @@ -159,22 +159,22 @@ require ( go.opentelemetry.io/otel/metric v1.22.0 // indirect go.opentelemetry.io/otel/trace v1.22.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.21.0 // indirect - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/oauth2 v0.16.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/crypto v0.22.0 // indirect + golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/oauth2 v0.18.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect google.golang.org/api v0.162.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect - google.golang.org/grpc v1.62.1 // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/grpc v1.63.2 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/tools/cosmovisor/go.sum b/tools/cosmovisor/go.sum index b3a06d571b71..52e782e83794 100644 --- a/tools/cosmovisor/go.sum +++ b/tools/cosmovisor/go.sum @@ -198,12 +198,12 @@ cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= -cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= +cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= +cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= -cosmossdk.io/x/upgrade v0.1.1 h1:aoPe2gNvH+Gwt/Pgq3dOxxQVU3j5P6Xf+DaUJTDZATc= -cosmossdk.io/x/upgrade v0.1.1/go.mod h1:MNLptLPcIFK9CWt7Ra//8WUZAxweyRDNcbs5nkOcQy0= +cosmossdk.io/x/upgrade v0.1.2-0.20240403102038-f63e5fdf7c96 h1:aJHYOadskHueWvIPgPkhhZxbN74sRiRY+E5ynsv0uSE= +cosmossdk.io/x/upgrade v0.1.2-0.20240403102038-f63e5fdf7c96/go.mod h1:zRrWkouBVAq8o4eLB5EuMo8hLXF121zcdGamwQ6wf/w= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= @@ -310,8 +310,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.5 h1:4lOcK5VTPrfbLOhNHmPYe6c7eDXHtBdMCQuKbAfFJdU= -github.com/cometbft/cometbft v0.38.5/go.mod h1:0tqKin+KQs8zDwzYD8rPHzSBIDNPuB4NrwwGDNb/hUg= +github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= +github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M= github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -326,17 +326,17 @@ github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAK github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU= github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co= -github.com/cosmos/cosmos-sdk v0.50.5 h1:MOEi+DKYgW67YaPgB+Pf+nHbD3V9S/ayitRKJYLfGIA= -github.com/cosmos/cosmos-sdk v0.50.5/go.mod h1:oV/k6GJgXV9QPoM2fsYDPPsyPBgQbdotv532O6Mz1OQ= +github.com/cosmos/cosmos-sdk v0.50.6-0.20240403102038-f63e5fdf7c96 h1:o8LxwVBiqvoH0ONhMz87COKPC0s6MgYJysMakThYmhY= +github.com/cosmos/cosmos-sdk v0.50.6-0.20240403102038-f63e5fdf7c96/go.mod h1:sM3HLOjUE6rwAiuwEOEtPd2DUcXG+uCktW+CdID+ZMM= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= -github.com/cosmos/iavl v1.0.1 h1:D+mYbcRO2wptYzOM1Hxl9cpmmHU1ZEt9T2Wv5nZTeUw= -github.com/cosmos/iavl v1.0.1/go.mod h1:8xIUkgVvwvVrBu81scdPty+/Dx9GqwHnAvXz4cwF7RY= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= +github.com/cosmos/iavl v1.1.1 h1:64nTi8s3gEoGqhA8TyAWFWfz7/pg0anKzHNSc1ETc7Q= +github.com/cosmos/iavl v1.1.1/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= @@ -354,8 +354,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= @@ -728,8 +728,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -832,8 +832,8 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= @@ -858,8 +858,8 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -874,16 +874,16 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.47.0 h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k= -github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= +github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -1051,8 +1051,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1064,8 +1064,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81 h1:6R2FC06FonbXQ8pK11/PDFY6N6LWlf9KlzibaCapmqc= +golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81/go.mod h1:CQ1k9gNrJ50XIzaKCRR2hssIjF07kZFEiieALBM/ARQ= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1151,8 +1151,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1178,8 +1178,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= -golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= +golang.org/x/oauth2 v0.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI= +golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= 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= @@ -1194,8 +1194,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1290,13 +1290,13 @@ golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1556,12 +1556,12 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1603,8 +1603,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/tools/hubl/go.mod b/tools/hubl/go.mod index 8b36b25760db..2468db63ca24 100644 --- a/tools/hubl/go.mod +++ b/tools/hubl/go.mod @@ -8,11 +8,11 @@ require ( cosmossdk.io/core v0.11.0 cosmossdk.io/errors v1.0.1 github.com/cockroachdb/errors v1.11.1 - github.com/cosmos/cosmos-sdk v0.50.5 + github.com/cosmos/cosmos-sdk v0.50.6-0.20240403102038-f63e5fdf7c96 github.com/manifoldco/promptui v0.9.0 - github.com/pelletier/go-toml/v2 v2.1.1 + github.com/pelletier/go-toml/v2 v2.2.0 github.com/spf13/cobra v1.8.0 - google.golang.org/grpc v1.62.1 + google.golang.org/grpc v1.63.2 google.golang.org/protobuf v1.33.0 ) @@ -21,7 +21,7 @@ require ( cosmossdk.io/depinject v1.0.0-alpha.4 // indirect cosmossdk.io/log v1.3.1 // indirect cosmossdk.io/math v1.3.0 // indirect - cosmossdk.io/store v1.0.2 // indirect + cosmossdk.io/store v1.1.0 // indirect cosmossdk.io/x/tx v0.13.1 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect @@ -39,20 +39,20 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.5 // indirect + github.com/cometbft/cometbft v0.38.6 // indirect github.com/cometbft/cometbft-db v0.9.1 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.4 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/gogoproto v1.4.11 // indirect - github.com/cosmos/iavl v1.0.1 // indirect + github.com/cosmos/gogoproto v1.4.12 // indirect + github.com/cosmos/iavl v1.1.1 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect @@ -100,7 +100,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -113,10 +113,10 @@ require ( github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.18.0 // indirect + github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.47.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/common v0.52.2 // indirect + github.com/prometheus/procfs v0.13.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.10.0 // indirect @@ -138,16 +138,16 @@ require ( github.com/zondax/ledger-go v0.14.3 // indirect go.etcd.io/bbolt v1.3.8 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.21.0 // indirect - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/crypto v0.22.0 // indirect + golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect diff --git a/tools/hubl/go.sum b/tools/hubl/go.sum index becfc2ee033f..0887b02add5a 100644 --- a/tools/hubl/go.sum +++ b/tools/hubl/go.sum @@ -16,8 +16,8 @@ cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= -cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= +cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= +cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -131,8 +131,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.5 h1:4lOcK5VTPrfbLOhNHmPYe6c7eDXHtBdMCQuKbAfFJdU= -github.com/cometbft/cometbft v0.38.5/go.mod h1:0tqKin+KQs8zDwzYD8rPHzSBIDNPuB4NrwwGDNb/hUg= +github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= +github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M= github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -149,17 +149,17 @@ github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAK github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU= github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co= -github.com/cosmos/cosmos-sdk v0.50.5 h1:MOEi+DKYgW67YaPgB+Pf+nHbD3V9S/ayitRKJYLfGIA= -github.com/cosmos/cosmos-sdk v0.50.5/go.mod h1:oV/k6GJgXV9QPoM2fsYDPPsyPBgQbdotv532O6Mz1OQ= +github.com/cosmos/cosmos-sdk v0.50.6-0.20240403102038-f63e5fdf7c96 h1:o8LxwVBiqvoH0ONhMz87COKPC0s6MgYJysMakThYmhY= +github.com/cosmos/cosmos-sdk v0.50.6-0.20240403102038-f63e5fdf7c96/go.mod h1:sM3HLOjUE6rwAiuwEOEtPd2DUcXG+uCktW+CdID+ZMM= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= -github.com/cosmos/iavl v1.0.1 h1:D+mYbcRO2wptYzOM1Hxl9cpmmHU1ZEt9T2Wv5nZTeUw= -github.com/cosmos/iavl v1.0.1/go.mod h1:8xIUkgVvwvVrBu81scdPty+/Dx9GqwHnAvXz4cwF7RY= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= +github.com/cosmos/iavl v1.1.1 h1:64nTi8s3gEoGqhA8TyAWFWfz7/pg0anKzHNSc1ETc7Q= +github.com/cosmos/iavl v1.1.1/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= @@ -177,8 +177,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= @@ -464,8 +464,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -570,8 +570,8 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= @@ -596,8 +596,8 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -612,16 +612,16 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.47.0 h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k= -github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= +github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -761,13 +761,13 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81 h1:6R2FC06FonbXQ8pK11/PDFY6N6LWlf9KlzibaCapmqc= +golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81/go.mod h1:CQ1k9gNrJ50XIzaKCRR2hssIjF07kZFEiieALBM/ARQ= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -781,8 +781,8 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= +golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -810,8 +810,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -822,8 +822,8 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -879,12 +879,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -915,8 +915,8 @@ golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= -golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= +golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= +golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -937,12 +937,12 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -960,8 +960,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/tools/hubl/internal/load.go b/tools/hubl/internal/load.go index eea3f62b0717..9b0069ff6cc5 100644 --- a/tools/hubl/internal/load.go +++ b/tools/hubl/internal/load.go @@ -174,7 +174,7 @@ func (c *ChainInfo) OpenClient() (*grpc.ClientConn, error) { } var err error - c.client, err = grpc.Dial(endpoint.Endpoint, grpc.WithTransportCredentials(creds)) + c.client, err = grpc.NewClient(endpoint.Endpoint, grpc.WithTransportCredentials(creds)) if err != nil { res = errors.Join(res, err) continue diff --git a/types/abci.pb.go b/types/abci.pb.go index 5f4da7f089d1..815a58d41aa1 100644 --- a/types/abci.pb.go +++ b/types/abci.pb.go @@ -5,11 +5,11 @@ package types import ( fmt "fmt" - types1 "github.com/cometbft/cometbft/abci/types" - types2 "github.com/cometbft/cometbft/proto/tendermint/types" - types "github.com/cosmos/cosmos-sdk/codec/types" + types "github.com/cometbft/cometbft/abci/types" + types1 "github.com/cometbft/cometbft/proto/tendermint/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" + any "github.com/cosmos/gogoproto/types/any" io "io" math "math" math_bits "math/bits" @@ -53,7 +53,7 @@ type TxResponse struct { // Amount of gas consumed by transaction. GasUsed int64 `protobuf:"varint,10,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` // The request transaction bytes. - Tx *types.Any `protobuf:"bytes,11,opt,name=tx,proto3" json:"tx,omitempty"` + Tx *any.Any `protobuf:"bytes,11,opt,name=tx,proto3" json:"tx,omitempty"` // Time of the previous block. For heights > 1, it's the weighted median of // the timestamps of the valid votes in the block.LastCommit. For height == 1, // it's genesis time. @@ -64,7 +64,7 @@ type TxResponse struct { // additional metadata, emitted only by processing the messages. // // Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 - Events []types1.Event `protobuf:"bytes,13,rep,name=events,proto3" json:"events"` + Events []types.Event `protobuf:"bytes,13,rep,name=events,proto3" json:"events"` } func (m *TxResponse) Reset() { *m = TxResponse{} } @@ -332,11 +332,11 @@ type Result struct { Log string `protobuf:"bytes,2,opt,name=log,proto3" json:"log,omitempty"` // Events contains a slice of Event objects that were emitted during message // or handler execution. - Events []types1.Event `protobuf:"bytes,3,rep,name=events,proto3" json:"events"` + Events []types.Event `protobuf:"bytes,3,rep,name=events,proto3" json:"events"` // msg_responses contains the Msg handler responses type packed in Anys. // // Since: cosmos-sdk 0.46 - MsgResponses []*types.Any `protobuf:"bytes,4,rep,name=msg_responses,json=msgResponses,proto3" json:"msg_responses,omitempty"` + MsgResponses []*any.Any `protobuf:"bytes,4,rep,name=msg_responses,json=msgResponses,proto3" json:"msg_responses,omitempty"` } func (m *Result) Reset() { *m = Result{} } @@ -480,7 +480,7 @@ type TxMsgData struct { // msg_responses contains the Msg handler responses packed into Anys. // // Since: cosmos-sdk 0.46 - MsgResponses []*types.Any `protobuf:"bytes,2,rep,name=msg_responses,json=msgResponses,proto3" json:"msg_responses,omitempty"` + MsgResponses []*any.Any `protobuf:"bytes,2,rep,name=msg_responses,json=msgResponses,proto3" json:"msg_responses,omitempty"` } func (m *TxMsgData) Reset() { *m = TxMsgData{} } @@ -523,7 +523,7 @@ func (m *TxMsgData) GetData() []*MsgData { return nil } -func (m *TxMsgData) GetMsgResponses() []*types.Any { +func (m *TxMsgData) GetMsgResponses() []*any.Any { if m != nil { return m.MsgResponses } @@ -633,7 +633,7 @@ type SearchBlocksResult struct { // Max count blocks per page Limit int64 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` // List of blocks in current page - Blocks []*types2.Block `protobuf:"bytes,6,rep,name=blocks,proto3" json:"blocks,omitempty"` + Blocks []*types1.Block `protobuf:"bytes,6,rep,name=blocks,proto3" json:"blocks,omitempty"` } func (m *SearchBlocksResult) Reset() { *m = SearchBlocksResult{} } @@ -703,7 +703,7 @@ func (m *SearchBlocksResult) GetLimit() int64 { return 0 } -func (m *SearchBlocksResult) GetBlocks() []*types2.Block { +func (m *SearchBlocksResult) GetBlocks() []*types1.Block { if m != nil { return m.Blocks } @@ -1751,7 +1751,7 @@ func (this *TxMsgData) String() string { repeatedStringForData += "}" repeatedStringForMsgResponses := "[]*Any{" for _, f := range this.MsgResponses { - repeatedStringForMsgResponses += strings.Replace(fmt.Sprintf("%v", f), "Any", "types.Any", 1) + "," + repeatedStringForMsgResponses += strings.Replace(fmt.Sprintf("%v", f), "Any", "any.Any", 1) + "," } repeatedStringForMsgResponses += "}" s := strings.Join([]string{`&TxMsgData{`, @@ -1787,7 +1787,7 @@ func (this *SearchBlocksResult) String() string { } repeatedStringForBlocks := "[]*Block{" for _, f := range this.Blocks { - repeatedStringForBlocks += strings.Replace(fmt.Sprintf("%v", f), "Block", "types2.Block", 1) + "," + repeatedStringForBlocks += strings.Replace(fmt.Sprintf("%v", f), "Block", "types1.Block", 1) + "," } repeatedStringForBlocks += "}" s := strings.Join([]string{`&SearchBlocksResult{`, @@ -2138,7 +2138,7 @@ func (m *TxResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Tx == nil { - m.Tx = &types.Any{} + m.Tx = &any.Any{} } if err := m.Tx.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2205,7 +2205,7 @@ func (m *TxResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Events = append(m.Events, types1.Event{}) + m.Events = append(m.Events, types.Event{}) if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -2808,7 +2808,7 @@ func (m *Result) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Events = append(m.Events, types1.Event{}) + m.Events = append(m.Events, types.Event{}) if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -2842,7 +2842,7 @@ func (m *Result) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.MsgResponses = append(m.MsgResponses, &types.Any{}) + m.MsgResponses = append(m.MsgResponses, &any.Any{}) if err := m.MsgResponses[len(m.MsgResponses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3195,7 +3195,7 @@ func (m *TxMsgData) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.MsgResponses = append(m.MsgResponses, &types.Any{}) + m.MsgResponses = append(m.MsgResponses, &any.Any{}) if err := m.MsgResponses[len(m.MsgResponses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3553,7 +3553,7 @@ func (m *SearchBlocksResult) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Blocks = append(m.Blocks, &types2.Block{}) + m.Blocks = append(m.Blocks, &types1.Block{}) if err := m.Blocks[len(m.Blocks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/types/address/store_key_test.go b/types/address/store_key_test.go index ac28f814cc36..c68f9273e559 100644 --- a/types/address/store_key_test.go +++ b/types/address/store_key_test.go @@ -18,6 +18,7 @@ func (suite *StoreKeySuite) TestLengthPrefix() { require := suite.Require() addr10byte := []byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9} addr20byte := []byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19} + var addr0byte []byte addr256byte := make([]byte, 256) tests := []struct { @@ -28,11 +29,11 @@ func (suite *StoreKeySuite) TestLengthPrefix() { }{ {"10-byte address", addr10byte, append([]byte{byte(10)}, addr10byte...), false}, {"20-byte address", addr20byte, append([]byte{byte(20)}, addr20byte...), false}, + {"0-byte address", addr0byte, addr0byte, false}, {"256-byte address (too long)", addr256byte, nil, true}, } for _, tt := range tests { - tt := tt suite.Run(tt.name, func() { storeKey, err := address.LengthPrefix(tt.addr) if tt.expErr { @@ -44,3 +45,34 @@ func (suite *StoreKeySuite) TestLengthPrefix() { }) } } + +func (suite *StoreKeySuite) TestMustLengthPrefix() { + require := suite.Require() + addr10byte := []byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9} + addr256byte := make([]byte, 256) + + tests := []struct { + name string + addr []byte + expStoreKey []byte + expPanic bool + }{ + {"10-byte address with length prefix", addr10byte, append([]byte{byte(10)}, addr10byte...), false}, + {"256-byte address triggers panic due to excessive length", addr256byte, nil, true}, + } + + for _, tt := range tests { + suite.Run(tt.name, func() { + defer func() { + r := recover() + if tt.expPanic { + require.NotNil(r) + } else { + require.Nil(r) + } + }() + storeKey := address.MustLengthPrefix(tt.addr) + require.Equal(tt.expStoreKey, storeKey) + }) + } +} diff --git a/types/context.go b/types/context.go index 2c63445f8709..0ebee5f132c5 100644 --- a/types/context.go +++ b/types/context.go @@ -6,7 +6,6 @@ import ( abci "github.com/cometbft/cometbft/abci/types" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/cosmos/gogoproto/proto" "cosmossdk.io/core/comet" "cosmossdk.io/core/header" @@ -78,10 +77,10 @@ func (c Context) Logger() log.Logger { return c.logge func (c Context) VoteInfos() []abci.VoteInfo { return c.voteInfo } func (c Context) GasMeter() storetypes.GasMeter { return c.gasMeter } func (c Context) BlockGasMeter() storetypes.GasMeter { return c.blockGasMeter } -func (c Context) IsCheckTx() bool { return c.checkTx } // Deprecated: use execMode instead -func (c Context) IsReCheckTx() bool { return c.recheckTx } // Deprecated: use execMode instead +func (c Context) IsCheckTx() bool { return c.checkTx } // Deprecated: use core/transaction service instead +func (c Context) IsReCheckTx() bool { return c.recheckTx } // Deprecated: use core/transaction service instead func (c Context) IsSigverifyTx() bool { return c.sigverifyTx } -func (c Context) ExecMode() ExecMode { return c.execMode } +func (c Context) ExecMode() ExecMode { return c.execMode } // Deprecated: use core/transaction service instead func (c Context) MinGasPrices() DecCoins { return c.minGasPrice } func (c Context) EventManager() EventManagerI { return c.eventManager } func (c Context) Priority() int64 { return c.priority } @@ -91,10 +90,9 @@ func (c Context) StreamingManager() storetypes.StreamingManager { return c.strea func (c Context) CometInfo() comet.Info { return c.cometInfo } func (c Context) HeaderInfo() header.Info { return c.headerInfo } -// clone the header before returning +// BlockHeader returns the header by value. func (c Context) BlockHeader() cmtproto.Header { - msg := proto.Clone(&c.header).(*cmtproto.Header) - return *msg + return c.header } // HeaderHash returns a copy of the header hash obtained during abci.RequestBeginBlock diff --git a/types/kv/helpers_test.go b/types/kv/helpers_test.go new file mode 100644 index 000000000000..37e9f368532b --- /dev/null +++ b/types/kv/helpers_test.go @@ -0,0 +1,89 @@ +package kv_test + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/cosmos/cosmos-sdk/types/kv" +) + +func TestAssertKeyAtLeastLength(t *testing.T) { + cases := []struct { + name string + key []byte + length int + expectPanic bool + }{ + { + name: "Store key length is less than the given length", + key: []byte("hello"), + length: 10, + expectPanic: true, + }, + { + name: "Store key length is equal to the given length", + key: []byte("store-key"), + length: 9, + expectPanic: false, + }, + { + name: "Store key length is greater than the given length", + key: []byte("unique"), + length: 3, + expectPanic: false, + }, + } + + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + if tc.expectPanic { + assert.Panics(t, func() { + kv.AssertKeyAtLeastLength(tc.key, tc.length) + }) + return + } + kv.AssertKeyAtLeastLength(tc.key, tc.length) + }) + } +} + +func TestAssertKeyLength(t *testing.T) { + cases := []struct { + name string + key []byte + length int + expectPanic bool + }{ + { + name: "Store key length is less than the given length", + key: []byte("hello"), + length: 10, + expectPanic: true, + }, + { + name: "Store key length is equal to the given length", + key: []byte("store-key"), + length: 9, + expectPanic: false, + }, + { + name: "Store key length is greater than the given length", + key: []byte("unique"), + length: 3, + expectPanic: true, + }, + } + + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + if tc.expectPanic { + assert.Panics(t, func() { + kv.AssertKeyLength(tc.key, tc.length) + }) + return + } + kv.AssertKeyLength(tc.key, tc.length) + }) + } +} diff --git a/types/mempool/mempool_test.go b/types/mempool/mempool_test.go index 3dbd5f1349b0..cdc0756141a6 100644 --- a/types/mempool/mempool_test.go +++ b/types/mempool/mempool_test.go @@ -211,7 +211,7 @@ type MempoolTestSuite struct { func (s *MempoolTestSuite) resetMempool() { s.iterations = 0 - s.mempool = mempool.NewSenderNonceMempool() + s.mempool = mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(5000)) } func (s *MempoolTestSuite) SetupTest() { diff --git a/types/mempool/sender_nonce.go b/types/mempool/sender_nonce.go index 524d20a73c74..9e2b25e4e47d 100644 --- a/types/mempool/sender_nonce.go +++ b/types/mempool/sender_nonce.go @@ -20,7 +20,7 @@ var ( _ Iterator = (*senderNonceMempoolIterator)(nil) ) -var DefaultMaxTx = 0 +var DefaultMaxTx = -1 // SenderNonceMempool is a mempool that prioritizes transactions within a sender // by nonce, the lowest first, but selects a random sender on each iteration. diff --git a/types/mempool/sender_nonce_test.go b/types/mempool/sender_nonce_test.go index e458c0bc4233..d4e4fe565ee3 100644 --- a/types/mempool/sender_nonce_test.go +++ b/types/mempool/sender_nonce_test.go @@ -114,7 +114,7 @@ func (s *MempoolTestSuite) TestTxOrder() { } for i, tt := range tests { t.Run(fmt.Sprintf("case %d", i), func(t *testing.T) { - pool := mempool.NewSenderNonceMempool(mempool.SenderNonceSeedOpt(tt.seed)) + pool := mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(5000), mempool.SenderNonceSeedOpt(tt.seed)) // create test txs and insert into mempool for i, ts := range tt.txs { tx := testTx{id: i, priority: int64(ts.p), nonce: uint64(ts.n), address: ts.a} @@ -172,7 +172,7 @@ func (s *MempoolTestSuite) TestTxNotFoundOnSender() { t := s.T() ctx := sdk.NewContext(nil, false, log.NewNopLogger()) accounts := simtypes.RandomAccounts(rand.New(rand.NewSource(0)), 1) - mp := mempool.NewSenderNonceMempool() + mp := mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(5000)) txSender := testTx{ nonce: 0, diff --git a/types/module/module.go b/types/module/module.go index d64ca83e835e..552cdcb58bfd 100644 --- a/types/module/module.go +++ b/types/module/module.go @@ -50,8 +50,6 @@ type AppModuleBasic interface { HasName HasGRPCGateway HasAminoCodec - - appmodulev2.HasRegisterInterfaces } // AppModule is the form for an application module. Most of @@ -61,7 +59,6 @@ type AppModule interface { HasName appmodulev2.AppModule - appmodulev2.HasRegisterInterfaces } // HasName allows the module to provide its own name for legacy purposes. diff --git a/types/query/pagination_test.go b/types/query/pagination_test.go index 3daa5ba09427..a35257ccabfa 100644 --- a/types/query/pagination_test.go +++ b/types/query/pagination_test.go @@ -12,6 +12,7 @@ import ( "cosmossdk.io/log" "cosmossdk.io/math" "cosmossdk.io/store/prefix" + _ "cosmossdk.io/x/accounts" _ "cosmossdk.io/x/auth" authkeeper "cosmossdk.io/x/auth/keeper" _ "cosmossdk.io/x/bank" @@ -68,6 +69,7 @@ func (s *paginationTestSuite) SetupTest() { app, err := testutilsims.Setup( depinject.Configs( configurator.NewAppConfig( + configurator.AccountsModule(), configurator.AuthModule(), configurator.BankModule(), configurator.ConsensusModule(), @@ -121,9 +123,12 @@ func (s *paginationTestSuite) TestPagination() { s.accountKeeper.SetAccount(s.ctx, acc1) s.Require().NoError(testutil.FundAccount(s.ctx, s.bankKeeper, addr1, balances)) + addr1Str, err := s.accountKeeper.AddressCodec().BytesToString(addr1) + s.Require().NoError(err) + s.T().Log("verify empty page request results a max of defaultLimit records and counts total records") pageReq := &query.PageRequest{} - request := types.NewQueryAllBalancesRequest(addr1, pageReq, false) + request := types.NewQueryAllBalancesRequest(addr1Str, pageReq, false) res, err := queryClient.AllBalances(gocontext.Background(), request) s.Require().NoError(err) s.Require().Equal(res.Pagination.Total, uint64(numBalances)) @@ -132,7 +137,7 @@ func (s *paginationTestSuite) TestPagination() { s.T().Log("verify page request with limit > defaultLimit, returns less or equal to `limit` records") pageReq = &query.PageRequest{Limit: overLimit} - request = types.NewQueryAllBalancesRequest(addr1, pageReq, false) + request = types.NewQueryAllBalancesRequest(addr1Str, pageReq, false) res, err = queryClient.AllBalances(gocontext.Background(), request) s.Require().NoError(err) s.Require().Equal(res.Pagination.Total, uint64(0)) @@ -141,7 +146,7 @@ func (s *paginationTestSuite) TestPagination() { s.T().Log("verify paginate with custom limit and countTotal true") pageReq = &query.PageRequest{Limit: underLimit, CountTotal: true} - request = types.NewQueryAllBalancesRequest(addr1, pageReq, false) + request = types.NewQueryAllBalancesRequest(addr1Str, pageReq, false) res, err = queryClient.AllBalances(gocontext.Background(), request) s.Require().NoError(err) s.Require().Equal(res.Balances.Len(), underLimit) @@ -150,7 +155,7 @@ func (s *paginationTestSuite) TestPagination() { s.T().Log("verify paginate with custom limit and countTotal false") pageReq = &query.PageRequest{Limit: defaultLimit, CountTotal: false} - request = types.NewQueryAllBalancesRequest(addr1, pageReq, false) + request = types.NewQueryAllBalancesRequest(addr1Str, pageReq, false) res, err = queryClient.AllBalances(gocontext.Background(), request) s.Require().NoError(err) s.Require().Equal(res.Balances.Len(), defaultLimit) @@ -159,7 +164,7 @@ func (s *paginationTestSuite) TestPagination() { s.T().Log("verify paginate with custom limit, key and countTotal false") pageReq = &query.PageRequest{Key: res.Pagination.NextKey, Limit: defaultLimit, CountTotal: false} - request = types.NewQueryAllBalancesRequest(addr1, pageReq, false) + request = types.NewQueryAllBalancesRequest(addr1Str, pageReq, false) res, err = queryClient.AllBalances(gocontext.Background(), request) s.Require().NoError(err) s.Require().Equal(res.Balances.Len(), defaultLimit) @@ -168,7 +173,7 @@ func (s *paginationTestSuite) TestPagination() { s.T().Log("verify paginate for last page, results in records less than max limit") pageReq = &query.PageRequest{Key: res.Pagination.NextKey, Limit: defaultLimit, CountTotal: false} - request = types.NewQueryAllBalancesRequest(addr1, pageReq, false) + request = types.NewQueryAllBalancesRequest(addr1Str, pageReq, false) res, err = queryClient.AllBalances(gocontext.Background(), request) s.Require().NoError(err) s.Require().LessOrEqual(res.Balances.Len(), defaultLimit) @@ -178,7 +183,7 @@ func (s *paginationTestSuite) TestPagination() { s.T().Log("verify paginate with offset and limit") pageReq = &query.PageRequest{Offset: 200, Limit: defaultLimit, CountTotal: false} - request = types.NewQueryAllBalancesRequest(addr1, pageReq, false) + request = types.NewQueryAllBalancesRequest(addr1Str, pageReq, false) res, err = queryClient.AllBalances(gocontext.Background(), request) s.Require().NoError(err) s.Require().LessOrEqual(res.Balances.Len(), defaultLimit) @@ -188,7 +193,7 @@ func (s *paginationTestSuite) TestPagination() { s.T().Log("verify paginate with offset and limit") pageReq = &query.PageRequest{Offset: 100, Limit: defaultLimit, CountTotal: false} - request = types.NewQueryAllBalancesRequest(addr1, pageReq, false) + request = types.NewQueryAllBalancesRequest(addr1Str, pageReq, false) res, err = queryClient.AllBalances(gocontext.Background(), request) s.Require().NoError(err) s.Require().LessOrEqual(res.Balances.Len(), defaultLimit) @@ -197,14 +202,14 @@ func (s *paginationTestSuite) TestPagination() { s.T().Log("verify paginate with offset and key - error") pageReq = &query.PageRequest{Key: res.Pagination.NextKey, Offset: 100, Limit: defaultLimit, CountTotal: false} - request = types.NewQueryAllBalancesRequest(addr1, pageReq, false) + request = types.NewQueryAllBalancesRequest(addr1Str, pageReq, false) _, err = queryClient.AllBalances(gocontext.Background(), request) s.Require().Error(err) s.Require().Equal("rpc error: code = InvalidArgument desc = paginate: invalid request, either offset or key is expected, got both", err.Error()) s.T().Log("verify paginate with offset greater than total results") pageReq = &query.PageRequest{Offset: 300, Limit: defaultLimit, CountTotal: false} - request = types.NewQueryAllBalancesRequest(addr1, pageReq, false) + request = types.NewQueryAllBalancesRequest(addr1Str, pageReq, false) res, err = queryClient.AllBalances(gocontext.Background(), request) s.Require().NoError(err) s.Require().LessOrEqual(res.Balances.Len(), 0) @@ -229,9 +234,12 @@ func (s *paginationTestSuite) TestReversePagination() { s.accountKeeper.SetAccount(s.ctx, acc1) s.Require().NoError(testutil.FundAccount(s.ctx, s.bankKeeper, addr1, balances)) + addr1Str, err := s.accountKeeper.AddressCodec().BytesToString(addr1) + s.Require().NoError(err) + s.T().Log("verify paginate with custom limit and countTotal, Reverse false") pageReq := &query.PageRequest{Limit: 2, CountTotal: true, Reverse: true, Key: nil} - request := types.NewQueryAllBalancesRequest(addr1, pageReq, false) + request := types.NewQueryAllBalancesRequest(addr1Str, pageReq, false) res1, err := queryClient.AllBalances(gocontext.Background(), request) s.Require().NoError(err) s.Require().Equal(2, res1.Balances.Len()) @@ -239,7 +247,7 @@ func (s *paginationTestSuite) TestReversePagination() { s.T().Log("verify paginate with custom limit and countTotal, Reverse false") pageReq = &query.PageRequest{Limit: 150} - request = types.NewQueryAllBalancesRequest(addr1, pageReq, false) + request = types.NewQueryAllBalancesRequest(addr1Str, pageReq, false) res1, err = queryClient.AllBalances(gocontext.Background(), request) s.Require().NoError(err) s.Require().Equal(res1.Balances.Len(), 150) @@ -248,7 +256,7 @@ func (s *paginationTestSuite) TestReversePagination() { s.T().Log("verify paginate with custom limit, key and Reverse true") pageReq = &query.PageRequest{Limit: defaultLimit, Reverse: true} - request = types.NewQueryAllBalancesRequest(addr1, pageReq, false) + request = types.NewQueryAllBalancesRequest(addr1Str, pageReq, false) res, err := queryClient.AllBalances(gocontext.Background(), request) s.Require().NoError(err) s.Require().Equal(res.Balances.Len(), defaultLimit) @@ -257,7 +265,7 @@ func (s *paginationTestSuite) TestReversePagination() { s.T().Log("verify paginate with custom limit, key and Reverse true") pageReq = &query.PageRequest{Offset: 100, Limit: defaultLimit, Reverse: true} - request = types.NewQueryAllBalancesRequest(addr1, pageReq, false) + request = types.NewQueryAllBalancesRequest(addr1Str, pageReq, false) res, err = queryClient.AllBalances(gocontext.Background(), request) s.Require().NoError(err) s.Require().Equal(res.Balances.Len(), defaultLimit) @@ -266,7 +274,7 @@ func (s *paginationTestSuite) TestReversePagination() { s.T().Log("verify paginate for last page, Reverse true") pageReq = &query.PageRequest{Offset: 200, Limit: defaultLimit, Reverse: true} - request = types.NewQueryAllBalancesRequest(addr1, pageReq, false) + request = types.NewQueryAllBalancesRequest(addr1Str, pageReq, false) res, err = queryClient.AllBalances(gocontext.Background(), request) s.Require().NoError(err) s.Require().Equal(res.Balances.Len(), lastPageRecords) @@ -275,7 +283,7 @@ func (s *paginationTestSuite) TestReversePagination() { s.T().Log("verify page request with limit > defaultLimit, returns less or equal to `limit` records") pageReq = &query.PageRequest{Limit: overLimit, Reverse: true} - request = types.NewQueryAllBalancesRequest(addr1, pageReq, false) + request = types.NewQueryAllBalancesRequest(addr1Str, pageReq, false) res, err = queryClient.AllBalances(gocontext.Background(), request) s.Require().NoError(err) s.Require().Equal(res.Pagination.Total, uint64(0)) @@ -284,7 +292,7 @@ func (s *paginationTestSuite) TestReversePagination() { s.T().Log("verify paginate with custom limit, key, countTotal false and Reverse true") pageReq = &query.PageRequest{Key: res1.Pagination.NextKey, Limit: 50, Reverse: true} - request = types.NewQueryAllBalancesRequest(addr1, pageReq, false) + request = types.NewQueryAllBalancesRequest(addr1Str, pageReq, false) res, err = queryClient.AllBalances(gocontext.Background(), request) s.Require().NoError(err) s.Require().Equal(res.Balances.Len(), 50) @@ -296,7 +304,7 @@ func (s *paginationTestSuite) TestReversePagination() { s.T().Log("verify paginate with custom limit, key, countTotal false and Reverse true") pageReq = &query.PageRequest{Key: res.Pagination.NextKey, Limit: 50, Reverse: true} - request = types.NewQueryAllBalancesRequest(addr1, pageReq, false) + request = types.NewQueryAllBalancesRequest(addr1Str, pageReq, false) res, err = queryClient.AllBalances(gocontext.Background(), request) s.Require().NoError(err) s.Require().Equal(res.Balances.Len(), 50) @@ -308,7 +316,7 @@ func (s *paginationTestSuite) TestReversePagination() { s.T().Log("verify paginate for last page Reverse true") pageReq = &query.PageRequest{Key: res.Pagination.NextKey, Limit: defaultLimit, Reverse: true} - request = types.NewQueryAllBalancesRequest(addr1, pageReq, false) + request = types.NewQueryAllBalancesRequest(addr1Str, pageReq, false) res, err = queryClient.AllBalances(gocontext.Background(), request) s.Require().NoError(err) s.Require().Equal(res.Balances.Len(), 51) @@ -320,14 +328,14 @@ func (s *paginationTestSuite) TestReversePagination() { s.T().Log("verify paginate with offset and key - error") pageReq = &query.PageRequest{Key: res1.Pagination.NextKey, Offset: 100, Limit: defaultLimit, CountTotal: false} - request = types.NewQueryAllBalancesRequest(addr1, pageReq, false) + request = types.NewQueryAllBalancesRequest(addr1Str, pageReq, false) _, err = queryClient.AllBalances(gocontext.Background(), request) s.Require().Error(err) s.Require().Equal("rpc error: code = InvalidArgument desc = paginate: invalid request, either offset or key is expected, got both", err.Error()) s.T().Log("verify paginate with offset greater than total results") pageReq = &query.PageRequest{Offset: 300, Limit: defaultLimit, CountTotal: false, Reverse: true} - request = types.NewQueryAllBalancesRequest(addr1, pageReq, false) + request = types.NewQueryAllBalancesRequest(addr1Str, pageReq, false) res, err = queryClient.AllBalances(gocontext.Background(), request) s.Require().NoError(err) s.Require().LessOrEqual(res.Balances.Len(), 0) @@ -350,9 +358,13 @@ func (s *paginationTestSuite) TestPaginate() { if err != nil { // should return no error fmt.Println(err) } + + addr1Str, err := s.accountKeeper.AddressCodec().BytesToString(addr1) + s.Require().NoError(err) + // Paginate example pageReq := &query.PageRequest{Key: nil, Limit: 1, CountTotal: true} - request := types.NewQueryAllBalancesRequest(addr1, pageReq, false) + request := types.NewQueryAllBalancesRequest(addr1Str, pageReq, false) balResult := sdk.NewCoins() authStore := s.ctx.KVStore(s.app.UnsafeFindStoreKey(types.StoreKey)) balancesStore := prefix.NewStore(authStore, types.BalancesPrefix) diff --git a/types/simulation/types.go b/types/simulation/types.go index 15bcb2bef155..da9c67332f6c 100644 --- a/types/simulation/types.go +++ b/types/simulation/types.go @@ -41,7 +41,7 @@ type WeightedProposalMsg interface { MsgSimulatorFn() MsgSimulatorFn // msg simulator function } -type MsgSimulatorFn func(r *rand.Rand, ctx sdk.Context, accs []Account, cdc address.Codec) (sdk.Msg, error) +type MsgSimulatorFn func(r *rand.Rand, accs []Account, cdc address.Codec) (sdk.Msg, error) type SimValFn func(r *rand.Rand) string diff --git a/types/tx/signing/signing.pb.go b/types/tx/signing/signing.pb.go index 7503cc3a4dec..7cbf43670814 100644 --- a/types/tx/signing/signing.pb.go +++ b/types/tx/signing/signing.pb.go @@ -5,9 +5,9 @@ package signing import ( fmt "fmt" - types "github.com/cosmos/cosmos-sdk/codec/types" - types1 "github.com/cosmos/cosmos-sdk/crypto/types" + types "github.com/cosmos/cosmos-sdk/crypto/types" proto "github.com/cosmos/gogoproto/proto" + any "github.com/cosmos/gogoproto/types/any" io "io" math "math" math_bits "math/bits" @@ -152,7 +152,7 @@ func (m *SignatureDescriptors) GetSignatures() []*SignatureDescriptor { // clients. type SignatureDescriptor struct { // public_key is the public key of the signer - PublicKey *types.Any `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + PublicKey *any.Any `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` Data *SignatureDescriptor_Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // sequence is the sequence of the account, which describes the // number of committed transactions signed by a given address. It is used to prevent @@ -193,7 +193,7 @@ func (m *SignatureDescriptor) XXX_DiscardUnknown() { var xxx_messageInfo_SignatureDescriptor proto.InternalMessageInfo -func (m *SignatureDescriptor) GetPublicKey() *types.Any { +func (m *SignatureDescriptor) GetPublicKey() *any.Any { if m != nil { return m.PublicKey } @@ -361,7 +361,7 @@ func (m *SignatureDescriptor_Data_Single) GetSignature() []byte { // Multi is the signature data for a multisig public key type SignatureDescriptor_Data_Multi struct { // bitarray specifies which keys within the multisig are signing - Bitarray *types1.CompactBitArray `protobuf:"bytes,1,opt,name=bitarray,proto3" json:"bitarray,omitempty"` + Bitarray *types.CompactBitArray `protobuf:"bytes,1,opt,name=bitarray,proto3" json:"bitarray,omitempty"` // signatures is the signatures of the multi-signature Signatures []*SignatureDescriptor_Data `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty"` } @@ -399,7 +399,7 @@ func (m *SignatureDescriptor_Data_Multi) XXX_DiscardUnknown() { var xxx_messageInfo_SignatureDescriptor_Data_Multi proto.InternalMessageInfo -func (m *SignatureDescriptor_Data_Multi) GetBitarray() *types1.CompactBitArray { +func (m *SignatureDescriptor_Data_Multi) GetBitarray() *types.CompactBitArray { if m != nil { return m.Bitarray } @@ -979,7 +979,7 @@ func (m *SignatureDescriptor) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.PublicKey == nil { - m.PublicKey = &types.Any{} + m.PublicKey = &any.Any{} } if err := m.PublicKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1343,7 +1343,7 @@ func (m *SignatureDescriptor_Data_Multi) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Bitarray == nil { - m.Bitarray = &types1.CompactBitArray{} + m.Bitarray = &types.CompactBitArray{} } if err := m.Bitarray.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/types/tx/tx.pb.go b/types/tx/tx.pb.go index e76864156971..8f35592976ca 100644 --- a/types/tx/tx.pb.go +++ b/types/tx/tx.pb.go @@ -6,14 +6,14 @@ package tx import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" - types1 "github.com/cosmos/cosmos-sdk/crypto/types" + types "github.com/cosmos/cosmos-sdk/crypto/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types2 "github.com/cosmos/cosmos-sdk/types" + types1 "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" signing "github.com/cosmos/cosmos-sdk/types/tx/signing" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" + any "github.com/cosmos/gogoproto/types/any" io "io" math "math" math_bits "math/bits" @@ -255,7 +255,7 @@ type SignDocDirectAux struct { // representation in TxRaw. BodyBytes []byte `protobuf:"bytes,1,opt,name=body_bytes,json=bodyBytes,proto3" json:"body_bytes,omitempty"` // public_key is the public key of the signing account. - PublicKey *types.Any `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + PublicKey *any.Any `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` // chain_id is the identifier of the chain this transaction targets. // It prevents signed transactions from being used on another chain by an // attacker. @@ -308,7 +308,7 @@ func (m *SignDocDirectAux) GetBodyBytes() []byte { return nil } -func (m *SignDocDirectAux) GetPublicKey() *types.Any { +func (m *SignDocDirectAux) GetPublicKey() *any.Any { if m != nil { return m.PublicKey } @@ -353,7 +353,7 @@ type TxBody struct { // By convention, the first required signer (usually from the first message) // is referred to as the primary signer and pays the fee for the whole // transaction. - Messages []*types.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` + Messages []*any.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` // memo is any arbitrary note/comment to be added to the transaction. // WARNING: in clients, any publicly exposed text should not be called memo, // but should be called `note` instead (see @@ -379,11 +379,11 @@ type TxBody struct { // extension_options are arbitrary options that can be added by chains // when the default options are not sufficient. If any of these are present // and can't be handled, the transaction will be rejected - ExtensionOptions []*types.Any `protobuf:"bytes,1023,rep,name=extension_options,json=extensionOptions,proto3" json:"extension_options,omitempty"` + ExtensionOptions []*any.Any `protobuf:"bytes,1023,rep,name=extension_options,json=extensionOptions,proto3" json:"extension_options,omitempty"` // extension_options are arbitrary options that can be added by chains // when the default options are not sufficient. If any of these are present // and can't be handled, they will be ignored - NonCriticalExtensionOptions []*types.Any `protobuf:"bytes,2047,rep,name=non_critical_extension_options,json=nonCriticalExtensionOptions,proto3" json:"non_critical_extension_options,omitempty"` + NonCriticalExtensionOptions []*any.Any `protobuf:"bytes,2047,rep,name=non_critical_extension_options,json=nonCriticalExtensionOptions,proto3" json:"non_critical_extension_options,omitempty"` } func (m *TxBody) Reset() { *m = TxBody{} } @@ -419,7 +419,7 @@ func (m *TxBody) XXX_DiscardUnknown() { var xxx_messageInfo_TxBody proto.InternalMessageInfo -func (m *TxBody) GetMessages() []*types.Any { +func (m *TxBody) GetMessages() []*any.Any { if m != nil { return m.Messages } @@ -447,14 +447,14 @@ func (m *TxBody) GetUnordered() bool { return false } -func (m *TxBody) GetExtensionOptions() []*types.Any { +func (m *TxBody) GetExtensionOptions() []*any.Any { if m != nil { return m.ExtensionOptions } return nil } -func (m *TxBody) GetNonCriticalExtensionOptions() []*types.Any { +func (m *TxBody) GetNonCriticalExtensionOptions() []*any.Any { if m != nil { return m.NonCriticalExtensionOptions } @@ -544,7 +544,7 @@ type SignerInfo struct { // public_key is the public key of the signer. It is optional for accounts // that already exist in state. If unset, the verifier can use the required \ // signer address for this position and lookup the public key. - PublicKey *types.Any `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + PublicKey *any.Any `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` // mode_info describes the signing mode of the signer and is a nested // structure to support nested multisig pubkey's ModeInfo *ModeInfo `protobuf:"bytes,2,opt,name=mode_info,json=modeInfo,proto3" json:"mode_info,omitempty"` @@ -587,7 +587,7 @@ func (m *SignerInfo) XXX_DiscardUnknown() { var xxx_messageInfo_SignerInfo proto.InternalMessageInfo -func (m *SignerInfo) GetPublicKey() *types.Any { +func (m *SignerInfo) GetPublicKey() *any.Any { if m != nil { return m.PublicKey } @@ -749,7 +749,7 @@ func (m *ModeInfo_Single) GetMode() signing.SignMode { // Multi is the mode info for a multisig public key type ModeInfo_Multi struct { // bitarray specifies which keys within the multisig are signing - Bitarray *types1.CompactBitArray `protobuf:"bytes,1,opt,name=bitarray,proto3" json:"bitarray,omitempty"` + Bitarray *types.CompactBitArray `protobuf:"bytes,1,opt,name=bitarray,proto3" json:"bitarray,omitempty"` // mode_infos is the corresponding modes of the signers of the multisig // which could include nested multisig public keys ModeInfos []*ModeInfo `protobuf:"bytes,2,rep,name=mode_infos,json=modeInfos,proto3" json:"mode_infos,omitempty"` @@ -788,7 +788,7 @@ func (m *ModeInfo_Multi) XXX_DiscardUnknown() { var xxx_messageInfo_ModeInfo_Multi proto.InternalMessageInfo -func (m *ModeInfo_Multi) GetBitarray() *types1.CompactBitArray { +func (m *ModeInfo_Multi) GetBitarray() *types.CompactBitArray { if m != nil { return m.Bitarray } @@ -2746,7 +2746,7 @@ func (m *SignDocDirectAux) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.PublicKey == nil { - m.PublicKey = &types.Any{} + m.PublicKey = &any.Any{} } if err := m.PublicKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2937,7 +2937,7 @@ func (m *TxBody) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Messages = append(m.Messages, &types.Any{}) + m.Messages = append(m.Messages, &any.Any{}) if err := m.Messages[len(m.Messages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3042,7 +3042,7 @@ func (m *TxBody) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ExtensionOptions = append(m.ExtensionOptions, &types.Any{}) + m.ExtensionOptions = append(m.ExtensionOptions, &any.Any{}) if err := m.ExtensionOptions[len(m.ExtensionOptions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3076,7 +3076,7 @@ func (m *TxBody) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.NonCriticalExtensionOptions = append(m.NonCriticalExtensionOptions, &types.Any{}) + m.NonCriticalExtensionOptions = append(m.NonCriticalExtensionOptions, &any.Any{}) if err := m.NonCriticalExtensionOptions[len(m.NonCriticalExtensionOptions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3317,7 +3317,7 @@ func (m *SignerInfo) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.PublicKey == nil { - m.PublicKey = &types.Any{} + m.PublicKey = &any.Any{} } if err := m.PublicKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -3647,7 +3647,7 @@ func (m *ModeInfo_Multi) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Bitarray == nil { - m.Bitarray = &types1.CompactBitArray{} + m.Bitarray = &types.CompactBitArray{} } if err := m.Bitarray.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -3766,7 +3766,7 @@ func (m *Fee) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Amount = append(m.Amount, types2.Coin{}) + m.Amount = append(m.Amount, types1.Coin{}) if err := m.Amount[len(m.Amount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3933,7 +3933,7 @@ func (m *Tip) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Amount = append(m.Amount, types2.Coin{}) + m.Amount = append(m.Amount, types1.Coin{}) if err := m.Amount[len(m.Amount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/x/accounts/defaults/lockup/continuous_locking_account.go b/x/accounts/defaults/lockup/continuous_locking_account.go index 4380388caa55..c38a48d4ee08 100644 --- a/x/accounts/defaults/lockup/continuous_locking_account.go +++ b/x/accounts/defaults/lockup/continuous_locking_account.go @@ -8,7 +8,7 @@ import ( collcodec "cosmossdk.io/collections/codec" "cosmossdk.io/math" "cosmossdk.io/x/accounts/accountstd" - lockuptypes "cosmossdk.io/x/accounts/lockup/types" + lockuptypes "cosmossdk.io/x/accounts/defaults/lockup/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" diff --git a/x/accounts/defaults/lockup/delayed_locking_account.go b/x/accounts/defaults/lockup/delayed_locking_account.go index 8de0c9f024ef..dbc19d960081 100644 --- a/x/accounts/defaults/lockup/delayed_locking_account.go +++ b/x/accounts/defaults/lockup/delayed_locking_account.go @@ -6,7 +6,7 @@ import ( "cosmossdk.io/math" "cosmossdk.io/x/accounts/accountstd" - lockuptypes "cosmossdk.io/x/accounts/lockup/types" + lockuptypes "cosmossdk.io/x/accounts/defaults/lockup/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" diff --git a/x/accounts/defaults/lockup/go.mod b/x/accounts/defaults/lockup/go.mod index 0aa46ff0fc86..ef506e11540e 100644 --- a/x/accounts/defaults/lockup/go.mod +++ b/x/accounts/defaults/lockup/go.mod @@ -1,4 +1,4 @@ -module cosmossdk.io/x/accounts/lockup +module cosmossdk.io/x/accounts/defaults/lockup go 1.21 @@ -8,24 +8,18 @@ require ( cosmossdk.io/x/accounts v0.0.0-20240226161501-23359a0b6d91 cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91 github.com/cosmos/cosmos-sdk v0.51.0 - github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/gogoproto v1.4.12 ) require ( + buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.32.0-20240130113600-88ef6483f90f.1 // indirect + buf.build/gen/go/tendermint/tendermint/protocolbuffers/go v1.32.0-20231117195010-33ed361a9051.1 // indirect cosmossdk.io/api v0.7.3 - github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect - github.com/spf13/cobra v1.8.0 // indirect - github.com/stretchr/testify v1.9.0 // indirect - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - google.golang.org/grpc v1.62.1 // indirect - google.golang.org/protobuf v1.33.0 -) - -require ( cosmossdk.io/errors v1.0.1 cosmossdk.io/log v1.3.1 // indirect cosmossdk.io/math v1.3.0 cosmossdk.io/store v1.0.2 // indirect + cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/tx v0.13.1 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect @@ -43,7 +37,8 @@ require ( github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect - github.com/cometbft/cometbft v0.38.6 // indirect + github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 // indirect github.com/cometbft/cometbft-db v0.11.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect @@ -55,7 +50,7 @@ require ( github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect @@ -82,6 +77,7 @@ require ( github.com/gorilla/mux v1.8.1 // indirect github.com/gorilla/websocket v1.5.1 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect + github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/hashicorp/go-hclog v1.6.2 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect @@ -100,7 +96,7 @@ require ( github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -109,13 +105,13 @@ require ( github.com/mtibben/percent v0.2.1 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.0 // indirect github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.50.0 // indirect + github.com/prometheus/common v0.52.2 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect @@ -127,8 +123,10 @@ require ( github.com/sourcegraph/conc v0.3.0 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.6.0 // indirect + github.com/spf13/cobra v1.8.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/viper v1.18.2 // indirect + github.com/stretchr/testify v1.9.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tendermint/go-amino v0.16.0 // indirect @@ -139,17 +137,20 @@ require ( gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 // indirect go.etcd.io/bbolt v1.3.9 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.21.0 // indirect + golang.org/x/crypto v0.22.0 // indirect + golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.22.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.18.0 // indirect - google.golang.org/genproto v0.0.0-20240221002015-b0ce06bbee7c // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/grpc v1.63.2 // indirect + google.golang.org/protobuf v1.33.0 gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect @@ -158,17 +159,11 @@ require ( sigs.k8s.io/yaml v1.4.0 // indirect ) -require ( - buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.32.0-20240130113600-88ef6483f90f.1 // indirect - buf.build/gen/go/tendermint/tendermint/protocolbuffers/go v1.32.0-20231117195010-33ed361a9051.1 // indirect - cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 // indirect - github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect -) - replace github.com/cosmos/cosmos-sdk => ../../../../. replace ( cosmossdk.io/api => ../../../../api + cosmossdk.io/collections => ../../../../collections // TODO tag new collections ASAP cosmossdk.io/core => ../../../../core cosmossdk.io/depinject => ../../../../depinject cosmossdk.io/x/accounts => ../../. @@ -180,5 +175,4 @@ replace ( cosmossdk.io/x/protocolpool => ../../../protocolpool cosmossdk.io/x/slashing => ../../../slashing cosmossdk.io/x/staking => ../../../staking - github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.1 ) diff --git a/x/accounts/defaults/lockup/go.sum b/x/accounts/defaults/lockup/go.sum index 196fd6a9e879..debe25fe8b5d 100644 --- a/x/accounts/defaults/lockup/go.sum +++ b/x/accounts/defaults/lockup/go.sum @@ -5,8 +5,6 @@ buf.build/gen/go/tendermint/tendermint/protocolbuffers/go v1.32.0-20231117195010 buf.build/gen/go/tendermint/tendermint/protocolbuffers/go v1.32.0-20231117195010-33ed361a9051.1/go.mod h1:9KmeMJUsSG3IiIwK63Lh1ipZJrwd7KHrWZseJeHukcs= 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/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= @@ -73,8 +71,6 @@ github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOF github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/bufbuild/protocompile v0.5.1 h1:mixz5lJX4Hiz4FpqFREJHIXLfaLBntfaJv1h+/jS+Qg= github.com/bufbuild/protocompile v0.5.1/go.mod h1:G5iLmavmF4NsYtpZFvE3B/zFch2GIY8+wjsYLR/lc40= -github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= -github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= @@ -86,8 +82,6 @@ github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghf github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -116,8 +110,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.11.0 h1:M3Lscmpogx5NTbb1EGyGDaFRdsoLWrUWimFEyf7jej8= github.com/cometbft/cometbft-db v0.11.0/go.mod h1:GDPJAC/iFHNjmZZPN8V8C1yr/eyityhi2W1hz2MGKSc= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -137,8 +131,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/cosmos/iavl v1.0.1 h1:D+mYbcRO2wptYzOM1Hxl9cpmmHU1ZEt9T2Wv5nZTeUw= github.com/cosmos/iavl v1.0.1/go.mod h1:8xIUkgVvwvVrBu81scdPty+/Dx9GqwHnAvXz4cwF7RY= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= @@ -158,8 +152,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= @@ -208,12 +202,11 @@ github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4 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/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= +github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -230,17 +223,16 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= -github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= +github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= @@ -396,7 +388,6 @@ github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= @@ -409,8 +400,6 @@ github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= -github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -421,15 +410,15 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= +github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -468,7 +457,6 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -522,9 +510,8 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= @@ -565,8 +552,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= -github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -652,9 +639,6 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= @@ -668,16 +652,15 @@ github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= +github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= @@ -708,8 +691,6 @@ go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9E go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -719,11 +700,8 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= @@ -742,8 +720,6 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -768,18 +744,13 @@ golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -790,10 +761,8 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -843,33 +812,22 @@ golang.org/x/sys v0.0.0-20220315194320-039c03cc5b86/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -894,8 +852,6 @@ golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -918,12 +874,12 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20240221002015-b0ce06bbee7c h1:Zmyn5CV/jxzKnF+3d+xzbomACPwLQqVpLTpyXN5uTaQ= -google.golang.org/genproto v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= -google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c h1:9g7erC9qu44ks7UK4gDNlnk4kOxZG707xKm4jVniy6o= -google.golang.org/genproto/googleapis/api v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -941,8 +897,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -957,7 +913,6 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= @@ -1002,7 +957,6 @@ nhooyr.io/websocket v1.8.10 h1:mv4p+MnGrLDcPlBoWsvPP7XCzTYMXP9F9eIGoKbgx7Q= nhooyr.io/websocket v1.8.10/go.mod h1:rN9OFWIUwuxg4fR5tELlYC04bXYowCP9GX47ivo2l+c= pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/x/accounts/defaults/lockup/lockup.go b/x/accounts/defaults/lockup/lockup.go index d24f3ff46d80..71e7687c8428 100644 --- a/x/accounts/defaults/lockup/lockup.go +++ b/x/accounts/defaults/lockup/lockup.go @@ -6,6 +6,8 @@ import ( "fmt" "time" + "github.com/cosmos/gogoproto/proto" + "cosmossdk.io/collections" collcodec "cosmossdk.io/collections/codec" "cosmossdk.io/core/address" @@ -13,11 +15,10 @@ import ( errorsmod "cosmossdk.io/errors" "cosmossdk.io/math" "cosmossdk.io/x/accounts/accountstd" - lockuptypes "cosmossdk.io/x/accounts/lockup/types" + lockuptypes "cosmossdk.io/x/accounts/defaults/lockup/types" banktypes "cosmossdk.io/x/bank/types" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/gogoproto/proto" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -460,7 +461,7 @@ func (bva *BaseLockup) TrackUndelegation(ctx context.Context, amount sdk.Coins) func (bva BaseLockup) getBalance(ctx context.Context, sender, denom string) (*sdk.Coin, error) { // Query account balance for the sent denom - balanceQueryReq := banktypes.NewQueryBalanceRequest(sdk.AccAddress(sender), denom) + balanceQueryReq := banktypes.NewQueryBalanceRequest(sender, denom) resp, err := accountstd.QueryModule[banktypes.QueryBalanceResponse](ctx, balanceQueryReq) if err != nil { return nil, err diff --git a/x/accounts/defaults/lockup/periodic_locking_account.go b/x/accounts/defaults/lockup/periodic_locking_account.go index ae306e3b51b8..be3ce30c1539 100644 --- a/x/accounts/defaults/lockup/periodic_locking_account.go +++ b/x/accounts/defaults/lockup/periodic_locking_account.go @@ -9,7 +9,7 @@ import ( errorsmod "cosmossdk.io/errors" "cosmossdk.io/math" "cosmossdk.io/x/accounts/accountstd" - lockuptypes "cosmossdk.io/x/accounts/lockup/types" + lockuptypes "cosmossdk.io/x/accounts/defaults/lockup/types" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" @@ -17,9 +17,7 @@ import ( ) // Compile-time type assertions -var ( - _ accountstd.Interface = (*PeriodicLockingAccount)(nil) -) +var _ accountstd.Interface = (*PeriodicLockingAccount)(nil) // NewPeriodicLockingAccount creates a new PeriodicLockingAccount object. func NewPeriodicLockingAccount(d accountstd.Dependencies) (*PeriodicLockingAccount, error) { diff --git a/x/accounts/defaults/lockup/permanent_locking_account.go b/x/accounts/defaults/lockup/permanent_locking_account.go index 954139d93819..70a8b98dd1d7 100644 --- a/x/accounts/defaults/lockup/permanent_locking_account.go +++ b/x/accounts/defaults/lockup/permanent_locking_account.go @@ -6,7 +6,7 @@ import ( "cosmossdk.io/math" "cosmossdk.io/x/accounts/accountstd" - lockuptypes "cosmossdk.io/x/accounts/lockup/types" + lockuptypes "cosmossdk.io/x/accounts/defaults/lockup/types" sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/x/accounts/defaults/lockup/protov2_wrapper.go b/x/accounts/defaults/lockup/protov2_wrapper.go index 782f9e301594..caee0c60398f 100644 --- a/x/accounts/defaults/lockup/protov2_wrapper.go +++ b/x/accounts/defaults/lockup/protov2_wrapper.go @@ -1,12 +1,14 @@ package lockup import ( + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/runtime/protoiface" + bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" stakingv1beta1 "cosmossdk.io/api/cosmos/staking/v1beta1" + sdk "github.com/cosmos/cosmos-sdk/types" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/runtime/protoiface" ) type ProtoMsg = protoiface.MessageV1 diff --git a/x/accounts/defaults/lockup/types/encoding.go b/x/accounts/defaults/lockup/types/encoding.go index e4aff1f1dadd..ec41739a09c6 100644 --- a/x/accounts/defaults/lockup/types/encoding.go +++ b/x/accounts/defaults/lockup/types/encoding.go @@ -5,8 +5,9 @@ import ( "reflect" "strings" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" proto "github.com/cosmos/gogoproto/proto" + + codectypes "github.com/cosmos/cosmos-sdk/codec/types" ) func UnpackAnyRaw(m *codectypes.Any) (proto.Message, error) { diff --git a/x/accounts/defaults/lockup/types/tx.pb.go b/x/accounts/defaults/lockup/types/tx.pb.go index 6d394bd0631c..c50ab2f5c360 100644 --- a/x/accounts/defaults/lockup/types/tx.pb.go +++ b/x/accounts/defaults/lockup/types/tx.pb.go @@ -6,7 +6,6 @@ package types import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" - types1 "github.com/cosmos/cosmos-sdk/codec/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/msgservice" @@ -14,6 +13,7 @@ import ( _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + any "github.com/cosmos/gogoproto/types/any" _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" @@ -360,7 +360,7 @@ var xxx_messageInfo_MsgSend proto.InternalMessageInfo // MsgExecuteMessagesResponse defines the response for lockup execute operations type MsgExecuteMessagesResponse struct { - Responses []*types1.Any `protobuf:"bytes,1,rep,name=responses,proto3" json:"responses,omitempty"` + Responses []*any.Any `protobuf:"bytes,1,rep,name=responses,proto3" json:"responses,omitempty"` } func (m *MsgExecuteMessagesResponse) Reset() { *m = MsgExecuteMessagesResponse{} } @@ -396,7 +396,7 @@ func (m *MsgExecuteMessagesResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgExecuteMessagesResponse proto.InternalMessageInfo -func (m *MsgExecuteMessagesResponse) GetResponses() []*types1.Any { +func (m *MsgExecuteMessagesResponse) GetResponses() []*any.Any { if m != nil { return m.Responses } @@ -2102,7 +2102,7 @@ func (m *MsgExecuteMessagesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Responses = append(m.Responses, &types1.Any{}) + m.Responses = append(m.Responses, &any.Any{}) if err := m.Responses[len(m.Responses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/x/accounts/depinject.go b/x/accounts/depinject.go index bef3dd4208cf..5f322b74c0ee 100644 --- a/x/accounts/depinject.go +++ b/x/accounts/depinject.go @@ -1,8 +1,73 @@ package accounts -import "cosmossdk.io/depinject" +import ( + "context" + + modulev1 "cosmossdk.io/api/cosmos/accounts/module/v1" + signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" + "cosmossdk.io/core/address" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/depinject" + "cosmossdk.io/depinject/appconfig" + baseaccount "cosmossdk.io/x/accounts/defaults/base" + "cosmossdk.io/x/tx/signing" + + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" +) var _ depinject.OnePerModuleType = AppModule{} // IsOnePerModuleType implements the depinject.OnePerModuleType interface. func (am AppModule) IsOnePerModuleType() {} + +func init() { + appconfig.RegisterModule( + &modulev1.Module{}, + appconfig.Provide(ProvideModule), + ) +} + +type ModuleInputs struct { + depinject.In + + Cdc codec.Codec + Environment appmodule.Environment + AddressCodec address.Codec + ExecRouter MsgRouter + QueryRouter QueryRouter + Registry cdctypes.InterfaceRegistry +} + +type ModuleOutputs struct { + depinject.Out + + AccountsKeeper Keeper + Module appmodule.AppModule +} + +var _ signing.SignModeHandler = directHandler{} + +type directHandler struct{} + +func (s directHandler) Mode() signingv1beta1.SignMode { + return signingv1beta1.SignMode_SIGN_MODE_DIRECT +} + +func (s directHandler) GetSignBytes(_ context.Context, _ signing.SignerData, _ signing.TxData) ([]byte, error) { + panic("not implemented") +} + +func ProvideModule(in ModuleInputs) ModuleOutputs { + handler := directHandler{} + account := baseaccount.NewAccount("base", signing.NewHandlerMap(handler)) + accountskeeper, err := NewKeeper( + in.Cdc, in.Environment, in.AddressCodec, + in.ExecRouter, in.QueryRouter, in.Registry, account, + ) + if err != nil { + panic(err) + } + m := NewAppModule(in.Cdc, accountskeeper) + return ModuleOutputs{AccountsKeeper: accountskeeper, Module: m} +} diff --git a/x/accounts/go.mod b/x/accounts/go.mod index 6121fe4e2e33..f527b37ac5a0 100644 --- a/x/accounts/go.mod +++ b/x/accounts/go.mod @@ -10,11 +10,11 @@ require ( cosmossdk.io/log v1.3.1 cosmossdk.io/x/tx v0.13.1 github.com/cosmos/cosmos-sdk v0.51.0 - github.com/cosmos/gogoproto v1.4.11 - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 + github.com/cosmos/gogoproto v1.4.12 + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.9.0 - google.golang.org/grpc v1.62.1 + google.golang.org/grpc v1.63.2 google.golang.org/protobuf v1.33.0 ) @@ -44,7 +44,7 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.6 // indirect + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 // indirect github.com/cometbft/cometbft-db v0.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect @@ -103,7 +103,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -113,13 +113,13 @@ require ( github.com/mtibben/percent v0.2.1 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.0 // indirect github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.50.0 // indirect + github.com/prometheus/common v0.52.2 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect @@ -143,18 +143,18 @@ require ( gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 // indirect go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.21.0 // indirect + golang.org/x/crypto v0.22.0 // indirect golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.22.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.18.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect diff --git a/x/accounts/go.sum b/x/accounts/go.sum index bf644ddab1de..871db699941c 100644 --- a/x/accounts/go.sum +++ b/x/accounts/go.sum @@ -118,8 +118,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -141,8 +141,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/cosmos/iavl v1.0.0 h1:bw6t0Mv/mVCJvlMTOPHWLs5uUE3BRBfVWCRelOzl+so= github.com/cosmos/iavl v1.0.0/go.mod h1:CmTGqMnRnucjxbjduneZXT+0vPgNElYvdefjX2q9tYc= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= @@ -162,8 +162,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= @@ -449,8 +449,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -553,8 +553,8 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= @@ -595,8 +595,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= -github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -748,8 +748,8 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= @@ -797,8 +797,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -809,8 +809,8 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -865,12 +865,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -923,12 +923,12 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -946,8 +946,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/x/accounts/internal/implementation/implementation.go b/x/accounts/internal/implementation/implementation.go index cb55359d04a7..47457af718d1 100644 --- a/x/accounts/internal/implementation/implementation.go +++ b/x/accounts/internal/implementation/implementation.go @@ -30,7 +30,7 @@ type AccountCreatorFunc = func(deps Dependencies) (string, Account, error) // MakeAccountsMap creates a map of account names to account implementations // from a list of account creator functions. func MakeAccountsMap( - cdc codec.BinaryCodec, + cdc codec.Codec, addressCodec address.Codec, env appmodule.Environment, accounts []AccountCreatorFunc, diff --git a/x/accounts/keeper.go b/x/accounts/keeper.go index 6a4779499819..676130fe6437 100644 --- a/x/accounts/keeper.go +++ b/x/accounts/keeper.go @@ -8,8 +8,6 @@ import ( "errors" "fmt" - gogoproto "github.com/cosmos/gogoproto/proto" - "google.golang.org/protobuf/proto" "google.golang.org/protobuf/runtime/protoiface" "cosmossdk.io/collections" @@ -50,22 +48,15 @@ type MsgRouter interface { ResponseNameByMsgName(name string) string } -// SignerProvider defines an interface used to get the expected sender from a message. -type SignerProvider interface { - // GetMsgV1Signers returns the signers of the message. - GetMsgV1Signers(msg gogoproto.Message) ([][]byte, proto.Message, error) -} - type InterfaceRegistry interface { RegisterInterface(name string, iface any, impls ...protoiface.MessageV1) RegisterImplementations(iface any, impls ...protoiface.MessageV1) } func NewKeeper( - cdc codec.BinaryCodec, + cdc codec.Codec, env appmodule.Environment, addressCodec address.Codec, - signerProvider SignerProvider, execRouter MsgRouter, queryRouter QueryRouter, ir InterfaceRegistry, @@ -76,7 +67,7 @@ func NewKeeper( environment: env, addressCodec: addressCodec, msgRouter: execRouter, - signerProvider: signerProvider, + codec: cdc, queryRouter: queryRouter, makeSendCoinsMsg: defaultCoinsTransferMsgFunc(addressCodec), Schema: collections.Schema{}, @@ -103,8 +94,8 @@ type Keeper struct { // deps coming from the runtime environment appmodule.Environment addressCodec address.Codec - msgRouter MsgRouter // todo use env - signerProvider SignerProvider + codec codec.Codec + msgRouter MsgRouter // todo use env queryRouter QueryRouter // todo use env makeSendCoinsMsg coinsTransferMsgFunc @@ -126,6 +117,15 @@ type Keeper struct { AccountsState collections.Map[collections.Pair[uint64, []byte], []byte] } +// IsAccountsModuleAccount check if an address belong to a smart account. +func (k Keeper) IsAccountsModuleAccount( + ctx context.Context, + accountAddr []byte, +) bool { + hasAcc, _ := k.AccountByNumber.Has(ctx, accountAddr) + return hasAcc +} + // Init creates a new account of the given type. func (k Keeper) Init( ctx context.Context, @@ -293,7 +293,7 @@ func (k Keeper) makeAccountContext(ctx context.Context, accountNumber uint64, ac sender, funds, k.sendModuleMessage, - k.sendModuleMessageUntyped, + k.SendModuleMessageUntyped, k.queryModule, ) } @@ -327,7 +327,7 @@ func (k Keeper) sendAnyMessages(ctx context.Context, sender []byte, anyMessages if err != nil { return nil, err } - resp, err := k.sendModuleMessageUntyped(ctx, sender, msg) + resp, err := k.SendModuleMessageUntyped(ctx, sender, msg) if err != nil { return nil, fmt.Errorf("failed to execute message %d: %s", i, err.Error()) } @@ -340,9 +340,9 @@ func (k Keeper) sendAnyMessages(ctx context.Context, sender []byte, anyMessages return anyResponses, nil } -// sendModuleMessageUntyped can be used to send a message towards a module. +// SendModuleMessageUntyped can be used to send a message towards a module. // It should be used when the response type is not known by the caller. -func (k Keeper) sendModuleMessageUntyped(ctx context.Context, sender []byte, msg implementation.ProtoMsg) (implementation.ProtoMsg, error) { +func (k Keeper) SendModuleMessageUntyped(ctx context.Context, sender []byte, msg implementation.ProtoMsg) (implementation.ProtoMsg, error) { // we need to fetch the response type from the request message type. // this is because the response type is not known. respName := k.msgRouter.ResponseNameByMsgName(implementation.MessageName(msg)) @@ -363,7 +363,7 @@ func (k Keeper) sendModuleMessageUntyped(ctx context.Context, sender []byte, msg // is not trying to impersonate another account. func (k Keeper) sendModuleMessage(ctx context.Context, sender []byte, msg, msgResp implementation.ProtoMsg) error { // do sender assertions. - wantSenders, _, err := k.signerProvider.GetMsgV1Signers(msg) + wantSenders, _, err := k.codec.GetMsgV1Signers(msg) if err != nil { return fmt.Errorf("cannot get signers: %w", err) } diff --git a/x/accounts/keeper_test.go b/x/accounts/keeper_test.go index be02ccb27502..27642680ae8f 100644 --- a/x/accounts/keeper_test.go +++ b/x/accounts/keeper_test.go @@ -80,14 +80,18 @@ func TestKeeper_Execute(t *testing.T) { return nil }) - m.signerProvider = mockSigner(func(msg implementation.ProtoMsg) ([]byte, error) { - require.Equal(t, msg.(*bankv1beta1.MsgSend).FromAddress, string(accAddr)) - return accAddr, nil - }) + m.msgRouter = mockExec(func(ctx context.Context, msg, msgResp implementation.ProtoMsg) error { + concrete, ok := msg.(*bankv1beta1.MsgSend) + require.True(t, ok) + require.Equal(t, concrete.FromAddress, string(accAddr)) + _, ok = msgResp.(*bankv1beta1.MsgSendResponse) + require.True(t, ok) - resp, err := m.Execute(ctx, accAddr, sender, &types.Int64Value{Value: 1000}, nil) - require.NoError(t, err) - require.True(t, implementation.Equal(&types.Empty{}, resp)) + resp, err := m.Execute(ctx, accAddr, sender, &types.Int64Value{Value: 1000}, nil) + require.NoError(t, err) + require.True(t, implementation.Equal(&types.Empty{}, resp)) + return nil + }) }) } diff --git a/x/accounts/proto/buf.gen.gogo.yaml b/x/accounts/proto/buf.gen.gogo.yaml index 9c8ba0a4b1fd..db36231d0c82 100644 --- a/x/accounts/proto/buf.gen.gogo.yaml +++ b/x/accounts/proto/buf.gen.gogo.yaml @@ -2,7 +2,7 @@ version: v1 plugins: - name: gocosmos out: .. - opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any - name: grpc-gateway out: .. opt: logtostderr=true,allow_colon_final_segments=true diff --git a/x/accounts/utils_test.go b/x/accounts/utils_test.go index 0fec9839686d..d9966acd7a0d 100644 --- a/x/accounts/utils_test.go +++ b/x/accounts/utils_test.go @@ -4,9 +4,7 @@ import ( "context" "testing" - gogoproto "github.com/cosmos/gogoproto/proto" "github.com/stretchr/testify/require" - "google.golang.org/protobuf/proto" "google.golang.org/protobuf/runtime/protoiface" "cosmossdk.io/collections/colltest" @@ -48,7 +46,7 @@ func newKeeper(t *testing.T, accounts ...implementation.AccountCreatorFunc) (Kee ss, ctx := colltest.MockStore() env := runtime.NewEnvironment(ss, log.NewNopLogger()) env.EventService = eventService{} - m, err := NewKeeper(nil, env, addressCodec{}, nil, nil, nil, interfaceRegistry{}, accounts...) + m, err := NewKeeper(nil, env, addressCodec{}, nil, nil, interfaceRegistry{}, accounts...) require.NoError(t, err) return m, ctx } @@ -63,18 +61,6 @@ func (m mockQuery) HybridHandlerByRequestName(_ string) []func(ctx context.Conte }} } -var _ SignerProvider = (*mockSigner)(nil) - -type mockSigner func(msg implementation.ProtoMsg) ([]byte, error) - -func (m mockSigner) GetMsgV1Signers(msg gogoproto.Message) ([][]byte, proto.Message, error) { - s, err := m(msg) - if err != nil { - return nil, nil, err - } - return [][]byte{s}, nil, nil -} - var _ MsgRouter = (*mockExec)(nil) type mockExec func(ctx context.Context, msg, msgResp implementation.ProtoMsg) error diff --git a/x/accounts/v1/query.pb.go b/x/accounts/v1/query.pb.go index 0beb657ff633..0e734500c33d 100644 --- a/x/accounts/v1/query.pb.go +++ b/x/accounts/v1/query.pb.go @@ -6,9 +6,9 @@ package v1 import ( context "context" fmt "fmt" - types "github.com/cosmos/cosmos-sdk/codec/types" 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" @@ -33,7 +33,7 @@ type AccountQueryRequest struct { // target defines the account to be queried. Target string `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` // request defines the query message being sent to the account. - Request *types.Any `protobuf:"bytes,2,opt,name=request,proto3" json:"request,omitempty"` + Request *any.Any `protobuf:"bytes,2,opt,name=request,proto3" json:"request,omitempty"` } func (m *AccountQueryRequest) Reset() { *m = AccountQueryRequest{} } @@ -76,7 +76,7 @@ func (m *AccountQueryRequest) GetTarget() string { return "" } -func (m *AccountQueryRequest) GetRequest() *types.Any { +func (m *AccountQueryRequest) GetRequest() *any.Any { if m != nil { return m.Request } @@ -86,7 +86,7 @@ func (m *AccountQueryRequest) GetRequest() *types.Any { // AccountQueryResponse is the response type for the Query/AccountQuery RPC method. type AccountQueryResponse struct { // response defines the query response of the account. - Response *types.Any `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` + Response *any.Any `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` } func (m *AccountQueryResponse) Reset() { *m = AccountQueryResponse{} } @@ -122,7 +122,7 @@ func (m *AccountQueryResponse) XXX_DiscardUnknown() { var xxx_messageInfo_AccountQueryResponse proto.InternalMessageInfo -func (m *AccountQueryResponse) GetResponse() *types.Any { +func (m *AccountQueryResponse) GetResponse() *any.Any { if m != nil { return m.Response } @@ -1296,7 +1296,7 @@ func (m *AccountQueryRequest) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Request == nil { - m.Request = &types.Any{} + m.Request = &any.Any{} } if err := m.Request.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1382,7 +1382,7 @@ func (m *AccountQueryResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Response == nil { - m.Response = &types.Any{} + m.Response = &any.Any{} } if err := m.Response.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/x/accounts/v1/tx.pb.go b/x/accounts/v1/tx.pb.go index 3a890f035698..e1eca4cc4770 100644 --- a/x/accounts/v1/tx.pb.go +++ b/x/accounts/v1/tx.pb.go @@ -6,14 +6,14 @@ package v1 import ( context "context" fmt "fmt" - types "github.com/cosmos/cosmos-sdk/codec/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types1 "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/msgservice" tx "github.com/cosmos/cosmos-sdk/types/tx" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" + any "github.com/cosmos/gogoproto/types/any" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -40,7 +40,7 @@ type MsgInit struct { // account_type is the type of the account to be created. AccountType string `protobuf:"bytes,2,opt,name=account_type,json=accountType,proto3" json:"account_type,omitempty"` // message is the message to be sent to the account. - Message *types.Any `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` + Message *any.Any `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` // funds contains the coins that the account wants to // send alongside the request. Funds github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,4,rep,name=funds,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"funds"` @@ -93,7 +93,7 @@ func (m *MsgInit) GetAccountType() string { return "" } -func (m *MsgInit) GetMessage() *types.Any { +func (m *MsgInit) GetMessage() *any.Any { if m != nil { return m.Message } @@ -112,7 +112,7 @@ type MsgInitResponse struct { // account_address is the address of the newly created account. AccountAddress string `protobuf:"bytes,1,opt,name=account_address,json=accountAddress,proto3" json:"account_address,omitempty"` // response is the response returned by the account implementation. - Response *types.Any `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"` + Response *any.Any `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"` } func (m *MsgInitResponse) Reset() { *m = MsgInitResponse{} } @@ -155,7 +155,7 @@ func (m *MsgInitResponse) GetAccountAddress() string { return "" } -func (m *MsgInitResponse) GetResponse() *types.Any { +func (m *MsgInitResponse) GetResponse() *any.Any { if m != nil { return m.Response } @@ -169,7 +169,7 @@ type MsgExecute struct { // target is the address of the account to be executed. Target string `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"` // message is the message to be sent to the account. - Message *types.Any `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` + Message *any.Any `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` // funds contains the coins that the account wants to // send alongside the request. Funds github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,4,rep,name=funds,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"funds"` @@ -222,7 +222,7 @@ func (m *MsgExecute) GetTarget() string { return "" } -func (m *MsgExecute) GetMessage() *types.Any { +func (m *MsgExecute) GetMessage() *any.Any { if m != nil { return m.Message } @@ -239,7 +239,7 @@ func (m *MsgExecute) GetFunds() github_com_cosmos_cosmos_sdk_types.Coins { // MsgExecuteResponse defines the Execute response type for the Msg/Execute RPC method. type MsgExecuteResponse struct { // response is the response returned by the account implementation. - Response *types.Any `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` + Response *any.Any `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` } func (m *MsgExecuteResponse) Reset() { *m = MsgExecuteResponse{} } @@ -275,7 +275,7 @@ func (m *MsgExecuteResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgExecuteResponse proto.InternalMessageInfo -func (m *MsgExecuteResponse) GetResponse() *types.Any { +func (m *MsgExecuteResponse) GetResponse() *any.Any { if m != nil { return m.Response } @@ -340,8 +340,8 @@ func (m *MsgExecuteBundle) GetTxs() []*tx.TxRaw { // BundledTxResponse defines the response of a bundled tx. type BundledTxResponse struct { - ExecResponses *types.Any `protobuf:"bytes,1,opt,name=exec_responses,json=execResponses,proto3" json:"exec_responses,omitempty"` - Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` + ExecResponses *any.Any `protobuf:"bytes,1,opt,name=exec_responses,json=execResponses,proto3" json:"exec_responses,omitempty"` + Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` } func (m *BundledTxResponse) Reset() { *m = BundledTxResponse{} } @@ -377,7 +377,7 @@ func (m *BundledTxResponse) XXX_DiscardUnknown() { var xxx_messageInfo_BundledTxResponse proto.InternalMessageInfo -func (m *BundledTxResponse) GetExecResponses() *types.Any { +func (m *BundledTxResponse) GetExecResponses() *any.Any { if m != nil { return m.ExecResponses } @@ -1253,7 +1253,7 @@ func (m *MsgInit) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Message == nil { - m.Message = &types.Any{} + m.Message = &any.Any{} } if err := m.Message.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1288,7 +1288,7 @@ func (m *MsgInit) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Funds = append(m.Funds, types1.Coin{}) + m.Funds = append(m.Funds, types.Coin{}) if err := m.Funds[len(m.Funds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -1405,7 +1405,7 @@ func (m *MsgInitResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Response == nil { - m.Response = &types.Any{} + m.Response = &any.Any{} } if err := m.Response.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1555,7 +1555,7 @@ func (m *MsgExecute) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Message == nil { - m.Message = &types.Any{} + m.Message = &any.Any{} } if err := m.Message.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1590,7 +1590,7 @@ func (m *MsgExecute) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Funds = append(m.Funds, types1.Coin{}) + m.Funds = append(m.Funds, types.Coin{}) if err := m.Funds[len(m.Funds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -1675,7 +1675,7 @@ func (m *MsgExecuteResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Response == nil { - m.Response = &types.Any{} + m.Response = &any.Any{} } if err := m.Response.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1877,7 +1877,7 @@ func (m *BundledTxResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.ExecResponses == nil { - m.ExecResponses = &types.Any{} + m.ExecResponses = &any.Any{} } if err := m.ExecResponses.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/x/auth/CHANGELOG.md b/x/auth/CHANGELOG.md index 585075a9d39e..1e8fa2a5bdf4 100644 --- a/x/auth/CHANGELOG.md +++ b/x/auth/CHANGELOG.md @@ -33,6 +33,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements +* [#19967](https://github.com/cosmos/cosmos-sdk/pull/19967) Refactor ante handlers to use `transaction.Service` for getting exec mode. * [#18780](https://github.com/cosmos/cosmos-sdk/pull/18780) Move sig verification out of the for loop, into the authenticate method. * [#19188](https://github.com/cosmos/cosmos-sdk/pull/19188) Remove creation of `BaseAccount` when sending a message to an account that does not exist. * When signing a transaction with an account that has not been created accountnumber 0 must be used diff --git a/x/auth/ante/ante.go b/x/auth/ante/ante.go index 657489a0c545..c3e68b92af59 100644 --- a/x/auth/ante/ante.go +++ b/x/auth/ante/ante.go @@ -42,7 +42,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { anteDecorators := []sdk.AnteDecorator{ NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first NewExtensionOptionsDecorator(options.ExtensionOptionChecker), - NewValidateBasicDecorator(), + NewValidateBasicDecorator(options.AccountKeeper.Environment()), NewTxTimeoutHeightDecorator(), NewValidateMemoDecorator(options.AccountKeeper), NewConsumeGasForTxSizeDecorator(options.AccountKeeper), diff --git a/x/auth/ante/basic.go b/x/auth/ante/basic.go index 59e9eca61ee1..37994cad1ec7 100644 --- a/x/auth/ante/basic.go +++ b/x/auth/ante/basic.go @@ -1,6 +1,8 @@ package ante import ( + "cosmossdk.io/core/appmodule/v2" + "cosmossdk.io/core/transaction" errorsmod "cosmossdk.io/errors" storetypes "cosmossdk.io/store/types" "cosmossdk.io/x/auth/migrations/legacytx" @@ -18,15 +20,20 @@ import ( // If ValidateBasic passes, decorator calls next AnteHandler in chain. Note, // ValidateBasicDecorator decorator will not get executed on ReCheckTx since it // is not dependent on application state. -type ValidateBasicDecorator struct{} +type ValidateBasicDecorator struct { + env appmodule.Environment +} -func NewValidateBasicDecorator() ValidateBasicDecorator { - return ValidateBasicDecorator{} +func NewValidateBasicDecorator(env appmodule.Environment) ValidateBasicDecorator { + return ValidateBasicDecorator{ + env: env, + } } func (vbd ValidateBasicDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, _ bool, next sdk.AnteHandler) (sdk.Context, error) { // no need to validate basic on recheck tx, call next antehandler - if ctx.ExecMode() == sdk.ExecModeReCheck { + txService := vbd.env.TransactionService + if txService.ExecMode(ctx) == transaction.ExecModeReCheck { return next(ctx, tx, false) } @@ -36,7 +43,7 @@ func (vbd ValidateBasicDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, _ bool, } } - return next(ctx, tx, ctx.ExecMode() == sdk.ExecModeSimulate) + return next(ctx, tx, false) } // ValidateMemoDecorator will validate memo given the parameters passed in @@ -69,7 +76,7 @@ func (vmd ValidateMemoDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, _ bool, } } - return next(ctx, tx, ctx.ExecMode() == sdk.ExecModeSimulate) + return next(ctx, tx, false) } // ConsumeTxSizeGasDecorator will take in parameters and consume gas proportional @@ -101,7 +108,8 @@ func (cgts ConsumeTxSizeGasDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, _ b ctx.GasMeter().ConsumeGas(params.TxSizeCostPerByte*storetypes.Gas(len(ctx.TxBytes())), "txSize") // simulate gas cost for signatures in simulate mode - if ctx.ExecMode() == sdk.ExecModeSimulate { + txService := cgts.ak.Environment().TransactionService + if txService.ExecMode(ctx) == transaction.ExecModeSimulate { // in simulate mode, each element should be a nil signature sigs, err := sigTx.GetSignaturesV2() if err != nil { @@ -143,7 +151,7 @@ func (cgts ConsumeTxSizeGasDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, _ b } } - return next(ctx, tx, ctx.ExecMode() == sdk.ExecModeSimulate) + return next(ctx, tx, false) } // isIncompleteSignature tests whether SignatureData is fully filled in for simulation purposes @@ -206,5 +214,5 @@ func (txh TxTimeoutHeightDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, _ boo ) } - return next(ctx, tx, ctx.ExecMode() == sdk.ExecModeSimulate) + return next(ctx, tx, false) } diff --git a/x/auth/ante/basic_test.go b/x/auth/ante/basic_test.go index 21d69d866b44..7546d59e7d62 100644 --- a/x/auth/ante/basic_test.go +++ b/x/auth/ante/basic_test.go @@ -36,7 +36,7 @@ func TestValidateBasic(t *testing.T) { invalidTx, err := suite.CreateTestTx(suite.ctx, privs, accNums, accSeqs, suite.ctx.ChainID(), signing.SignMode_SIGN_MODE_DIRECT) require.NoError(t, err) - vbd := ante.NewValidateBasicDecorator() + vbd := ante.NewValidateBasicDecorator(suite.accountKeeper.Environment()) antehandler := sdk.ChainAnteDecorators(vbd) _, err = antehandler(suite.ctx, invalidTx, false) diff --git a/x/auth/ante/expected_keepers.go b/x/auth/ante/expected_keepers.go index c33dcaa685d3..52bf0acc31f3 100644 --- a/x/auth/ante/expected_keepers.go +++ b/x/auth/ante/expected_keepers.go @@ -4,11 +4,16 @@ import ( "context" "cosmossdk.io/core/address" + "cosmossdk.io/core/appmodule" "cosmossdk.io/x/auth/types" sdk "github.com/cosmos/cosmos-sdk/types" ) +type HasEnvironment interface { + Environment() appmodule.Environment +} + // AccountKeeper defines the contract needed for AccountKeeper related APIs. // Interface provides support to use non-sdk AccountKeeper for AnteHandler's decorators. type AccountKeeper interface { @@ -16,8 +21,9 @@ type AccountKeeper interface { GetAccount(ctx context.Context, addr sdk.AccAddress) sdk.AccountI SetAccount(ctx context.Context, acc sdk.AccountI) GetModuleAddress(moduleName string) sdk.AccAddress - AddressCodec() address.Codec NewAccountWithAddress(ctx context.Context, addr sdk.AccAddress) sdk.AccountI + AddressCodec() address.Codec + Environment() appmodule.Environment } // FeegrantKeeper defines the expected feegrant keeper. diff --git a/x/auth/ante/export_test.go b/x/auth/ante/export_test.go new file mode 100644 index 000000000000..ad990a30d210 --- /dev/null +++ b/x/auth/ante/export_test.go @@ -0,0 +1,12 @@ +package ante + +import ( + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var SimSecp256k1PubkeyInternal = simSecp256k1Pubkey + +func SetSVDPubKey(svd SigVerificationDecorator, ctx sdk.Context, acc sdk.AccountI, txPubKey cryptotypes.PubKey) error { + return svd.setPubKey(ctx, acc, txPubKey) +} diff --git a/x/auth/ante/ext.go b/x/auth/ante/ext.go index 92fefff3afff..b87a2b8b4f74 100644 --- a/x/auth/ante/ext.go +++ b/x/auth/ante/ext.go @@ -49,7 +49,7 @@ func (r RejectExtensionOptionsDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, return ctx, err } - return next(ctx, tx, ctx.ExecMode() == sdk.ExecModeSimulate) + return next(ctx, tx, false) } func checkExtOpts(tx sdk.Tx, checker ExtensionOptionChecker) error { diff --git a/x/auth/ante/fee.go b/x/auth/ante/fee.go index 018b447c97e3..cf3e54a5b272 100644 --- a/x/auth/ante/fee.go +++ b/x/auth/ante/fee.go @@ -4,6 +4,7 @@ import ( "bytes" "fmt" + "cosmossdk.io/core/transaction" errorsmod "cosmossdk.io/errors" "cosmossdk.io/x/auth/types" @@ -45,7 +46,9 @@ func (dfd DeductFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, _ bool, nex return ctx, errorsmod.Wrap(sdkerrors.ErrTxDecode, "Tx must be a FeeTx") } - if ctx.ExecMode() != sdk.ExecModeSimulate && ctx.BlockHeight() > 0 && feeTx.GetGas() == 0 { + txService := dfd.accountKeeper.Environment().TransactionService + execMode := txService.ExecMode(ctx) + if execMode != transaction.ExecModeSimulate && ctx.BlockHeight() > 0 && feeTx.GetGas() == 0 { return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidGasLimit, "must provide positive gas") } @@ -55,7 +58,7 @@ func (dfd DeductFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, _ bool, nex ) fee := feeTx.GetFee() - if ctx.ExecMode() != sdk.ExecModeSimulate { + if execMode != transaction.ExecModeSimulate { fee, priority, err = dfd.txFeeChecker(ctx, tx) if err != nil { return ctx, err @@ -67,7 +70,7 @@ func (dfd DeductFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, _ bool, nex newCtx := ctx.WithPriority(priority) - return next(newCtx, tx, ctx.ExecMode() == sdk.ExecModeSimulate) + return next(newCtx, tx, false) } func (dfd DeductFeeDecorator) checkDeductFee(ctx sdk.Context, sdkTx sdk.Tx, fee sdk.Coins) error { diff --git a/x/auth/ante/setup.go b/x/auth/ante/setup.go index 6ab8fcd4c1d2..66e69fb7b8bf 100644 --- a/x/auth/ante/setup.go +++ b/x/auth/ante/setup.go @@ -67,14 +67,14 @@ func (sud SetUpContextDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, _ bool, } }() - return next(newCtx, tx, ctx.ExecMode() == sdk.ExecModeSimulate) + return next(newCtx, tx, false) } // SetGasMeter returns a new context with a gas meter set from a given context. func SetGasMeter(ctx sdk.Context, gasLimit uint64) sdk.Context { // In various cases such as simulation and during the genesis block, we do not // meter any gas utilization. - if ctx.ExecMode() == sdk.ExecModeSimulate || ctx.BlockHeight() == 0 { + if ctx.ExecMode() == sdk.ExecModeSimulate || ctx.BlockHeight() == 0 { // NOTE: using environment here breaks the API of SetGasMeter, an alternative must be found for server/v2. ref: https://github.com/cosmos/cosmos-sdk/issues/19640 return ctx.WithGasMeter(storetypes.NewInfiniteGasMeter()) } diff --git a/x/auth/ante/sigverify.go b/x/auth/ante/sigverify.go index facc160fcee3..9db1433c0d02 100644 --- a/x/auth/ante/sigverify.go +++ b/x/auth/ante/sigverify.go @@ -10,6 +10,7 @@ import ( secp256k1dcrd "github.com/decred/dcrd/dcrec/secp256k1/v4" "google.golang.org/protobuf/types/known/anypb" + "cosmossdk.io/core/transaction" errorsmod "cosmossdk.io/errors" storetypes "cosmossdk.io/store/types" aa_interface_v1 "cosmossdk.io/x/accounts/interfaces/account_abstraction/v1" @@ -215,7 +216,7 @@ func (svd SigVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, _ boo ctx.EventManager().EmitEvents(events) - return next(ctx, tx, ctx.ExecMode() == sdk.ExecModeSimulate) + return next(ctx, tx, false) } // authenticate the authentication of the TX for a specific tx signer. @@ -280,7 +281,7 @@ func (svd SigVerificationDecorator) consumeSignatureGas( pubKey cryptotypes.PubKey, signature signing.SignatureV2, ) error { - if ctx.ExecMode() == sdk.ExecModeSimulate && pubKey == nil { + if svd.ak.Environment().TransactionService.ExecMode(ctx) == transaction.ExecModeSimulate && pubKey == nil { pubKey = simSecp256k1Pubkey } @@ -310,7 +311,7 @@ func (svd SigVerificationDecorator) verifySig(ctx sdk.Context, tx sdk.Tx, acc sd // we're in simulation mode, or in ReCheckTx, or context is not // on sig verify tx, then we do not need to verify the signatures // in the tx. - if ctx.ExecMode() == sdk.ExecModeSimulate || ctx.IsReCheckTx() || !ctx.IsSigverifyTx() { + if svd.ak.Environment().TransactionService.ExecMode(ctx) == transaction.ExecModeSimulate || ctx.IsReCheckTx() || !ctx.IsSigverifyTx() { return nil } @@ -384,7 +385,7 @@ func (svd SigVerificationDecorator) setPubKey(ctx sdk.Context, acc sdk.AccountI, if txPubKey == nil { // if we're not in simulation mode, and we do not have a valid pubkey // for this signer, then we simply error. - if ctx.ExecMode() != sdk.ExecModeSimulate { + if svd.ak.Environment().TransactionService.ExecMode(ctx) != transaction.ExecModeSimulate { return fmt.Errorf("the account %s is without a pubkey and did not provide a pubkey in the tx to set it", acc.GetAddress().String()) } // if we're in simulation mode, then we can populate the pubkey with the @@ -479,7 +480,7 @@ func (vscd ValidateSigCountDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, _ b } } - return next(ctx, tx, ctx.ExecMode() == sdk.ExecModeSimulate) + return next(ctx, tx, false) } // DefaultSigVerificationGasConsumer is the default implementation of SignatureVerificationGasConsumer. It consumes gas diff --git a/x/auth/ante/sigverify_internal_test.go b/x/auth/ante/sigverify_internal_test.go index 3408b82f2634..47be009d798a 100644 --- a/x/auth/ante/sigverify_internal_test.go +++ b/x/auth/ante/sigverify_internal_test.go @@ -1,10 +1,14 @@ -package ante +package ante_test import ( + "context" "testing" "github.com/stretchr/testify/require" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/transaction" + "cosmossdk.io/x/auth/ante" authcodec "cosmossdk.io/x/auth/codec" authtypes "cosmossdk.io/x/auth/types" @@ -12,8 +16,26 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) +type mockAccount struct { + ante.AccountKeeper +} + +func (*mockAccount) Environment() appmodule.Environment { + return appmodule.Environment{ + TransactionService: &mockTransactionService{}, + } +} + +type mockTransactionService struct { + transaction.Service +} + +func (*mockTransactionService) ExecMode(ctx context.Context) transaction.ExecMode { + return transaction.ExecMode(sdk.UnwrapSDKContext(ctx).ExecMode()) +} + func TestSigVerify_setPubKey(t *testing.T) { - svd := SigVerificationDecorator{} + svd := ante.NewSigVerificationDecorator(&mockAccount{}, nil, nil, nil) alicePk := secp256k1.GenPrivKey().PubKey() bobPk := secp256k1.GenPrivKey().PubKey() @@ -28,22 +50,22 @@ func TestSigVerify_setPubKey(t *testing.T) { t.Run("on not sig verify tx - skip", func(t *testing.T) { acc := &authtypes.BaseAccount{} ctx = ctx.WithExecMode(sdk.ExecModeSimulate).WithIsSigverifyTx(false) - err := svd.setPubKey(ctx, acc, nil) + err := ante.SetSVDPubKey(svd, ctx, acc, nil) require.NoError(t, err) }) t.Run("on sim, populate with sim key, if pubkey is nil", func(t *testing.T) { acc := &authtypes.BaseAccount{Address: aliceAddr} ctx = ctx.WithExecMode(sdk.ExecModeSimulate).WithIsSigverifyTx(true) - err := svd.setPubKey(ctx, acc, nil) + err := ante.SetSVDPubKey(svd, ctx, acc, nil) require.NoError(t, err) - require.Equal(t, acc.PubKey.GetCachedValue(), simSecp256k1Pubkey) + require.Equal(t, acc.PubKey.GetCachedValue(), ante.SimSecp256k1PubkeyInternal) }) t.Run("on sim, populate with real pub key, if pubkey is not nil", func(t *testing.T) { acc := &authtypes.BaseAccount{Address: aliceAddr} ctx = ctx.WithExecMode(sdk.ExecModeSimulate).WithIsSigverifyTx(true) - err := svd.setPubKey(ctx, acc, alicePk) + err := ante.SetSVDPubKey(svd, ctx, acc, alicePk) require.NoError(t, err) require.Equal(t, acc.PubKey.GetCachedValue(), alicePk) }) @@ -51,7 +73,7 @@ func TestSigVerify_setPubKey(t *testing.T) { t.Run("not on sim, populate the address", func(t *testing.T) { acc := &authtypes.BaseAccount{Address: aliceAddr} ctx = ctx.WithExecMode(sdk.ExecModeFinalize).WithIsSigverifyTx(true) - err := svd.setPubKey(ctx, acc, alicePk) + err := ante.SetSVDPubKey(svd, ctx, acc, alicePk) require.NoError(t, err) require.Equal(t, acc.PubKey.GetCachedValue(), alicePk) }) @@ -59,7 +81,7 @@ func TestSigVerify_setPubKey(t *testing.T) { t.Run("not on sim, fail on invalid pubkey.address", func(t *testing.T) { acc := &authtypes.BaseAccount{Address: aliceAddr} ctx = ctx.WithExecMode(sdk.ExecModeFinalize).WithIsSigverifyTx(true) - err := svd.setPubKey(ctx, acc, bobPk) + err := ante.SetSVDPubKey(svd, ctx, acc, bobPk) require.ErrorContains(t, err, "cannot be claimed") }) } diff --git a/x/auth/ante/testutil/expected_keepers_mocks.go b/x/auth/ante/testutil/expected_keepers_mocks.go index 091ae6477359..ebe73dfecac7 100644 --- a/x/auth/ante/testutil/expected_keepers_mocks.go +++ b/x/auth/ante/testutil/expected_keepers_mocks.go @@ -9,11 +9,49 @@ import ( reflect "reflect" address "cosmossdk.io/core/address" + appmodule "cosmossdk.io/core/appmodule" types "cosmossdk.io/x/auth/types" types0 "github.com/cosmos/cosmos-sdk/types" gomock "github.com/golang/mock/gomock" ) +// MockHasEnvironment is a mock of HasEnvironment interface. +type MockHasEnvironment struct { + ctrl *gomock.Controller + recorder *MockHasEnvironmentMockRecorder +} + +// MockHasEnvironmentMockRecorder is the mock recorder for MockHasEnvironment. +type MockHasEnvironmentMockRecorder struct { + mock *MockHasEnvironment +} + +// NewMockHasEnvironment creates a new mock instance. +func NewMockHasEnvironment(ctrl *gomock.Controller) *MockHasEnvironment { + mock := &MockHasEnvironment{ctrl: ctrl} + mock.recorder = &MockHasEnvironmentMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockHasEnvironment) EXPECT() *MockHasEnvironmentMockRecorder { + return m.recorder +} + +// Environment mocks base method. +func (m *MockHasEnvironment) Environment() appmodule.Environment { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Environment") + ret0, _ := ret[0].(appmodule.Environment) + return ret0 +} + +// Environment indicates an expected call of Environment. +func (mr *MockHasEnvironmentMockRecorder) Environment() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Environment", reflect.TypeOf((*MockHasEnvironment)(nil).Environment)) +} + // MockAccountKeeper is a mock of AccountKeeper interface. type MockAccountKeeper struct { ctrl *gomock.Controller @@ -51,6 +89,20 @@ func (mr *MockAccountKeeperMockRecorder) AddressCodec() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddressCodec", reflect.TypeOf((*MockAccountKeeper)(nil).AddressCodec)) } +// Environment mocks base method. +func (m *MockAccountKeeper) Environment() appmodule.Environment { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Environment") + ret0, _ := ret[0].(appmodule.Environment) + return ret0 +} + +// Environment indicates an expected call of Environment. +func (mr *MockAccountKeeperMockRecorder) Environment() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Environment", reflect.TypeOf((*MockAccountKeeper)(nil).Environment)) +} + // GetAccount mocks base method. func (m *MockAccountKeeper) GetAccount(ctx context.Context, addr types0.AccAddress) types0.AccountI { m.ctrl.T.Helper() diff --git a/x/auth/ante/testutil_test.go b/x/auth/ante/testutil_test.go index 1814e94f2b29..d002ecb77049 100644 --- a/x/auth/ante/testutil_test.go +++ b/x/auth/ante/testutil_test.go @@ -51,6 +51,7 @@ type AnteTestSuite struct { txBuilder client.TxBuilder accountKeeper keeper.AccountKeeper bankKeeper *authtestutil.MockBankKeeper + acctsModKeeper *authtestutil.MockAccountsModKeeper txBankKeeper *txtestutil.MockBankKeeper feeGrantKeeper *antetestutil.MockFeegrantKeeper encCfg moduletestutil.TestEncodingConfig @@ -60,10 +61,12 @@ type AnteTestSuite struct { func SetupTestSuite(t *testing.T, isCheckTx bool) *AnteTestSuite { t.Helper() suite := &AnteTestSuite{} + // gomock initializations ctrl := gomock.NewController(t) suite.bankKeeper = authtestutil.NewMockBankKeeper(ctrl) suite.txBankKeeper = txtestutil.NewMockBankKeeper(ctrl) suite.feeGrantKeeper = antetestutil.NewMockFeegrantKeeper(ctrl) + suite.acctsModKeeper = authtestutil.NewMockAccountsModKeeper(ctrl) key := storetypes.NewKVStoreKey(types.StoreKey) testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) @@ -80,7 +83,7 @@ func SetupTestSuite(t *testing.T, isCheckTx bool) *AnteTestSuite { } suite.accountKeeper = keeper.NewAccountKeeper( - runtime.NewEnvironment(runtime.NewKVStoreService(key), log.NewNopLogger()), suite.encCfg.Codec, types.ProtoBaseAccount, maccPerms, authcodec.NewBech32Codec("cosmos"), + runtime.NewEnvironment(runtime.NewKVStoreService(key), log.NewNopLogger()), suite.encCfg.Codec, types.ProtoBaseAccount, suite.acctsModKeeper, maccPerms, authcodec.NewBech32Codec("cosmos"), sdk.Bech32MainPrefix, types.NewModuleAddress("gov").String(), ) suite.accountKeeper.GetModuleAccount(suite.ctx, types.FeeCollectorName) diff --git a/x/auth/ante/unordered.go b/x/auth/ante/unordered.go index 0394701ddf59..193f5545125a 100644 --- a/x/auth/ante/unordered.go +++ b/x/auth/ante/unordered.go @@ -3,6 +3,8 @@ package ante import ( "crypto/sha256" + "cosmossdk.io/core/appmodule/v2" + "cosmossdk.io/core/transaction" errorsmod "cosmossdk.io/errors" "cosmossdk.io/x/auth/ante/unorderedtx" @@ -28,12 +30,14 @@ type UnorderedTxDecorator struct { // maxUnOrderedTTL defines the maximum TTL a transaction can define. maxUnOrderedTTL uint64 txManager *unorderedtx.Manager + env appmodule.Environment } -func NewUnorderedTxDecorator(maxTTL uint64, m *unorderedtx.Manager) *UnorderedTxDecorator { +func NewUnorderedTxDecorator(maxTTL uint64, m *unorderedtx.Manager, env appmodule.Environment) *UnorderedTxDecorator { return &UnorderedTxDecorator{ maxUnOrderedTTL: maxTTL, txManager: m, + env: env, } } @@ -42,7 +46,7 @@ func (d *UnorderedTxDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, _ bool, ne if !ok || !unorderedTx.GetUnordered() { // If the transaction does not implement unordered capabilities or has the // unordered value as false, we bypass. - return next(ctx, tx, ctx.ExecMode() == sdk.ExecModeSimulate) + return next(ctx, tx, false) } // TTL is defined as a specific block height at which this tx is no longer valid @@ -65,10 +69,10 @@ func (d *UnorderedTxDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, _ bool, ne return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "tx %X is duplicated") } - if ctx.ExecMode() == sdk.ExecModeFinalize { + if d.env.TransactionService.ExecMode(ctx) == transaction.ExecModeFinalize { // a new tx included in the block, add the hash to the unordered tx manager d.txManager.Add(txHash, ttl) } - return next(ctx, tx, ctx.ExecMode() == sdk.ExecModeSimulate) + return next(ctx, tx, false) } diff --git a/x/auth/ante/unordered_test.go b/x/auth/ante/unordered_test.go index 61653ee75a46..5e4ec4a5ead3 100644 --- a/x/auth/ante/unordered_test.go +++ b/x/auth/ante/unordered_test.go @@ -23,7 +23,9 @@ func TestUnorderedTxDecorator_OrderedTx(t *testing.T) { txm.Start() - chain := sdk.ChainAnteDecorators(ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxUnOrderedTTL, txm)) + suite := SetupTestSuite(t, false) + + chain := sdk.ChainAnteDecorators(ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxUnOrderedTTL, txm, suite.accountKeeper.Environment())) tx, txBz := genUnorderedTx(t, false, 0) ctx := sdk.Context{}.WithTxBytes(txBz).WithBlockHeight(100) @@ -40,7 +42,9 @@ func TestUnorderedTxDecorator_UnorderedTx_NoTTL(t *testing.T) { txm.Start() - chain := sdk.ChainAnteDecorators(ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxUnOrderedTTL, txm)) + suite := SetupTestSuite(t, false) + + chain := sdk.ChainAnteDecorators(ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxUnOrderedTTL, txm, suite.accountKeeper.Environment())) tx, txBz := genUnorderedTx(t, true, 0) ctx := sdk.Context{}.WithTxBytes(txBz).WithBlockHeight(100) @@ -57,7 +61,9 @@ func TestUnorderedTxDecorator_UnorderedTx_InvalidTTL(t *testing.T) { txm.Start() - chain := sdk.ChainAnteDecorators(ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxUnOrderedTTL, txm)) + suite := SetupTestSuite(t, false) + + chain := sdk.ChainAnteDecorators(ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxUnOrderedTTL, txm, suite.accountKeeper.Environment())) tx, txBz := genUnorderedTx(t, true, 100+unorderedtx.DefaultMaxUnOrderedTTL+1) ctx := sdk.Context{}.WithTxBytes(txBz).WithBlockHeight(100) @@ -74,7 +80,9 @@ func TestUnorderedTxDecorator_UnorderedTx_AlreadyExists(t *testing.T) { txm.Start() - chain := sdk.ChainAnteDecorators(ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxUnOrderedTTL, txm)) + suite := SetupTestSuite(t, false) + + chain := sdk.ChainAnteDecorators(ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxUnOrderedTTL, txm, suite.accountKeeper.Environment())) tx, txBz := genUnorderedTx(t, true, 150) ctx := sdk.Context{}.WithTxBytes(txBz).WithBlockHeight(100) @@ -94,7 +102,9 @@ func TestUnorderedTxDecorator_UnorderedTx_ValidCheckTx(t *testing.T) { txm.Start() - chain := sdk.ChainAnteDecorators(ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxUnOrderedTTL, txm)) + suite := SetupTestSuite(t, false) + + chain := sdk.ChainAnteDecorators(ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxUnOrderedTTL, txm, suite.accountKeeper.Environment())) tx, txBz := genUnorderedTx(t, true, 150) ctx := sdk.Context{}.WithTxBytes(txBz).WithBlockHeight(100).WithExecMode(sdk.ExecModeCheck) @@ -111,7 +121,9 @@ func TestUnorderedTxDecorator_UnorderedTx_ValidDeliverTx(t *testing.T) { txm.Start() - chain := sdk.ChainAnteDecorators(ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxUnOrderedTTL, txm)) + suite := SetupTestSuite(t, false) + + chain := sdk.ChainAnteDecorators(ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxUnOrderedTTL, txm, suite.accountKeeper.Environment())) tx, txBz := genUnorderedTx(t, true, 150) ctx := sdk.Context{}.WithTxBytes(txBz).WithBlockHeight(100).WithExecMode(sdk.ExecModeFinalize) diff --git a/x/auth/ante/validator_tx_fee.go b/x/auth/ante/validator_tx_fee.go index eb04320c1abe..af4f02fed05f 100644 --- a/x/auth/ante/validator_tx_fee.go +++ b/x/auth/ante/validator_tx_fee.go @@ -24,7 +24,7 @@ func checkTxFeeWithValidatorMinGasPrices(ctx sdk.Context, tx sdk.Tx) (sdk.Coins, // Ensure that the provided fees meet a minimum threshold for the validator, // if this is a CheckTx. This is only for local mempool purposes, and thus // is only ran on check tx. - if ctx.ExecMode() == sdk.ExecModeCheck { + if ctx.ExecMode() == sdk.ExecModeCheck { // NOTE: using environment here breaks the API of fee logic, an alternative must be found for server/v2. ref: https://github.com/cosmos/cosmos-sdk/issues/19640 minGasPrices := ctx.MinGasPrices() if !minGasPrices.IsZero() { requiredFees := make(sdk.Coins, len(minGasPrices)) diff --git a/x/auth/depinject.go b/x/auth/depinject.go index 67d75e7c902a..834912a4de30 100644 --- a/x/auth/depinject.go +++ b/x/auth/depinject.go @@ -28,9 +28,10 @@ func init() { type ModuleInputs struct { depinject.In - Config *modulev1.Module - Environment appmodule.Environment - Cdc codec.Codec + Config *modulev1.Module + Environment appmodule.Environment + Cdc codec.Codec + AccountsModKeeper types.AccountsModKeeper AddressCodec address.Codec RandomGenesisAccountsFn types.RandomGenesisAccountsFn `optional:"true"` @@ -69,8 +70,8 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { panic(err) } - k := keeper.NewAccountKeeper(in.Environment, in.Cdc, in.AccountI, maccPerms, in.AddressCodec, in.Config.Bech32Prefix, auth) - m := NewAppModule(in.Cdc, k, in.RandomGenesisAccountsFn) + k := keeper.NewAccountKeeper(in.Environment, in.Cdc, in.AccountI, in.AccountsModKeeper, maccPerms, in.AddressCodec, in.Config.Bech32Prefix, auth) + m := NewAppModule(in.Cdc, k, in.AccountsModKeeper, in.RandomGenesisAccountsFn) return ModuleOutputs{AccountKeeper: k, Module: m} } diff --git a/x/auth/go.mod b/x/auth/go.mod index 9c257ae380dd..4ad905a965d1 100644 --- a/x/auth/go.mod +++ b/x/auth/go.mod @@ -15,11 +15,11 @@ require ( cosmossdk.io/x/bank v0.0.0-00010101000000-000000000000 cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 cosmossdk.io/x/tx v0.13.1 - github.com/cometbft/cometbft v0.38.6 + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 github.com/cosmos/cosmos-proto v1.0.0-beta.4 github.com/cosmos/cosmos-sdk v0.51.0 - github.com/cosmos/gogoproto v1.4.11 - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 + github.com/cosmos/gogoproto v1.4.12 + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 @@ -27,8 +27,8 @@ require ( github.com/spf13/viper v1.18.2 github.com/stretchr/testify v1.9.0 golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 - google.golang.org/grpc v1.62.1 + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de + google.golang.org/grpc v1.63.2 google.golang.org/protobuf v1.33.0 gotest.tools/v3 v3.5.1 pgregory.net/rapid v1.1.0 @@ -110,7 +110,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -120,13 +120,13 @@ require ( github.com/mtibben/percent v0.2.1 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.0 // indirect github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.50.0 // indirect + github.com/prometheus/common v0.52.2 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect @@ -149,16 +149,16 @@ require ( gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 // indirect go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.21.0 // indirect + golang.org/x/crypto v0.22.0 // indirect golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.22.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.18.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect diff --git a/x/auth/go.sum b/x/auth/go.sum index 046ebfecd550..507f3ab80bd9 100644 --- a/x/auth/go.sum +++ b/x/auth/go.sum @@ -118,8 +118,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -141,8 +141,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/cosmos/iavl v1.0.0 h1:bw6t0Mv/mVCJvlMTOPHWLs5uUE3BRBfVWCRelOzl+so= github.com/cosmos/iavl v1.0.0/go.mod h1:CmTGqMnRnucjxbjduneZXT+0vPgNElYvdefjX2q9tYc= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= @@ -162,8 +162,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= @@ -449,8 +449,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -553,8 +553,8 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= @@ -595,8 +595,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= -github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -749,8 +749,8 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= @@ -799,8 +799,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -812,8 +812,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -868,12 +868,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -927,12 +927,12 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -950,8 +950,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/x/auth/keeper/account.go b/x/auth/keeper/account.go index bdd36d12450f..3e21fd9a8594 100644 --- a/x/auth/keeper/account.go +++ b/x/auth/keeper/account.go @@ -32,7 +32,7 @@ func (ak AccountKeeper) NewAccount(ctx context.Context, acc sdk.AccountI) sdk.Ac // HasAccount implements AccountKeeperI. func (ak AccountKeeper) HasAccount(ctx context.Context, addr sdk.AccAddress) bool { has, _ := ak.Accounts.Has(ctx, addr) - return has + return has || ak.AccountsModKeeper.IsAccountsModuleAccount(ctx, addr) } // GetAccount implements AccountKeeperI. diff --git a/x/auth/keeper/deterministic_test.go b/x/auth/keeper/deterministic_test.go index 61baa01c2835..c04b4da279b3 100644 --- a/x/auth/keeper/deterministic_test.go +++ b/x/auth/keeper/deterministic_test.go @@ -6,6 +6,7 @@ import ( "sync/atomic" "testing" + "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" "pgregory.net/rapid" @@ -16,6 +17,7 @@ import ( "cosmossdk.io/x/auth" authcodec "cosmossdk.io/x/auth/codec" "cosmossdk.io/x/auth/keeper" + authtestutil "cosmossdk.io/x/auth/testutil" "cosmossdk.io/x/auth/types" "github.com/cosmos/cosmos-sdk/baseapp" @@ -33,13 +35,14 @@ type DeterministicTestSuite struct { accountNumberLanes uint64 - key *storetypes.KVStoreKey - environment appmodule.Environment - ctx sdk.Context - queryClient types.QueryClient - accountKeeper keeper.AccountKeeper - encCfg moduletestutil.TestEncodingConfig - maccPerms map[string][]string + key *storetypes.KVStoreKey + environment appmodule.Environment + ctx sdk.Context + queryClient types.QueryClient + accountKeeper keeper.AccountKeeper + acctsModKeeper *authtestutil.MockAccountsModKeeper + encCfg moduletestutil.TestEncodingConfig + maccPerms map[string][]string } var ( @@ -62,6 +65,11 @@ func (suite *DeterministicTestSuite) SetupTest() { testCtx := testutil.DefaultContextWithDB(suite.T(), key, storetypes.NewTransientStoreKey("transient_test")) suite.ctx = testCtx.Ctx.WithHeaderInfo(header.Info{}) + // gomock initializations + ctrl := gomock.NewController(suite.T()) + acctsModKeeper := authtestutil.NewMockAccountsModKeeper(ctrl) + suite.acctsModKeeper = acctsModKeeper + maccPerms := map[string][]string{ "fee_collector": nil, "mint": {"minter"}, @@ -75,6 +83,7 @@ func (suite *DeterministicTestSuite) SetupTest() { env, suite.encCfg.Codec, types.ProtoBaseAccount, + suite.acctsModKeeper, maccPerms, authcodec.NewBech32Codec("cosmos"), "cosmos", @@ -295,6 +304,7 @@ func (suite *DeterministicTestSuite) TestGRPCQueryModuleAccounts() { suite.environment, suite.encCfg.Codec, types.ProtoBaseAccount, + suite.acctsModKeeper, maccPerms, authcodec.NewBech32Codec("cosmos"), "cosmos", @@ -342,6 +352,7 @@ func (suite *DeterministicTestSuite) TestGRPCQueryModuleAccountByName() { suite.environment, suite.encCfg.Codec, types.ProtoBaseAccount, + suite.acctsModKeeper, maccPerms, authcodec.NewBech32Codec("cosmos"), "cosmos", diff --git a/x/auth/keeper/keeper.go b/x/auth/keeper/keeper.go index 9f03b175fcb4..1474acbe9eb1 100644 --- a/x/auth/keeper/keeper.go +++ b/x/auth/keeper/keeper.go @@ -14,6 +14,7 @@ import ( "cosmossdk.io/x/auth/types" "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -53,6 +54,9 @@ type AccountKeeperI interface { // AddressCodec returns the account address codec. AddressCodec() address.Codec + + // Environment returns the module's environment. + Environment() appmodule.Environment } func NewAccountIndexes(sb *collections.SchemaBuilder) AccountsIndexes { @@ -80,7 +84,8 @@ func (a AccountsIndexes) IndexesList() []collections.Index[sdk.AccAddress, sdk.A // AccountKeeper encodes/decodes accounts using the go-amino (binary) // encoding/decoding library. type AccountKeeper struct { - addressCodec address.Codec + addressCodec address.Codec + AccountsModKeeper types.AccountsModKeeper environment appmodule.Environment cdc codec.BinaryCodec @@ -111,7 +116,7 @@ var _ AccountKeeperI = &AccountKeeper{} // and don't have to fit into any predefined structure. This auth module does not use account permissions internally, though other modules // may use auth.Keeper to access the accounts permissions map. func NewAccountKeeper( - env appmodule.Environment, cdc codec.BinaryCodec, proto func() sdk.AccountI, + env appmodule.Environment, cdc codec.BinaryCodec, proto func() sdk.AccountI, accountsModKeeper types.AccountsModKeeper, maccPerms map[string][]string, ac address.Codec, bech32Prefix, authority string, ) AccountKeeper { permAddrs := make(map[string]types.PermissionsForAddress) @@ -122,16 +127,17 @@ func NewAccountKeeper( sb := collections.NewSchemaBuilder(env.KVStoreService) ak := AccountKeeper{ - addressCodec: ac, - bech32Prefix: bech32Prefix, - environment: env, - proto: proto, - cdc: cdc, - permAddrs: permAddrs, - authority: authority, - Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)), - AccountNumber: collections.NewSequence(sb, types.GlobalAccountNumberKey, "account_number"), - Accounts: collections.NewIndexedMap(sb, types.AddressStoreKeyPrefix, "accounts", sdk.AccAddressKey, codec.CollInterfaceValue[sdk.AccountI](cdc), NewAccountIndexes(sb)), + addressCodec: ac, + bech32Prefix: bech32Prefix, + environment: env, + proto: proto, + cdc: cdc, + AccountsModKeeper: accountsModKeeper, + permAddrs: permAddrs, + authority: authority, + Params: collections.NewItem(sb, types.ParamsKey, "params", codec.CollValue[types.Params](cdc)), + AccountNumber: collections.NewSequence(sb, types.GlobalAccountNumberKey, "account_number"), + Accounts: collections.NewIndexedMap(sb, types.AddressStoreKeyPrefix, "accounts", sdk.AccAddressKey, codec.CollInterfaceValue[sdk.AccountI](cdc), NewAccountIndexes(sb)), } schema, err := sb.Build() if err != nil { @@ -275,3 +281,45 @@ func (ak AccountKeeper) GetParams(ctx context.Context) (params types.Params) { } return params } + +func (ak AccountKeeper) NonAtomicMsgsExec(ctx context.Context, signer sdk.AccAddress, msgs []sdk.Msg) ([]*types.NonAtomicExecResult, error) { + msgResponses := make([]*types.NonAtomicExecResult, 0, len(msgs)) + + for _, msg := range msgs { + if m, ok := msg.(sdk.HasValidateBasic); ok { + if err := m.ValidateBasic(); err != nil { + value := &types.NonAtomicExecResult{Error: err.Error()} + msgResponses = append(msgResponses, value) + continue + } + } + + if err := ak.environment.BranchService.Execute(ctx, func(ctx context.Context) error { + result, err := ak.AccountsModKeeper.SendModuleMessageUntyped(ctx, signer, msg) + if err != nil { + // If an error occurs during message execution, append error response + response := &types.NonAtomicExecResult{Resp: nil, Error: err.Error()} + msgResponses = append(msgResponses, response) + } else { + resp, err := codectypes.NewAnyWithValue(result) + if err != nil { + response := &types.NonAtomicExecResult{Resp: nil, Error: err.Error()} + msgResponses = append(msgResponses, response) + } + response := &types.NonAtomicExecResult{Resp: resp, Error: ""} + msgResponses = append(msgResponses, response) + } + + return nil + }); err != nil { + return nil, err + } + } + + return msgResponses, nil +} + +// Environment returns the module's environment. +func (ak AccountKeeper) Environment() appmodule.Environment { + return ak.environment +} diff --git a/x/auth/keeper/keeper_test.go b/x/auth/keeper/keeper_test.go index 02a25bb6ec83..579556b8739c 100644 --- a/x/auth/keeper/keeper_test.go +++ b/x/auth/keeper/keeper_test.go @@ -3,6 +3,7 @@ package keeper_test import ( "testing" + "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -12,6 +13,7 @@ import ( "cosmossdk.io/x/auth" authcodec "cosmossdk.io/x/auth/codec" "cosmossdk.io/x/auth/keeper" + authtestutil "cosmossdk.io/x/auth/testutil" "cosmossdk.io/x/auth/types" "github.com/cosmos/cosmos-sdk/baseapp" @@ -40,10 +42,11 @@ type KeeperTestSuite struct { ctx sdk.Context - queryClient types.QueryClient - accountKeeper keeper.AccountKeeper - msgServer types.MsgServer - encCfg moduletestutil.TestEncodingConfig + queryClient types.QueryClient + accountKeeper keeper.AccountKeeper + acctsModKeeper *authtestutil.MockAccountsModKeeper + msgServer types.MsgServer + encCfg moduletestutil.TestEncodingConfig } func (suite *KeeperTestSuite) SetupTest() { @@ -55,6 +58,11 @@ func (suite *KeeperTestSuite) SetupTest() { testCtx := testutil.DefaultContextWithDB(suite.T(), key, storetypes.NewTransientStoreKey("transient_test")) suite.ctx = testCtx.Ctx.WithHeaderInfo(header.Info{}) + // gomock initializations + ctrl := gomock.NewController(suite.T()) + acctsModKeeper := authtestutil.NewMockAccountsModKeeper(ctrl) + suite.acctsModKeeper = acctsModKeeper + maccPerms := map[string][]string{ "fee_collector": nil, "mint": {"minter"}, @@ -68,6 +76,7 @@ func (suite *KeeperTestSuite) SetupTest() { env, suite.encCfg.Codec, types.ProtoBaseAccount, + acctsModKeeper, maccPerms, authcodec.NewBech32Codec("cosmos"), "cosmos", diff --git a/x/auth/keeper/msg_server.go b/x/auth/keeper/msg_server.go index c66785af36c4..50e3a65b5c39 100644 --- a/x/auth/keeper/msg_server.go +++ b/x/auth/keeper/msg_server.go @@ -2,9 +2,12 @@ package keeper import ( "context" + "errors" "fmt" "cosmossdk.io/x/auth/types" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) var _ types.MsgServer = msgServer{} @@ -20,6 +23,35 @@ func NewMsgServerImpl(ak AccountKeeper) types.MsgServer { } } +func (ms msgServer) NonAtomicExec(goCtx context.Context, msg *types.MsgNonAtomicExec) (*types.MsgNonAtomicExecResponse, error) { + if msg.Signer == "" { + return nil, errors.New("empty signer address string is not allowed") + } + + signer, err := ms.ak.AddressCodec().StringToBytes(msg.Signer) + if err != nil { + return nil, sdkerrors.ErrInvalidAddress.Wrapf("invalid signer address: %s", err) + } + + if len(msg.Msgs) == 0 { + return nil, sdkerrors.ErrInvalidRequest.Wrapf("messages cannot be empty") + } + + msgs, err := msg.GetMessages() + if err != nil { + return nil, err + } + + results, err := ms.ak.NonAtomicMsgsExec(goCtx, signer, msgs) + if err != nil { + return nil, err + } + + return &types.MsgNonAtomicExecResponse{ + Results: results, + }, nil +} + func (ms msgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { if ms.ak.authority != msg.Authority { return nil, fmt.Errorf( diff --git a/x/auth/module.go b/x/auth/module.go index 9adf511a096e..8459fd4aa610 100644 --- a/x/auth/module.go +++ b/x/auth/module.go @@ -40,6 +40,7 @@ var ( type AppModule struct { accountKeeper keeper.AccountKeeper randGenAccountsFn types.RandomGenesisAccountsFn + accountsModKeeper types.AccountsModKeeper cdc codec.Codec } @@ -47,10 +48,11 @@ type AppModule struct { func (am AppModule) IsAppModule() {} // NewAppModule creates a new AppModule object -func NewAppModule(cdc codec.Codec, accountKeeper keeper.AccountKeeper, randGenAccountsFn types.RandomGenesisAccountsFn) AppModule { +func NewAppModule(cdc codec.Codec, accountKeeper keeper.AccountKeeper, ak types.AccountsModKeeper, randGenAccountsFn types.RandomGenesisAccountsFn) AppModule { return AppModule{ accountKeeper: accountKeeper, randGenAccountsFn: randGenAccountsFn, + accountsModKeeper: ak, cdc: cdc, } } diff --git a/x/auth/proto/buf.gen.gogo.yaml b/x/auth/proto/buf.gen.gogo.yaml index 9c8ba0a4b1fd..db36231d0c82 100644 --- a/x/auth/proto/buf.gen.gogo.yaml +++ b/x/auth/proto/buf.gen.gogo.yaml @@ -2,7 +2,7 @@ version: v1 plugins: - name: gocosmos out: .. - opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any - name: grpc-gateway out: .. opt: logtostderr=true,allow_colon_final_segments=true diff --git a/x/auth/proto/cosmos/auth/v1beta1/tx.proto b/x/auth/proto/cosmos/auth/v1beta1/tx.proto index 4089d047be56..172525f1d251 100644 --- a/x/auth/proto/cosmos/auth/v1beta1/tx.proto +++ b/x/auth/proto/cosmos/auth/v1beta1/tx.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package cosmos.auth.v1beta1; import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/msg/v1/msg.proto"; import "amino/amino.proto"; @@ -18,6 +19,9 @@ service Msg { // // Since: cosmos-sdk 0.47 rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); + + // NonAtomicExec allows users to submit multiple messages for non-atomic execution. + rpc NonAtomicExec(MsgNonAtomicExec) returns (MsgNonAtomicExecResponse); } // MsgUpdateParams is the Msg/UpdateParams request type. @@ -41,3 +45,23 @@ message MsgUpdateParams { // // Since: cosmos-sdk 0.47 message MsgUpdateParamsResponse {} + +// MsgNonAtomicExec defines the Msg/NonAtomicExec request type. +message MsgNonAtomicExec { + option (cosmos.msg.v1.signer) = "signer"; + + string signer = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated google.protobuf.Any msgs = 2 [(cosmos_proto.accepts_interface) = "cosmos.base.v1beta1.Msg"]; +} + +// NonAtomicExecResult defines the response structure for executing a +// MsgNonAtomicExec. +message NonAtomicExecResult { + string error = 1; + google.protobuf.Any resp = 2; +} + +// MsgNonAtomicExecResponse defines the response of MsgNonAtomicExec. +message MsgNonAtomicExecResponse { + repeated NonAtomicExecResult results = 1; +} diff --git a/x/auth/signing/adapter.go b/x/auth/signing/adapter.go index 42b1b82fdc48..3230b49a80f3 100644 --- a/x/auth/signing/adapter.go +++ b/x/auth/signing/adapter.go @@ -27,6 +27,7 @@ func GetSignBytesAdapter( ctx context.Context, handlerMap *txsigning.HandlerMap, mode signing.SignMode, + signerData SignerData, tx sdk.Tx, ) ([]byte, error) { diff --git a/x/auth/simulation/proposals.go b/x/auth/simulation/proposals.go index 148753163ad0..244acb1975e1 100644 --- a/x/auth/simulation/proposals.go +++ b/x/auth/simulation/proposals.go @@ -31,7 +31,7 @@ func ProposalMsgs() []simtypes.WeightedProposalMsg { } // SimulateMsgUpdateParams returns a random MsgUpdateParams -func SimulateMsgUpdateParams(r *rand.Rand, _ sdk.Context, _ []simtypes.Account, _ coreaddress.Codec) (sdk.Msg, error) { +func SimulateMsgUpdateParams(r *rand.Rand, _ []simtypes.Account, _ coreaddress.Codec) (sdk.Msg, error) { // use the default gov module account address as authority var authority sdk.AccAddress = address.Module("gov") diff --git a/x/auth/simulation/proposals_test.go b/x/auth/simulation/proposals_test.go index 6a1168afd593..bbe53b58ef48 100644 --- a/x/auth/simulation/proposals_test.go +++ b/x/auth/simulation/proposals_test.go @@ -20,7 +20,6 @@ func TestProposalMsgs(t *testing.T) { s := rand.NewSource(1) r := rand.New(s) - ctx := sdk.NewContext(nil, true, nil) accounts := simtypes.RandomAccounts(r, 3) // execute ProposalMsgs function @@ -33,7 +32,7 @@ func TestProposalMsgs(t *testing.T) { assert.Equal(t, simulation.OpWeightMsgUpdateParams, w0.AppParamsKey()) assert.Equal(t, simulation.DefaultWeightMsgUpdateParams, w0.DefaultWeight()) - msg, err := w0.MsgSimulatorFn()(r, ctx, accounts, codectestutil.CodecOptions{}.GetAddressCodec()) + msg, err := w0.MsgSimulatorFn()(r, accounts, codectestutil.CodecOptions{}.GetAddressCodec()) assert.NilError(t, err) msgUpdateParams, ok := msg.(*types.MsgUpdateParams) assert.Assert(t, ok) diff --git a/x/auth/testutil/app_config.go b/x/auth/testutil/app_config.go index eeb5a324cb45..d7ddcd09c3ff 100644 --- a/x/auth/testutil/app_config.go +++ b/x/auth/testutil/app_config.go @@ -1,8 +1,9 @@ package testutil import ( + _ "cosmossdk.io/x/accounts" // import as blank for app wiring _ "cosmossdk.io/x/auth" // import as blank for app wiring - _ "cosmossdk.io/x/auth/tx/config" // import as blank for app wiring + _ "cosmossdk.io/x/auth/tx/config" // import as blank for app wiring`` _ "cosmossdk.io/x/auth/vesting" // import as blank for app wiring _ "cosmossdk.io/x/bank" // import as blank for app wiring _ "cosmossdk.io/x/staking" // import as blank for app wiring @@ -13,6 +14,7 @@ import ( ) var AppConfig = configurator.NewAppConfig( + configurator.AccountsModule(), configurator.AuthModule(), configurator.BankModule(), configurator.VestingModule(), diff --git a/x/auth/testutil/expected_keepers_mocks.go b/x/auth/testutil/expected_keepers_mocks.go index 2d0e602a8cbc..8d4b1f2891be 100644 --- a/x/auth/testutil/expected_keepers_mocks.go +++ b/x/auth/testutil/expected_keepers_mocks.go @@ -10,6 +10,7 @@ import ( types "github.com/cosmos/cosmos-sdk/types" gomock "github.com/golang/mock/gomock" + protoiface "google.golang.org/protobuf/runtime/protoiface" ) // MockBankKeeper is a mock of BankKeeper interface. @@ -81,3 +82,55 @@ func (mr *MockBankKeeperMockRecorder) SendCoinsFromAccountToModule(ctx, senderAd mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromAccountToModule", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromAccountToModule), ctx, senderAddr, recipientModule, amt) } + +// MockAccountsModKeeper is a mock of AccountsModKeeper interface. +type MockAccountsModKeeper struct { + ctrl *gomock.Controller + recorder *MockAccountsModKeeperMockRecorder +} + +// MockAccountsModKeeperMockRecorder is the mock recorder for MockAccountsModKeeper. +type MockAccountsModKeeperMockRecorder struct { + mock *MockAccountsModKeeper +} + +// NewMockAccountsModKeeper creates a new mock instance. +func NewMockAccountsModKeeper(ctrl *gomock.Controller) *MockAccountsModKeeper { + mock := &MockAccountsModKeeper{ctrl: ctrl} + mock.recorder = &MockAccountsModKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockAccountsModKeeper) EXPECT() *MockAccountsModKeeperMockRecorder { + return m.recorder +} + +// IsAccountsModuleAccount mocks base method. +func (m *MockAccountsModKeeper) IsAccountsModuleAccount(ctx context.Context, accountAddr []byte) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsAccountsModuleAccount", ctx, accountAddr) + ret0, _ := ret[0].(bool) + return ret0 +} + +// IsAccountsModuleAccount indicates an expected call of IsAccountsModuleAccount. +func (mr *MockAccountsModKeeperMockRecorder) IsAccountsModuleAccount(ctx, accountAddr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsAccountsModuleAccount", reflect.TypeOf((*MockAccountsModKeeper)(nil).IsAccountsModuleAccount), ctx, accountAddr) +} + +// SendModuleMessageUntyped mocks base method. +func (m *MockAccountsModKeeper) SendModuleMessageUntyped(ctx context.Context, sender []byte, msg protoiface.MessageV1) (protoiface.MessageV1, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendModuleMessageUntyped", ctx, sender, msg) + ret0, _ := ret[0].(protoiface.MessageV1) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SendModuleMessageUntyped indicates an expected call of SendModuleMessageUntyped. +func (mr *MockAccountsModKeeperMockRecorder) SendModuleMessageUntyped(ctx, sender, msg interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendModuleMessageUntyped", reflect.TypeOf((*MockAccountsModKeeper)(nil).SendModuleMessageUntyped), ctx, sender, msg) +} diff --git a/x/auth/types/auth.pb.go b/x/auth/types/auth.pb.go index 965822434943..89667c1fee9d 100644 --- a/x/auth/types/auth.pb.go +++ b/x/auth/types/auth.pb.go @@ -6,10 +6,10 @@ package types import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" + any "github.com/cosmos/gogoproto/types/any" io "io" math "math" math_bits "math/bits" @@ -30,10 +30,10 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // for basic account functionality. Any custom account type should extend this // type for additional functionality (e.g. vesting). type BaseAccount struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - PubKey *types.Any `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"public_key,omitempty"` - AccountNumber uint64 `protobuf:"varint,3,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty"` - Sequence uint64 `protobuf:"varint,4,opt,name=sequence,proto3" json:"sequence,omitempty"` + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + PubKey *any.Any `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"public_key,omitempty"` + AccountNumber uint64 `protobuf:"varint,3,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty"` + Sequence uint64 `protobuf:"varint,4,opt,name=sequence,proto3" json:"sequence,omitempty"` } func (m *BaseAccount) Reset() { *m = BaseAccount{} } @@ -726,7 +726,7 @@ func (m *BaseAccount) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.PubKey == nil { - m.PubKey = &types.Any{} + m.PubKey = &any.Any{} } if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/x/auth/types/codec.go b/x/auth/types/codec.go index 685d9eb85dc5..08accef30af9 100644 --- a/x/auth/types/codec.go +++ b/x/auth/types/codec.go @@ -58,5 +58,6 @@ func RegisterInterfaces(registrar registry.InterfaceRegistrar) { registrar.RegisterImplementations((*sdk.Msg)(nil), &MsgUpdateParams{}, + &MsgNonAtomicExec{}, ) } diff --git a/x/auth/types/expected_keepers.go b/x/auth/types/expected_keepers.go index ffcfe49aa10d..10f3cc4f3331 100644 --- a/x/auth/types/expected_keepers.go +++ b/x/auth/types/expected_keepers.go @@ -3,6 +3,8 @@ package types import ( "context" + "google.golang.org/protobuf/runtime/protoiface" + sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -12,3 +14,9 @@ type BankKeeper interface { SendCoins(ctx context.Context, from, to sdk.AccAddress, amt sdk.Coins) error SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error } + +// AccountsModKeeper defines the contract for x/accounts APIs +type AccountsModKeeper interface { + SendModuleMessageUntyped(ctx context.Context, sender []byte, msg protoiface.MessageV1) (protoiface.MessageV1, error) + IsAccountsModuleAccount(ctx context.Context, accountAddr []byte) bool +} diff --git a/x/auth/types/genesis.pb.go b/x/auth/types/genesis.pb.go index 2fff60df2b98..c7bd41ddb544 100644 --- a/x/auth/types/genesis.pb.go +++ b/x/auth/types/genesis.pb.go @@ -5,10 +5,10 @@ package types import ( fmt "fmt" - types "github.com/cosmos/cosmos-sdk/codec/types" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" + any "github.com/cosmos/gogoproto/types/any" io "io" math "math" math_bits "math/bits" @@ -30,7 +30,7 @@ type GenesisState struct { // params defines all the parameters of the module. Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` // accounts are the accounts present at genesis. - Accounts []*types.Any `protobuf:"bytes,2,rep,name=accounts,proto3" json:"accounts,omitempty"` + Accounts []*any.Any `protobuf:"bytes,2,rep,name=accounts,proto3" json:"accounts,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -73,7 +73,7 @@ func (m *GenesisState) GetParams() Params { return Params{} } -func (m *GenesisState) GetAccounts() []*types.Any { +func (m *GenesisState) GetAccounts() []*any.Any { if m != nil { return m.Accounts } @@ -279,7 +279,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Accounts = append(m.Accounts, &types.Any{}) + m.Accounts = append(m.Accounts, &any.Any{}) if err := m.Accounts[len(m.Accounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/x/auth/types/msgs.go b/x/auth/types/msgs.go new file mode 100644 index 000000000000..6900aab97713 --- /dev/null +++ b/x/auth/types/msgs.go @@ -0,0 +1,20 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// GetMessages returns the cache values from the MsgNonAtomicExec.Msgs if present. +func (msg MsgNonAtomicExec) GetMessages() ([]sdk.Msg, error) { + msgs := make([]sdk.Msg, len(msg.Msgs)) + for i, msgAny := range msg.Msgs { + msg, ok := msgAny.GetCachedValue().(sdk.Msg) + if !ok { + return nil, sdkerrors.ErrInvalidRequest.Wrapf("messages contains %T which is not a sdk.Msg", msgAny) + } + msgs[i] = msg + } + + return msgs, nil +} diff --git a/x/auth/types/query.pb.go b/x/auth/types/query.pb.go index e97260c963e5..9825cb7c7b92 100644 --- a/x/auth/types/query.pb.go +++ b/x/auth/types/query.pb.go @@ -7,11 +7,11 @@ import ( context "context" fmt "fmt" _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" query "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" + any "github.com/cosmos/gogoproto/types/any" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -85,7 +85,7 @@ func (m *QueryAccountsRequest) GetPagination() *query.PageRequest { // Since: cosmos-sdk 0.43 type QueryAccountsResponse struct { // accounts are the existing accounts - Accounts []*types.Any `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"` + Accounts []*any.Any `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"` // pagination defines the pagination in the response. Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -123,7 +123,7 @@ func (m *QueryAccountsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryAccountsResponse proto.InternalMessageInfo -func (m *QueryAccountsResponse) GetAccounts() []*types.Any { +func (m *QueryAccountsResponse) GetAccounts() []*any.Any { if m != nil { return m.Accounts } @@ -179,7 +179,7 @@ var xxx_messageInfo_QueryAccountRequest proto.InternalMessageInfo // QueryAccountResponse is the response type for the Query/Account RPC method. type QueryAccountResponse struct { // account defines the account of the corresponding address. - Account *types.Any `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` + Account *any.Any `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` } func (m *QueryAccountResponse) Reset() { *m = QueryAccountResponse{} } @@ -215,7 +215,7 @@ func (m *QueryAccountResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryAccountResponse proto.InternalMessageInfo -func (m *QueryAccountResponse) GetAccount() *types.Any { +func (m *QueryAccountResponse) GetAccount() *any.Any { if m != nil { return m.Account } @@ -348,7 +348,7 @@ var xxx_messageInfo_QueryModuleAccountsRequest proto.InternalMessageInfo // // Since: cosmos-sdk 0.46 type QueryModuleAccountsResponse struct { - Accounts []*types.Any `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"` + Accounts []*any.Any `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"` } func (m *QueryModuleAccountsResponse) Reset() { *m = QueryModuleAccountsResponse{} } @@ -384,7 +384,7 @@ func (m *QueryModuleAccountsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryModuleAccountsResponse proto.InternalMessageInfo -func (m *QueryModuleAccountsResponse) GetAccounts() []*types.Any { +func (m *QueryModuleAccountsResponse) GetAccounts() []*any.Any { if m != nil { return m.Accounts } @@ -438,7 +438,7 @@ func (m *QueryModuleAccountByNameRequest) GetName() string { // QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. type QueryModuleAccountByNameResponse struct { - Account *types.Any `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` + Account *any.Any `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` } func (m *QueryModuleAccountByNameResponse) Reset() { *m = QueryModuleAccountByNameResponse{} } @@ -474,7 +474,7 @@ func (m *QueryModuleAccountByNameResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryModuleAccountByNameResponse proto.InternalMessageInfo -func (m *QueryModuleAccountByNameResponse) GetAccount() *types.Any { +func (m *QueryModuleAccountByNameResponse) GetAccount() *any.Any { if m != nil { return m.Account } @@ -2563,7 +2563,7 @@ func (m *QueryAccountsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Accounts = append(m.Accounts, &types.Any{}) + m.Accounts = append(m.Accounts, &any.Any{}) if err := m.Accounts[len(m.Accounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -2766,7 +2766,7 @@ func (m *QueryAccountResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Account == nil { - m.Account = &types.Any{} + m.Account = &any.Any{} } if err := m.Account.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -3034,7 +3034,7 @@ func (m *QueryModuleAccountsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Accounts = append(m.Accounts, &types.Any{}) + m.Accounts = append(m.Accounts, &any.Any{}) if err := m.Accounts[len(m.Accounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3201,7 +3201,7 @@ func (m *QueryModuleAccountByNameResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Account == nil { - m.Account = &types.Any{} + m.Account = &any.Any{} } if err := m.Account.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/x/auth/types/tx.pb.go b/x/auth/types/tx.pb.go index 1bda98a785f8..960a79d6585b 100644 --- a/x/auth/types/tx.pb.go +++ b/x/auth/types/tx.pb.go @@ -7,6 +7,7 @@ import ( context "context" fmt "fmt" _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/codec/types" _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" @@ -130,36 +131,203 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo +// MsgNonAtomicExec defines the Msg/NonAtomicExec request type. +type MsgNonAtomicExec struct { + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` + Msgs []*types.Any `protobuf:"bytes,2,rep,name=msgs,proto3" json:"msgs,omitempty"` +} + +func (m *MsgNonAtomicExec) Reset() { *m = MsgNonAtomicExec{} } +func (m *MsgNonAtomicExec) String() string { return proto.CompactTextString(m) } +func (*MsgNonAtomicExec) ProtoMessage() {} +func (*MsgNonAtomicExec) Descriptor() ([]byte, []int) { + return fileDescriptor_c2d62bd9c4c212e5, []int{2} +} +func (m *MsgNonAtomicExec) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgNonAtomicExec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgNonAtomicExec.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 *MsgNonAtomicExec) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgNonAtomicExec.Merge(m, src) +} +func (m *MsgNonAtomicExec) XXX_Size() int { + return m.Size() +} +func (m *MsgNonAtomicExec) XXX_DiscardUnknown() { + xxx_messageInfo_MsgNonAtomicExec.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgNonAtomicExec proto.InternalMessageInfo + +func (m *MsgNonAtomicExec) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +func (m *MsgNonAtomicExec) GetMsgs() []*types.Any { + if m != nil { + return m.Msgs + } + return nil +} + +// NonAtomicExecResult defines the response structure for executing a +// MsgNonAtomicExec. +type NonAtomicExecResult struct { + Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + Resp *types.Any `protobuf:"bytes,2,opt,name=resp,proto3" json:"resp,omitempty"` +} + +func (m *NonAtomicExecResult) Reset() { *m = NonAtomicExecResult{} } +func (m *NonAtomicExecResult) String() string { return proto.CompactTextString(m) } +func (*NonAtomicExecResult) ProtoMessage() {} +func (*NonAtomicExecResult) Descriptor() ([]byte, []int) { + return fileDescriptor_c2d62bd9c4c212e5, []int{3} +} +func (m *NonAtomicExecResult) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NonAtomicExecResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NonAtomicExecResult.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 *NonAtomicExecResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_NonAtomicExecResult.Merge(m, src) +} +func (m *NonAtomicExecResult) XXX_Size() int { + return m.Size() +} +func (m *NonAtomicExecResult) XXX_DiscardUnknown() { + xxx_messageInfo_NonAtomicExecResult.DiscardUnknown(m) +} + +var xxx_messageInfo_NonAtomicExecResult proto.InternalMessageInfo + +func (m *NonAtomicExecResult) GetError() string { + if m != nil { + return m.Error + } + return "" +} + +func (m *NonAtomicExecResult) GetResp() *types.Any { + if m != nil { + return m.Resp + } + return nil +} + +// MsgNonAtomicExecResponse defines the response of MsgNonAtomicExec. +type MsgNonAtomicExecResponse struct { + Results []*NonAtomicExecResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` +} + +func (m *MsgNonAtomicExecResponse) Reset() { *m = MsgNonAtomicExecResponse{} } +func (m *MsgNonAtomicExecResponse) String() string { return proto.CompactTextString(m) } +func (*MsgNonAtomicExecResponse) ProtoMessage() {} +func (*MsgNonAtomicExecResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c2d62bd9c4c212e5, []int{4} +} +func (m *MsgNonAtomicExecResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgNonAtomicExecResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgNonAtomicExecResponse.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 *MsgNonAtomicExecResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgNonAtomicExecResponse.Merge(m, src) +} +func (m *MsgNonAtomicExecResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgNonAtomicExecResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgNonAtomicExecResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgNonAtomicExecResponse proto.InternalMessageInfo + +func (m *MsgNonAtomicExecResponse) GetResults() []*NonAtomicExecResult { + if m != nil { + return m.Results + } + return nil +} + func init() { proto.RegisterType((*MsgUpdateParams)(nil), "cosmos.auth.v1beta1.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.auth.v1beta1.MsgUpdateParamsResponse") + proto.RegisterType((*MsgNonAtomicExec)(nil), "cosmos.auth.v1beta1.MsgNonAtomicExec") + proto.RegisterType((*NonAtomicExecResult)(nil), "cosmos.auth.v1beta1.NonAtomicExecResult") + proto.RegisterType((*MsgNonAtomicExecResponse)(nil), "cosmos.auth.v1beta1.MsgNonAtomicExecResponse") } func init() { proto.RegisterFile("cosmos/auth/v1beta1/tx.proto", fileDescriptor_c2d62bd9c4c212e5) } var fileDescriptor_c2d62bd9c4c212e5 = []byte{ - // 336 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x2c, 0x2d, 0xc9, 0xd0, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, - 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0xc8, 0xea, 0x81, 0x64, 0xf5, - 0xa0, 0xb2, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0x79, 0x7d, 0x10, 0x0b, 0xa2, 0x54, 0x4a, - 0x12, 0xa2, 0x34, 0x1e, 0x22, 0x01, 0xd5, 0x07, 0x91, 0x12, 0x87, 0xda, 0x91, 0x5b, 0x9c, 0xae, - 0x5f, 0x66, 0x08, 0xa2, 0xa0, 0x12, 0x82, 0x89, 0xb9, 0x99, 0x79, 0xf9, 0xfa, 0x60, 0x12, 0x2a, - 0x24, 0x87, 0xcd, 0x3d, 0x60, 0xeb, 0xc1, 0xf2, 0x4a, 0xfb, 0x19, 0xb9, 0xf8, 0x7d, 0x8b, 0xd3, - 0x43, 0x0b, 0x52, 0x12, 0x4b, 0x52, 0x03, 0x12, 0x8b, 0x12, 0x73, 0x8b, 0x85, 0xcc, 0xb8, 0x38, - 0x41, 0x2a, 0xf2, 0x8b, 0x32, 0x4b, 0x2a, 0x25, 0x18, 0x15, 0x18, 0x35, 0x38, 0x9d, 0x24, 0x2e, - 0x6d, 0xd1, 0x15, 0x81, 0x3a, 0xc2, 0x31, 0x25, 0xa5, 0x28, 0xb5, 0xb8, 0x38, 0xb8, 0xa4, 0x28, - 0x33, 0x2f, 0x3d, 0x08, 0xa1, 0x54, 0xc8, 0x8e, 0x8b, 0xad, 0x00, 0x6c, 0x82, 0x04, 0x93, 0x02, - 0xa3, 0x06, 0xb7, 0x91, 0xb4, 0x1e, 0x16, 0xef, 0xea, 0x41, 0x2c, 0x71, 0xe2, 0x3c, 0x71, 0x4f, - 0x9e, 0x61, 0xc5, 0xf3, 0x0d, 0x5a, 0x8c, 0x41, 0x50, 0x5d, 0x56, 0x26, 0x4d, 0xcf, 0x37, 0x68, - 0x21, 0xcc, 0xeb, 0x7a, 0xbe, 0x41, 0x4b, 0x11, 0x62, 0x82, 0x6e, 0x71, 0x4a, 0xb6, 0x7e, 0x05, - 0xc4, 0x13, 0x68, 0xae, 0x55, 0x92, 0xe4, 0x12, 0x47, 0x13, 0x0a, 0x4a, 0x2d, 0x2e, 0xc8, 0xcf, - 0x2b, 0x4e, 0x35, 0x2a, 0xe0, 0x62, 0xf6, 0x2d, 0x4e, 0x17, 0x4a, 0xe2, 0xe2, 0x41, 0xf1, 0x9f, - 0x0a, 0x56, 0x77, 0xa1, 0x19, 0x22, 0xa5, 0x43, 0x8c, 0x2a, 0x98, 0x55, 0x52, 0xac, 0x0d, 0x20, - 0xaf, 0x38, 0x19, 0x9f, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, - 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x14, 0x34, 0x3e, - 0x8b, 0x53, 0xb2, 0xf5, 0x32, 0xf3, 0x61, 0x7e, 0x29, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, - 0x47, 0x85, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xf0, 0x09, 0xbc, 0x34, 0x3c, 0x02, 0x00, 0x00, + // 520 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x31, 0x6f, 0xd3, 0x40, + 0x18, 0xcd, 0xd1, 0x36, 0x28, 0x17, 0x10, 0xe0, 0x46, 0x6a, 0x9a, 0x22, 0x53, 0x22, 0x90, 0xa2, + 0x88, 0x9c, 0x49, 0x8a, 0x18, 0x3a, 0x20, 0xc5, 0x52, 0xc7, 0x20, 0x64, 0xd4, 0x85, 0x01, 0x64, + 0xc7, 0xc7, 0x61, 0xb5, 0xf6, 0x59, 0xf7, 0x5d, 0xaa, 0x64, 0x43, 0x8c, 0x4c, 0x8c, 0xfc, 0x04, + 0xc6, 0x0c, 0xdd, 0x59, 0x2b, 0xa6, 0x8a, 0x05, 0x26, 0x84, 0x92, 0x21, 0x7f, 0x03, 0xf9, 0xee, + 0xdc, 0x2a, 0x91, 0x51, 0xbb, 0xd8, 0xbe, 0x7b, 0xef, 0xfb, 0xbe, 0xf7, 0xee, 0x9d, 0xf1, 0xfd, + 0x21, 0x87, 0x98, 0x83, 0xe3, 0x8f, 0xe4, 0x07, 0xe7, 0xa4, 0x1b, 0x50, 0xe9, 0x77, 0x1d, 0x39, + 0x26, 0xa9, 0xe0, 0x92, 0x5b, 0x9b, 0x1a, 0x25, 0x19, 0x4a, 0x0c, 0xda, 0xa8, 0x31, 0xce, 0xb8, + 0xc2, 0x9d, 0xec, 0x4b, 0x53, 0x1b, 0xdb, 0x8c, 0x73, 0x76, 0x4c, 0x1d, 0xb5, 0x0a, 0x46, 0xef, + 0x1d, 0x3f, 0x99, 0xe4, 0x90, 0xee, 0xf2, 0x4e, 0xd7, 0x98, 0x96, 0x1a, 0xda, 0x32, 0xe3, 0x63, + 0x60, 0xce, 0x49, 0x37, 0x7b, 0x19, 0xe0, 0x9e, 0x1f, 0x47, 0x09, 0x77, 0xd4, 0xd3, 0x6c, 0xd9, + 0x45, 0x52, 0x95, 0x32, 0x85, 0x37, 0xbf, 0x23, 0x7c, 0x67, 0x00, 0xec, 0x30, 0x0d, 0x7d, 0x49, + 0x5f, 0xf9, 0xc2, 0x8f, 0xc1, 0x7a, 0x8e, 0x2b, 0x19, 0x83, 0x8b, 0x48, 0x4e, 0xea, 0x68, 0x17, + 0xb5, 0x2a, 0x6e, 0xfd, 0xe7, 0x69, 0xa7, 0x66, 0x44, 0xf4, 0xc3, 0x50, 0x50, 0x80, 0xd7, 0x52, + 0x44, 0x09, 0xf3, 0x2e, 0xa9, 0xd6, 0x0b, 0x5c, 0x4e, 0x55, 0x87, 0xfa, 0x8d, 0x5d, 0xd4, 0xaa, + 0xf6, 0x76, 0x48, 0xc1, 0x49, 0x10, 0x3d, 0xc4, 0xad, 0x9c, 0xfd, 0x79, 0x50, 0xfa, 0xb6, 0x98, + 0xb6, 0x91, 0x67, 0xaa, 0xf6, 0x9f, 0x7d, 0x5a, 0x4c, 0xdb, 0x97, 0xfd, 0x3e, 0x2f, 0xa6, 0xed, + 0x87, 0xba, 0x43, 0x07, 0xc2, 0x23, 0x67, 0xac, 0x4d, 0xac, 0xa8, 0x6d, 0x6e, 0xe3, 0xad, 0x95, + 0x2d, 0x8f, 0x42, 0xca, 0x13, 0xa0, 0xcd, 0xaf, 0x08, 0xdf, 0x1d, 0x00, 0x7b, 0xc9, 0x93, 0xbe, + 0xe4, 0x71, 0x34, 0x3c, 0x18, 0xd3, 0xa1, 0xf5, 0x14, 0x97, 0x21, 0x62, 0x09, 0x15, 0x57, 0x5a, + 0x33, 0x3c, 0xeb, 0x00, 0xaf, 0xc7, 0xc0, 0x32, 0x57, 0x6b, 0xad, 0x6a, 0xaf, 0x46, 0x74, 0x68, + 0x24, 0x0f, 0x8d, 0xf4, 0x93, 0x89, 0xbb, 0xf3, 0xe3, 0xb4, 0x63, 0x72, 0x21, 0x81, 0x0f, 0xf4, + 0xc2, 0xee, 0x00, 0x98, 0xa7, 0xca, 0xf7, 0xab, 0x99, 0x3d, 0xd3, 0xb3, 0x79, 0x88, 0x37, 0x97, + 0x64, 0x79, 0x14, 0x46, 0xc7, 0xd2, 0xaa, 0xe1, 0x0d, 0x2a, 0x04, 0x37, 0xda, 0x3c, 0xbd, 0xb0, + 0x5a, 0x78, 0x5d, 0x50, 0x48, 0xcd, 0xb1, 0x16, 0x0a, 0xf0, 0x14, 0xa3, 0xf9, 0x16, 0xd7, 0x57, + 0x0d, 0xe7, 0xa7, 0x61, 0xb9, 0xf8, 0xa6, 0x50, 0x53, 0xa0, 0x8e, 0x94, 0x93, 0x56, 0x61, 0x3e, + 0x05, 0xb2, 0xbc, 0xbc, 0xb0, 0xf7, 0x0b, 0xe1, 0xb5, 0x01, 0x30, 0x2b, 0xc0, 0xb7, 0x96, 0xae, + 0xcc, 0xa3, 0xc2, 0x56, 0x2b, 0xb9, 0x34, 0x9e, 0x5c, 0x87, 0x75, 0xa1, 0x97, 0xe2, 0xdb, 0xcb, + 0xc9, 0x3d, 0xfe, 0x5f, 0xf9, 0x12, 0xad, 0xd1, 0xb9, 0x16, 0x2d, 0x1f, 0xd3, 0xd8, 0xf8, 0x98, + 0x5d, 0x42, 0x77, 0xef, 0x6c, 0x66, 0xa3, 0xf3, 0x99, 0x8d, 0xfe, 0xce, 0x6c, 0xf4, 0x65, 0x6e, + 0x97, 0xce, 0xe7, 0x76, 0xe9, 0xf7, 0xdc, 0x2e, 0xbd, 0x31, 0x7f, 0x22, 0x84, 0x47, 0x24, 0xe2, + 0xf9, 0x2d, 0x94, 0x93, 0x94, 0x42, 0x50, 0x56, 0x11, 0xec, 0xfd, 0x0b, 0x00, 0x00, 0xff, 0xff, + 0xa1, 0x5a, 0xf2, 0x18, 0x11, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -179,6 +347,8 @@ type MsgClient interface { // // Since: cosmos-sdk 0.47 UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + // NonAtomicExec allows users to submit multiple messages for non-atomic execution. + NonAtomicExec(ctx context.Context, in *MsgNonAtomicExec, opts ...grpc.CallOption) (*MsgNonAtomicExecResponse, error) } type msgClient struct { @@ -198,6 +368,15 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts return out, nil } +func (c *msgClient) NonAtomicExec(ctx context.Context, in *MsgNonAtomicExec, opts ...grpc.CallOption) (*MsgNonAtomicExecResponse, error) { + out := new(MsgNonAtomicExecResponse) + err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Msg/NonAtomicExec", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // UpdateParams defines a (governance) operation for updating the x/auth module @@ -205,6 +384,8 @@ type MsgServer interface { // // Since: cosmos-sdk 0.47 UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + // NonAtomicExec allows users to submit multiple messages for non-atomic execution. + NonAtomicExec(context.Context, *MsgNonAtomicExec) (*MsgNonAtomicExecResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -214,6 +395,9 @@ type UnimplementedMsgServer struct { func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } +func (*UnimplementedMsgServer) NonAtomicExec(ctx context.Context, req *MsgNonAtomicExec) (*MsgNonAtomicExecResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NonAtomicExec not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -237,6 +421,24 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_NonAtomicExec_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgNonAtomicExec) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).NonAtomicExec(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.auth.v1beta1.Msg/NonAtomicExec", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).NonAtomicExec(ctx, req.(*MsgNonAtomicExec)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.auth.v1beta1.Msg", HandlerType: (*MsgServer)(nil), @@ -245,6 +447,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UpdateParams", Handler: _Msg_UpdateParams_Handler, }, + { + MethodName: "NonAtomicExec", + Handler: _Msg_NonAtomicExec_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/auth/v1beta1/tx.proto", @@ -313,6 +519,129 @@ func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *MsgNonAtomicExec) 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 *MsgNonAtomicExec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgNonAtomicExec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Msgs) > 0 { + for iNdEx := len(m.Msgs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Msgs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *NonAtomicExecResult) 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 *NonAtomicExecResult) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NonAtomicExecResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Resp != nil { + { + size, err := m.Resp.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Error) > 0 { + i -= len(m.Error) + copy(dAtA[i:], m.Error) + i = encodeVarintTx(dAtA, i, uint64(len(m.Error))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgNonAtomicExecResponse) 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 *MsgNonAtomicExecResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgNonAtomicExecResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Results) > 0 { + for iNdEx := len(m.Results) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Results[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -348,6 +677,57 @@ func (m *MsgUpdateParamsResponse) Size() (n int) { return n } +func (m *MsgNonAtomicExec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Msgs) > 0 { + for _, e := range m.Msgs { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *NonAtomicExecResult) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Error) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Resp != nil { + l = m.Resp.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgNonAtomicExecResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Results) > 0 { + for _, e := range m.Results { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -519,6 +899,324 @@ func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgNonAtomicExec) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgNonAtomicExec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgNonAtomicExec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Msgs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Msgs = append(m.Msgs, &types.Any{}) + if err := m.Msgs[len(m.Msgs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NonAtomicExecResult) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: NonAtomicExecResult: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NonAtomicExecResult: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Error = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Resp == nil { + m.Resp = &types.Any{} + } + if err := m.Resp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgNonAtomicExecResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgNonAtomicExecResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgNonAtomicExecResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Results", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Results = append(m.Results, &NonAtomicExecResult{}) + if err := m.Results[len(m.Results)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/auth/vesting/testutil/expected_keepers_mocks.go b/x/auth/vesting/testutil/expected_keepers_mocks.go index 1df8f8ebbf2b..e7ff4c4d66ec 100644 --- a/x/auth/vesting/testutil/expected_keepers_mocks.go +++ b/x/auth/vesting/testutil/expected_keepers_mocks.go @@ -10,6 +10,7 @@ import ( types "github.com/cosmos/cosmos-sdk/types" gomock "github.com/golang/mock/gomock" + protoiface "google.golang.org/protobuf/runtime/protoiface" ) // MockBankKeeper is a mock of BankKeeper interface. @@ -81,3 +82,55 @@ func (mr *MockBankKeeperMockRecorder) SendCoins(ctx, fromAddr, toAddr, amt inter mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoins", reflect.TypeOf((*MockBankKeeper)(nil).SendCoins), ctx, fromAddr, toAddr, amt) } + +// MockAccountsModKeeper is a mock of AccountsModKeeper interface. +type MockAccountsModKeeper struct { + ctrl *gomock.Controller + recorder *MockAccountsModKeeperMockRecorder +} + +// MockAccountsModKeeperMockRecorder is the mock recorder for MockAccountsModKeeper. +type MockAccountsModKeeperMockRecorder struct { + mock *MockAccountsModKeeper +} + +// NewMockAccountsModKeeper creates a new mock instance. +func NewMockAccountsModKeeper(ctrl *gomock.Controller) *MockAccountsModKeeper { + mock := &MockAccountsModKeeper{ctrl: ctrl} + mock.recorder = &MockAccountsModKeeperMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockAccountsModKeeper) EXPECT() *MockAccountsModKeeperMockRecorder { + return m.recorder +} + +// IsAccountsModuleAccount mocks base method. +func (m *MockAccountsModKeeper) IsAccountsModuleAccount(ctx context.Context, accountAddr []byte) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "IsAccountsModuleAccount", ctx, accountAddr) + ret0, _ := ret[0].(bool) + return ret0 +} + +// IsAccountsModuleAccount indicates an expected call of IsAccountsModuleAccount. +func (mr *MockAccountsModKeeperMockRecorder) IsAccountsModuleAccount(ctx, accountAddr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsAccountsModuleAccount", reflect.TypeOf((*MockAccountsModKeeper)(nil).IsAccountsModuleAccount), ctx, accountAddr) +} + +// SendModuleMessageUntyped mocks base method. +func (m *MockAccountsModKeeper) SendModuleMessageUntyped(ctx context.Context, sender []byte, msg protoiface.MessageV1) (protoiface.MessageV1, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendModuleMessageUntyped", ctx, sender, msg) + ret0, _ := ret[0].(protoiface.MessageV1) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SendModuleMessageUntyped indicates an expected call of SendModuleMessageUntyped. +func (mr *MockAccountsModKeeperMockRecorder) SendModuleMessageUntyped(ctx, sender, msg interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendModuleMessageUntyped", reflect.TypeOf((*MockAccountsModKeeper)(nil).SendModuleMessageUntyped), ctx, sender, msg) +} diff --git a/x/auth/vesting/types/expected_keepers.go b/x/auth/vesting/types/expected_keepers.go index 59172579de02..d52848119f5e 100644 --- a/x/auth/vesting/types/expected_keepers.go +++ b/x/auth/vesting/types/expected_keepers.go @@ -3,6 +3,8 @@ package types import ( context "context" + "cosmossdk.io/x/auth/types" + sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -13,3 +15,7 @@ type BankKeeper interface { SendCoins(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error BlockedAddr(addr sdk.AccAddress) bool } + +type AccountsModKeeper interface { + types.AccountsModKeeper +} diff --git a/x/auth/vesting/types/vesting_account_test.go b/x/auth/vesting/types/vesting_account_test.go index 83273f32bbad..18459338da7c 100644 --- a/x/auth/vesting/types/vesting_account_test.go +++ b/x/auth/vesting/types/vesting_account_test.go @@ -4,6 +4,7 @@ import ( "testing" "time" + "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -14,6 +15,7 @@ import ( "cosmossdk.io/x/auth/keeper" authtypes "cosmossdk.io/x/auth/types" "cosmossdk.io/x/auth/vesting" + vestingtestutil "cosmossdk.io/x/auth/vesting/testutil" "cosmossdk.io/x/auth/vesting/types" codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" @@ -46,6 +48,10 @@ func (s *VestingAccountTestSuite) SetupTest() { testCtx := testutil.DefaultContextWithDB(s.T(), key, storetypes.NewTransientStoreKey("transient_test")) s.ctx = testCtx.Ctx.WithHeaderInfo(header.Info{}) + // gomock initializations + ctrl := gomock.NewController(&testing.T{}) + acctsModKeeper := vestingtestutil.NewMockAccountsModKeeper(ctrl) + maccPerms := map[string][]string{ "fee_collector": nil, "mint": {"minter"}, @@ -59,6 +65,7 @@ func (s *VestingAccountTestSuite) SetupTest() { env, encCfg.Codec, authtypes.ProtoBaseAccount, + acctsModKeeper, maccPerms, authcodec.NewBech32Codec("cosmos"), "cosmos", diff --git a/x/authz/CHANGELOG.md b/x/authz/CHANGELOG.md index e6de2c18baca..2caad8f47eb1 100644 --- a/x/authz/CHANGELOG.md +++ b/x/authz/CHANGELOG.md @@ -31,6 +31,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### API Breaking Changes +* [#19783](https://github.com/cosmos/cosmos-sdk/pull/19783) Removes the use of Accouts String() method + * `NewMsgExec`, `NewMsgGrant` and `NewMsgRevoke` now takes strings as arguments instead of `sdk.AccAddress`. + * `ExportGenesis` also returns an error. + * `IterateGrants` returns an error, its handler function also returns an error. * [#19637](https://github.com/cosmos/cosmos-sdk/pull/19637) `NewKeeper` doesn't take a message router anymore. Set the message router in the `appmodule.Environment` instead. * [#19490](https://github.com/cosmos/cosmos-sdk/pull/19490) `appmodule.Environment` is received on the Keeper to get access to different application services. * [#18737](https://github.com/cosmos/cosmos-sdk/pull/18737) Update the keeper method `DequeueAndDeleteExpiredGrants` to take a limit argument for the number of grants to prune. @@ -39,3 +43,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Consensus Breaking Changes * [#19188](https://github.com/cosmos/cosmos-sdk/pull/19188) Remove creation of `BaseAccount` when sending a message to an account that does not exist. + +### Bug Fixes + +* [#19874](https://github.com/cosmos/cosmos-sdk/pull/19923) Now when querying transaction events (cosmos.tx.v1beta1.Service/GetTxsEvent) the response will contains only UTF-8 characters \ No newline at end of file diff --git a/x/authz/authz.pb.go b/x/authz/authz.pb.go index 6be85430a132..14a8c7b972d8 100644 --- a/x/authz/authz.pb.go +++ b/x/authz/authz.pb.go @@ -6,11 +6,11 @@ package authz import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + any "github.com/cosmos/gogoproto/types/any" _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" @@ -73,7 +73,7 @@ var xxx_messageInfo_GenericAuthorization proto.InternalMessageInfo // Grant gives permissions to execute // the provide method with expiration time. type Grant struct { - Authorization *types.Any `protobuf:"bytes,1,opt,name=authorization,proto3" json:"authorization,omitempty"` + Authorization *any.Any `protobuf:"bytes,1,opt,name=authorization,proto3" json:"authorization,omitempty"` // time when the grant will expire and will be pruned. If null, then the grant // doesn't have a time expiration (other conditions in `authorization` // may apply to invalidate the grant) @@ -118,7 +118,7 @@ var xxx_messageInfo_Grant proto.InternalMessageInfo type GrantAuthorization struct { Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"` Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"` - Authorization *types.Any `protobuf:"bytes,3,opt,name=authorization,proto3" json:"authorization,omitempty"` + Authorization *any.Any `protobuf:"bytes,3,opt,name=authorization,proto3" json:"authorization,omitempty"` Expiration *time.Time `protobuf:"bytes,4,opt,name=expiration,proto3,stdtime" json:"expiration,omitempty"` } @@ -629,7 +629,7 @@ func (m *Grant) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Authorization == nil { - m.Authorization = &types.Any{} + m.Authorization = &any.Any{} } if err := m.Authorization.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -815,7 +815,7 @@ func (m *GrantAuthorization) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Authorization == nil { - m.Authorization = &types.Any{} + m.Authorization = &any.Any{} } if err := m.Authorization.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/x/authz/client/cli/tx.go b/x/authz/client/cli/tx.go index 6227785b067a..d065c57cc288 100644 --- a/x/authz/client/cli/tx.go +++ b/x/authz/client/cli/tx.go @@ -67,7 +67,10 @@ func NewCmdExecAuthorization() *cobra.Command { if err != nil { return err } - grantee := clientCtx.GetFromAddress() + grantee, err := clientCtx.AddressCodec.BytesToString(clientCtx.GetFromAddress()) + if err != nil { + return err + } if offline, _ := cmd.Flags().GetBool(flags.FlagOffline); offline { return errors.New("cannot broadcast tx during offline mode") @@ -106,15 +109,20 @@ Examples: return err } - if strings.EqualFold(args[0], clientCtx.GetFromAddress().String()) { - return errors.New("grantee and granter should be different") + grantee := args[0] + if _, err := clientCtx.AddressCodec.StringToBytes(grantee); err != nil { + return err } - grantee, err := clientCtx.AddressCodec.StringToBytes(args[0]) + granter, err := clientCtx.AddressCodec.BytesToString(clientCtx.GetFromAddress()) if err != nil { return err } + if strings.EqualFold(grantee, granter) { + return errors.New("grantee and granter should be different") + } + var authorization authz.Authorization switch args[1] { case "send": @@ -151,7 +159,7 @@ Examples: return err } - authorization = bank.NewSendAuthorization(spendLimit, allowed) + authorization = bank.NewSendAuthorization(spendLimit, allowed, clientCtx.AddressCodec) case "generic": msgType, err := cmd.Flags().GetString(FlagMsgType) @@ -230,7 +238,7 @@ Examples: return err } - msg, err := authz.NewMsgGrant(clientCtx.GetFromAddress(), grantee, authorization, expire) + msg, err := authz.NewMsgGrant(granter, grantee, authorization, expire) if err != nil { return err } diff --git a/x/authz/client/cli/tx_test.go b/x/authz/client/cli/tx_test.go index a9c4d87a96f6..bdb963a102a2 100644 --- a/x/authz/client/cli/tx_test.go +++ b/x/authz/client/cli/tx_test.go @@ -80,6 +80,8 @@ func (s *CLITestSuite) SetupSuite() { val := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) s.grantee = make([]sdk.AccAddress, 6) + valAddr, err := s.baseCtx.AddressCodec.BytesToString(val[0].Address) + s.Require().NoError(err) s.addrs = make([]sdk.AccAddress, 1) s.addrs[0] = s.createAccount("validator address") @@ -93,13 +95,15 @@ func (s *CLITestSuite) SetupSuite() { s.grantee[1] = s.createAccount("grantee2") // Send some funds to the new account. s.msgSendExec(s.grantee[1]) + grantee1Addr, err := s.baseCtx.AddressCodec.BytesToString(s.grantee[1]) + s.Require().NoError(err) // grant send authorization to grantee2 out, err := authzclitestutil.CreateGrant(s.clientCtx, []string{ - s.grantee[1].String(), + grantee1Addr, "send", fmt.Sprintf("--%s=100stake", cli.FlagSpendLimit), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, valAddr), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), @@ -112,13 +116,15 @@ func (s *CLITestSuite) SetupSuite() { // Create new account in the keyring. s.grantee[2] = s.createAccount("grantee3") + grantee2Addr, err := s.baseCtx.AddressCodec.BytesToString(s.grantee[2]) + s.Require().NoError(err) // grant send authorization to grantee3 _, err = authzclitestutil.CreateGrant(s.clientCtx, []string{ - s.grantee[2].String(), + grantee2Addr, "send", fmt.Sprintf("--%s=100stake", cli.FlagSpendLimit), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, valAddr), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(10))).String()), @@ -129,6 +135,8 @@ func (s *CLITestSuite) SetupSuite() { // Create new accounts in the keyring. s.grantee[3] = s.createAccount("grantee4") s.msgSendExec(s.grantee[3]) + grantee3Addr, err := s.baseCtx.AddressCodec.BytesToString(s.grantee[3]) + s.Require().NoError(err) s.grantee[4] = s.createAccount("grantee5") s.grantee[5] = s.createAccount("grantee6") @@ -136,11 +144,11 @@ func (s *CLITestSuite) SetupSuite() { // grant send authorization with allow list to grantee4 out, err = authzclitestutil.CreateGrant(s.clientCtx, []string{ - s.grantee[3].String(), + grantee3Addr, "send", fmt.Sprintf("--%s=100stake", cli.FlagSpendLimit), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, valAddr), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%d", cli.FlagExpiration, time.Now().Add(time.Minute*time.Duration(120)).Unix()), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10))).String()), @@ -170,9 +178,13 @@ func (s *CLITestSuite) msgSendExec(grantee sdk.AccAddress) { coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(200))) from := val[0].Address + fromAddr, err := s.clientCtx.AddressCodec.BytesToString(from) + s.Require().NoError(err) + granteeAddr, err := s.clientCtx.AddressCodec.BytesToString(grantee) + s.Require().NoError(err) msgSend := &banktypes.MsgSend{ - FromAddress: from.String(), - ToAddress: grantee.String(), + FromAddress: fromAddr, + ToAddress: granteeAddr, Amount: coins, } @@ -182,8 +194,14 @@ func (s *CLITestSuite) msgSendExec(grantee sdk.AccAddress) { func (s *CLITestSuite) TestCLITxGrantAuthorization() { val := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) + valAddress, err := s.clientCtx.ValidatorAddressCodec.BytesToString(s.addrs[0]) + s.Require().NoError(err) + fromAddr, err := s.baseCtx.AddressCodec.BytesToString(val[0].Address) + s.Require().NoError(err) grantee := s.grantee[0] + granteeAddr, err := s.baseCtx.AddressCodec.BytesToString(grantee) + s.Require().NoError(err) twoHours := time.Now().Add(time.Minute * 120).Unix() pastHour := time.Now().Add(-time.Minute * 60).Unix() @@ -213,7 +231,7 @@ func (s *CLITestSuite) TestCLITxGrantAuthorization() { "grantee_addr", "send", fmt.Sprintf("--%s=100stake", cli.FlagSpendLimit), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, fromAddr), fmt.Sprintf("--%s=true", flags.FlagGenerateOnly), fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), }, @@ -223,10 +241,10 @@ func (s *CLITestSuite) TestCLITxGrantAuthorization() { { "Invalid spend limit", []string{ - grantee.String(), + granteeAddr, "send", fmt.Sprintf("--%s=0stake", cli.FlagSpendLimit), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, fromAddr), fmt.Sprintf("--%s=true", flags.FlagGenerateOnly), fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), }, @@ -236,10 +254,10 @@ func (s *CLITestSuite) TestCLITxGrantAuthorization() { { "Invalid expiration time", []string{ - grantee.String(), + granteeAddr, "send", fmt.Sprintf("--%s=100stake", cli.FlagSpendLimit), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, fromAddr), fmt.Sprintf("--%s=true", flags.FlagBroadcastMode), fmt.Sprintf("--%s=%d", cli.FlagExpiration, pastHour), }, @@ -249,10 +267,10 @@ func (s *CLITestSuite) TestCLITxGrantAuthorization() { { "fail with error invalid msg-type", []string{ - grantee.String(), + granteeAddr, "generic", fmt.Sprintf("--%s=invalid-msg-type", cli.FlagMsgType), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, fromAddr), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10))).String()), @@ -264,14 +282,14 @@ func (s *CLITestSuite) TestCLITxGrantAuthorization() { { "invalid bond denom for tx delegate authorization allowed validators", []string{ - grantee.String(), + granteeAddr, "delegate", fmt.Sprintf("--%s=100xyz", cli.FlagSpendLimit), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, fromAddr), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), - fmt.Sprintf("--%s=%s", cli.FlagAllowedValidators, sdk.ValAddress(s.addrs[0]).String()), + fmt.Sprintf("--%s=%s", cli.FlagAllowedValidators, valAddress), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10))).String()), }, true, @@ -280,14 +298,14 @@ func (s *CLITestSuite) TestCLITxGrantAuthorization() { { "invalid bond denom for tx delegate authorization deny validators", []string{ - grantee.String(), + granteeAddr, "delegate", fmt.Sprintf("--%s=100xyz", cli.FlagSpendLimit), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, fromAddr), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), - fmt.Sprintf("--%s=%s", cli.FlagDenyValidators, sdk.ValAddress(s.addrs[0]).String()), + fmt.Sprintf("--%s=%s", cli.FlagDenyValidators, valAddress), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10))).String()), }, true, @@ -296,14 +314,14 @@ func (s *CLITestSuite) TestCLITxGrantAuthorization() { { "invalid bond denom for tx undelegate authorization", []string{ - grantee.String(), + granteeAddr, "unbond", fmt.Sprintf("--%s=100xyz", cli.FlagSpendLimit), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, fromAddr), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), - fmt.Sprintf("--%s=%s", cli.FlagAllowedValidators, sdk.ValAddress(s.addrs[0]).String()), + fmt.Sprintf("--%s=%s", cli.FlagAllowedValidators, valAddress), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10))).String()), }, true, @@ -312,14 +330,14 @@ func (s *CLITestSuite) TestCLITxGrantAuthorization() { { "invalid bond denom for tx redelegate authorization", []string{ - grantee.String(), + granteeAddr, "redelegate", fmt.Sprintf("--%s=100xyz", cli.FlagSpendLimit), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, fromAddr), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), - fmt.Sprintf("--%s=%s", cli.FlagAllowedValidators, sdk.ValAddress(s.addrs[0]).String()), + fmt.Sprintf("--%s=%s", cli.FlagAllowedValidators, valAddress), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10))).String()), }, true, @@ -328,14 +346,14 @@ func (s *CLITestSuite) TestCLITxGrantAuthorization() { { "invalid decimal coin expression with more than single coin", []string{ - grantee.String(), + granteeAddr, "delegate", fmt.Sprintf("--%s=100stake,20xyz", cli.FlagSpendLimit), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, fromAddr), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), - fmt.Sprintf("--%s=%s", cli.FlagAllowedValidators, sdk.ValAddress(s.addrs[0]).String()), + fmt.Sprintf("--%s=%s", cli.FlagAllowedValidators, valAddress), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10))).String()), }, true, @@ -344,7 +362,7 @@ func (s *CLITestSuite) TestCLITxGrantAuthorization() { { "invalid authorization type", []string{ - grantee.String(), + granteeAddr, "invalid authz type", }, true, @@ -353,10 +371,10 @@ func (s *CLITestSuite) TestCLITxGrantAuthorization() { { "Valid tx send authorization", []string{ - grantee.String(), + granteeAddr, "send", fmt.Sprintf("--%s=100stake", cli.FlagSpendLimit), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, fromAddr), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), @@ -368,10 +386,10 @@ func (s *CLITestSuite) TestCLITxGrantAuthorization() { { "Valid tx send authorization with allow list", []string{ - grantee.String(), + granteeAddr, "send", fmt.Sprintf("--%s=100stake", cli.FlagSpendLimit), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, fromAddr), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), @@ -384,10 +402,10 @@ func (s *CLITestSuite) TestCLITxGrantAuthorization() { { "Invalid tx send authorization with duplicate allow list", []string{ - grantee.String(), + granteeAddr, "send", fmt.Sprintf("--%s=100stake", cli.FlagSpendLimit), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, fromAddr), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), @@ -400,10 +418,10 @@ func (s *CLITestSuite) TestCLITxGrantAuthorization() { { "Valid tx generic authorization", []string{ - grantee.String(), + granteeAddr, "generic", fmt.Sprintf("--%s=%s", cli.FlagMsgType, typeMsgVote), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, fromAddr), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), @@ -415,10 +433,10 @@ func (s *CLITestSuite) TestCLITxGrantAuthorization() { { "fail when granter = grantee", []string{ - grantee.String(), + granteeAddr, "generic", fmt.Sprintf("--%s=%s", cli.FlagMsgType, typeMsgVote), - fmt.Sprintf("--%s=%s", flags.FlagFrom, grantee.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, granteeAddr), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), @@ -430,10 +448,10 @@ func (s *CLITestSuite) TestCLITxGrantAuthorization() { { "Valid tx with amino", []string{ - grantee.String(), + granteeAddr, "generic", fmt.Sprintf("--%s=%s", cli.FlagMsgType, typeMsgVote), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, fromAddr), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%d", cli.FlagExpiration, twoHours), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), diff --git a/x/authz/go.mod b/x/authz/go.mod index 1262c450495b..5c3306b10eaf 100644 --- a/x/authz/go.mod +++ b/x/authz/go.mod @@ -17,17 +17,17 @@ require ( cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 cosmossdk.io/x/tx v0.13.1 github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.6 + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 github.com/cosmos/cosmos-proto v1.0.0-beta.4 github.com/cosmos/cosmos-sdk v0.51.0 - github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/gogoproto v1.4.12 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.9.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 - google.golang.org/grpc v1.62.1 + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de + google.golang.org/grpc v1.63.2 google.golang.org/protobuf v1.33.0 ) @@ -60,7 +60,7 @@ require ( github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect @@ -106,7 +106,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -116,13 +116,13 @@ require ( github.com/mtibben/percent v0.2.1 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.0 // indirect github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.50.0 // indirect + github.com/prometheus/common v0.52.2 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect @@ -146,17 +146,17 @@ require ( gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 // indirect go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.21.0 // indirect + golang.org/x/crypto v0.22.0 // indirect golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.22.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.18.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect diff --git a/x/authz/go.sum b/x/authz/go.sum index 046ebfecd550..507f3ab80bd9 100644 --- a/x/authz/go.sum +++ b/x/authz/go.sum @@ -118,8 +118,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -141,8 +141,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/cosmos/iavl v1.0.0 h1:bw6t0Mv/mVCJvlMTOPHWLs5uUE3BRBfVWCRelOzl+so= github.com/cosmos/iavl v1.0.0/go.mod h1:CmTGqMnRnucjxbjduneZXT+0vPgNElYvdefjX2q9tYc= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= @@ -162,8 +162,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= @@ -449,8 +449,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -553,8 +553,8 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= @@ -595,8 +595,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= -github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -749,8 +749,8 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= @@ -799,8 +799,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -812,8 +812,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -868,12 +868,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -927,12 +927,12 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -950,8 +950,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/x/authz/keeper/genesis.go b/x/authz/keeper/genesis.go index d5de1d741b09..909c54dc1421 100644 --- a/x/authz/keeper/genesis.go +++ b/x/authz/keeper/genesis.go @@ -41,17 +41,27 @@ func (k Keeper) InitGenesis(ctx context.Context, data *authz.GenesisState) error } // ExportGenesis returns a GenesisState for a given context. -func (k Keeper) ExportGenesis(ctx context.Context) *authz.GenesisState { +func (k Keeper) ExportGenesis(ctx context.Context) (*authz.GenesisState, error) { var entries []authz.GrantAuthorization - k.IterateGrants(ctx, func(granter, grantee sdk.AccAddress, grant authz.Grant) bool { + err := k.IterateGrants(ctx, func(granter, grantee sdk.AccAddress, grant authz.Grant) (bool, error) { + granterAddr, err := k.authKeeper.AddressCodec().BytesToString(granter) + if err != nil { + return false, err + } + granteeAddr, err := k.authKeeper.AddressCodec().BytesToString(grantee) + if err != nil { + return false, err + } entries = append(entries, authz.GrantAuthorization{ - Granter: granter.String(), - Grantee: grantee.String(), + Granter: granterAddr, + Grantee: granteeAddr, Expiration: grant.Expiration, Authorization: grant.Authorization, }) - return false + return false, nil }) - - return authz.NewGenesisState(entries) + if err != nil { + return nil, err + } + return authz.NewGenesisState(entries), nil } diff --git a/x/authz/keeper/genesis_test.go b/x/authz/keeper/genesis_test.go index d913c3bef304..a4a40033514d 100644 --- a/x/authz/keeper/genesis_test.go +++ b/x/authz/keeper/genesis_test.go @@ -81,18 +81,20 @@ func (suite *GenesisTestSuite) TestImportExportGenesis() { grant := &bank.SendAuthorization{SpendLimit: coins} err := suite.keeper.SaveGrant(suite.ctx, granteeAddr, granterAddr, grant, &expires) suite.Require().NoError(err) - genesis := suite.keeper.ExportGenesis(suite.ctx) - + genesis, err := suite.keeper.ExportGenesis(suite.ctx) + suite.Require().NoError(err) // Clear keeper err = suite.keeper.DeleteGrant(suite.ctx, granteeAddr, granterAddr, grant.MsgTypeURL()) suite.Require().NoError(err) - newGenesis := suite.keeper.ExportGenesis(suite.ctx) + newGenesis, err := suite.keeper.ExportGenesis(suite.ctx) + suite.Require().NoError(err) suite.Require().NotEqual(genesis, newGenesis) suite.Require().Empty(newGenesis) err = suite.keeper.InitGenesis(suite.ctx, genesis) suite.Require().NoError(err) - newGenesis = suite.keeper.ExportGenesis(suite.ctx) + newGenesis, err = suite.keeper.ExportGenesis(suite.ctx) + suite.Require().NoError(err) suite.Require().Equal(genesis, newGenesis) } diff --git a/x/authz/keeper/grpc_query_test.go b/x/authz/keeper/grpc_query_test.go index be53c1df8e3f..6cb51dbae0f7 100644 --- a/x/authz/keeper/grpc_query_test.go +++ b/x/authz/keeper/grpc_query_test.go @@ -21,6 +21,11 @@ func (suite *TestSuite) TestGRPCQueryAuthorization() { expAuthorization authz.Authorization ) + addr0, err := suite.accountKeeper.AddressCodec().BytesToString(addrs[0]) + suite.Require().NoError(err) + addr1, err := suite.accountKeeper.AddressCodec().BytesToString(addrs[1]) + suite.Require().NoError(err) + testCases := []struct { msg string malleate func(require *require.Assertions) @@ -39,7 +44,7 @@ func (suite *TestSuite) TestGRPCQueryAuthorization() { "fail invalid grantee addr", func(require *require.Assertions) { req = &authz.QueryGrantsRequest{ - Granter: addrs[0].String(), + Granter: addr0, } }, "empty address string is not allowed", @@ -49,8 +54,8 @@ func (suite *TestSuite) TestGRPCQueryAuthorization() { "fail invalid msg-type", func(require *require.Assertions) { req = &authz.QueryGrantsRequest{ - Granter: addrs[0].String(), - Grantee: addrs[1].String(), + Granter: addr0, + Grantee: addr1, MsgTypeUrl: "unknown", } }, @@ -61,8 +66,8 @@ func (suite *TestSuite) TestGRPCQueryAuthorization() { "authorization not found", func(require *require.Assertions) { req = &authz.QueryGrantsRequest{ - Granter: addrs[1].String(), - Grantee: addrs[0].String(), + Granter: addr1, + Grantee: addr0, MsgTypeUrl: banktypes.SendAuthorization{}.MsgTypeURL(), } }, @@ -74,8 +79,8 @@ func (suite *TestSuite) TestGRPCQueryAuthorization() { func(require *require.Assertions) { expAuthorization = suite.createSendAuthorization(addrs[0], addrs[1]) req = &authz.QueryGrantsRequest{ - Granter: addrs[1].String(), - Grantee: addrs[0].String(), + Granter: addr1, + Grantee: addr0, MsgTypeUrl: expAuthorization.MsgTypeURL(), } }, @@ -95,8 +100,8 @@ func (suite *TestSuite) TestGRPCQueryAuthorization() { expAuthorization = suite.createSendAuthorizationWithAllowList(addrs[0], addrs[1]) require.Len(expAuthorization.(*banktypes.SendAuthorization).GetAllowList(), 1) req = &authz.QueryGrantsRequest{ - Granter: addrs[1].String(), - Grantee: addrs[0].String(), + Granter: addr1, + Grantee: addr0, MsgTypeUrl: expAuthorization.MsgTypeURL(), } }, @@ -132,6 +137,9 @@ func (suite *TestSuite) TestGRPCQueryGranterGrants() { require := suite.Require() queryClient, addrs := suite.queryClient, suite.addrs + addr0, err := suite.accountKeeper.AddressCodec().BytesToString(addrs[0]) + suite.Require().NoError(err) + testCases := []struct { msg string preRun func() @@ -153,7 +161,7 @@ func (suite *TestSuite) TestGRPCQueryGranterGrants() { }, false, authz.QueryGranterGrantsRequest{ - Granter: addrs[0].String(), + Granter: addr0, }, 1, }, @@ -164,7 +172,7 @@ func (suite *TestSuite) TestGRPCQueryGranterGrants() { }, false, authz.QueryGranterGrantsRequest{ - Granter: addrs[0].String(), + Granter: addr0, }, 2, }, @@ -174,7 +182,7 @@ func (suite *TestSuite) TestGRPCQueryGranterGrants() { }, false, authz.QueryGranterGrantsRequest{ - Granter: addrs[0].String(), + Granter: addr0, Pagination: &query.PageRequest{ Limit: 1, }, @@ -202,6 +210,11 @@ func (suite *TestSuite) TestGRPCQueryGranteeGrants() { require := suite.Require() queryClient, addrs := suite.queryClient, suite.addrs + addr0, err := suite.accountKeeper.AddressCodec().BytesToString(addrs[0]) + suite.Require().NoError(err) + addr2, err := suite.accountKeeper.AddressCodec().BytesToString(addrs[2]) + suite.Require().NoError(err) + testCases := []struct { msg string preRun func() @@ -223,7 +236,7 @@ func (suite *TestSuite) TestGRPCQueryGranteeGrants() { }, false, authz.QueryGranteeGrantsRequest{ - Grantee: addrs[0].String(), + Grantee: addr0, }, 1, }, @@ -232,7 +245,7 @@ func (suite *TestSuite) TestGRPCQueryGranteeGrants() { func() {}, false, authz.QueryGranteeGrantsRequest{ - Grantee: addrs[2].String(), + Grantee: addr2, }, 0, }, @@ -243,7 +256,7 @@ func (suite *TestSuite) TestGRPCQueryGranteeGrants() { }, false, authz.QueryGranteeGrantsRequest{ - Grantee: addrs[0].String(), + Grantee: addr0, }, 2, }, @@ -252,7 +265,7 @@ func (suite *TestSuite) TestGRPCQueryGranteeGrants() { func() {}, false, authz.QueryGranteeGrantsRequest{ - Grantee: addrs[0].String(), + Grantee: addr0, Pagination: &query.PageRequest{ Limit: 1, }, @@ -289,8 +302,10 @@ func (suite *TestSuite) createSendAuthorization(grantee, granter sdk.AccAddress) func (suite *TestSuite) createSendAuthorizationWithAllowList(grantee, granter sdk.AccAddress) authz.Authorization { exp := suite.ctx.HeaderInfo().Time.Add(time.Hour) newCoins := sdk.NewCoins(sdk.NewInt64Coin("steak", 100)) - authorization := &banktypes.SendAuthorization{SpendLimit: newCoins, AllowList: []string{suite.addrs[5].String()}} - err := suite.authzKeeper.SaveGrant(suite.ctx, grantee, granter, authorization, &exp) + addr, err := suite.accountKeeper.AddressCodec().BytesToString(suite.addrs[5]) + suite.Require().NoError(err) + authorization := &banktypes.SendAuthorization{SpendLimit: newCoins, AllowList: []string{addr}} + err = suite.authzKeeper.SaveGrant(suite.ctx, grantee, granter, authorization, &exp) suite.Require().NoError(err) return authorization } diff --git a/x/authz/keeper/keeper.go b/x/authz/keeper/keeper.go index 2613e4085327..3feafa900325 100644 --- a/x/authz/keeper/keeper.go +++ b/x/authz/keeper/keeper.go @@ -197,10 +197,19 @@ func (k Keeper) SaveGrant(ctx context.Context, grantee, granter sdk.AccAddress, return err } + granterAddr, err := k.authKeeper.AddressCodec().BytesToString(granter) + if err != nil { + return err + } + granteeAddr, err := k.authKeeper.AddressCodec().BytesToString(grantee) + if err != nil { + return err + } + return k.environment.EventService.EventManager(ctx).Emit(&authz.EventGrant{ MsgTypeUrl: authorization.MsgTypeURL(), - Granter: granter.String(), - Grantee: grantee.String(), + Granter: granterAddr, + Grantee: granteeAddr, }) } @@ -211,7 +220,8 @@ func (k Keeper) DeleteGrant(ctx context.Context, grantee, granter sdk.AccAddress skey := grantStoreKey(grantee, granter, msgType) grant, found := k.getGrant(ctx, skey) if !found { - return errorsmod.Wrapf(authz.ErrNoAuthorizationFound, "failed to delete grant with key %s", string(skey)) + return errorsmod.Wrapf(authz.ErrNoAuthorizationFound, + "failed to delete grant with given granter: %s, grantee: %s & msgType: %s ", granter.String(), grantee.String(), msgType) } if grant.Expiration != nil { @@ -226,10 +236,18 @@ func (k Keeper) DeleteGrant(ctx context.Context, grantee, granter sdk.AccAddress return err } + granterAddr, err := k.authKeeper.AddressCodec().BytesToString(granter) + if err != nil { + return err + } + granteeAddr, err := k.authKeeper.AddressCodec().BytesToString(grantee) + if err != nil { + return err + } return k.environment.EventService.EventManager(ctx).Emit(&authz.EventRevoke{ MsgTypeUrl: msgType, - Granter: granter.String(), - Grantee: grantee.String(), + Granter: granterAddr, + Grantee: granteeAddr, }) } @@ -282,8 +300,8 @@ func (k Keeper) GetAuthorization(ctx context.Context, grantee, granter sdk.AccAd // It should not be used in query or msg services without charging additional gas. // The iteration stops when the handler function returns true or the iterator exhaust. func (k Keeper) IterateGrants(ctx context.Context, - handler func(granterAddr, granteeAddr sdk.AccAddress, grant authz.Grant) bool, -) { + handler func(granterAddr, granteeAddr sdk.AccAddress, grant authz.Grant) (bool, error), +) error { store := runtime.KVStoreAdapter(k.environment.KVStoreService.OpenKVStore(ctx)) iter := storetypes.KVStorePrefixIterator(store, GrantKey) defer iter.Close() @@ -291,10 +309,15 @@ func (k Keeper) IterateGrants(ctx context.Context, var grant authz.Grant granterAddr, granteeAddr, _ := parseGrantStoreKey(iter.Key()) k.cdc.MustUnmarshal(iter.Value(), &grant) - if handler(granterAddr, granteeAddr, grant) { + ok, err := handler(granterAddr, granteeAddr, grant) + if err != nil { + return err + } + if ok { break } } + return nil } func (k Keeper) getGrantQueueItem(ctx context.Context, expiration time.Time, granter, grantee sdk.AccAddress) (*authz.GrantQueueItem, error) { diff --git a/x/authz/keeper/keeper_test.go b/x/authz/keeper/keeper_test.go index b0c77f497dae..23d25f2af98b 100644 --- a/x/authz/keeper/keeper_test.go +++ b/x/authz/keeper/keeper_test.go @@ -147,7 +147,7 @@ func (s *TestSuite) TestKeeperIter() { granteeAddr := addrs[1] granter2Addr := addrs[2] e := ctx.HeaderInfo().Time.AddDate(1, 0, 0) - sendAuthz := banktypes.NewSendAuthorization(coins100, nil) + sendAuthz := banktypes.NewSendAuthorization(coins100, nil, s.accountKeeper.AddressCodec()) err := s.authzKeeper.SaveGrant(ctx, granteeAddr, granterAddr, sendAuthz, &e) s.Require().NoError(err) @@ -155,10 +155,10 @@ func (s *TestSuite) TestKeeperIter() { err = s.authzKeeper.SaveGrant(ctx, granteeAddr, granter2Addr, sendAuthz, &e) s.Require().NoError(err) - s.authzKeeper.IterateGrants(ctx, func(granter, grantee sdk.AccAddress, grant authz.Grant) bool { + _ = s.authzKeeper.IterateGrants(ctx, func(granter, grantee sdk.AccAddress, grant authz.Grant) (bool, error) { s.Require().Equal(granteeAddr, grantee) s.Require().Contains([]sdk.AccAddress{granterAddr, granter2Addr}, granter) - return true + return true, nil }) } @@ -169,8 +169,13 @@ func (s *TestSuite) TestDispatchAction() { granterAddr := addrs[0] granteeAddr := addrs[1] - recipientAddr := addrs[2] - a := banktypes.NewSendAuthorization(coins100, nil) + granterStrAddr, err := s.accountKeeper.AddressCodec().BytesToString(addrs[0]) + s.Require().NoError(err) + granteeStrAddr, err := s.accountKeeper.AddressCodec().BytesToString(addrs[1]) + s.Require().NoError(err) + recipientStrAddr, err := s.accountKeeper.AddressCodec().BytesToString(addrs[2]) + s.Require().NoError(err) + a := banktypes.NewSendAuthorization(coins100, nil, s.accountKeeper.AddressCodec()) testCases := []struct { name string @@ -182,11 +187,11 @@ func (s *TestSuite) TestDispatchAction() { }{ { "expect error authorization not found", - authz.NewMsgExec(granteeAddr, []sdk.Msg{ + authz.NewMsgExec(granteeStrAddr, []sdk.Msg{ &banktypes.MsgSend{ Amount: coins10, - FromAddress: granterAddr.String(), - ToAddress: recipientAddr.String(), + FromAddress: granterStrAddr, + ToAddress: recipientStrAddr, }, }), true, @@ -201,11 +206,11 @@ func (s *TestSuite) TestDispatchAction() { }, { "expect error expired authorization", - authz.NewMsgExec(granteeAddr, []sdk.Msg{ + authz.NewMsgExec(granteeStrAddr, []sdk.Msg{ &banktypes.MsgSend{ Amount: coins10, - FromAddress: granterAddr.String(), - ToAddress: recipientAddr.String(), + FromAddress: granterStrAddr, + ToAddress: recipientStrAddr, }, }), true, @@ -220,11 +225,11 @@ func (s *TestSuite) TestDispatchAction() { }, { "expect error over spent limit", - authz.NewMsgExec(granteeAddr, []sdk.Msg{ + authz.NewMsgExec(granteeStrAddr, []sdk.Msg{ &banktypes.MsgSend{ Amount: coins1000, - FromAddress: granterAddr.String(), - ToAddress: recipientAddr.String(), + FromAddress: granterStrAddr, + ToAddress: recipientStrAddr, }, }), true, @@ -239,11 +244,11 @@ func (s *TestSuite) TestDispatchAction() { }, { "valid test verify amount left", - authz.NewMsgExec(granteeAddr, []sdk.Msg{ + authz.NewMsgExec(granteeStrAddr, []sdk.Msg{ &banktypes.MsgSend{ Amount: coins10, - FromAddress: granterAddr.String(), - ToAddress: recipientAddr.String(), + FromAddress: granterStrAddr, + ToAddress: recipientStrAddr, }, }), false, @@ -265,11 +270,11 @@ func (s *TestSuite) TestDispatchAction() { }, { "valid test verify authorization is removed when it is used up", - authz.NewMsgExec(granteeAddr, []sdk.Msg{ + authz.NewMsgExec(granteeStrAddr, []sdk.Msg{ &banktypes.MsgSend{ Amount: coins100, - FromAddress: granterAddr.String(), - ToAddress: recipientAddr.String(), + FromAddress: granterStrAddr, + ToAddress: recipientStrAddr, }, }), false, @@ -314,19 +319,24 @@ func (s *TestSuite) TestDispatchedEvents() { addrs := s.addrs granterAddr := addrs[0] granteeAddr := addrs[1] - recipientAddr := addrs[2] + granterStrAddr, err := s.accountKeeper.AddressCodec().BytesToString(addrs[0]) + s.Require().NoError(err) + granteeStrAddr, err := s.accountKeeper.AddressCodec().BytesToString(addrs[1]) + s.Require().NoError(err) + recipientStrAddr, err := s.accountKeeper.AddressCodec().BytesToString(addrs[2]) + s.Require().NoError(err) expiration := s.ctx.HeaderInfo().Time.Add(1 * time.Second) // must be in the future - msgs := authz.NewMsgExec(granteeAddr, []sdk.Msg{ + msgs := authz.NewMsgExec(granteeStrAddr, []sdk.Msg{ &banktypes.MsgSend{ Amount: coins10, - FromAddress: granterAddr.String(), - ToAddress: recipientAddr.String(), + FromAddress: granterStrAddr, + ToAddress: recipientStrAddr, }, }) // grant authorization - err := s.authzKeeper.SaveGrant(s.ctx, granteeAddr, granterAddr, &banktypes.SendAuthorization{SpendLimit: coins10}, &expiration) + err = s.authzKeeper.SaveGrant(s.ctx, granteeAddr, granterAddr, &banktypes.SendAuthorization{SpendLimit: coins10}, &expiration) require.NoError(err) authorizations, err := s.authzKeeper.GetAuthorizations(s.ctx, granteeAddr, granterAddr) require.NoError(err) @@ -412,7 +422,7 @@ func (s *TestSuite) TestGetAuthorization() { genAuthMulti := authz.NewGenericAuthorization(sdk.MsgTypeURL(&banktypes.MsgMultiSend{})) genAuthSend := authz.NewGenericAuthorization(sdk.MsgTypeURL(&banktypes.MsgSend{})) - sendAuth := banktypes.NewSendAuthorization(coins10, nil) + sendAuth := banktypes.NewSendAuthorization(coins10, nil, s.accountKeeper.AddressCodec()) start := s.ctx.HeaderInfo().Time expired := start.Add(time.Duration(1) * time.Second) diff --git a/x/authz/keeper/msg_server_test.go b/x/authz/keeper/msg_server_test.go index 879061943b14..5e4a25279b87 100644 --- a/x/authz/keeper/msg_server_test.go +++ b/x/authz/keeper/msg_server_test.go @@ -36,6 +36,10 @@ func (suite *TestSuite) TestGrant() { coins := sdk.NewCoins(sdk.NewCoin("steak", sdkmath.NewInt(10))) grantee, granter := addrs[0], addrs[1] + granterStrAddr, err := suite.accountKeeper.AddressCodec().BytesToString(granter) + suite.Require().NoError(err) + granteeStrAddr, err := suite.accountKeeper.AddressCodec().BytesToString(grantee) + suite.Require().NoError(err) testCases := []struct { name string @@ -46,11 +50,11 @@ func (suite *TestSuite) TestGrant() { { name: "identical grantee and granter", malleate: func() *authz.MsgGrant { - grant, err := authz.NewGrant(curBlockTime, banktypes.NewSendAuthorization(coins, nil), &oneYear) + grant, err := authz.NewGrant(curBlockTime, banktypes.NewSendAuthorization(coins, nil, suite.accountKeeper.AddressCodec()), &oneYear) suite.Require().NoError(err) return &authz.MsgGrant{ - Granter: grantee.String(), - Grantee: grantee.String(), + Granter: granteeStrAddr, + Grantee: granteeStrAddr, Grant: grant, } }, @@ -60,11 +64,11 @@ func (suite *TestSuite) TestGrant() { { name: "invalid granter", malleate: func() *authz.MsgGrant { - grant, err := authz.NewGrant(curBlockTime, banktypes.NewSendAuthorization(coins, nil), &oneYear) + grant, err := authz.NewGrant(curBlockTime, banktypes.NewSendAuthorization(coins, nil, suite.accountKeeper.AddressCodec()), &oneYear) suite.Require().NoError(err) return &authz.MsgGrant{ Granter: "invalid", - Grantee: grantee.String(), + Grantee: granteeStrAddr, Grant: grant, } }, @@ -74,10 +78,10 @@ func (suite *TestSuite) TestGrant() { { name: "invalid grantee", malleate: func() *authz.MsgGrant { - grant, err := authz.NewGrant(curBlockTime, banktypes.NewSendAuthorization(coins, nil), &oneYear) + grant, err := authz.NewGrant(curBlockTime, banktypes.NewSendAuthorization(coins, nil, suite.accountKeeper.AddressCodec()), &oneYear) suite.Require().NoError(err) return &authz.MsgGrant{ - Granter: granter.String(), + Granter: granterStrAddr, Grantee: "invalid", Grant: grant, } @@ -89,8 +93,8 @@ func (suite *TestSuite) TestGrant() { name: "invalid grant", malleate: func() *authz.MsgGrant { return &authz.MsgGrant{ - Granter: granter.String(), - Grantee: grantee.String(), + Granter: granterStrAddr, + Grantee: granteeStrAddr, Grant: authz.Grant{ Expiration: &oneYear, }, @@ -103,11 +107,11 @@ func (suite *TestSuite) TestGrant() { name: "invalid grant, past time", malleate: func() *authz.MsgGrant { pTime := curBlockTime.Add(-time.Hour) - grant, err := authz.NewGrant(curBlockTime, banktypes.NewSendAuthorization(coins, nil), &oneHour) // we only need the authorization + grant, err := authz.NewGrant(curBlockTime, banktypes.NewSendAuthorization(coins, nil, suite.accountKeeper.AddressCodec()), &oneHour) // we only need the authorization suite.Require().NoError(err) return &authz.MsgGrant{ - Granter: granter.String(), - Grantee: grantee.String(), + Granter: granterStrAddr, + Grantee: granteeStrAddr, Grant: authz.Grant{ Authorization: grant.Authorization, Expiration: &pTime, @@ -125,11 +129,15 @@ func (suite *TestSuite) TestGrant() { acc := authtypes.NewBaseAccountWithAddress(newAcc) suite.accountKeeper.EXPECT().NewAccountWithAddress(gomock.Any(), newAcc).Return(acc).AnyTimes() - grant, err := authz.NewGrant(curBlockTime, banktypes.NewSendAuthorization(coins, nil), &oneYear) + grant, err := authz.NewGrant(curBlockTime, banktypes.NewSendAuthorization(coins, nil, suite.accountKeeper.AddressCodec()), &oneYear) + suite.Require().NoError(err) + + addr, err := suite.accountKeeper.AddressCodec().BytesToString(newAcc) suite.Require().NoError(err) + return &authz.MsgGrant{ - Granter: granter.String(), - Grantee: newAcc.String(), + Granter: granterStrAddr, + Grantee: addr, Grant: grant, } }, @@ -137,11 +145,11 @@ func (suite *TestSuite) TestGrant() { { name: "valid grant", malleate: func() *authz.MsgGrant { - grant, err := authz.NewGrant(curBlockTime, banktypes.NewSendAuthorization(coins, nil), &oneYear) + grant, err := authz.NewGrant(curBlockTime, banktypes.NewSendAuthorization(coins, nil, suite.accountKeeper.AddressCodec()), &oneYear) suite.Require().NoError(err) return &authz.MsgGrant{ - Granter: granter.String(), - Grantee: grantee.String(), + Granter: granterStrAddr, + Grantee: granteeStrAddr, Grant: grant, } }, @@ -149,11 +157,11 @@ func (suite *TestSuite) TestGrant() { { name: "valid grant, same grantee, granter pair but different msgType", malleate: func() *authz.MsgGrant { - g, err := authz.NewGrant(curBlockTime, banktypes.NewSendAuthorization(coins, nil), &oneHour) + g, err := authz.NewGrant(curBlockTime, banktypes.NewSendAuthorization(coins, nil, suite.accountKeeper.AddressCodec()), &oneHour) suite.Require().NoError(err) _, err = suite.msgSrvr.Grant(suite.ctx, &authz.MsgGrant{ - Granter: granter.String(), - Grantee: grantee.String(), + Granter: granterStrAddr, + Grantee: granteeStrAddr, Grant: g, }) suite.Require().NoError(err) @@ -161,8 +169,8 @@ func (suite *TestSuite) TestGrant() { grant, err := authz.NewGrant(curBlockTime, authz.NewGenericAuthorization("/cosmos.bank.v1beta1.MsgUpdateParams"), &oneHour) suite.Require().NoError(err) return &authz.MsgGrant{ - Granter: granter.String(), - Grantee: grantee.String(), + Granter: granterStrAddr, + Grantee: granteeStrAddr, Grant: grant, } }, @@ -170,11 +178,11 @@ func (suite *TestSuite) TestGrant() { { name: "valid grant with allow list", malleate: func() *authz.MsgGrant { - grant, err := authz.NewGrant(curBlockTime, banktypes.NewSendAuthorization(coins, []sdk.AccAddress{granter}), &oneYear) + grant, err := authz.NewGrant(curBlockTime, banktypes.NewSendAuthorization(coins, []sdk.AccAddress{granter}, suite.accountKeeper.AddressCodec()), &oneYear) suite.Require().NoError(err) return &authz.MsgGrant{ - Granter: granter.String(), - Grantee: grantee.String(), + Granter: granterStrAddr, + Grantee: granteeStrAddr, Grant: grant, } }, @@ -182,11 +190,11 @@ func (suite *TestSuite) TestGrant() { { name: "valid grant with nil expiration time", malleate: func() *authz.MsgGrant { - grant, err := authz.NewGrant(curBlockTime, banktypes.NewSendAuthorization(coins, nil), nil) + grant, err := authz.NewGrant(curBlockTime, banktypes.NewSendAuthorization(coins, nil, suite.accountKeeper.AddressCodec()), nil) suite.Require().NoError(err) return &authz.MsgGrant{ - Granter: granter.String(), - Grantee: grantee.String(), + Granter: granterStrAddr, + Grantee: granteeStrAddr, Grant: grant, } }, @@ -210,6 +218,10 @@ func (suite *TestSuite) TestRevoke() { addrs := suite.createAccounts() grantee, granter := addrs[0], addrs[1] + granterStrAddr, err := suite.accountKeeper.AddressCodec().BytesToString(granter) + suite.Require().NoError(err) + granteeStrAddr, err := suite.accountKeeper.AddressCodec().BytesToString(grantee) + suite.Require().NoError(err) testCases := []struct { name string @@ -221,8 +233,8 @@ func (suite *TestSuite) TestRevoke() { name: "identical grantee and granter", malleate: func() *authz.MsgRevoke { return &authz.MsgRevoke{ - Granter: grantee.String(), - Grantee: grantee.String(), + Granter: granteeStrAddr, + Grantee: granteeStrAddr, MsgTypeUrl: bankSendAuthMsgType, } }, @@ -234,7 +246,7 @@ func (suite *TestSuite) TestRevoke() { malleate: func() *authz.MsgRevoke { return &authz.MsgRevoke{ Granter: "invalid", - Grantee: grantee.String(), + Grantee: granteeStrAddr, MsgTypeUrl: bankSendAuthMsgType, } }, @@ -245,7 +257,7 @@ func (suite *TestSuite) TestRevoke() { name: "invalid grantee", malleate: func() *authz.MsgRevoke { return &authz.MsgRevoke{ - Granter: granter.String(), + Granter: granterStrAddr, Grantee: "invalid", MsgTypeUrl: bankSendAuthMsgType, } @@ -257,8 +269,8 @@ func (suite *TestSuite) TestRevoke() { name: "no msg given", malleate: func() *authz.MsgRevoke { return &authz.MsgRevoke{ - Granter: granter.String(), - Grantee: grantee.String(), + Granter: granterStrAddr, + Grantee: granteeStrAddr, MsgTypeUrl: "", } }, @@ -271,8 +283,8 @@ func (suite *TestSuite) TestRevoke() { suite.createSendAuthorization(grantee, granter) return &authz.MsgRevoke{ - Granter: granter.String(), - Grantee: grantee.String(), + Granter: granterStrAddr, + Grantee: granteeStrAddr, MsgTypeUrl: bankSendAuthMsgType, } }, @@ -281,8 +293,8 @@ func (suite *TestSuite) TestRevoke() { name: "no existing grant to revoke", malleate: func() *authz.MsgRevoke { return &authz.MsgRevoke{ - Granter: granter.String(), - Grantee: grantee.String(), + Granter: granterStrAddr, + Grantee: granteeStrAddr, MsgTypeUrl: bankSendAuthMsgType, } }, @@ -308,11 +320,15 @@ func (suite *TestSuite) TestExec() { addrs := suite.createAccounts() grantee, granter := addrs[0], addrs[1] + granterStrAddr, err := suite.accountKeeper.AddressCodec().BytesToString(granter) + suite.Require().NoError(err) + granteeStrAddr, err := suite.accountKeeper.AddressCodec().BytesToString(grantee) + suite.Require().NoError(err) coins := sdk.NewCoins(sdk.NewCoin("steak", sdkmath.NewInt(10))) msg := &banktypes.MsgSend{ - FromAddress: granter.String(), - ToAddress: grantee.String(), + FromAddress: granterStrAddr, + ToAddress: granteeStrAddr, Amount: coins, } @@ -325,7 +341,7 @@ func (suite *TestSuite) TestExec() { { name: "invalid grantee (empty)", malleate: func() authz.MsgExec { - return authz.NewMsgExec(sdk.AccAddress{}, []sdk.Msg{msg}) + return authz.NewMsgExec("", []sdk.Msg{msg}) }, expErr: true, errMsg: "empty address string is not allowed", @@ -333,7 +349,7 @@ func (suite *TestSuite) TestExec() { { name: "non existing grant", malleate: func() authz.MsgExec { - return authz.NewMsgExec(grantee, []sdk.Msg{msg}) + return authz.NewMsgExec(granteeStrAddr, []sdk.Msg{msg}) }, expErr: true, errMsg: "authorization not found", @@ -341,7 +357,7 @@ func (suite *TestSuite) TestExec() { { name: "no message case", malleate: func() authz.MsgExec { - return authz.NewMsgExec(grantee, []sdk.Msg{}) + return authz.NewMsgExec(granteeStrAddr, []sdk.Msg{}) }, expErr: true, errMsg: "messages cannot be empty", @@ -350,7 +366,7 @@ func (suite *TestSuite) TestExec() { name: "valid case", malleate: func() authz.MsgExec { suite.createSendAuthorization(grantee, granter) - return authz.NewMsgExec(grantee, []sdk.Msg{msg}) + return authz.NewMsgExec(granteeStrAddr, []sdk.Msg{msg}) }, }, } @@ -372,30 +388,35 @@ func (suite *TestSuite) TestExec() { func (suite *TestSuite) TestPruneExpiredGrants() { addrs := suite.createAccounts() + addr0, err := suite.accountKeeper.AddressCodec().BytesToString(addrs[0]) + suite.Require().NoError(err) + addr1, err := suite.accountKeeper.AddressCodec().BytesToString(addrs[1]) + suite.Require().NoError(err) + timeNow := suite.ctx.BlockTime() expiration := timeNow.Add(time.Hour) coins := sdk.NewCoins(sdk.NewCoin("steak", sdkmath.NewInt(10))) - grant, err := authz.NewGrant(timeNow, banktypes.NewSendAuthorization(coins, nil), &expiration) + grant, err := authz.NewGrant(timeNow, banktypes.NewSendAuthorization(coins, nil, suite.accountKeeper.AddressCodec()), &expiration) suite.Require().NoError(err) _, err = suite.msgSrvr.Grant(suite.ctx, &authz.MsgGrant{ - Granter: addrs[0].String(), - Grantee: addrs[1].String(), + Granter: addr0, + Grantee: addr1, Grant: grant, }) suite.Require().NoError(err) _, err = suite.msgSrvr.Grant(suite.ctx, &authz.MsgGrant{ - Granter: addrs[1].String(), - Grantee: addrs[0].String(), + Granter: addr1, + Grantee: addr0, Grant: grant, }) suite.Require().NoError(err) totalGrants := 0 - suite.authzKeeper.IterateGrants(suite.ctx, func(sdk.AccAddress, sdk.AccAddress, authz.Grant) bool { + _ = suite.authzKeeper.IterateGrants(suite.ctx, func(sdk.AccAddress, sdk.AccAddress, authz.Grant) (bool, error) { totalGrants++ - return false + return false, nil }) suite.Require().Equal(len(addrs), totalGrants) @@ -404,13 +425,13 @@ func (suite *TestSuite) TestPruneExpiredGrants() { headerInfo.Time = headerInfo.Time.Add(2 * time.Hour) suite.ctx = suite.ctx.WithHeaderInfo(headerInfo) - _, err = suite.authzKeeper.PruneExpiredGrants(suite.ctx, &authz.MsgPruneExpiredGrants{Pruner: addrs[0].String()}) + _, err = suite.authzKeeper.PruneExpiredGrants(suite.ctx, &authz.MsgPruneExpiredGrants{Pruner: addr0}) suite.Require().NoError(err) totalGrants = 0 - suite.authzKeeper.IterateGrants(suite.ctx, func(sdk.AccAddress, sdk.AccAddress, authz.Grant) bool { + _ = suite.authzKeeper.IterateGrants(suite.ctx, func(sdk.AccAddress, sdk.AccAddress, authz.Grant) (bool, error) { totalGrants++ - return false + return false, nil }) suite.Require().Equal(0, totalGrants) } diff --git a/x/authz/migrations/v2/store_test.go b/x/authz/migrations/v2/store_test.go index 4440ae5b4fbe..fe328faae8e8 100644 --- a/x/authz/migrations/v2/store_test.go +++ b/x/authz/migrations/v2/store_test.go @@ -42,7 +42,7 @@ func TestMigration(t *testing.T) { blockTime := ctx.HeaderInfo().Time oneDay := blockTime.AddDate(0, 0, 1) oneYear := blockTime.AddDate(1, 0, 0) - sendAuthz := banktypes.NewSendAuthorization(coins100, nil) + sendAuthz := banktypes.NewSendAuthorization(coins100, nil, codectestutil.CodecOptions{}.GetAddressCodec()) grants := []struct { granter sdk.AccAddress diff --git a/x/authz/module/abci_test.go b/x/authz/module/abci_test.go index ba2ae1914a85..53f0701f287e 100644 --- a/x/authz/module/abci_test.go +++ b/x/authz/module/abci_test.go @@ -54,7 +54,7 @@ func TestExpiredGrantsQueue(t *testing.T) { expiration := ctx.HeaderInfo().Time.AddDate(0, 1, 0) expiration2 := expiration.AddDate(1, 0, 0) smallCoins := sdk.NewCoins(sdk.NewInt64Coin("stake", 10)) - sendAuthz := banktypes.NewSendAuthorization(smallCoins, nil) + sendAuthz := banktypes.NewSendAuthorization(smallCoins, nil, codectestutil.CodecOptions{}.GetAddressCodec()) ctrl := gomock.NewController(t) accountKeeper := authztestutil.NewMockAccountKeeper(ctrl) @@ -71,7 +71,8 @@ func TestExpiredGrantsQueue(t *testing.T) { save := func(grantee sdk.AccAddress, exp *time.Time) { err := authzKeeper.SaveGrant(ctx, grantee, granter, sendAuthz, exp) - require.NoError(t, err, "Grant from %s", grantee.String()) + addr, _ := accountKeeper.AddressCodec().BytesToString(grantee) + require.NoError(t, err, "Grant from %s", addr) } save(grantee1, &expiration) save(grantee2, &expiration) @@ -86,8 +87,10 @@ func TestExpiredGrantsQueue(t *testing.T) { err := authzmodule.BeginBlocker(ctx, authzKeeper) require.NoError(t, err) + addr, err := accountKeeper.AddressCodec().BytesToString(granter) + require.NoError(t, err) res, err := queryClient.GranterGrants(ctx.Context(), &authz.QueryGranterGrantsRequest{ - Granter: granter.String(), + Granter: addr, }) require.NoError(t, err) require.NotNil(t, res) diff --git a/x/authz/module/module.go b/x/authz/module/module.go index a19447ba36c2..bf39198c6412 100644 --- a/x/authz/module/module.go +++ b/x/authz/module/module.go @@ -134,7 +134,10 @@ func (am AppModule) InitGenesis(ctx context.Context, data json.RawMessage) error // ExportGenesis returns the exported genesis state as raw bytes for the authz module. func (am AppModule) ExportGenesis(ctx context.Context) (json.RawMessage, error) { - gs := am.keeper.ExportGenesis(ctx) + gs, err := am.keeper.ExportGenesis(ctx) + if err != nil { + return nil, err + } return am.cdc.MarshalJSON(gs) } diff --git a/x/authz/msgs.go b/x/authz/msgs.go index ad7b34fbf1c7..0964f45cb34b 100644 --- a/x/authz/msgs.go +++ b/x/authz/msgs.go @@ -20,10 +20,10 @@ var ( ) // NewMsgGrant creates a new MsgGrant -func NewMsgGrant(granter, grantee sdk.AccAddress, a Authorization, expiration *time.Time) (*MsgGrant, error) { +func NewMsgGrant(granter, grantee string, a Authorization, expiration *time.Time) (*MsgGrant, error) { m := &MsgGrant{ - Granter: granter.String(), - Grantee: grantee.String(), + Granter: granter, + Grantee: grantee, Grant: Grant{Expiration: expiration}, } err := m.SetAuthorization(a) @@ -71,16 +71,16 @@ func (msg MsgGrant) UnpackInterfaces(unpacker cdctypes.AnyUnpacker) error { } // NewMsgRevoke creates a new MsgRevoke -func NewMsgRevoke(granter, grantee sdk.AccAddress, msgTypeURL string) MsgRevoke { +func NewMsgRevoke(granter, grantee, msgTypeURL string) MsgRevoke { return MsgRevoke{ - Granter: granter.String(), - Grantee: grantee.String(), + Granter: granter, + Grantee: grantee, MsgTypeUrl: msgTypeURL, } } // NewMsgExec creates a new MsgExecAuthorized -func NewMsgExec(grantee sdk.AccAddress, msgs []sdk.Msg) MsgExec { +func NewMsgExec(grantee string, msgs []sdk.Msg) MsgExec { msgsAny := make([]*cdctypes.Any, len(msgs)) for i, msg := range msgs { any, err := cdctypes.NewAnyWithValue(msg) @@ -92,7 +92,7 @@ func NewMsgExec(grantee sdk.AccAddress, msgs []sdk.Msg) MsgExec { } return MsgExec{ - Grantee: grantee.String(), + Grantee: grantee, Msgs: msgsAny, } } diff --git a/x/authz/msgs_test.go b/x/authz/msgs_test.go index bd0a230be281..8675683b5526 100644 --- a/x/authz/msgs_test.go +++ b/x/authz/msgs_test.go @@ -69,10 +69,10 @@ func TestAminoJSON(t *testing.T) { require.NoError(t, err) grant, err := authz.NewGrant(blockTime, authz.NewGenericAuthorization(typeURL), &expiresAt) require.NoError(t, err) - sendAuthz := banktypes.NewSendAuthorization(sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(1000))), nil) + sendAuthz := banktypes.NewSendAuthorization(sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(1000))), nil, codectestutil.CodecOptions{}.GetValidatorCodec()) sendGrant, err := authz.NewGrant(blockTime, sendAuthz, &expiresAt) require.NoError(t, err) - valAddr, err := sdk.ValAddressFromBech32("cosmosvaloper1xcy3els9ua75kdm783c3qu0rfa2eples6eavqq") + valAddr, err := valAddressCodec.StringToBytes("cosmosvaloper1xcy3els9ua75kdm783c3qu0rfa2eples6eavqq") require.NoError(t, err) stakingAuth, err := stakingtypes.NewStakeAuthorization([]sdk.ValAddress{valAddr}, nil, stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_DELEGATE, &sdk.Coin{Denom: "stake", Amount: sdkmath.NewInt(1000)}, valAddressCodec) require.NoError(t, err) diff --git a/x/authz/proto/buf.gen.gogo.yaml b/x/authz/proto/buf.gen.gogo.yaml index 9c8ba0a4b1fd..db36231d0c82 100644 --- a/x/authz/proto/buf.gen.gogo.yaml +++ b/x/authz/proto/buf.gen.gogo.yaml @@ -2,7 +2,7 @@ version: v1 plugins: - name: gocosmos out: .. - opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any - name: grpc-gateway out: .. opt: logtostderr=true,allow_colon_final_segments=true diff --git a/x/authz/simulation/decoder_test.go b/x/authz/simulation/decoder_test.go index dbeee176732a..ff14fd76e316 100644 --- a/x/authz/simulation/decoder_test.go +++ b/x/authz/simulation/decoder_test.go @@ -27,7 +27,7 @@ func TestDecodeStore(t *testing.T) { now := time.Now().UTC() e := now.Add(1) - sendAuthz := banktypes.NewSendAuthorization(sdk.NewCoins(sdk.NewInt64Coin("foo", 123)), nil) + sendAuthz := banktypes.NewSendAuthorization(sdk.NewCoins(sdk.NewInt64Coin("foo", 123)), nil, codectestutil.CodecOptions{}.GetAddressCodec()) grant, _ := authz.NewGrant(now, sendAuthz, &e) grantBz, err := encCfg.Codec.Marshal(&grant) require.NoError(t, err) diff --git a/x/authz/simulation/genesis.go b/x/authz/simulation/genesis.go index 0fc5c757cf71..59b2d299a46c 100644 --- a/x/authz/simulation/genesis.go +++ b/x/authz/simulation/genesis.go @@ -5,6 +5,7 @@ import ( "time" v1 "cosmossdk.io/api/cosmos/gov/v1" + "cosmossdk.io/core/address" sdkmath "cosmossdk.io/math" "cosmossdk.io/x/authz" banktypes "cosmossdk.io/x/bank/types" @@ -16,7 +17,7 @@ import ( ) // genGrant returns a slice of authorization grants. -func genGrant(r *rand.Rand, accounts []simtypes.Account, genT time.Time) []authz.GrantAuthorization { +func genGrant(r *rand.Rand, accounts []simtypes.Account, genT time.Time, cdc address.Codec) []authz.GrantAuthorization { authorizations := make([]authz.GrantAuthorization, len(accounts)-1) for i := 0; i < len(accounts)-1; i++ { granter := accounts[i] @@ -26,10 +27,12 @@ func genGrant(r *rand.Rand, accounts []simtypes.Account, genT time.Time) []authz e := genT.AddDate(1, 0, 0) expiration = &e } + granterAddr, _ := cdc.BytesToString(granter.Address) + granteeAddr, _ := cdc.BytesToString(grantee.Address) authorizations[i] = authz.GrantAuthorization{ - Granter: granter.Address.String(), - Grantee: grantee.Address.String(), - Authorization: generateRandomGrant(r), + Granter: granterAddr, + Grantee: granteeAddr, + Authorization: generateRandomGrant(r, cdc), Expiration: expiration, } } @@ -37,9 +40,9 @@ func genGrant(r *rand.Rand, accounts []simtypes.Account, genT time.Time) []authz return authorizations } -func generateRandomGrant(r *rand.Rand) *codectypes.Any { +func generateRandomGrant(r *rand.Rand, addressCodec address.Codec) *codectypes.Any { authorizations := make([]*codectypes.Any, 2) - sendAuthz := banktypes.NewSendAuthorization(sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(1000))), nil) + sendAuthz := banktypes.NewSendAuthorization(sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(1000))), nil, addressCodec) authorizations[0] = newAnyAuthorization(sendAuthz) authorizations[1] = newAnyAuthorization(authz.NewGenericAuthorization(sdk.MsgTypeURL(&v1.MsgSubmitProposal{}))) @@ -59,7 +62,7 @@ func newAnyAuthorization(a authz.Authorization) *codectypes.Any { func RandomizedGenState(simState *module.SimulationState) { var grants []authz.GrantAuthorization simState.AppParams.GetOrGenerate("authz", &grants, simState.Rand, func(r *rand.Rand) { - grants = genGrant(r, simState.Accounts, simState.GenTimestamp) + grants = genGrant(r, simState.Accounts, simState.GenTimestamp, simState.AddressCodec) }) authzGrantsGenesis := authz.NewGenesisState(grants) diff --git a/x/authz/simulation/operations.go b/x/authz/simulation/operations.go index c73c562b5f37..9e25d14aa6ea 100644 --- a/x/authz/simulation/operations.go +++ b/x/authz/simulation/operations.go @@ -4,6 +4,7 @@ import ( "math/rand" "time" + "cosmossdk.io/core/address" "cosmossdk.io/x/authz" "cosmossdk.io/x/authz/keeper" banktype "cosmossdk.io/x/bank/types" @@ -121,9 +122,17 @@ func SimulateMsgGrant( if !t1.Before(ctx.HeaderInfo().Time) { expiration = &t1 } - randomAuthz := generateRandomAuthorization(r, spendLimit) + randomAuthz := generateRandomAuthorization(r, spendLimit, ak.AddressCodec()) - msg, err := authz.NewMsgGrant(granter.Address, grantee.Address, randomAuthz, expiration) + granterAddr, err := ak.AddressCodec().BytesToString(granter.Address) + if err != nil { + return simtypes.NoOpMsg(authz.ModuleName, TypeMsgGrant, "could not get granter address"), nil, nil + } + granteeAddr, err := ak.AddressCodec().BytesToString(grantee.Address) + if err != nil { + return simtypes.NoOpMsg(authz.ModuleName, TypeMsgGrant, "could not get grantee address"), nil, nil + } + msg, err := authz.NewMsgGrant(granterAddr, granteeAddr, randomAuthz, expiration) if err != nil { return simtypes.NoOpMsg(authz.ModuleName, TypeMsgGrant, err.Error()), nil, err } @@ -150,9 +159,9 @@ func SimulateMsgGrant( } } -func generateRandomAuthorization(r *rand.Rand, spendLimit sdk.Coins) authz.Authorization { +func generateRandomAuthorization(r *rand.Rand, spendLimit sdk.Coins, addressCodec address.Codec) authz.Authorization { authorizations := make([]authz.Authorization, 2) - sendAuthz := banktype.NewSendAuthorization(spendLimit, nil) + sendAuthz := banktype.NewSendAuthorization(spendLimit, nil, addressCodec) authorizations[0] = sendAuthz authorizations[1] = authz.NewGenericAuthorization(sdk.MsgTypeURL(&banktype.MsgSend{})) @@ -174,13 +183,16 @@ func SimulateMsgRevoke( var grant authz.Grant hasGrant := false - k.IterateGrants(ctx, func(granter, grantee sdk.AccAddress, g authz.Grant) bool { + err := k.IterateGrants(ctx, func(granter, grantee sdk.AccAddress, g authz.Grant) (bool, error) { grant = g granterAddr = granter granteeAddr = grantee hasGrant = true - return true + return true, nil }) + if err != nil { + return simtypes.NoOpMsg(authz.ModuleName, TypeMsgRevoke, err.Error()), nil, err + } if !hasGrant { return simtypes.NoOpMsg(authz.ModuleName, TypeMsgRevoke, "no grants"), nil, nil @@ -202,7 +214,15 @@ func SimulateMsgRevoke( return simtypes.NoOpMsg(authz.ModuleName, TypeMsgRevoke, "authorization error"), nil, err } - msg := authz.NewMsgRevoke(granterAddr, granteeAddr, a.MsgTypeURL()) + granterStrAddr, err := ak.AddressCodec().BytesToString(granterAddr) + if err != nil { + return simtypes.NoOpMsg(authz.ModuleName, TypeMsgRevoke, "could not get granter address"), nil, nil + } + granteeStrAddr, err := ak.AddressCodec().BytesToString(granteeAddr) + if err != nil { + return simtypes.NoOpMsg(authz.ModuleName, TypeMsgRevoke, "could not get grantee address"), nil, nil + } + msg := authz.NewMsgRevoke(granterStrAddr, granteeStrAddr, a.MsgTypeURL()) account := ak.GetAccount(ctx, granterAddr) tx, err := simtestutil.GenSignedMockTx( r, @@ -244,19 +264,18 @@ func SimulateMsgExec( var granteeAddr sdk.AccAddress var sendAuth *banktype.SendAuthorization var err error - k.IterateGrants(ctx, func(granter, grantee sdk.AccAddress, grant authz.Grant) bool { + err = k.IterateGrants(ctx, func(granter, grantee sdk.AccAddress, grant authz.Grant) (bool, error) { granterAddr = granter granteeAddr = grantee var a authz.Authorization a, err = grant.GetAuthorization() if err != nil { - return true + return true, err } var ok bool sendAuth, ok = a.(*banktype.SendAuthorization) - return ok + return ok, nil }) - if err != nil { return simtypes.NoOpMsg(authz.ModuleName, TypeMsgExec, err.Error()), nil, err } @@ -305,7 +324,7 @@ func SimulateMsgExec( } - msgExec := authz.NewMsgExec(granteeAddr, msg) + msgExec := authz.NewMsgExec(greStr, msg) granteeSpendableCoins := bk.SpendableCoins(ctx, granteeAddr) fees, err := simtypes.RandomFees(r, granteeSpendableCoins) if err != nil { diff --git a/x/authz/tx.pb.go b/x/authz/tx.pb.go index d46af9385590..2b52d6c36f10 100644 --- a/x/authz/tx.pb.go +++ b/x/authz/tx.pb.go @@ -7,12 +7,12 @@ import ( context "context" fmt "fmt" _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" + any "github.com/cosmos/gogoproto/types/any" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -118,7 +118,7 @@ type MsgExec struct { // Execute Msg. // The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) // triple and validate it. - Msgs []*types.Any `protobuf:"bytes,2,rep,name=msgs,proto3" json:"msgs,omitempty"` + Msgs []*any.Any `protobuf:"bytes,2,rep,name=msgs,proto3" json:"msgs,omitempty"` } func (m *MsgExec) Reset() { *m = MsgExec{} } @@ -1300,7 +1300,7 @@ func (m *MsgExec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Msgs = append(m.Msgs, &types.Any{}) + m.Msgs = append(m.Msgs, &any.Any{}) if err := m.Msgs[len(m.Msgs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/x/bank/CHANGELOG.md b/x/bank/CHANGELOG.md index 3d1944d2c446..d6d3a6962123 100644 --- a/x/bank/CHANGELOG.md +++ b/x/bank/CHANGELOG.md @@ -28,6 +28,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Features * [#17569](https://github.com/cosmos/cosmos-sdk/pull/17569) Introduce a new message type, `MsgBurn`, to burn coins. +* [#20014](https://github.com/cosmos/cosmos-sdk/pull/20014) Support app wiring for `SendRestrictionFn`. ### Improvements @@ -35,6 +36,11 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### API Breaking Changes +* [#19954](https://github.com/cosmos/cosmos-sdk/pull/19954) Removal of the Address.String() method and related changes: + * Changed `NewInput`, `NewOutput`, `NewQueryBalanceRequest`, `NewQueryAllBalancesRequest`, `NewQuerySpendableBalancesRequest` to accept a string instead of an `AccAddress`. + * Added an address codec as an argument to `NewSendAuthorization`. + * Added an address codec as an argument to `SanitizeGenesisBalances` which also returns an error. + * (simulation) `RandomGenesisBalances` also returns an error. * [#17569](https://github.com/cosmos/cosmos-sdk/pull/17569) `BurnCoins` takes an address instead of a module name * [#19477](https://github.com/cosmos/cosmos-sdk/pull/19477) `appmodule.Environment` is passed to bank `NewKeeper` * [#19627](https://github.com/cosmos/cosmos-sdk/pull/19627) The genesis api has been updated to match `appmodule.HasGenesis`. diff --git a/x/bank/autocli.go b/x/bank/autocli.go index 065dda07068d..4b4c3529f2bd 100644 --- a/x/bank/autocli.go +++ b/x/bank/autocli.go @@ -85,7 +85,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { To look up one or more specific denoms, supply them as arguments to this command. To look up all denoms, do not provide any arguments.`, ), - PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "denoms"}}, + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "denoms", Varargs: true}}, }, }, }, diff --git a/x/bank/client/cli/tx.go b/x/bank/client/cli/tx.go index 02f68cd6eb80..a480d3b1a2cc 100644 --- a/x/bank/client/cli/tx.go +++ b/x/bank/client/cli/tx.go @@ -81,12 +81,12 @@ When using '--dry-run' a key name cannot be used, only a bech32 address.`, var output []types.Output for _, arg := range args[1 : len(args)-1] { - toAddr, err := clientCtx.AddressCodec.StringToBytes(arg) + _, err = clientCtx.AddressCodec.StringToBytes(arg) if err != nil { return err } - output = append(output, types.NewOutput(toAddr, sendCoins)) + output = append(output, types.NewOutput(arg, sendCoins)) } // amount to be send from the from address @@ -99,7 +99,12 @@ When using '--dry-run' a key name cannot be used, only a bech32 address.`, amount = coins.MulInt(totalAddrs) } - msg := types.NewMsgMultiSend(types.NewInput(clientCtx.FromAddress, amount), output) + fromAddr, err := clientCtx.AddressCodec.BytesToString(clientCtx.FromAddress) + if err != nil { + return err + } + + msg := types.NewMsgMultiSend(types.NewInput(fromAddr, amount), output) return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, diff --git a/x/bank/depinject.go b/x/bank/depinject.go index 8a9d3efdd825..1d6f7dd3e533 100644 --- a/x/bank/depinject.go +++ b/x/bank/depinject.go @@ -1,6 +1,11 @@ package bank import ( + "fmt" + "sort" + + "golang.org/x/exp/maps" + modulev1 "cosmossdk.io/api/cosmos/bank/module/v1" "cosmossdk.io/core/appmodule" "cosmossdk.io/depinject" @@ -18,8 +23,10 @@ var _ depinject.OnePerModuleType = AppModule{} func (am AppModule) IsOnePerModuleType() {} func init() { - appconfig.RegisterModule(&modulev1.Module{}, + appconfig.RegisterModule( + &modulev1.Module{}, appconfig.Provide(ProvideModule), + appconfig.Invoke(InvokeSetSendRestrictions), ) } @@ -86,3 +93,39 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { return ModuleOutputs{BankKeeper: bankKeeper, Module: m} } + +func InvokeSetSendRestrictions( + config *modulev1.Module, + keeper keeper.BaseKeeper, + restrictions map[string]types.SendRestrictionFn, +) error { + if config == nil { + return nil + } + + modules := maps.Keys(restrictions) + order := config.RestrictionsOrder + if len(order) == 0 { + order = modules + sort.Strings(order) + } + + if len(order) != len(modules) { + return fmt.Errorf("len(restrictions order: %v) != len(restriction modules: %v)", order, modules) + } + + if len(modules) == 0 { + return nil + } + + for _, module := range order { + restriction, ok := restrictions[module] + if !ok { + return fmt.Errorf("can't find send restriction for module %s", module) + } + + keeper.AppendSendRestriction(restriction) + } + + return nil +} diff --git a/x/bank/go.mod b/x/bank/go.mod index 15d50337d5ac..b59b16a8a705 100644 --- a/x/bank/go.mod +++ b/x/bank/go.mod @@ -13,18 +13,18 @@ require ( cosmossdk.io/store v1.0.2 cosmossdk.io/x/accounts v0.0.0-00010101000000-000000000000 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.6 + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 github.com/cosmos/cosmos-proto v1.0.0-beta.4 github.com/cosmos/cosmos-sdk v0.51.0 - github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/gogoproto v1.4.12 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/hashicorp/go-metrics v0.5.3 github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.9.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 - google.golang.org/grpc v1.62.1 + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de + google.golang.org/grpc v1.63.2 gotest.tools/v3 v3.5.1 ) @@ -60,7 +60,7 @@ require ( github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect @@ -105,7 +105,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -115,13 +115,13 @@ require ( github.com/mtibben/percent v0.2.1 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.0 // indirect github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.50.0 // indirect + github.com/prometheus/common v0.52.2 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect @@ -145,17 +145,17 @@ require ( gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 // indirect go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.21.0 // indirect - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect + golang.org/x/crypto v0.22.0 // indirect + golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.22.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.18.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/x/bank/go.sum b/x/bank/go.sum index 046ebfecd550..507f3ab80bd9 100644 --- a/x/bank/go.sum +++ b/x/bank/go.sum @@ -118,8 +118,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -141,8 +141,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/cosmos/iavl v1.0.0 h1:bw6t0Mv/mVCJvlMTOPHWLs5uUE3BRBfVWCRelOzl+so= github.com/cosmos/iavl v1.0.0/go.mod h1:CmTGqMnRnucjxbjduneZXT+0vPgNElYvdefjX2q9tYc= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= @@ -162,8 +162,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= @@ -449,8 +449,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -553,8 +553,8 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= @@ -595,8 +595,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= -github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -749,8 +749,8 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= @@ -799,8 +799,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -812,8 +812,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -868,12 +868,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -927,12 +927,12 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -950,8 +950,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/x/bank/keeper/collections_test.go b/x/bank/keeper/collections_test.go index 8e77b664f395..a5c37ffa63b0 100644 --- a/x/bank/keeper/collections_test.go +++ b/x/bank/keeper/collections_test.go @@ -38,12 +38,18 @@ func TestBankStateCompatibility(t *testing.T) { authKeeper := banktestutil.NewMockAccountKeeper(ctrl) authKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec("cosmos")).AnyTimes() + ac := codectestutil.CodecOptions{}.GetAddressCodec() + addr, err := ac.BytesToString(accAddrs[4]) + require.NoError(t, err) + authority, err := ac.BytesToString(authtypes.NewModuleAddress(banktypes.GovModuleName)) + require.NoError(t, err) + k := keeper.NewBaseKeeper( env, encCfg.Codec, authKeeper, - map[string]bool{accAddrs[4].String(): true}, - authtypes.NewModuleAddress(banktypes.GovModuleName).String(), + map[string]bool{addr: true}, + authority, ) // test we can decode balances without problems diff --git a/x/bank/keeper/genesis.go b/x/bank/keeper/genesis.go index dd094055c79a..3f7ec88c1e5f 100644 --- a/x/bank/keeper/genesis.go +++ b/x/bank/keeper/genesis.go @@ -13,7 +13,8 @@ import ( // InitGenesis initializes the bank module's state from a given genesis state. func (k BaseKeeper) InitGenesis(ctx context.Context, genState *types.GenesisState) error { - if err := k.SetParams(ctx, genState.Params); err != nil { + var err error + if err = k.SetParams(ctx, genState.Params); err != nil { return err } @@ -22,7 +23,10 @@ func (k BaseKeeper) InitGenesis(ctx context.Context, genState *types.GenesisStat } totalSupplyMap := sdk.NewMapCoins(sdk.Coins{}) - genState.Balances = types.SanitizeGenesisBalances(genState.Balances) + genState.Balances, err = types.SanitizeGenesisBalances(genState.Balances, k.ak.AddressCodec()) + if err != nil { + return err + } for _, balance := range genState.Balances { addr := balance.GetAddress() diff --git a/x/bank/keeper/genesis_test.go b/x/bank/keeper/genesis_test.go index 5462ca52802f..0432d1b0fd94 100644 --- a/x/bank/keeper/genesis_test.go +++ b/x/bank/keeper/genesis_test.go @@ -4,6 +4,7 @@ import ( sdkmath "cosmossdk.io/math" "cosmossdk.io/x/bank/types" + codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" ) @@ -21,7 +22,7 @@ func (suite *KeeperTestSuite) TestExportGenesis() { for i := range []int{1, 2} { suite.bankKeeper.SetDenomMetaData(ctx, expectedMetadata[i]) - accAddr, err1 := sdk.AccAddressFromBech32(expectedBalances[i].Address) + accAddr, err1 := suite.authKeeper.AddressCodec().StringToBytes(expectedBalances[i].Address) if err1 != nil { panic(err1) } @@ -49,17 +50,25 @@ func (suite *KeeperTestSuite) TestExportGenesis() { } func (suite *KeeperTestSuite) getTestBalancesAndSupply() ([]types.Balance, sdk.Coins) { - addr2, _ := sdk.AccAddressFromBech32("cosmos1f9xjhxm0plzrh9cskf4qee4pc2xwp0n0556gh0") - addr1, _ := sdk.AccAddressFromBech32("cosmos1t5u0jfg3ljsjrh2m9e47d4ny2hea7eehxrzdgd") + ac := codectestutil.CodecOptions{}.GetAddressCodec() + addr2, err := suite.authKeeper.AddressCodec().StringToBytes("cosmos1f9xjhxm0plzrh9cskf4qee4pc2xwp0n0556gh0") + suite.Require().NoError(err) + addr1, _ := suite.authKeeper.AddressCodec().StringToBytes("cosmos1t5u0jfg3ljsjrh2m9e47d4ny2hea7eehxrzdgd") + suite.Require().NoError(err) addr1Balance := sdk.Coins{sdk.NewInt64Coin("testcoin3", 10)} addr2Balance := sdk.Coins{sdk.NewInt64Coin("testcoin1", 32), sdk.NewInt64Coin("testcoin2", 34)} totalSupply := addr1Balance totalSupply = totalSupply.Add(addr2Balance...) + addr2Str, err := ac.BytesToString(addr2) + suite.Require().NoError(err) + addr1Str, err := ac.BytesToString(addr1) + suite.Require().NoError(err) + return []types.Balance{ - {Address: addr2.String(), Coins: addr2Balance}, - {Address: addr1.String(), Coins: addr1Balance}, + {Address: addr2Str, Coins: addr2Balance}, + {Address: addr1Str, Coins: addr1Balance}, }, totalSupply } diff --git a/x/bank/keeper/grpc_query.go b/x/bank/keeper/grpc_query.go index 22bbcdac580e..b24fc91434c9 100644 --- a/x/bank/keeper/grpc_query.go +++ b/x/bank/keeper/grpc_query.go @@ -292,7 +292,11 @@ func (k BaseKeeper) DenomOwners( if err != nil { return nil, err } - return &types.DenomOwner{Address: key.K2().String(), Balance: sdk.NewCoin(req.Denom, amt)}, nil + addr, err := k.ak.AddressCodec().BytesToString(key.K2()) + if err != nil { + return nil, err + } + return &types.DenomOwner{Address: addr, Balance: sdk.NewCoin(req.Denom, amt)}, nil }, query.WithCollectionPaginationPairPrefix[string, sdk.AccAddress](req.Denom), ) diff --git a/x/bank/keeper/grpc_query_test.go b/x/bank/keeper/grpc_query_test.go index a33d91903573..a5b4e352c88c 100644 --- a/x/bank/keeper/grpc_query_test.go +++ b/x/bank/keeper/grpc_query_test.go @@ -11,6 +11,7 @@ import ( "cosmossdk.io/x/bank/testutil" "cosmossdk.io/x/bank/types" + codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" @@ -20,6 +21,9 @@ func (suite *KeeperTestSuite) TestQueryBalance() { ctx, queryClient := suite.ctx, suite.queryClient _, _, addr := testdata.KeyTestPubAddr() + addrStr, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(addr) + suite.Require().NoError(err) + origCoins := sdk.NewCoins(newBarCoin(30)) suite.mockFundAccount(addr) suite.Require().NoError(testutil.FundAccount(ctx, suite.bankKeeper, addr, origCoins)) @@ -38,13 +42,13 @@ func (suite *KeeperTestSuite) TestQueryBalance() { }, { "invalid denom", - types.NewQueryBalanceRequest(addr, "0000"), + types.NewQueryBalanceRequest(addrStr, "0000"), "invalid denom", nil, }, { "empty address", - types.NewQueryBalanceRequest(sdk.AccAddress{}, barDenom), + types.NewQueryBalanceRequest("", barDenom), "empty address string is not allowed", nil, }, @@ -56,13 +60,13 @@ func (suite *KeeperTestSuite) TestQueryBalance() { }, { "query missing denom", - &types.QueryBalanceRequest{Address: addr.String()}, + &types.QueryBalanceRequest{Address: addrStr}, "invalid denom", nil, }, { "valid query empty result", - types.NewQueryBalanceRequest(addr, fooDenom), + types.NewQueryBalanceRequest(addrStr, fooDenom), "", func(res *types.QueryBalanceResponse) { suite.True(res.Balance.IsZero()) @@ -70,7 +74,7 @@ func (suite *KeeperTestSuite) TestQueryBalance() { }, { "valid query", - types.NewQueryBalanceRequest(addr, barDenom), + types.NewQueryBalanceRequest(addrStr, barDenom), "", func(res *types.QueryBalanceResponse) { suite.True(res.Balance.IsEqual(newBarCoin(30))) @@ -103,12 +107,15 @@ func (suite *KeeperTestSuite) TestQueryAllBalances() { _, err := queryClient.AllBalances(gocontext.Background(), &types.QueryAllBalancesRequest{}) suite.Require().Error(err) + addrStr, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(addr) + suite.Require().NoError(err) + pageReq := &query.PageRequest{ Key: nil, Limit: 1, CountTotal: false, } - req := types.NewQueryAllBalancesRequest(addr, pageReq, false) + req := types.NewQueryAllBalancesRequest(addrStr, pageReq, false) res, err := queryClient.AllBalances(gocontext.Background(), req) suite.Require().NoError(err) suite.Require().NotNil(res) @@ -137,7 +144,7 @@ func (suite *KeeperTestSuite) TestQueryAllBalances() { Limit: 1, CountTotal: true, } - req = types.NewQueryAllBalancesRequest(addr, pageReq, false) + req = types.NewQueryAllBalancesRequest(addrStr, pageReq, false) res, err = queryClient.AllBalances(gocontext.Background(), req) suite.Require().NoError(err) suite.Equal(res.Balances.Len(), 1) @@ -151,7 +158,7 @@ func (suite *KeeperTestSuite) TestQueryAllBalances() { Limit: 1, CountTotal: true, } - req = types.NewQueryAllBalancesRequest(addr, pageReq, false) + req = types.NewQueryAllBalancesRequest(addrStr, pageReq, false) res, err = queryClient.AllBalances(gocontext.Background(), req) suite.Require().NoError(err) suite.Equal(res.Balances.Len(), 1) @@ -163,7 +170,7 @@ func (suite *KeeperTestSuite) TestQueryAllBalances() { Limit: 1, CountTotal: true, } - req = types.NewQueryAllBalancesRequest(addr, pageReq, true) + req = types.NewQueryAllBalancesRequest(addrStr, pageReq, true) res, err = queryClient.AllBalances(gocontext.Background(), req) suite.Require().NoError(err) suite.Equal(res.Balances.Len(), 1) @@ -173,12 +180,14 @@ func (suite *KeeperTestSuite) TestQueryAllBalances() { func (suite *KeeperTestSuite) TestSpendableBalances() { _, _, addr := testdata.KeyTestPubAddr() + addrStr, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(addr) + suite.Require().NoError(err) ctx := sdk.UnwrapSDKContext(suite.ctx) ctx = ctx.WithHeaderInfo(header.Info{Time: time.Now()}) queryClient := suite.mockQueryClient(ctx) - _, err := queryClient.SpendableBalances(ctx, &types.QuerySpendableBalancesRequest{}) + _, err = queryClient.SpendableBalances(ctx, &types.QuerySpendableBalancesRequest{}) suite.Require().Error(err) pageReq := &query.PageRequest{ @@ -186,7 +195,7 @@ func (suite *KeeperTestSuite) TestSpendableBalances() { Limit: 2, CountTotal: false, } - req := types.NewQuerySpendableBalancesRequest(addr, pageReq) + req := types.NewQuerySpendableBalancesRequest(addrStr, pageReq) acc := authtypes.NewBaseAccountWithAddress(addr) suite.mockSpendableCoins(ctx, acc) diff --git a/x/bank/keeper/keeper.go b/x/bank/keeper/keeper.go index c643eb01489b..749c81ace578 100644 --- a/x/bank/keeper/keeper.go +++ b/x/bank/keeper/keeper.go @@ -439,6 +439,10 @@ func (k BaseKeeper) setSupply(ctx context.Context, coin sdk.Coin) { func (k BaseKeeper) trackDelegation(ctx context.Context, addr sdk.AccAddress, balance, amt sdk.Coins) error { acc := k.ak.GetAccount(ctx, addr) if acc == nil { + // check if it's an x/accounts smart account + if k.ak.HasAccount(ctx, addr) { + return nil + } return errorsmod.Wrapf(sdkerrors.ErrUnknownAddress, "account %s does not exist", addr) } @@ -456,6 +460,10 @@ func (k BaseKeeper) trackDelegation(ctx context.Context, addr sdk.AccAddress, ba func (k BaseKeeper) trackUndelegation(ctx context.Context, addr sdk.AccAddress, amt sdk.Coins) error { acc := k.ak.GetAccount(ctx, addr) if acc == nil { + // check if it's an x/accounts smart account + if k.ak.HasAccount(ctx, addr) { + return nil + } return errorsmod.Wrapf(sdkerrors.ErrUnknownAddress, "account %s does not exist", addr) } diff --git a/x/bank/keeper/keeper_test.go b/x/bank/keeper/keeper_test.go index e44423e352ff..2c8f114ee8e3 100644 --- a/x/bank/keeper/keeper_test.go +++ b/x/bank/keeper/keeper_test.go @@ -134,6 +134,12 @@ func (suite *KeeperTestSuite) SetupTest() { env := runtime.NewEnvironment(runtime.NewKVStoreService(key), log.NewNopLogger()) + ac := codectestutil.CodecOptions{}.GetAddressCodec() + addr, err := ac.BytesToString(accAddrs[4]) + suite.Require().NoError(err) + authority, err := ac.BytesToString(authtypes.NewModuleAddress(banktypes.GovModuleName)) + suite.Require().NoError(err) + // gomock initializations ctrl := gomock.NewController(suite.T()) authKeeper := banktestutil.NewMockAccountKeeper(ctrl) @@ -144,8 +150,8 @@ func (suite *KeeperTestSuite) SetupTest() { env, encCfg.Codec, suite.authKeeper, - map[string]bool{accAddrs[4].String(): true}, - authtypes.NewModuleAddress(banktypes.GovModuleName).String(), + map[string]bool{addr: true}, + authority, ) banktypes.RegisterInterfaces(encCfg.InterfaceRegistry) @@ -310,11 +316,15 @@ func (suite *KeeperTestSuite) TestGetAuthority() { authority, ) } + govAddr, err := suite.authKeeper.AddressCodec().BytesToString(authtypes.NewModuleAddress(banktypes.GovModuleName)) + suite.Require().NoError(err) + modAddr, err := suite.authKeeper.AddressCodec().BytesToString(authtypes.NewModuleAddress(banktypes.MintModuleName)) + suite.Require().NoError(err) tests := map[string]string{ "some random account": "cosmos139f7kncmglres2nf3h4hc4tade85ekfr8sulz5", - "gov module account": authtypes.NewModuleAddress(banktypes.GovModuleName).String(), - "another module account": authtypes.NewModuleAddress(banktypes.MintModuleName).String(), + "gov module account": govAddr, + "another module account": modAddr, } for name, expected := range tests { @@ -630,12 +640,17 @@ func (suite *KeeperTestSuite) TestInputOutputNewAccount() { require.Empty(suite.bankKeeper.GetAllBalances(ctx, accAddrs[1])) + acc0StrAddr, err := suite.authKeeper.AddressCodec().BytesToString(accAddrs[0]) + suite.Require().NoError(err) + acc1StrAddr, err := suite.authKeeper.AddressCodec().BytesToString(accAddrs[1]) + suite.Require().NoError(err) + suite.mockInputOutputCoins([]sdk.AccountI{authtypes.NewBaseAccountWithAddress(accAddrs[0])}, []sdk.AccAddress{accAddrs[1]}) input := banktypes.Input{ - Address: accAddrs[0].String(), Coins: sdk.NewCoins(newFooCoin(30), newBarCoin(10)), + Address: acc0StrAddr, Coins: sdk.NewCoins(newFooCoin(30), newBarCoin(10)), } outputs := []banktypes.Output{ - {Address: accAddrs[1].String(), Coins: sdk.NewCoins(newFooCoin(30), newBarCoin(10))}, + {Address: acc1StrAddr, Coins: sdk.NewCoins(newFooCoin(30), newBarCoin(10))}, } require.NoError(suite.bankKeeper.InputOutputCoins(ctx, input, outputs)) @@ -651,12 +666,20 @@ func (suite *KeeperTestSuite) TestInputOutputCoins() { balances := sdk.NewCoins(newFooCoin(90), newBarCoin(30)) acc0 := authtypes.NewBaseAccountWithAddress(accAddrs[0]) + + acc0StrAddr, err := suite.authKeeper.AddressCodec().BytesToString(accAddrs[0]) + suite.Require().NoError(err) + acc1StrAddr, err := suite.authKeeper.AddressCodec().BytesToString(accAddrs[1]) + suite.Require().NoError(err) + acc2StrAddr, err := suite.authKeeper.AddressCodec().BytesToString(accAddrs[2]) + suite.Require().NoError(err) + input := banktypes.Input{ - Address: accAddrs[0].String(), Coins: sdk.NewCoins(newFooCoin(60), newBarCoin(20)), + Address: acc0StrAddr, Coins: sdk.NewCoins(newFooCoin(60), newBarCoin(20)), } outputs := []banktypes.Output{ - {Address: accAddrs[1].String(), Coins: sdk.NewCoins(newFooCoin(30), newBarCoin(10))}, - {Address: accAddrs[2].String(), Coins: sdk.NewCoins(newFooCoin(30), newBarCoin(10))}, + {Address: acc1StrAddr, Coins: sdk.NewCoins(newFooCoin(30), newBarCoin(10))}, + {Address: acc2StrAddr, Coins: sdk.NewCoins(newFooCoin(30), newBarCoin(10))}, } require.Error(suite.bankKeeper.InputOutputCoins(ctx, input, []banktypes.Output{})) @@ -668,12 +691,12 @@ func (suite *KeeperTestSuite) TestInputOutputCoins() { require.NoError(banktestutil.FundAccount(ctx, suite.bankKeeper, accAddrs[0], balances)) insufficientInput := banktypes.Input{ - Address: accAddrs[0].String(), + Address: acc0StrAddr, Coins: sdk.NewCoins(newFooCoin(300), newBarCoin(100)), } insufficientOutputs := []banktypes.Output{ - {Address: accAddrs[1].String(), Coins: sdk.NewCoins(newFooCoin(300), newBarCoin(100))}, - {Address: accAddrs[2].String(), Coins: sdk.NewCoins(newFooCoin(300), newBarCoin(100))}, + {Address: acc1StrAddr, Coins: sdk.NewCoins(newFooCoin(300), newBarCoin(100))}, + {Address: acc2StrAddr, Coins: sdk.NewCoins(newFooCoin(300), newBarCoin(100))}, } require.Error(suite.bankKeeper.InputOutputCoins(ctx, insufficientInput, insufficientOutputs)) @@ -756,10 +779,16 @@ func (suite *KeeperTestSuite) TestInputOutputCoinsWithRestrictions() { setupCtx := suite.ctx balances := sdk.NewCoins(newFooCoin(1000), newBarCoin(500)) fromAddr := accAddrs[0] + fromStrAddr, err := suite.authKeeper.AddressCodec().BytesToString(fromAddr) + suite.Require().NoError(err) fromAcc := authtypes.NewBaseAccountWithAddress(fromAddr) inputAccs := []sdk.AccountI{fromAcc} toAddr1 := accAddrs[1] + toAddr1Str, err := suite.authKeeper.AddressCodec().BytesToString(toAddr1) + suite.Require().NoError(err) toAddr2 := accAddrs[2] + toAddr2Str, err := suite.authKeeper.AddressCodec().BytesToString(toAddr2) + suite.Require().NoError(err) suite.mockFundAccount(accAddrs[0]) suite.Require().NoError(banktestutil.FundAccount(setupCtx, suite.bankKeeper, accAddrs[0], balances)) @@ -778,7 +807,7 @@ func (suite *KeeperTestSuite) TestInputOutputCoinsWithRestrictions() { name: "nil restriction", fn: nil, inputCoins: sdk.NewCoins(newFooCoin(5)), - outputs: []banktypes.Output{{Address: toAddr1.String(), Coins: sdk.NewCoins(newFooCoin(5))}}, + outputs: []banktypes.Output{{Address: toAddr1Str, Coins: sdk.NewCoins(newFooCoin(5))}}, outputAddrs: []sdk.AccAddress{toAddr1}, expBals: expBals{ from: sdk.NewCoins(newFooCoin(995), newBarCoin(500)), @@ -790,7 +819,7 @@ func (suite *KeeperTestSuite) TestInputOutputCoinsWithRestrictions() { name: "passthrough restriction single output", fn: restrictionPassthrough(), inputCoins: sdk.NewCoins(newFooCoin(10)), - outputs: []banktypes.Output{{Address: toAddr1.String(), Coins: sdk.NewCoins(newFooCoin(10))}}, + outputs: []banktypes.Output{{Address: toAddr1Str, Coins: sdk.NewCoins(newFooCoin(10))}}, outputAddrs: []sdk.AccAddress{toAddr1}, expArgs: []*restrictionArgs{ { @@ -810,7 +839,7 @@ func (suite *KeeperTestSuite) TestInputOutputCoinsWithRestrictions() { name: "new to restriction single output", fn: restrictionNewTo(toAddr2), inputCoins: sdk.NewCoins(newFooCoin(26)), - outputs: []banktypes.Output{{Address: toAddr1.String(), Coins: sdk.NewCoins(newFooCoin(26))}}, + outputs: []banktypes.Output{{Address: toAddr1Str, Coins: sdk.NewCoins(newFooCoin(26))}}, outputAddrs: []sdk.AccAddress{toAddr2}, expArgs: []*restrictionArgs{ { @@ -830,7 +859,7 @@ func (suite *KeeperTestSuite) TestInputOutputCoinsWithRestrictions() { name: "error restriction single output", fn: restrictionError("restriction test error"), inputCoins: sdk.NewCoins(newBarCoin(88)), - outputs: []banktypes.Output{{Address: toAddr1.String(), Coins: sdk.NewCoins(newBarCoin(88))}}, + outputs: []banktypes.Output{{Address: toAddr1Str, Coins: sdk.NewCoins(newBarCoin(88))}}, outputAddrs: []sdk.AccAddress{}, expArgs: []*restrictionArgs{ { @@ -852,8 +881,8 @@ func (suite *KeeperTestSuite) TestInputOutputCoinsWithRestrictions() { fn: restrictionPassthrough(), inputCoins: sdk.NewCoins(newFooCoin(11), newBarCoin(12)), outputs: []banktypes.Output{ - {Address: toAddr1.String(), Coins: sdk.NewCoins(newFooCoin(11))}, - {Address: toAddr2.String(), Coins: sdk.NewCoins(newBarCoin(12))}, + {Address: toAddr1Str, Coins: sdk.NewCoins(newFooCoin(11))}, + {Address: toAddr2Str, Coins: sdk.NewCoins(newBarCoin(12))}, }, outputAddrs: []sdk.AccAddress{toAddr1, toAddr2}, expArgs: []*restrictionArgs{ @@ -881,8 +910,8 @@ func (suite *KeeperTestSuite) TestInputOutputCoinsWithRestrictions() { fn: restrictionError("", "second restriction error"), inputCoins: sdk.NewCoins(newFooCoin(44)), outputs: []banktypes.Output{ - {Address: toAddr1.String(), Coins: sdk.NewCoins(newFooCoin(12))}, - {Address: toAddr2.String(), Coins: sdk.NewCoins(newFooCoin(32))}, + {Address: toAddr1Str, Coins: sdk.NewCoins(newFooCoin(12))}, + {Address: toAddr2Str, Coins: sdk.NewCoins(newFooCoin(32))}, }, outputAddrs: []sdk.AccAddress{toAddr1}, expArgs: []*restrictionArgs{ @@ -911,8 +940,8 @@ func (suite *KeeperTestSuite) TestInputOutputCoinsWithRestrictions() { fn: restrictionNewTo(toAddr2, toAddr1), inputCoins: sdk.NewCoins(newBarCoin(35)), outputs: []banktypes.Output{ - {Address: toAddr1.String(), Coins: sdk.NewCoins(newBarCoin(10))}, - {Address: toAddr2.String(), Coins: sdk.NewCoins(newBarCoin(25))}, + {Address: toAddr1Str, Coins: sdk.NewCoins(newBarCoin(10))}, + {Address: toAddr2Str, Coins: sdk.NewCoins(newBarCoin(25))}, }, outputAddrs: []sdk.AccAddress{toAddr1, toAddr2}, expArgs: []*restrictionArgs{ @@ -946,7 +975,7 @@ func (suite *KeeperTestSuite) TestInputOutputCoinsWithRestrictions() { ctx := suite.ctx suite.mockInputOutputCoins(inputAccs, tc.outputAddrs) input := banktypes.Input{ - Address: fromAddr.String(), + Address: fromStrAddr, Coins: tc.inputCoins, } @@ -1331,6 +1360,12 @@ func (suite *KeeperTestSuite) TestMsgSendEvents() { require := suite.Require() acc0 := authtypes.NewBaseAccountWithAddress(accAddrs[0]) + + acc0StrAddr, err := suite.authKeeper.AddressCodec().BytesToString(accAddrs[0]) + suite.Require().NoError(err) + acc1StrAddr, err := suite.authKeeper.AddressCodec().BytesToString(accAddrs[1]) + suite.Require().NoError(err) + newCoins := sdk.NewCoins(sdk.NewInt64Coin(fooDenom, 50)) suite.mockFundAccount(accAddrs[0]) require.NoError(banktestutil.FundAccount(suite.ctx, suite.bankKeeper, accAddrs[0], newCoins)) @@ -1343,11 +1378,11 @@ func (suite *KeeperTestSuite) TestMsgSendEvents() { } event1.Attributes = append( event1.Attributes, - abci.EventAttribute{Key: banktypes.AttributeKeyRecipient, Value: accAddrs[1].String()}, + abci.EventAttribute{Key: banktypes.AttributeKeyRecipient, Value: acc1StrAddr}, ) event1.Attributes = append( event1.Attributes, - abci.EventAttribute{Key: banktypes.AttributeKeySender, Value: accAddrs[0].String()}, + abci.EventAttribute{Key: banktypes.AttributeKeySender, Value: acc0StrAddr}, ) event1.Attributes = append( event1.Attributes, @@ -1368,16 +1403,23 @@ func (suite *KeeperTestSuite) TestMsgMultiSendEvents() { require.NoError(suite.bankKeeper.SetParams(ctx, banktypes.DefaultParams())) + acc0StrAddr, err := suite.authKeeper.AddressCodec().BytesToString(accAddrs[0]) + suite.Require().NoError(err) + acc2StrAddr, err := suite.authKeeper.AddressCodec().BytesToString(accAddrs[2]) + suite.Require().NoError(err) + acc3StrAddr, err := suite.authKeeper.AddressCodec().BytesToString(accAddrs[3]) + suite.Require().NoError(err) + coins := sdk.NewCoins(sdk.NewInt64Coin(fooDenom, 50), sdk.NewInt64Coin(barDenom, 100)) newCoins := sdk.NewCoins(sdk.NewInt64Coin(fooDenom, 50)) newCoins2 := sdk.NewCoins(sdk.NewInt64Coin(barDenom, 100)) input := banktypes.Input{ - Address: accAddrs[0].String(), + Address: acc0StrAddr, Coins: coins, } outputs := []banktypes.Output{ - {Address: accAddrs[2].String(), Coins: newCoins}, - {Address: accAddrs[3].String(), Coins: newCoins2}, + {Address: acc2StrAddr, Coins: newCoins}, + {Address: acc3StrAddr, Coins: newCoins2}, } suite.authKeeper.EXPECT().GetAccount(suite.ctx, accAddrs[0]).Return(acc0) @@ -1417,7 +1459,7 @@ func (suite *KeeperTestSuite) TestMsgMultiSendEvents() { } event1.Attributes = append( event1.Attributes, - abci.EventAttribute{Key: banktypes.AttributeKeyRecipient, Value: accAddrs[2].String()}, + abci.EventAttribute{Key: banktypes.AttributeKeyRecipient, Value: acc2StrAddr}, ) event1.Attributes = append( event1.Attributes, @@ -1428,7 +1470,7 @@ func (suite *KeeperTestSuite) TestMsgMultiSendEvents() { } event2.Attributes = append( event2.Attributes, - abci.EventAttribute{Key: banktypes.AttributeKeyRecipient, Value: accAddrs[3].String()}, + abci.EventAttribute{Key: banktypes.AttributeKeyRecipient, Value: acc3StrAddr}, ) event2.Attributes = append( event2.Attributes, @@ -1736,6 +1778,7 @@ func (suite *KeeperTestSuite) TestUndelegateCoins_Invalid() { suite.mockFundAccount(accAddrs[0]) require.NoError(banktestutil.FundAccount(ctx, suite.bankKeeper, accAddrs[0], origCoins)) + suite.authKeeper.EXPECT().HasAccount(ctx, accAddrs[0]).Return(false) suite.mockDelegateCoins(ctx, acc0, holderAcc) require.NoError(suite.bankKeeper.DelegateCoins(ctx, accAddrs[0], holderAcc.GetAddress(), delCoins)) @@ -1851,16 +1894,17 @@ func (suite *KeeperTestSuite) TestBalanceTrackingEvents() { case banktypes.EventTypeCoinSpent: coinsSpent, err := sdk.ParseCoinsNormalized(e.Attributes[1].Value) require.NoError(err) - spender, err := sdk.AccAddressFromBech32(e.Attributes[0].Value) + _, err = suite.authKeeper.AddressCodec().StringToBytes(e.Attributes[0].Value) require.NoError(err) - balances[spender.String()] = balances[spender.String()].Sub(coinsSpent...) + + balances[e.Attributes[0].Value] = balances[e.Attributes[0].Value].Sub(coinsSpent...) case banktypes.EventTypeCoinReceived: coinsRecv, err := sdk.ParseCoinsNormalized(e.Attributes[1].Value) require.NoError(err) - receiver, err := sdk.AccAddressFromBech32(e.Attributes[0].Value) + _, err = suite.authKeeper.AddressCodec().StringToBytes(e.Attributes[0].Value) require.NoError(err) - balances[receiver.String()] = balances[receiver.String()].Add(coinsRecv...) + balances[e.Attributes[0].Value] = balances[e.Attributes[0].Value].Add(coinsRecv...) } } @@ -1876,7 +1920,10 @@ func (suite *KeeperTestSuite) TestBalanceTrackingEvents() { return false } - balance, exists := balances[address.String()] + addr, err := suite.authKeeper.AddressCodec().BytesToString(address) + suite.Require().NoError(err) + + balance, exists := balances[addr] require.True(exists) expectedUtxo := sdk.NewCoin("utxo", balance.AmountOf(coin.Denom)) diff --git a/x/bank/keeper/msg_server_test.go b/x/bank/keeper/msg_server_test.go index 45e5270f71e6..ea27bbcbf1fc 100644 --- a/x/bank/keeper/msg_server_test.go +++ b/x/bank/keeper/msg_server_test.go @@ -72,6 +72,11 @@ func (suite *KeeperTestSuite) TestMsgSend() { atom0 := sdk.NewCoins(sdk.NewInt64Coin("atom", 0)) atom123eth0 := sdk.Coins{sdk.NewInt64Coin("atom", 123), sdk.NewInt64Coin("eth", 0)} + acc4Addr, err := suite.authKeeper.AddressCodec().BytesToString(accAddrs[4]) + suite.Require().NoError(err) + minterAccAddr, err := suite.authKeeper.AddressCodec().BytesToString(minterAcc.GetAddress()) + suite.Require().NoError(err) + testCases := []struct { name string input *banktypes.MsgSend @@ -81,8 +86,8 @@ func (suite *KeeperTestSuite) TestMsgSend() { { name: "invalid send to blocked address", input: &banktypes.MsgSend{ - FromAddress: minterAcc.GetAddress().String(), - ToAddress: accAddrs[4].String(), + FromAddress: minterAccAddr, + ToAddress: acc4Addr, Amount: origCoins, }, expErr: true, @@ -91,7 +96,7 @@ func (suite *KeeperTestSuite) TestMsgSend() { { name: "invalid coins", input: &banktypes.MsgSend{ - FromAddress: minterAcc.GetAddress().String(), + FromAddress: minterAccAddr, ToAddress: baseAcc.Address, Amount: atom0, }, @@ -101,7 +106,7 @@ func (suite *KeeperTestSuite) TestMsgSend() { { name: "123atom,0eth: invalid coins", input: &banktypes.MsgSend{ - FromAddress: minterAcc.GetAddress().String(), + FromAddress: minterAccAddr, ToAddress: baseAcc.Address, Amount: atom123eth0, }, @@ -121,7 +126,7 @@ func (suite *KeeperTestSuite) TestMsgSend() { { name: "invalid to address: empty address string is not allowed: invalid address", input: &banktypes.MsgSend{ - FromAddress: minterAcc.GetAddress().String(), + FromAddress: minterAccAddr, ToAddress: "", Amount: origCoins, }, @@ -131,7 +136,7 @@ func (suite *KeeperTestSuite) TestMsgSend() { { name: "all good", input: &banktypes.MsgSend{ - FromAddress: minterAcc.GetAddress().String(), + FromAddress: minterAccAddr, ToAddress: baseAcc.Address, Amount: origCoins, }, @@ -165,6 +170,15 @@ func (suite *KeeperTestSuite) TestMsgMultiSend() { sendCoins := sdk.NewCoins(sdk.NewInt64Coin(origDenom, 50)) suite.bankKeeper.SetSendEnabled(suite.ctx, origDenom, true) + acc0Addr, err := suite.authKeeper.AddressCodec().BytesToString(accAddrs[0]) + suite.Require().NoError(err) + acc1Addr, err := suite.authKeeper.AddressCodec().BytesToString(accAddrs[1]) + suite.Require().NoError(err) + acc4Addr, err := suite.authKeeper.AddressCodec().BytesToString(accAddrs[4]) + suite.Require().NoError(err) + minterAccAddr, err := suite.authKeeper.AddressCodec().BytesToString(minterAcc.GetAddress()) + suite.Require().NoError(err) + testCases := []struct { name string input *banktypes.MsgMultiSend @@ -181,7 +195,7 @@ func (suite *KeeperTestSuite) TestMsgMultiSend() { name: "no inputs to send transaction", input: &banktypes.MsgMultiSend{ Outputs: []banktypes.Output{ - {Address: accAddrs[4].String(), Coins: sendCoins}, + {Address: acc4Addr, Coins: sendCoins}, }, }, expErr: true, @@ -191,8 +205,8 @@ func (suite *KeeperTestSuite) TestMsgMultiSend() { name: "more than one inputs to send transaction", input: &banktypes.MsgMultiSend{ Inputs: []banktypes.Input{ - {Address: minterAcc.GetAddress().String(), Coins: origCoins}, - {Address: minterAcc.GetAddress().String(), Coins: origCoins}, + {Address: minterAccAddr, Coins: origCoins}, + {Address: minterAccAddr, Coins: origCoins}, }, }, expErr: true, @@ -202,7 +216,7 @@ func (suite *KeeperTestSuite) TestMsgMultiSend() { name: "no outputs to send transaction", input: &banktypes.MsgMultiSend{ Inputs: []banktypes.Input{ - {Address: minterAcc.GetAddress().String(), Coins: origCoins}, + {Address: minterAccAddr, Coins: origCoins}, }, }, expErr: true, @@ -212,11 +226,11 @@ func (suite *KeeperTestSuite) TestMsgMultiSend() { name: "invalid send to blocked address", input: &banktypes.MsgMultiSend{ Inputs: []banktypes.Input{ - {Address: minterAcc.GetAddress().String(), Coins: origCoins}, + {Address: minterAccAddr, Coins: origCoins}, }, Outputs: []banktypes.Output{ - {Address: accAddrs[0].String(), Coins: sendCoins}, - {Address: accAddrs[4].String(), Coins: sendCoins}, + {Address: acc0Addr, Coins: sendCoins}, + {Address: acc4Addr, Coins: sendCoins}, }, }, expErr: true, @@ -226,11 +240,11 @@ func (suite *KeeperTestSuite) TestMsgMultiSend() { name: "invalid send to blocked address", input: &banktypes.MsgMultiSend{ Inputs: []banktypes.Input{ - {Address: minterAcc.GetAddress().String(), Coins: origCoins}, + {Address: minterAccAddr, Coins: origCoins}, }, Outputs: []banktypes.Output{ - {Address: accAddrs[0].String(), Coins: sendCoins}, - {Address: accAddrs[1].String(), Coins: sendCoins}, + {Address: acc0Addr, Coins: sendCoins}, + {Address: acc1Addr, Coins: sendCoins}, }, }, expErr: false, @@ -258,6 +272,8 @@ func (suite *KeeperTestSuite) TestMsgMultiSend() { } func (suite *KeeperTestSuite) TestMsgSetSendEnabled() { + govAccAddr, err := suite.authKeeper.AddressCodec().BytesToString(govAcc.GetAddress()) + suite.Require().NoError(err) testCases := []struct { name string req *banktypes.MsgSetSendEnabled @@ -267,7 +283,7 @@ func (suite *KeeperTestSuite) TestMsgSetSendEnabled() { { name: "all good", req: banktypes.NewMsgSetSendEnabled( - govAcc.GetAddress().String(), + govAccAddr, []*banktypes.SendEnabled{ banktypes.NewSendEnabled("atom1", true), }, @@ -277,7 +293,7 @@ func (suite *KeeperTestSuite) TestMsgSetSendEnabled() { { name: "all good with two denoms", req: banktypes.NewMsgSetSendEnabled( - govAcc.GetAddress().String(), + govAccAddr, []*banktypes.SendEnabled{ banktypes.NewSendEnabled("atom1", true), banktypes.NewSendEnabled("atom2", true), @@ -288,7 +304,7 @@ func (suite *KeeperTestSuite) TestMsgSetSendEnabled() { { name: "duplicate denoms", req: banktypes.NewMsgSetSendEnabled( - govAcc.GetAddress().String(), + govAccAddr, []*banktypes.SendEnabled{ banktypes.NewSendEnabled("atom", true), banktypes.NewSendEnabled("atom", true), @@ -301,7 +317,7 @@ func (suite *KeeperTestSuite) TestMsgSetSendEnabled() { { name: "bad first denom name, (invalid send enabled denom present in list)", req: banktypes.NewMsgSetSendEnabled( - govAcc.GetAddress().String(), + govAccAddr, []*banktypes.SendEnabled{ banktypes.NewSendEnabled("not a denom", true), banktypes.NewSendEnabled("somecoin", true), @@ -314,7 +330,7 @@ func (suite *KeeperTestSuite) TestMsgSetSendEnabled() { { name: "bad second denom name, (invalid send enabled denom present in list)", req: banktypes.NewMsgSetSendEnabled( - govAcc.GetAddress().String(), + govAccAddr, []*banktypes.SendEnabled{ banktypes.NewSendEnabled("somecoin", true), banktypes.NewSendEnabled("not a denom", true), @@ -327,7 +343,7 @@ func (suite *KeeperTestSuite) TestMsgSetSendEnabled() { { name: "invalid UseDefaultFor denom", req: banktypes.NewMsgSetSendEnabled( - govAcc.GetAddress().String(), + govAccAddr, []*banktypes.SendEnabled{ banktypes.NewSendEnabled("atom", true), }, @@ -367,6 +383,9 @@ func (suite *KeeperTestSuite) TestMsgBurn() { origCoins := sdk.NewInt64Coin("eth", 100) atom0 := sdk.NewInt64Coin("atom", 0) + multiPermAccAddr, err := suite.authKeeper.AddressCodec().BytesToString(multiPermAcc.GetAddress()) + suite.Require().NoError(err) + testCases := []struct { name string input *banktypes.MsgBurn @@ -376,7 +395,7 @@ func (suite *KeeperTestSuite) TestMsgBurn() { { name: "invalid coins", input: &banktypes.MsgBurn{ - FromAddress: multiPermAcc.GetAddress().String(), + FromAddress: multiPermAccAddr, Amount: []*sdk.Coin{&atom0}, }, expErr: true, @@ -395,7 +414,7 @@ func (suite *KeeperTestSuite) TestMsgBurn() { { name: "all good", input: &banktypes.MsgBurn{ - FromAddress: multiPermAcc.GetAddress().String(), + FromAddress: multiPermAccAddr, Amount: []*sdk.Coin{&origCoins}, }, expErr: false, diff --git a/x/bank/proto/buf.gen.gogo.yaml b/x/bank/proto/buf.gen.gogo.yaml index 9c8ba0a4b1fd..db36231d0c82 100644 --- a/x/bank/proto/buf.gen.gogo.yaml +++ b/x/bank/proto/buf.gen.gogo.yaml @@ -2,7 +2,7 @@ version: v1 plugins: - name: gocosmos out: .. - opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any - name: grpc-gateway out: .. opt: logtostderr=true,allow_colon_final_segments=true diff --git a/x/bank/proto/cosmos/bank/module/v1/module.proto b/x/bank/proto/cosmos/bank/module/v1/module.proto index dd79d1707d01..effc0b577da6 100644 --- a/x/bank/proto/cosmos/bank/module/v1/module.proto +++ b/x/bank/proto/cosmos/bank/module/v1/module.proto @@ -17,4 +17,10 @@ message Module { // authority defines the custom module authority. If not set, defaults to the governance module. string authority = 2; + + // restrictions_order specifies the order of send restrictions and should be + // a list of module names which provide a send restriction instance. If no + // order is provided, then restrictions will be applied in alphabetical order + // of module names. + repeated string restrictions_order = 3; } diff --git a/x/bank/simulation/genesis.go b/x/bank/simulation/genesis.go index 7c9c6ba46e38..9e8b8512b827 100644 --- a/x/bank/simulation/genesis.go +++ b/x/bank/simulation/genesis.go @@ -59,17 +59,21 @@ func RandomGenesisSendEnabled(r *rand.Rand, bondDenom string) []types.SendEnable // RandomGenesisBalances returns a slice of account balances. Each account has // a balance of simState.InitialStake for simState.BondDenom. -func RandomGenesisBalances(simState *module.SimulationState) []types.Balance { +func RandomGenesisBalances(simState *module.SimulationState) ([]types.Balance, error) { genesisBalances := []types.Balance{} for _, acc := range simState.Accounts { + addr, err := simState.AddressCodec.BytesToString(acc.Address) + if err != nil { + return nil, err + } genesisBalances = append(genesisBalances, types.Balance{ - Address: acc.Address.String(), + Address: addr, Coins: sdk.NewCoins(sdk.NewCoin(simState.BondDenom, simState.InitialStake)), }) } - return genesisBalances + return genesisBalances, nil } // RandomizedGenState generates a random GenesisState for bank @@ -83,9 +87,14 @@ func RandomizedGenState(simState *module.SimulationState) { totalSupply := simState.InitialStake.Mul(sdkmath.NewInt((numAccs + simState.NumBonded))) supply := sdk.NewCoins(sdk.NewCoin(simState.BondDenom, totalSupply)) + balances, err := RandomGenesisBalances(simState) + if err != nil { + panic(err) + } + bankGenesis := types.GenesisState{ Params: types.NewParams(defaultSendEnabledParam), - Balances: RandomGenesisBalances(simState), + Balances: balances, Supply: supply, SendEnabled: sendEnabled, } diff --git a/x/bank/simulation/operations.go b/x/bank/simulation/operations.go index 0c9c6269101f..b3933b6d01e1 100644 --- a/x/bank/simulation/operations.go +++ b/x/bank/simulation/operations.go @@ -218,8 +218,13 @@ func SimulateMsgMultiSend(txGen client.TxConfig, ak types.AccountKeeper, bk keep // generate random input fields, ignore to address from, _, coins, skip := randomSendFields(r, ctx, accs, bk, ak) + fromAddr, err := ak.AddressCodec().BytesToString(from.Address) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, "could not retrieve address"), nil, err + } + // make sure account is fresh and not used in previous input - for usedAddrs[from.Address.String()] { + for usedAddrs[fromAddr] { from, _, coins, skip = randomSendFields(r, ctx, accs, bk, ak) } @@ -228,13 +233,13 @@ func SimulateMsgMultiSend(txGen client.TxConfig, ak types.AccountKeeper, bk keep } // set input address in used address map - usedAddrs[from.Address.String()] = true + usedAddrs[fromAddr] = true // set signer privkey privs[i] = from.PrivKey // set next input and accumulate total sent coins - inputs[i] = types.NewInput(from.Address, coins) + inputs[i] = types.NewInput(fromAddr, coins) totalSentCoins = totalSentCoins.Add(coins...) } @@ -244,7 +249,11 @@ func SimulateMsgMultiSend(txGen client.TxConfig, ak types.AccountKeeper, bk keep } for o := range outputs { - outAddr, _ := simtypes.RandomAcc(r, accs) + out, _ := simtypes.RandomAcc(r, accs) + outAddr, err := ak.AddressCodec().BytesToString(out.Address) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, "could not retrieve output address"), nil, err + } var outCoins sdk.Coins // split total sent coins into random subsets for output @@ -257,7 +266,7 @@ func SimulateMsgMultiSend(txGen client.TxConfig, ak types.AccountKeeper, bk keep totalSentCoins = totalSentCoins.Sub(outCoins...) } - outputs[o] = types.NewOutput(outAddr.Address, outCoins) + outputs[o] = types.NewOutput(outAddr, outCoins) } // remove any output that has no coins @@ -305,9 +314,13 @@ func SimulateMsgMultiSendToModuleAccount( for i := range inputs { sender := accs[i] privs[i] = sender.PrivKey + senderAddr, err := ak.AddressCodec().BytesToString(sender.Address) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, err.Error()), nil, err + } spendable := bk.SpendableCoins(ctx, sender.Address) coins := simtypes.RandSubsetCoins(r, spendable) - inputs[i] = types.NewInput(sender.Address, coins) + inputs[i] = types.NewInput(senderAddr, coins) totalSentCoins = totalSentCoins.Add(coins...) } if err := bk.IsSendEnabledCoins(ctx, totalSentCoins...); err != nil { @@ -315,6 +328,11 @@ func SimulateMsgMultiSendToModuleAccount( } moduleAccounts := getModuleAccounts(ak, ctx, moduleAccount) for i := range outputs { + outAddr, err := ak.AddressCodec().BytesToString(moduleAccounts[i].Address) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, msgType, "could not retrieve output address"), nil, err + } + var outCoins sdk.Coins // split total sent coins into random subsets for output if i == len(outputs)-1 { @@ -325,7 +343,7 @@ func SimulateMsgMultiSendToModuleAccount( outCoins = simtypes.RandSubsetCoins(r, totalSentCoins) totalSentCoins = totalSentCoins.Sub(outCoins...) } - outputs[i] = types.NewOutput(moduleAccounts[i].Address, outCoins) + outputs[i] = types.NewOutput(outAddr, outCoins) } // remove any output that has no coins for i := 0; i < len(outputs); { diff --git a/x/bank/simulation/proposals.go b/x/bank/simulation/proposals.go index 18340ded35af..7e2683fed6cb 100644 --- a/x/bank/simulation/proposals.go +++ b/x/bank/simulation/proposals.go @@ -31,15 +31,18 @@ func ProposalMsgs() []simtypes.WeightedProposalMsg { } // SimulateMsgUpdateParams returns a random MsgUpdateParams -func SimulateMsgUpdateParams(r *rand.Rand, _ sdk.Context, _ []simtypes.Account, _ coreaddress.Codec) (sdk.Msg, error) { +func SimulateMsgUpdateParams(r *rand.Rand, _ []simtypes.Account, ac coreaddress.Codec) (sdk.Msg, error) { // use the default gov module account address as authority - var authority sdk.AccAddress = address.Module("gov") + authority, err := ac.BytesToString(address.Module("gov")) + if err != nil { + return nil, err + } params := types.DefaultParams() params.DefaultSendEnabled = r.Intn(2) == 0 return &types.MsgUpdateParams{ - Authority: authority.String(), + Authority: authority, Params: params, }, nil } diff --git a/x/bank/simulation/proposals_test.go b/x/bank/simulation/proposals_test.go index 479d55488e48..3d60a17bbb91 100644 --- a/x/bank/simulation/proposals_test.go +++ b/x/bank/simulation/proposals_test.go @@ -10,17 +10,17 @@ import ( "cosmossdk.io/x/bank/types" codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" ) func TestProposalMsgs(t *testing.T) { + ac := codectestutil.CodecOptions{}.GetAddressCodec() + // initialize parameters s := rand.NewSource(1) r := rand.New(s) - ctx := sdk.NewContext(nil, true, nil) accounts := simtypes.RandomAccounts(r, 3) // execute ProposalMsgs function @@ -33,12 +33,14 @@ func TestProposalMsgs(t *testing.T) { assert.Equal(t, simulation.OpWeightMsgUpdateParams, w0.AppParamsKey()) assert.Equal(t, simulation.DefaultWeightMsgUpdateParams, w0.DefaultWeight()) - msg, err := w0.MsgSimulatorFn()(r, ctx, accounts, codectestutil.CodecOptions{}.GetAddressCodec()) + msg, err := w0.MsgSimulatorFn()(r, accounts, ac) assert.NilError(t, err) msgUpdateParams, ok := msg.(*types.MsgUpdateParams) assert.Assert(t, ok) - assert.Equal(t, sdk.AccAddress(address.Module("gov")).String(), msgUpdateParams.Authority) + authority, err := ac.BytesToString(address.Module("gov")) + assert.NilError(t, err) + assert.Equal(t, authority, msgUpdateParams.Authority) assert.Assert(t, len(msgUpdateParams.Params.SendEnabled) == 0) //nolint:staticcheck // we're testing the old way here assert.Equal(t, true, msgUpdateParams.Params.DefaultSendEnabled) } diff --git a/x/bank/types/balance.go b/x/bank/types/balance.go index a9863984498e..32c90d7c953f 100644 --- a/x/bank/types/balance.go +++ b/x/bank/types/balance.go @@ -6,6 +6,7 @@ import ( "fmt" "sort" + "cosmossdk.io/core/address" "cosmossdk.io/x/bank/exported" "github.com/cosmos/cosmos-sdk/codec" @@ -53,7 +54,7 @@ func (b balanceByAddress) Swap(i, j int) { } // SanitizeGenesisBalances checks for duplicates and sorts addresses and coin sets. -func SanitizeGenesisBalances(balances []Balance) []Balance { +func SanitizeGenesisBalances(balances []Balance, addressCodec address.Codec) ([]Balance, error) { // Given that this function sorts balances, using the standard library's // Quicksort based algorithms, we have algorithmic complexities of: // * Best case: O(nlogn) @@ -68,7 +69,10 @@ func SanitizeGenesisBalances(balances []Balance) []Balance { // 2. Track any duplicate addresses to avoid false positives on invariant checks. seen := make(map[string]struct{}) for i := range balances { - addr, _ := sdk.AccAddressFromBech32(balances[i].Address) + addr, err := addressCodec.StringToBytes(balances[i].Address) + if err != nil { + return nil, err + } addresses[i] = addr if _, exists := seen[string(addr)]; exists { panic(fmt.Sprintf("genesis state has a duplicate account: %q aka %x", balances[i].Address, addr)) @@ -79,7 +83,7 @@ func SanitizeGenesisBalances(balances []Balance) []Balance { // 3. Sort balances. sort.Sort(balanceByAddress{addresses: addresses, balances: balances}) - return balances + return balances, nil } // GenesisBalancesIterator implements genesis account iteration. diff --git a/x/bank/types/balance_test.go b/x/bank/types/balance_test.go index 2e0d3e7c5181..c208f88c218c 100644 --- a/x/bank/types/balance_test.go +++ b/x/bank/types/balance_test.go @@ -9,6 +9,7 @@ import ( "cosmossdk.io/math" bank "cosmossdk.io/x/bank/types" + codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -147,15 +148,19 @@ func TestSanitizeBalances(t *testing.T) { coins := sdk.Coins{coin} addrs, _ := makeRandomAddressesAndPublicKeys(20) + ac := codectestutil.CodecOptions{}.GetAddressCodec() var balances []bank.Balance for _, addr := range addrs { + addrStr, err := ac.BytesToString(addr) + require.NoError(t, err) balances = append(balances, bank.Balance{ - Address: addr.String(), + Address: addrStr, Coins: coins, }) } // 2. Sort the values. - sorted := bank.SanitizeGenesisBalances(balances) + sorted, err := bank.SanitizeGenesisBalances(balances, ac) + require.NoError(t, err) // 3. Compare and ensure that all the values are sorted in ascending order. // Invariant after sorting: @@ -180,9 +185,12 @@ func TestSanitizeBalancesDuplicates(t *testing.T) { addrs, _ := makeRandomAddressesAndPublicKeys(13) var balances []bank.Balance + ac := codectestutil.CodecOptions{}.GetAddressCodec() for _, addr := range addrs { + addrStr, err := ac.BytesToString(addr) + require.NoError(t, err) balances = append(balances, bank.Balance{ - Address: addr.String(), + Address: addrStr, Coins: coins, }) } @@ -190,7 +198,7 @@ func TestSanitizeBalancesDuplicates(t *testing.T) { // 2. Add duplicate dupIdx := 3 balances = append(balances, balances[dupIdx]) - addr, _ := sdk.AccAddressFromBech32(balances[dupIdx].Address) + addr, _ := ac.StringToBytes(balances[dupIdx].Address) expectedError := fmt.Sprintf("genesis state has a duplicate account: %q aka %x", balances[dupIdx].Address, addr) // 3. Add more balances @@ -198,15 +206,18 @@ func TestSanitizeBalancesDuplicates(t *testing.T) { coins2 := sdk.Coins{coin2, coin} addrs2, _ := makeRandomAddressesAndPublicKeys(31) for _, addr := range addrs2 { + addrStr, err := ac.BytesToString(addr) + require.NoError(t, err) balances = append(balances, bank.Balance{ - Address: addr.String(), + Address: addrStr, Coins: coins2, }) } // 4. Execute SanitizeGenesisBalances and expect an error require.PanicsWithValue(t, expectedError, func() { - bank.SanitizeGenesisBalances(balances) + _, err := bank.SanitizeGenesisBalances(balances, ac) + require.NoError(t, err) }, "SanitizeGenesisBalances should panic with duplicate accounts") } @@ -238,15 +249,20 @@ func benchmarkSanitizeBalances(b *testing.B, nAddresses int) { addrs, _ := makeRandomAddressesAndPublicKeys(nAddresses) b.ResetTimer() + var err error + ac := codectestutil.CodecOptions{}.GetAddressCodec() for i := 0; i < b.N; i++ { var balances []bank.Balance for _, addr := range addrs { + addrStr, err := ac.BytesToString(addr) + require.NoError(b, err) balances = append(balances, bank.Balance{ - Address: addr.String(), + Address: addrStr, Coins: coins, }) } - sink = bank.SanitizeGenesisBalances(balances) + sink, err = bank.SanitizeGenesisBalances(balances, ac) + require.NoError(b, err) } if sink == nil { b.Fatal("Benchmark did not run") diff --git a/x/bank/types/inputs_outputs.go b/x/bank/types/inputs_outputs.go index 5d98f72a87de..d448f7bcc075 100644 --- a/x/bank/types/inputs_outputs.go +++ b/x/bank/types/inputs_outputs.go @@ -51,9 +51,9 @@ func (in Input) ValidateBasic() error { } // NewInput - create a transaction input, used with MsgMultiSend -func NewInput(addr sdk.AccAddress, coins sdk.Coins) Input { +func NewInput(addr string, coins sdk.Coins) Input { return Input{ - Address: addr.String(), + Address: addr, Coins: coins, } } @@ -76,9 +76,9 @@ func (out Output) ValidateBasic() error { } // NewOutput - create a transaction output, used with MsgMultiSend -func NewOutput(addr sdk.AccAddress, coins sdk.Coins) Output { +func NewOutput(addr string, coins sdk.Coins) Output { return Output{ - Address: addr.String(), + Address: addr, Coins: coins, } } diff --git a/x/bank/types/msgs_test.go b/x/bank/types/msgs_test.go index a6c59826bebb..3a85e5d367da 100644 --- a/x/bank/types/msgs_test.go +++ b/x/bank/types/msgs_test.go @@ -7,6 +7,7 @@ import ( "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/testutil" "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -22,10 +23,15 @@ func TestMsgSendGetSignBytes(t *testing.T) { } func TestInputValidation(t *testing.T) { - addr1 := sdk.AccAddress([]byte("_______alice________")) - addr2 := sdk.AccAddress([]byte("________bob_________")) - addrEmpty := sdk.AccAddress([]byte("")) - addrLong := sdk.AccAddress([]byte("Purposefully long address")) + ac := testutil.CodecOptions{}.GetAddressCodec() + addr1, err := ac.BytesToString([]byte("_______alice________")) + require.NoError(t, err) + addr2, err := ac.BytesToString([]byte("________bob_________")) + require.NoError(t, err) + addrEmpty, err := ac.BytesToString([]byte("")) + require.NoError(t, err) + addrLong, err := ac.BytesToString([]byte("Purposefully long address")) + require.NoError(t, err) someCoins := sdk.NewCoins(sdk.NewInt64Coin("atom", 123)) multiCoins := sdk.NewCoins(sdk.NewInt64Coin("atom", 123), sdk.NewInt64Coin("eth", 20)) @@ -63,10 +69,15 @@ func TestInputValidation(t *testing.T) { } func TestOutputValidation(t *testing.T) { - addr1 := sdk.AccAddress([]byte("_______alice________")) - addr2 := sdk.AccAddress([]byte("________bob_________")) - addrEmpty := sdk.AccAddress([]byte("")) - addrLong := sdk.AccAddress([]byte("Purposefully long address")) + ac := testutil.CodecOptions{}.GetAddressCodec() + addr1, err := ac.BytesToString([]byte("_______alice________")) + require.NoError(t, err) + addr2, err := ac.BytesToString([]byte("________bob_________")) + require.NoError(t, err) + addrEmpty, err := ac.BytesToString([]byte("")) + require.NoError(t, err) + addrLong, err := ac.BytesToString([]byte("Purposefully long address")) + require.NoError(t, err) someCoins := sdk.NewCoins(sdk.NewInt64Coin("atom", 123)) multiCoins := sdk.NewCoins(sdk.NewInt64Coin("atom", 123), sdk.NewInt64Coin("eth", 20)) @@ -104,8 +115,12 @@ func TestOutputValidation(t *testing.T) { } func TestMsgMultiSendGetSignBytes(t *testing.T) { - addr1 := sdk.AccAddress([]byte("input")) - addr2 := sdk.AccAddress([]byte("output")) + ac := testutil.CodecOptions{}.GetAddressCodec() + addr1, err := ac.BytesToString([]byte("input")) + require.NoError(t, err) + addr2, err := ac.BytesToString([]byte("output")) + require.NoError(t, err) + coins := sdk.NewCoins(sdk.NewInt64Coin("atom", 10)) msg := &MsgMultiSend{ Inputs: []Input{NewInput(addr1, coins)}, diff --git a/x/bank/types/querier.go b/x/bank/types/querier.go index 6a2dcb097432..532676c084ab 100644 --- a/x/bank/types/querier.go +++ b/x/bank/types/querier.go @@ -1,7 +1,6 @@ package types import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" ) @@ -14,19 +13,19 @@ const ( ) // NewQueryBalanceRequest creates a new instance of QueryBalanceRequest. -func NewQueryBalanceRequest(addr sdk.AccAddress, denom string) *QueryBalanceRequest { - return &QueryBalanceRequest{Address: addr.String(), Denom: denom} +func NewQueryBalanceRequest(addr, denom string) *QueryBalanceRequest { + return &QueryBalanceRequest{Address: addr, Denom: denom} } // NewQueryAllBalancesRequest creates a new instance of QueryAllBalancesRequest. -func NewQueryAllBalancesRequest(addr sdk.AccAddress, req *query.PageRequest, resolveDenom bool) *QueryAllBalancesRequest { - return &QueryAllBalancesRequest{Address: addr.String(), Pagination: req, ResolveDenom: resolveDenom} +func NewQueryAllBalancesRequest(addr string, req *query.PageRequest, resolveDenom bool) *QueryAllBalancesRequest { + return &QueryAllBalancesRequest{Address: addr, Pagination: req, ResolveDenom: resolveDenom} } // NewQuerySpendableBalancesRequest creates a new instance of a // QuerySpendableBalancesRequest. -func NewQuerySpendableBalancesRequest(addr sdk.AccAddress, req *query.PageRequest) *QuerySpendableBalancesRequest { - return &QuerySpendableBalancesRequest{Address: addr.String(), Pagination: req} +func NewQuerySpendableBalancesRequest(addr string, req *query.PageRequest) *QuerySpendableBalancesRequest { + return &QuerySpendableBalancesRequest{Address: addr, Pagination: req} } // NewQuerySpendableBalanceByDenomRequest creates a new instance of a diff --git a/x/bank/types/restrictions.go b/x/bank/types/restrictions.go index 6d7d6fe6bc86..2ec4489a0978 100644 --- a/x/bank/types/restrictions.go +++ b/x/bank/types/restrictions.go @@ -54,6 +54,9 @@ func ComposeMintingRestrictions(restrictions ...MintingRestrictionFn) MintingRes // A SendRestrictionFn can restrict sends and/or provide a new receiver address. type SendRestrictionFn func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) (newToAddr sdk.AccAddress, err error) +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (SendRestrictionFn) IsOnePerModuleType() {} + var _ SendRestrictionFn = NoOpSendRestrictionFn // NoOpSendRestrictionFn is a no-op SendRestrictionFn. diff --git a/x/bank/types/send_authorization.go b/x/bank/types/send_authorization.go index cdc1fc62a24c..05c5299894e9 100644 --- a/x/bank/types/send_authorization.go +++ b/x/bank/types/send_authorization.go @@ -3,6 +3,8 @@ package types import ( context "context" + "cosmossdk.io/core/address" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/authz" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -14,9 +16,9 @@ import ( const gasCostPerIteration = uint64(10) // NewSendAuthorization creates a new SendAuthorization object. -func NewSendAuthorization(spendLimit sdk.Coins, allowed []sdk.AccAddress) *SendAuthorization { +func NewSendAuthorization(spendLimit sdk.Coins, allowed []sdk.AccAddress, addressCodec address.Codec) *SendAuthorization { return &SendAuthorization{ - AllowList: toBech32Addresses(allowed), + AllowList: toBech32Addresses(allowed, addressCodec), SpendLimit: spendLimit, } } @@ -82,14 +84,18 @@ func (a SendAuthorization) ValidateBasic() error { return nil } -func toBech32Addresses(allowed []sdk.AccAddress) []string { +func toBech32Addresses(allowed []sdk.AccAddress, addressCodec address.Codec) []string { if len(allowed) == 0 { return nil } allowedAddrs := make([]string, len(allowed)) for i, addr := range allowed { - allowedAddrs[i] = addr.String() + addrStr, err := addressCodec.BytesToString(addr) + if err != nil { + panic(err) // TODO: + } + allowedAddrs[i] = addrStr } return allowedAddrs diff --git a/x/bank/types/send_authorization_test.go b/x/bank/types/send_authorization_test.go index fbecc2300669..4d0ad0382c1a 100644 --- a/x/bank/types/send_authorization_test.go +++ b/x/bank/types/send_authorization_test.go @@ -1,7 +1,7 @@ package types_test import ( - fmt "fmt" + "fmt" "testing" "github.com/stretchr/testify/require" @@ -11,6 +11,7 @@ import ( storetypes "cosmossdk.io/store/types" "cosmossdk.io/x/bank/types" + codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -25,10 +26,11 @@ var ( ) func TestSendAuthorization(t *testing.T) { + ac := codectestutil.CodecOptions{}.GetAddressCodec() ctx := testutil.DefaultContextWithDB(t, storetypes.NewKVStoreKey(types.StoreKey), storetypes.NewTransientStoreKey("transient_test")).Ctx.WithHeaderInfo(header.Info{}) allowList := make([]sdk.AccAddress, 1) allowList[0] = toAddr - authorization := types.NewSendAuthorization(coins1000, nil) + authorization := types.NewSendAuthorization(coins1000, nil, ac) t.Log("verify authorization returns valid method name") require.Equal(t, authorization.MsgTypeURL(), "/cosmos.bank.v1beta1.MsgSend") @@ -41,7 +43,7 @@ func TestSendAuthorization(t *testing.T) { require.True(t, resp.Delete) require.Nil(t, resp.Updated) - authorization = types.NewSendAuthorization(coins1000, nil) + authorization = types.NewSendAuthorization(coins1000, nil, ac) require.Equal(t, authorization.MsgTypeURL(), "/cosmos.bank.v1beta1.MsgSend") require.NoError(t, authorization.ValidateBasic()) send = types.NewMsgSend(fromAddrStr, toAddrStr, coins500) @@ -52,7 +54,7 @@ func TestSendAuthorization(t *testing.T) { require.NoError(t, err) require.False(t, resp.Delete) require.NotNil(t, resp.Updated) - sendAuth := types.NewSendAuthorization(coins500, nil) + sendAuth := types.NewSendAuthorization(coins500, nil, ac) require.Equal(t, sendAuth.String(), resp.Updated.String()) t.Log("expect updated authorization nil after spending remaining amount") @@ -62,7 +64,7 @@ func TestSendAuthorization(t *testing.T) { require.Nil(t, resp.Updated) t.Log("allow list and no address") - authzWithAllowList := types.NewSendAuthorization(coins1000, allowList) + authzWithAllowList := types.NewSendAuthorization(coins1000, allowList, ac) require.Equal(t, authzWithAllowList.MsgTypeURL(), "/cosmos.bank.v1beta1.MsgSend") require.NoError(t, authorization.ValidateBasic()) send = types.NewMsgSend(fromAddrStr, unknownAddrStr, coins500) @@ -75,7 +77,7 @@ func TestSendAuthorization(t *testing.T) { require.Contains(t, err.Error(), fmt.Sprintf("cannot send to %s address", unknownAddrStr)) t.Log("send to address in allow list") - authzWithAllowList = types.NewSendAuthorization(coins1000, allowList) + authzWithAllowList = types.NewSendAuthorization(coins1000, allowList, ac) require.Equal(t, authzWithAllowList.MsgTypeURL(), "/cosmos.bank.v1beta1.MsgSend") require.NoError(t, authorization.ValidateBasic()) send = types.NewMsgSend(fromAddrStr, toAddrStr, coins500) @@ -85,10 +87,10 @@ func TestSendAuthorization(t *testing.T) { require.True(t, resp.Accept) require.NotNil(t, resp.Updated) // coins1000-coins500 = coins500 - require.Equal(t, types.NewSendAuthorization(coins500, allowList).String(), resp.Updated.String()) + require.Equal(t, types.NewSendAuthorization(coins500, allowList, ac).String(), resp.Updated.String()) t.Log("send everything to address not in allow list") - authzWithAllowList = types.NewSendAuthorization(coins1000, allowList) + authzWithAllowList = types.NewSendAuthorization(coins1000, allowList, ac) require.Equal(t, authzWithAllowList.MsgTypeURL(), "/cosmos.bank.v1beta1.MsgSend") require.NoError(t, authorization.ValidateBasic()) send = types.NewMsgSend(fromAddrStr, unknownAddrStr, coins1000) @@ -98,7 +100,7 @@ func TestSendAuthorization(t *testing.T) { require.Contains(t, err.Error(), fmt.Sprintf("cannot send to %s address", unknownAddrStr)) t.Log("send everything to address in allow list") - authzWithAllowList = types.NewSendAuthorization(coins1000, allowList) + authzWithAllowList = types.NewSendAuthorization(coins1000, allowList, ac) require.Equal(t, authzWithAllowList.MsgTypeURL(), "/cosmos.bank.v1beta1.MsgSend") require.NoError(t, authorization.ValidateBasic()) send = types.NewMsgSend(fromAddrStr, toAddrStr, coins1000) diff --git a/x/circuit/go.mod b/x/circuit/go.mod index 6593e91b9c31..470a4e9c4ae0 100644 --- a/x/circuit/go.mod +++ b/x/circuit/go.mod @@ -13,12 +13,12 @@ require ( cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 github.com/cockroachdb/errors v1.11.1 github.com/cosmos/cosmos-sdk v0.51.0 - github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/gogoproto v1.4.12 github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/stretchr/testify v1.9.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 - google.golang.org/grpc v1.62.1 + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de + google.golang.org/grpc v1.63.2 ) require ( @@ -45,7 +45,7 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.6 // indirect + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 // indirect github.com/cometbft/cometbft-db v0.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect @@ -57,7 +57,7 @@ require ( github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect @@ -104,7 +104,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -114,13 +114,13 @@ require ( github.com/mtibben/percent v0.2.1 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.0 // indirect github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.50.0 // indirect + github.com/prometheus/common v0.52.2 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect @@ -145,17 +145,17 @@ require ( gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 // indirect go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.21.0 // indirect + golang.org/x/crypto v0.22.0 // indirect golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.22.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.18.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/x/circuit/go.sum b/x/circuit/go.sum index 046ebfecd550..507f3ab80bd9 100644 --- a/x/circuit/go.sum +++ b/x/circuit/go.sum @@ -118,8 +118,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -141,8 +141,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/cosmos/iavl v1.0.0 h1:bw6t0Mv/mVCJvlMTOPHWLs5uUE3BRBfVWCRelOzl+so= github.com/cosmos/iavl v1.0.0/go.mod h1:CmTGqMnRnucjxbjduneZXT+0vPgNElYvdefjX2q9tYc= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= @@ -162,8 +162,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= @@ -449,8 +449,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -553,8 +553,8 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= @@ -595,8 +595,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= -github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -749,8 +749,8 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= @@ -799,8 +799,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -812,8 +812,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -868,12 +868,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -927,12 +927,12 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -950,8 +950,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/x/circuit/module.go b/x/circuit/module.go index 5f14b29e4c8c..32dd06677651 100644 --- a/x/circuit/module.go +++ b/x/circuit/module.go @@ -4,7 +4,6 @@ import ( "context" "encoding/json" "fmt" - "time" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" @@ -16,7 +15,6 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/telemetry" "github.com/cosmos/cosmos-sdk/types/module" ) @@ -93,12 +91,10 @@ func (am AppModule) ValidateGenesis(bz json.RawMessage) error { // InitGenesis performs genesis initialization for the circuit module. func (am AppModule) InitGenesis(ctx context.Context, data json.RawMessage) error { - start := time.Now() var genesisState types.GenesisState if err := am.cdc.UnmarshalJSON(data, &genesisState); err != nil { return err } - telemetry.MeasureSince(start, "InitGenesis", "crisis", "unmarshal") return am.keeper.InitGenesis(ctx, &genesisState) } diff --git a/x/circuit/proto/buf.gen.gogo.yaml b/x/circuit/proto/buf.gen.gogo.yaml index 9c8ba0a4b1fd..db36231d0c82 100644 --- a/x/circuit/proto/buf.gen.gogo.yaml +++ b/x/circuit/proto/buf.gen.gogo.yaml @@ -2,7 +2,7 @@ version: v1 plugins: - name: gocosmos out: .. - opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any - name: grpc-gateway out: .. opt: logtostderr=true,allow_colon_final_segments=true diff --git a/x/consensus/proto/buf.gen.gogo.yaml b/x/consensus/proto/buf.gen.gogo.yaml index 9c8ba0a4b1fd..db36231d0c82 100644 --- a/x/consensus/proto/buf.gen.gogo.yaml +++ b/x/consensus/proto/buf.gen.gogo.yaml @@ -2,7 +2,7 @@ version: v1 plugins: - name: gocosmos out: .. - opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any - name: grpc-gateway out: .. opt: logtostderr=true,allow_colon_final_segments=true diff --git a/x/counter/proto/buf.gen.gogo.yaml b/x/counter/proto/buf.gen.gogo.yaml index 9c8ba0a4b1fd..db36231d0c82 100644 --- a/x/counter/proto/buf.gen.gogo.yaml +++ b/x/counter/proto/buf.gen.gogo.yaml @@ -2,7 +2,7 @@ version: v1 plugins: - name: gocosmos out: .. - opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any - name: grpc-gateway out: .. opt: logtostderr=true,allow_colon_final_segments=true diff --git a/x/crisis/abci.go b/x/crisis/abci.go index 8ce275ecd799..2eacc641c4ad 100644 --- a/x/crisis/abci.go +++ b/x/crisis/abci.go @@ -2,7 +2,6 @@ package crisis import ( "context" - "time" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" @@ -12,7 +11,7 @@ import ( // check all registered invariants func EndBlocker(ctx context.Context, k keeper.Keeper) { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyEndBlocker) + defer telemetry.ModuleMeasureSince(types.ModuleName, telemetry.Now(), telemetry.MetricKeyEndBlocker) sdkCtx := sdk.UnwrapSDKContext(ctx) if k.InvCheckPeriod() == 0 || sdkCtx.BlockHeight()%int64(k.InvCheckPeriod()) != 0 { diff --git a/x/crisis/module.go b/x/crisis/module.go index 807a276aca93..0a17ce54908b 100644 --- a/x/crisis/module.go +++ b/x/crisis/module.go @@ -4,7 +4,6 @@ import ( "context" "encoding/json" "fmt" - "time" "github.com/spf13/cobra" "google.golang.org/grpc" @@ -13,7 +12,6 @@ import ( "cosmossdk.io/core/registry" "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/telemetry" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/crisis/keeper" "github.com/cosmos/cosmos-sdk/x/crisis/types" @@ -118,12 +116,10 @@ func (am AppModule) ValidateGenesis(bz json.RawMessage) error { // InitGenesis performs genesis initialization for the crisis module. func (am AppModule) InitGenesis(ctx context.Context, data json.RawMessage) error { - start := time.Now() var genesisState types.GenesisState if err := am.cdc.UnmarshalJSON(data, &genesisState); err != nil { return err } - telemetry.MeasureSince(start, "InitGenesis", "crisis", "unmarshal") am.keeper.InitGenesis(ctx, &genesisState) if !am.skipGenesisInvariants { diff --git a/x/crisis/proto/buf.gen.gogo.yaml b/x/crisis/proto/buf.gen.gogo.yaml index 9c8ba0a4b1fd..db36231d0c82 100644 --- a/x/crisis/proto/buf.gen.gogo.yaml +++ b/x/crisis/proto/buf.gen.gogo.yaml @@ -2,7 +2,7 @@ version: v1 plugins: - name: gocosmos out: .. - opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any - name: grpc-gateway out: .. opt: logtostderr=true,allow_colon_final_segments=true diff --git a/x/distribution/CHANGELOG.md b/x/distribution/CHANGELOG.md index 610ac8103bce..40d4d948779f 100644 --- a/x/distribution/CHANGELOG.md +++ b/x/distribution/CHANGELOG.md @@ -31,6 +31,9 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### API Breaking Changes +* [#19868](https://github.com/cosmos/cosmos-sdk/pull/19868) Removes Accounts String method + * `NewMsgSetWithdrawAddress` now takes strings as argument instead of `sdk.AccAddress`. + * `NewGenesisState` now takes a string as argument instead of `sdk.ConsAddress`. * [#19445](https://github.com/cosmos/cosmos-sdk/pull/19445) `appmodule.Environment` is received on the Keeper to get access to different application services * [#17115](https://github.com/cosmos/cosmos-sdk/pull/17115) Use collections for `PreviousProposer` and `ValidatorSlashEvents`: * remove from `Keeper`: `GetPreviousProposerConsAddr`, `SetPreviousProposerConsAddr`, `GetValidatorHistoricalReferenceCount`, `GetValidatorSlashEvent`, `SetValidatorSlashEvent`. diff --git a/x/distribution/client/common/common.go b/x/distribution/client/common/common.go index 1e6aa4e28ce8..e17180a9c092 100644 --- a/x/distribution/client/common/common.go +++ b/x/distribution/client/common/common.go @@ -6,18 +6,17 @@ import ( "cosmossdk.io/x/distribution/types" "github.com/cosmos/cosmos-sdk/client" - sdk "github.com/cosmos/cosmos-sdk/types" ) // QueryDelegationRewards queries a delegation rewards between a delegator and a // validator. func QueryDelegationRewards(clientCtx client.Context, delAddr, valAddr string) ([]byte, int64, error) { - delegatorAddr, err := sdk.AccAddressFromBech32(delAddr) + delegatorAddr, err := clientCtx.AddressCodec.StringToBytes(delAddr) if err != nil { return nil, 0, err } - validatorAddr, err := sdk.ValAddressFromBech32(valAddr) + validatorAddr, err := clientCtx.ValidatorAddressCodec.StringToBytes(valAddr) if err != nil { return nil, 0, err } diff --git a/x/distribution/client/common/common_test.go b/x/distribution/client/common/common_test.go index 05fa593079e0..2020e3b8f109 100644 --- a/x/distribution/client/common/common_test.go +++ b/x/distribution/client/common/common_test.go @@ -7,10 +7,15 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec/legacy" + codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" ) func TestQueryDelegationRewardsAddrValidation(t *testing.T) { - clientCtx := client.Context{}.WithLegacyAmino(legacy.Cdc) + cdcOpts := codectestutil.CodecOptions{} + clientCtx := client.Context{}. + WithLegacyAmino(legacy.Cdc). + WithAddressCodec(cdcOpts.GetAddressCodec()). + WithValidatorAddressCodec(cdcOpts.GetValidatorCodec()) type args struct { delAddr string diff --git a/x/distribution/depinject.go b/x/distribution/depinject.go index 09303459a44a..299f750c60c7 100644 --- a/x/distribution/depinject.go +++ b/x/distribution/depinject.go @@ -57,6 +57,11 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority) } + authorityAddr, err := in.AccountKeeper.AddressCodec().BytesToString(authority) + if err != nil { + panic(err) + } + k := keeper.NewKeeper( in.Cdc, in.Environment, @@ -65,7 +70,7 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { in.StakingKeeper, in.PoolKeeper, feeCollectorName, - authority.String(), + authorityAddr, ) m := NewAppModule(in.Cdc, k, in.AccountKeeper, in.BankKeeper, in.StakingKeeper, in.PoolKeeper) diff --git a/x/distribution/go.mod b/x/distribution/go.mod index c85f5a62d6a0..98764938266d 100644 --- a/x/distribution/go.mod +++ b/x/distribution/go.mod @@ -17,7 +17,7 @@ require ( github.com/cockroachdb/errors v1.11.1 github.com/cosmos/cosmos-proto v1.0.0-beta.4 github.com/cosmos/cosmos-sdk v0.51.0 - github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/gogoproto v1.4.12 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 @@ -25,8 +25,8 @@ require ( github.com/pkg/errors v0.9.1 github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.9.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 - google.golang.org/grpc v1.62.1 + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de + google.golang.org/grpc v1.63.2 gotest.tools/v3 v3.5.1 ) @@ -52,7 +52,7 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.6 // indirect + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 // indirect github.com/cometbft/cometbft-db v0.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect @@ -63,7 +63,7 @@ require ( github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect @@ -108,7 +108,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -118,12 +118,12 @@ require ( github.com/mtibben/percent v0.2.1 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.0 // indirect github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.50.0 // indirect + github.com/prometheus/common v0.52.2 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect @@ -147,17 +147,17 @@ require ( gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 // indirect go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.21.0 // indirect + golang.org/x/crypto v0.22.0 // indirect golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.22.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.18.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/x/distribution/go.sum b/x/distribution/go.sum index 1e7095cfdb39..cdaac20029c3 100644 --- a/x/distribution/go.sum +++ b/x/distribution/go.sum @@ -120,8 +120,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -143,8 +143,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/cosmos/iavl v1.0.0 h1:bw6t0Mv/mVCJvlMTOPHWLs5uUE3BRBfVWCRelOzl+so= github.com/cosmos/iavl v1.0.0/go.mod h1:CmTGqMnRnucjxbjduneZXT+0vPgNElYvdefjX2q9tYc= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= @@ -164,8 +164,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= @@ -451,8 +451,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -555,8 +555,8 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= @@ -597,8 +597,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= -github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -751,8 +751,8 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= @@ -801,8 +801,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -814,8 +814,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -870,12 +870,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -929,12 +929,12 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -952,8 +952,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/x/distribution/keeper/abci.go b/x/distribution/keeper/abci.go index 544b62e1e69e..60d1aea984a9 100644 --- a/x/distribution/keeper/abci.go +++ b/x/distribution/keeper/abci.go @@ -1,8 +1,6 @@ package keeper import ( - "time" - "cosmossdk.io/x/distribution/types" "github.com/cosmos/cosmos-sdk/telemetry" @@ -13,7 +11,7 @@ import ( // and distribute rewards for the previous block. // TODO: use context.Context after including the comet service func (k Keeper) BeginBlocker(ctx sdk.Context) error { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) + defer telemetry.ModuleMeasureSince(types.ModuleName, telemetry.Now(), telemetry.MetricKeyBeginBlocker) // determine the total power signing the block var previousTotalPower int64 diff --git a/x/distribution/keeper/allocation_test.go b/x/distribution/keeper/allocation_test.go index d0286dd64131..22d5bea88860 100644 --- a/x/distribution/keeper/allocation_test.go +++ b/x/distribution/keeper/allocation_test.go @@ -32,7 +32,8 @@ func TestAllocateTokensToValidatorWithCommission(t *testing.T) { ctrl := gomock.NewController(t) key := storetypes.NewKVStoreKey(disttypes.StoreKey) testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) - encCfg := moduletestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{}, distribution.AppModule{}) + cdcOpts := codectestutil.CodecOptions{} + encCfg := moduletestutil.MakeTestEncodingConfig(cdcOpts, distribution.AppModule{}) ctx := testCtx.Ctx.WithHeaderInfo(header.Info{Time: time.Now()}) bankKeeper := distrtestutil.NewMockBankKeeper(ctrl) @@ -47,6 +48,9 @@ func TestAllocateTokensToValidatorWithCommission(t *testing.T) { accountKeeper.EXPECT().GetModuleAddress("distribution").Return(distrAcc.GetAddress()) stakingKeeper.EXPECT().ValidatorAddressCodec().Return(valCodec).AnyTimes() + authorityAddr, err := cdcOpts.GetAddressCodec().BytesToString(authtypes.NewModuleAddress("gov")) + require.NoError(t, err) + distrKeeper := keeper.NewKeeper( encCfg.Codec, env, @@ -55,11 +59,13 @@ func TestAllocateTokensToValidatorWithCommission(t *testing.T) { stakingKeeper, poolKeeper, "fee_collector", - authtypes.NewModuleAddress("gov").String(), + authorityAddr, ) // create validator with 50% commission - val, err := distrtestutil.CreateValidator(valConsPk0, math.NewInt(100)) + operatorAddr, err := stakingKeeper.ValidatorAddressCodec().BytesToString(valConsPk0.Address()) + require.NoError(t, err) + val, err := distrtestutil.CreateValidator(valConsPk0, operatorAddr, math.NewInt(100)) require.NoError(t, err) val.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDec(0)) stakingKeeper.EXPECT().ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk0)).Return(val, nil).AnyTimes() @@ -92,7 +98,8 @@ func TestAllocateTokensToManyValidators(t *testing.T) { ctrl := gomock.NewController(t) key := storetypes.NewKVStoreKey(disttypes.StoreKey) testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) - encCfg := moduletestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{}, distribution.AppModule{}) + cdcOpts := codectestutil.CodecOptions{} + encCfg := moduletestutil.MakeTestEncodingConfig(cdcOpts, distribution.AppModule{}) ctx := testCtx.Ctx.WithHeaderInfo(header.Info{Time: time.Now()}) bankKeeper := distrtestutil.NewMockBankKeeper(ctrl) @@ -107,6 +114,9 @@ func TestAllocateTokensToManyValidators(t *testing.T) { env := runtime.NewEnvironment(runtime.NewKVStoreService(key), log.NewNopLogger()) + authorityAddr, err := cdcOpts.GetAddressCodec().BytesToString(authtypes.NewModuleAddress("gov")) + require.NoError(t, err) + distrKeeper := keeper.NewKeeper( encCfg.Codec, env, @@ -115,7 +125,7 @@ func TestAllocateTokensToManyValidators(t *testing.T) { stakingKeeper, poolKeeper, "fee_collector", - authtypes.NewModuleAddress("gov").String(), + authorityAddr, ) // reset fee pool & set params @@ -124,14 +134,18 @@ func TestAllocateTokensToManyValidators(t *testing.T) { // create validator with 50% commission valAddr0 := sdk.ValAddress(valConsAddr0) - val0, err := distrtestutil.CreateValidator(valConsPk0, math.NewInt(100)) + operatorAddr, err := stakingKeeper.ValidatorAddressCodec().BytesToString(valConsPk0.Address()) + require.NoError(t, err) + val0, err := distrtestutil.CreateValidator(valConsPk0, operatorAddr, math.NewInt(100)) require.NoError(t, err) val0.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDec(0)) stakingKeeper.EXPECT().ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk0)).Return(val0, nil).AnyTimes() // create second validator with 0% commission valAddr1 := sdk.ValAddress(valConsAddr1) - val1, err := distrtestutil.CreateValidator(valConsPk1, math.NewInt(100)) + operatorAddr, err = stakingKeeper.ValidatorAddressCodec().BytesToString(valConsPk1.Address()) + require.NoError(t, err) + val1, err := distrtestutil.CreateValidator(valConsPk1, operatorAddr, math.NewInt(100)) require.NoError(t, err) val1.Commission = stakingtypes.NewCommission(math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0)) stakingKeeper.EXPECT().ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk1)).Return(val1, nil).AnyTimes() @@ -224,7 +238,8 @@ func TestAllocateTokensTruncation(t *testing.T) { ctrl := gomock.NewController(t) key := storetypes.NewKVStoreKey(disttypes.StoreKey) testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) - encCfg := moduletestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{}, distribution.AppModule{}) + cdcOpts := codectestutil.CodecOptions{} + encCfg := moduletestutil.MakeTestEncodingConfig(cdcOpts, distribution.AppModule{}) ctx := testCtx.Ctx.WithHeaderInfo(header.Info{Time: time.Now()}) bankKeeper := distrtestutil.NewMockBankKeeper(ctrl) @@ -239,6 +254,9 @@ func TestAllocateTokensTruncation(t *testing.T) { env := runtime.NewEnvironment(runtime.NewKVStoreService(key), log.NewNopLogger()) + authorityAddr, err := cdcOpts.GetAddressCodec().BytesToString(authtypes.NewModuleAddress("gov")) + require.NoError(t, err) + distrKeeper := keeper.NewKeeper( encCfg.Codec, env, @@ -247,7 +265,7 @@ func TestAllocateTokensTruncation(t *testing.T) { stakingKeeper, poolKeeper, "fee_collector", - authtypes.NewModuleAddress("gov").String(), + authorityAddr, ) // reset fee pool @@ -256,21 +274,27 @@ func TestAllocateTokensTruncation(t *testing.T) { // create validator with 10% commission valAddr0 := sdk.ValAddress(valConsAddr0) - val0, err := distrtestutil.CreateValidator(valConsPk0, math.NewInt(100)) + operatorAddr, err := stakingKeeper.ValidatorAddressCodec().BytesToString(valConsPk0.Address()) + require.NoError(t, err) + val0, err := distrtestutil.CreateValidator(valConsPk0, operatorAddr, math.NewInt(100)) require.NoError(t, err) val0.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(1, 1), math.LegacyNewDecWithPrec(1, 1), math.LegacyNewDec(0)) stakingKeeper.EXPECT().ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk0)).Return(val0, nil).AnyTimes() // create second validator with 10% commission valAddr1 := sdk.ValAddress(valConsAddr1) - val1, err := distrtestutil.CreateValidator(valConsPk1, math.NewInt(100)) + operatorAddr, err = stakingKeeper.ValidatorAddressCodec().BytesToString(valConsPk1.Address()) + require.NoError(t, err) + val1, err := distrtestutil.CreateValidator(valConsPk1, operatorAddr, math.NewInt(100)) require.NoError(t, err) val1.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(1, 1), math.LegacyNewDecWithPrec(1, 1), math.LegacyNewDec(0)) stakingKeeper.EXPECT().ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk1)).Return(val1, nil).AnyTimes() // create third validator with 10% commission valAddr2 := sdk.ValAddress(valConsAddr2) - val2, err := stakingtypes.NewValidator(sdk.ValAddress(valConsAddr2).String(), valConsPk1, stakingtypes.Description{}) + valAddr2Str, err := cdcOpts.GetValidatorCodec().BytesToString(valAddr2) + require.NoError(t, err) + val2, err := stakingtypes.NewValidator(valAddr2Str, valConsPk1, stakingtypes.Description{}) require.NoError(t, err) val2.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(1, 1), math.LegacyNewDecWithPrec(1, 1), math.LegacyNewDec(0)) stakingKeeper.EXPECT().ValidatorByConsAddr(gomock.Any(), sdk.GetConsAddress(valConsPk2)).Return(val2, nil).AnyTimes() diff --git a/x/distribution/keeper/delegation_test.go b/x/distribution/keeper/delegation_test.go index fc11b8b27d7f..39fd4dbf754d 100644 --- a/x/distribution/keeper/delegation_test.go +++ b/x/distribution/keeper/delegation_test.go @@ -44,6 +44,9 @@ func TestCalculateRewardsBasic(t *testing.T) { env := runtime.NewEnvironment(runtime.NewKVStoreService(key), log.NewNopLogger()) + authorityAddr, err := accountKeeper.AddressCodec().BytesToString(authtypes.NewModuleAddress("gov")) + require.NoError(t, err) + distrKeeper := keeper.NewKeeper( encCfg.Codec, env, @@ -52,7 +55,7 @@ func TestCalculateRewardsBasic(t *testing.T) { stakingKeeper, poolKeeper, "fee_collector", - authtypes.NewModuleAddress("gov").String(), + authorityAddr, ) // reset fee pool @@ -62,12 +65,19 @@ func TestCalculateRewardsBasic(t *testing.T) { // create validator with 50% commission valAddr := sdk.ValAddress(valConsAddr0) addr := sdk.AccAddress(valAddr) - val, err := distrtestutil.CreateValidator(valConsPk0, math.NewInt(1000)) + operatorAddr, err := stakingKeeper.ValidatorAddressCodec().BytesToString(valConsPk0.Address()) + require.NoError(t, err) + val, err := distrtestutil.CreateValidator(valConsPk0, operatorAddr, math.NewInt(1000)) require.NoError(t, err) val.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDec(0)) + addrStr, err := accountKeeper.AddressCodec().BytesToString(addr) + require.NoError(t, err) + valAddrStr, err := stakingKeeper.ValidatorAddressCodec().BytesToString(valAddr) + require.NoError(t, err) + // delegation mock - del := stakingtypes.NewDelegation(addr.String(), valAddr.String(), val.DelegatorShares) + del := stakingtypes.NewDelegation(addrStr, valAddrStr, val.DelegatorShares) stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val, nil).Times(3) stakingKeeper.EXPECT().Delegation(gomock.Any(), addr, valAddr).Return(del, nil) @@ -147,6 +157,9 @@ func TestCalculateRewardsAfterSlash(t *testing.T) { env := runtime.NewEnvironment(runtime.NewKVStoreService(key), log.NewNopLogger()) + authorityAddr, err := accountKeeper.AddressCodec().BytesToString(authtypes.NewModuleAddress("gov")) + require.NoError(t, err) + distrKeeper := keeper.NewKeeper( encCfg.Codec, env, @@ -155,7 +168,7 @@ func TestCalculateRewardsAfterSlash(t *testing.T) { stakingKeeper, poolKeeper, "fee_collector", - authtypes.NewModuleAddress("gov").String(), + authorityAddr, ) // reset fee pool @@ -167,11 +180,18 @@ func TestCalculateRewardsAfterSlash(t *testing.T) { addr := sdk.AccAddress(valAddr) valPower := int64(100) stake := sdk.TokensFromConsensusPower(100, sdk.DefaultPowerReduction) - val, err := distrtestutil.CreateValidator(valConsPk0, stake) + operatorAddr, err := stakingKeeper.ValidatorAddressCodec().BytesToString(valConsPk0.Address()) + require.NoError(t, err) + val, err := distrtestutil.CreateValidator(valConsPk0, operatorAddr, stake) require.NoError(t, err) val.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDec(0)) - del := stakingtypes.NewDelegation(addr.String(), valAddr.String(), val.DelegatorShares) + addrStr, err := accountKeeper.AddressCodec().BytesToString(addr) + require.NoError(t, err) + valAddrStr, err := stakingKeeper.ValidatorAddressCodec().BytesToString(valAddr) + require.NoError(t, err) + + del := stakingtypes.NewDelegation(addrStr, valAddrStr, val.DelegatorShares) // set mock calls stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val, nil).Times(4) @@ -253,6 +273,9 @@ func TestCalculateRewardsAfterManySlashes(t *testing.T) { env := runtime.NewEnvironment(runtime.NewKVStoreService(key), log.NewNopLogger()) + authorityAddr, err := accountKeeper.AddressCodec().BytesToString(authtypes.NewModuleAddress("gov")) + require.NoError(t, err) + distrKeeper := keeper.NewKeeper( encCfg.Codec, env, @@ -261,7 +284,7 @@ func TestCalculateRewardsAfterManySlashes(t *testing.T) { stakingKeeper, poolKeeper, "fee_collector", - authtypes.NewModuleAddress("gov").String(), + authorityAddr, ) // reset fee pool @@ -273,12 +296,19 @@ func TestCalculateRewardsAfterManySlashes(t *testing.T) { addr := sdk.AccAddress(valAddr) valPower := int64(100) stake := sdk.TokensFromConsensusPower(valPower, sdk.DefaultPowerReduction) - val, err := distrtestutil.CreateValidator(valConsPk0, stake) + operatorAddr, err := stakingKeeper.ValidatorAddressCodec().BytesToString(valConsPk0.Address()) + require.NoError(t, err) + val, err := distrtestutil.CreateValidator(valConsPk0, operatorAddr, stake) require.NoError(t, err) val.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDec(0)) + addrStr, err := accountKeeper.AddressCodec().BytesToString(addr) + require.NoError(t, err) + valAddrStr, err := stakingKeeper.ValidatorAddressCodec().BytesToString(valAddr) + require.NoError(t, err) + // delegation mocks - del := stakingtypes.NewDelegation(addr.String(), valAddr.String(), val.DelegatorShares) + del := stakingtypes.NewDelegation(addrStr, valAddrStr, val.DelegatorShares) stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val, nil).Times(4) stakingKeeper.EXPECT().Delegation(gomock.Any(), addr, valAddr).Return(del, nil) @@ -380,6 +410,9 @@ func TestCalculateRewardsMultiDelegator(t *testing.T) { env := runtime.NewEnvironment(runtime.NewKVStoreService(key), log.NewNopLogger()) + authorityAddr, err := accountKeeper.AddressCodec().BytesToString(authtypes.NewModuleAddress("gov")) + require.NoError(t, err) + distrKeeper := keeper.NewKeeper( encCfg.Codec, env, @@ -388,7 +421,7 @@ func TestCalculateRewardsMultiDelegator(t *testing.T) { stakingKeeper, poolKeeper, "fee_collector", - authtypes.NewModuleAddress("gov").String(), + authorityAddr, ) // reset fee pool @@ -398,12 +431,19 @@ func TestCalculateRewardsMultiDelegator(t *testing.T) { // create validator with 50% commission valAddr := sdk.ValAddress(valConsAddr0) addr0 := sdk.AccAddress(valAddr) - val, err := distrtestutil.CreateValidator(valConsPk0, math.NewInt(100)) + operatorAddr, err := stakingKeeper.ValidatorAddressCodec().BytesToString(valConsPk0.Address()) + require.NoError(t, err) + val, err := distrtestutil.CreateValidator(valConsPk0, operatorAddr, math.NewInt(100)) + require.NoError(t, err) + + addrStr, err := accountKeeper.AddressCodec().BytesToString(addr0) + require.NoError(t, err) + valAddrStr, err := stakingKeeper.ValidatorAddressCodec().BytesToString(valAddr) require.NoError(t, err) val.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDec(0)) - del0 := stakingtypes.NewDelegation(addr0.String(), valAddr.String(), val.DelegatorShares) + del0 := stakingtypes.NewDelegation(addrStr, valAddrStr, val.DelegatorShares) // set mock calls stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val, nil).Times(4) @@ -423,7 +463,7 @@ func TestCalculateRewardsMultiDelegator(t *testing.T) { // second delegation addr1 := sdk.AccAddress(valConsAddr1) - _, del1, err := distrtestutil.Delegate(ctx, distrKeeper, addr1, &val, math.NewInt(100), nil, stakingKeeper) + _, del1, err := distrtestutil.Delegate(ctx, distrKeeper, addr1, &val, math.NewInt(100), nil, stakingKeeper, accountKeeper.AddressCodec()) require.NoError(t, err) stakingKeeper.EXPECT().Delegation(gomock.Any(), addr1, valAddr).Return(del1, nil) @@ -480,6 +520,9 @@ func TestWithdrawDelegationRewardsBasic(t *testing.T) { env := runtime.NewEnvironment(runtime.NewKVStoreService(key), log.NewNopLogger()) + authorityAddr, err := accountKeeper.AddressCodec().BytesToString(authtypes.NewModuleAddress("gov")) + require.NoError(t, err) + distrKeeper := keeper.NewKeeper( encCfg.Codec, env, @@ -488,7 +531,7 @@ func TestWithdrawDelegationRewardsBasic(t *testing.T) { stakingKeeper, poolKeeper, "fee_collector", - authtypes.NewModuleAddress("gov").String(), + authorityAddr, ) // reset fee pool @@ -498,13 +541,20 @@ func TestWithdrawDelegationRewardsBasic(t *testing.T) { // create validator with 50% commission valAddr := sdk.ValAddress(valConsAddr0) addr := sdk.AccAddress(valAddr) - val, err := distrtestutil.CreateValidator(valConsPk0, math.NewInt(100)) + operatorAddr, err := stakingKeeper.ValidatorAddressCodec().BytesToString(valConsPk0.Address()) + require.NoError(t, err) + val, err := distrtestutil.CreateValidator(valConsPk0, operatorAddr, math.NewInt(100)) require.NoError(t, err) val.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDec(0)) + addrStr, err := accountKeeper.AddressCodec().BytesToString(addr) + require.NoError(t, err) + valAddrStr, err := stakingKeeper.ValidatorAddressCodec().BytesToString(valAddr) + require.NoError(t, err) + // delegation mock - del := stakingtypes.NewDelegation(addr.String(), valAddr.String(), val.DelegatorShares) + del := stakingtypes.NewDelegation(addrStr, valAddrStr, val.DelegatorShares) stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val, nil).Times(5) stakingKeeper.EXPECT().Delegation(gomock.Any(), addr, valAddr).Return(del, nil).Times(3) @@ -558,6 +608,9 @@ func TestCalculateRewardsAfterManySlashesInSameBlock(t *testing.T) { env := runtime.NewEnvironment(runtime.NewKVStoreService(key), log.NewNopLogger()) + authorityAddr, err := accountKeeper.AddressCodec().BytesToString(authtypes.NewModuleAddress("gov")) + require.NoError(t, err) + distrKeeper := keeper.NewKeeper( encCfg.Codec, env, @@ -566,7 +619,7 @@ func TestCalculateRewardsAfterManySlashesInSameBlock(t *testing.T) { stakingKeeper, poolKeeper, "fee_collector", - authtypes.NewModuleAddress("gov").String(), + authorityAddr, ) // reset fee pool @@ -576,13 +629,20 @@ func TestCalculateRewardsAfterManySlashesInSameBlock(t *testing.T) { // create validator with 50% commission valAddr := sdk.ValAddress(valConsAddr0) addr := sdk.AccAddress(valAddr) - val, err := distrtestutil.CreateValidator(valConsPk0, math.NewInt(100)) + operatorAddr, err := stakingKeeper.ValidatorAddressCodec().BytesToString(valConsPk0.Address()) + require.NoError(t, err) + val, err := distrtestutil.CreateValidator(valConsPk0, operatorAddr, math.NewInt(100)) require.NoError(t, err) val.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDec(0)) + addrStr, err := accountKeeper.AddressCodec().BytesToString(addr) + require.NoError(t, err) + valAddrStr, err := stakingKeeper.ValidatorAddressCodec().BytesToString(valAddr) + require.NoError(t, err) + // delegation mock - del := stakingtypes.NewDelegation(addr.String(), valAddr.String(), val.DelegatorShares) + del := stakingtypes.NewDelegation(addrStr, valAddrStr, val.DelegatorShares) stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val, nil).Times(5) stakingKeeper.EXPECT().Delegation(gomock.Any(), addr, valAddr).Return(del, nil) @@ -677,6 +737,9 @@ func TestCalculateRewardsMultiDelegatorMultiSlash(t *testing.T) { env := runtime.NewEnvironment(runtime.NewKVStoreService(key), log.NewNopLogger()) + authorityAddr, err := accountKeeper.AddressCodec().BytesToString(authtypes.NewModuleAddress("gov")) + require.NoError(t, err) + distrKeeper := keeper.NewKeeper( encCfg.Codec, env, @@ -685,7 +748,7 @@ func TestCalculateRewardsMultiDelegatorMultiSlash(t *testing.T) { stakingKeeper, poolKeeper, "fee_collector", - authtypes.NewModuleAddress("gov").String(), + authorityAddr, ) // reset fee pool @@ -697,12 +760,19 @@ func TestCalculateRewardsMultiDelegatorMultiSlash(t *testing.T) { // create validator with 50% commission valAddr := sdk.ValAddress(valConsAddr0) addr := sdk.AccAddress(valAddr) - val, err := distrtestutil.CreateValidator(valConsPk0, sdk.TokensFromConsensusPower(valPower, sdk.DefaultPowerReduction)) + operatorAddr, err := stakingKeeper.ValidatorAddressCodec().BytesToString(valConsPk0.Address()) + require.NoError(t, err) + val, err := distrtestutil.CreateValidator(valConsPk0, operatorAddr, sdk.TokensFromConsensusPower(valPower, sdk.DefaultPowerReduction)) require.NoError(t, err) val.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDec(0)) + addrStr, err := accountKeeper.AddressCodec().BytesToString(addr) + require.NoError(t, err) + valAddrStr, err := stakingKeeper.ValidatorAddressCodec().BytesToString(valAddr) + require.NoError(t, err) + // validator and delegation mocks - del := stakingtypes.NewDelegation(addr.String(), valAddr.String(), val.DelegatorShares) + del := stakingtypes.NewDelegation(addrStr, valAddrStr, val.DelegatorShares) stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val, nil).Times(3) stakingKeeper.EXPECT().Delegation(gomock.Any(), addr, valAddr).Return(del, nil) @@ -746,6 +816,7 @@ func TestCalculateRewardsMultiDelegatorMultiSlash(t *testing.T) { sdk.TokensFromConsensusPower(100, sdk.DefaultPowerReduction), nil, stakingKeeper, + accountKeeper.AddressCodec(), ) require.NoError(t, err) @@ -819,6 +890,9 @@ func TestCalculateRewardsMultiDelegatorMultWithdraw(t *testing.T) { env := runtime.NewEnvironment(runtime.NewKVStoreService(key), log.NewNopLogger()) + authorityAddr, err := accountKeeper.AddressCodec().BytesToString(authtypes.NewModuleAddress("gov")) + require.NoError(t, err) + distrKeeper := keeper.NewKeeper( encCfg.Codec, env, @@ -827,7 +901,7 @@ func TestCalculateRewardsMultiDelegatorMultWithdraw(t *testing.T) { stakingKeeper, poolKeeper, "fee_collector", - authtypes.NewModuleAddress("gov").String(), + authorityAddr, ) // reset fee pool @@ -837,12 +911,19 @@ func TestCalculateRewardsMultiDelegatorMultWithdraw(t *testing.T) { // create validator with 50% commission valAddr := sdk.ValAddress(valConsAddr0) addr := sdk.AccAddress(valAddr) - val, err := distrtestutil.CreateValidator(valConsPk0, math.NewInt(100)) + operatorAddr, err := stakingKeeper.ValidatorAddressCodec().BytesToString(valConsPk0.Address()) + require.NoError(t, err) + val, err := distrtestutil.CreateValidator(valConsPk0, operatorAddr, math.NewInt(100)) require.NoError(t, err) val.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDec(0)) + addrStr, err := accountKeeper.AddressCodec().BytesToString(addr) + require.NoError(t, err) + valAddrStr, err := stakingKeeper.ValidatorAddressCodec().BytesToString(valAddr) + require.NoError(t, err) + // validator and delegation mocks - del := stakingtypes.NewDelegation(addr.String(), valAddr.String(), val.DelegatorShares) + del := stakingtypes.NewDelegation(addrStr, valAddrStr, val.DelegatorShares) stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val, nil).Times(3) stakingKeeper.EXPECT().Delegation(gomock.Any(), addr, valAddr).Return(del, nil).Times(5) @@ -871,6 +952,7 @@ func TestCalculateRewardsMultiDelegatorMultWithdraw(t *testing.T) { math.NewInt(100), nil, stakingKeeper, + accountKeeper.AddressCodec(), ) require.NoError(t, err) @@ -1022,6 +1104,9 @@ func Test100PercentCommissionReward(t *testing.T) { env := runtime.NewEnvironment(runtime.NewKVStoreService(key), log.NewNopLogger()) + authorityAddr, err := accountKeeper.AddressCodec().BytesToString(authtypes.NewModuleAddress("gov")) + require.NoError(t, err) + distrKeeper := keeper.NewKeeper( encCfg.Codec, env, @@ -1030,7 +1115,7 @@ func Test100PercentCommissionReward(t *testing.T) { stakingKeeper, poolKeeper, "fee_collector", - authtypes.NewModuleAddress("gov").String(), + authorityAddr, ) // reset fee pool @@ -1040,12 +1125,19 @@ func Test100PercentCommissionReward(t *testing.T) { // create validator with 50% commission valAddr := sdk.ValAddress(valConsAddr0) addr := sdk.AccAddress(valAddr) - val, err := distrtestutil.CreateValidator(valConsPk0, math.NewInt(100)) + operatorAddr, err := stakingKeeper.ValidatorAddressCodec().BytesToString(valConsPk0.Address()) + require.NoError(t, err) + val, err := distrtestutil.CreateValidator(valConsPk0, operatorAddr, math.NewInt(100)) require.NoError(t, err) val.Commission = stakingtypes.NewCommission(math.LegacyNewDecWithPrec(10, 1), math.LegacyNewDecWithPrec(10, 1), math.LegacyNewDec(0)) + addrStr, err := accountKeeper.AddressCodec().BytesToString(addr) + require.NoError(t, err) + valAddrStr, err := stakingKeeper.ValidatorAddressCodec().BytesToString(valAddr) + require.NoError(t, err) + // validator and delegation mocks - del := stakingtypes.NewDelegation(addr.String(), valAddr.String(), val.DelegatorShares) + del := stakingtypes.NewDelegation(addrStr, valAddrStr, val.DelegatorShares) stakingKeeper.EXPECT().Validator(gomock.Any(), valAddr).Return(val, nil).Times(3) stakingKeeper.EXPECT().Delegation(gomock.Any(), addr, valAddr).Return(del, nil).Times(3) diff --git a/x/distribution/keeper/genesis.go b/x/distribution/keeper/genesis.go index 527ef35ba952..b6c0d0fb5c33 100644 --- a/x/distribution/keeper/genesis.go +++ b/x/distribution/keeper/genesis.go @@ -159,9 +159,17 @@ func (k Keeper) ExportGenesis(ctx context.Context) (*types.GenesisState, error) var dwi []types.DelegatorWithdrawInfo err = k.DelegatorsWithdrawAddress.Walk(ctx, nil, func(key, value sdk.AccAddress) (stop bool, err error) { + keyAddr, err := k.authKeeper.AddressCodec().BytesToString(key) + if err != nil { + return true, err + } + valueAddr, err := k.authKeeper.AddressCodec().BytesToString(value) + if err != nil { + return true, err + } dwi = append(dwi, types.DelegatorWithdrawInfo{ - DelegatorAddress: key.String(), - WithdrawAddress: value.String(), + DelegatorAddress: keyAddr, + WithdrawAddress: valueAddr, }) return false, nil }) @@ -177,8 +185,13 @@ func (k Keeper) ExportGenesis(ctx context.Context) (*types.GenesisState, error) outstanding := make([]types.ValidatorOutstandingRewardsRecord, 0) err = k.ValidatorOutstandingRewards.Walk(ctx, nil, func(addr sdk.ValAddress, rewards types.ValidatorOutstandingRewards) (stop bool, err error) { + valAddr, err := k.stakingKeeper.ValidatorAddressCodec().BytesToString(addr) + if err != nil { + return true, err + } + outstanding = append(outstanding, types.ValidatorOutstandingRewardsRecord{ - ValidatorAddress: addr.String(), + ValidatorAddress: valAddr, OutstandingRewards: rewards.Rewards, }) return false, nil @@ -190,8 +203,13 @@ func (k Keeper) ExportGenesis(ctx context.Context) (*types.GenesisState, error) acc := make([]types.ValidatorAccumulatedCommissionRecord, 0) err = k.ValidatorsAccumulatedCommission.Walk(ctx, nil, func(addr sdk.ValAddress, commission types.ValidatorAccumulatedCommission) (stop bool, err error) { + valAddr, err := k.stakingKeeper.ValidatorAddressCodec().BytesToString(addr) + if err != nil { + return true, err + } + acc = append(acc, types.ValidatorAccumulatedCommissionRecord{ - ValidatorAddress: addr.String(), + ValidatorAddress: valAddr, Accumulated: commission, }) return false, nil @@ -203,8 +221,13 @@ func (k Keeper) ExportGenesis(ctx context.Context) (*types.GenesisState, error) his := make([]types.ValidatorHistoricalRewardsRecord, 0) err = k.ValidatorHistoricalRewards.Walk(ctx, nil, func(key collections.Pair[sdk.ValAddress, uint64], rewards types.ValidatorHistoricalRewards) (stop bool, err error) { + valAddr, err := k.stakingKeeper.ValidatorAddressCodec().BytesToString(key.K1()) + if err != nil { + return true, err + } + his = append(his, types.ValidatorHistoricalRewardsRecord{ - ValidatorAddress: key.K1().String(), + ValidatorAddress: valAddr, Period: key.K2(), Rewards: rewards, }) @@ -218,8 +241,13 @@ func (k Keeper) ExportGenesis(ctx context.Context) (*types.GenesisState, error) cur := make([]types.ValidatorCurrentRewardsRecord, 0) err = k.ValidatorCurrentRewards.Walk(ctx, nil, func(val sdk.ValAddress, rewards types.ValidatorCurrentRewards) (stop bool, err error) { + valAddr, err := k.stakingKeeper.ValidatorAddressCodec().BytesToString(val) + if err != nil { + return true, err + } + cur = append(cur, types.ValidatorCurrentRewardsRecord{ - ValidatorAddress: val.String(), + ValidatorAddress: valAddr, Rewards: rewards, }) return false, nil @@ -231,9 +259,19 @@ func (k Keeper) ExportGenesis(ctx context.Context) (*types.GenesisState, error) dels := make([]types.DelegatorStartingInfoRecord, 0) err = k.DelegatorStartingInfo.Walk(ctx, nil, func(key collections.Pair[sdk.ValAddress, sdk.AccAddress], value types.DelegatorStartingInfo) (stop bool, err error) { + delAddr, err := k.authKeeper.AddressCodec().BytesToString(key.K2()) + if err != nil { + return true, err + } + + valAddr, err := k.stakingKeeper.ValidatorAddressCodec().BytesToString(key.K1()) + if err != nil { + return true, err + } + dels = append(dels, types.DelegatorStartingInfoRecord{ - DelegatorAddress: key.K2().String(), - ValidatorAddress: key.K1().String(), + DelegatorAddress: delAddr, + ValidatorAddress: valAddr, StartingInfo: value, }) return false, nil @@ -246,10 +284,15 @@ func (k Keeper) ExportGenesis(ctx context.Context) (*types.GenesisState, error) err = k.ValidatorSlashEvents.Walk( ctx, nil, - func(k collections.Triple[sdk.ValAddress, uint64, uint64], event types.ValidatorSlashEvent) (stop bool, err error) { + func(key collections.Triple[sdk.ValAddress, uint64, uint64], event types.ValidatorSlashEvent) (stop bool, err error) { + valAddr, err := k.stakingKeeper.ValidatorAddressCodec().BytesToString(key.K1()) + if err != nil { + return true, err + } + slashes = append(slashes, types.ValidatorSlashEventRecord{ - ValidatorAddress: k.K1().String(), - Height: k.K2(), + ValidatorAddress: valAddr, + Height: key.K2(), Period: event.ValidatorPeriod, ValidatorSlashEvent: event, }) @@ -260,5 +303,9 @@ func (k Keeper) ExportGenesis(ctx context.Context) (*types.GenesisState, error) return nil, err } - return types.NewGenesisState(params, feePool, dwi, pp, outstanding, acc, his, cur, dels, slashes), nil + ppAddr, err := k.stakingKeeper.ConsensusAddressCodec().BytesToString(pp) + if err != nil { + return nil, err + } + return types.NewGenesisState(params, feePool, dwi, ppAddr, outstanding, acc, his, cur, dels, slashes), nil } diff --git a/x/distribution/keeper/grpc_query.go b/x/distribution/keeper/grpc_query.go index 38889665a0e4..62b602c8a805 100644 --- a/x/distribution/keeper/grpc_query.go +++ b/x/distribution/keeper/grpc_query.go @@ -86,9 +86,14 @@ func (k Querier) ValidatorDistributionInfo(ctx context.Context, req *types.Query return nil, err } + operatorAddr, err := k.authKeeper.AddressCodec().BytesToString(delAdr) + if err != nil { + return nil, err + } + return &types.QueryValidatorDistributionInfoResponse{ Commission: validatorCommission.Commission, - OperatorAddress: delAdr.String(), + OperatorAddress: operatorAddr, SelfBondRewards: rewards, }, nil } @@ -356,7 +361,12 @@ func (k Querier) DelegatorWithdrawAddress(ctx context.Context, req *types.QueryD return nil, err } - return &types.QueryDelegatorWithdrawAddressResponse{WithdrawAddress: withdrawAddr.String()}, nil + addr, err := k.authKeeper.AddressCodec().BytesToString(withdrawAddr) + if err != nil { + return nil, err + } + + return &types.QueryDelegatorWithdrawAddressResponse{WithdrawAddress: addr}, nil } // Deprecated: DO NOT USE diff --git a/x/distribution/keeper/grpc_query_test.go b/x/distribution/keeper/grpc_query_test.go index bd7c4fb03d0c..14bbbd66902f 100644 --- a/x/distribution/keeper/grpc_query_test.go +++ b/x/distribution/keeper/grpc_query_test.go @@ -12,6 +12,7 @@ import ( "cosmossdk.io/x/distribution/types" stakingtypes "cosmossdk.io/x/staking/types" + codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -54,11 +55,15 @@ func TestQueryParams(t *testing.T) { func TestQueryValidatorDistributionInfo(t *testing.T) { ctx, addrs, distrKeeper, dep := initFixture(t) queryServer := keeper.NewQuerier(distrKeeper) + operatorAddr, err := codectestutil.CodecOptions{}.GetValidatorCodec().BytesToString(valConsPk0.Address()) + require.NoError(t, err) + val, err := distrtestutil.CreateValidator(valConsPk0, operatorAddr, math.NewInt(100)) + require.NoError(t, err) - val, err := distrtestutil.CreateValidator(valConsPk0, math.NewInt(100)) + addr0Str, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(addrs[0]) require.NoError(t, err) - del := stakingtypes.NewDelegation(addrs[0].String(), val.OperatorAddress, val.DelegatorShares) + del := stakingtypes.NewDelegation(addr0Str, val.OperatorAddress, val.DelegatorShares) dep.stakingKeeper.EXPECT().Validator(gomock.Any(), gomock.Any()).Return(val, nil).AnyTimes() dep.stakingKeeper.EXPECT().Delegation(gomock.Any(), gomock.Any(), gomock.Any()).Return(del, nil).AnyTimes() @@ -80,7 +85,7 @@ func TestQueryValidatorDistributionInfo(t *testing.T) { { name: "not a validator", req: &types.QueryValidatorDistributionInfoRequest{ - ValidatorAddress: addrs[0].String(), + ValidatorAddress: addr0Str, }, resp: &types.QueryValidatorDistributionInfoResponse{}, errMsg: `expected 'cosmosvaloper' got 'cosmos'`, diff --git a/x/distribution/keeper/keeper.go b/x/distribution/keeper/keeper.go index fab55212f68b..845666de3d21 100644 --- a/x/distribution/keeper/keeper.go +++ b/x/distribution/keeper/keeper.go @@ -165,9 +165,14 @@ func (k Keeper) SetWithdrawAddr(ctx context.Context, delegatorAddr, withdrawAddr return types.ErrSetWithdrawAddrDisabled } + addr, err := k.authKeeper.AddressCodec().BytesToString(withdrawAddr) + if err != nil { + return err + } + if err = k.environment.EventService.EventManager(ctx).EmitKV( types.EventTypeSetWithdrawAddress, - event.NewAttribute(types.AttributeKeyWithdrawAddress, withdrawAddr.String()), + event.NewAttribute(types.AttributeKeyWithdrawAddress, addr), ); err != nil { return err } diff --git a/x/distribution/keeper/keeper_test.go b/x/distribution/keeper/keeper_test.go index 3456466401f9..c148529fcf41 100644 --- a/x/distribution/keeper/keeper_test.go +++ b/x/distribution/keeper/keeper_test.go @@ -39,7 +39,8 @@ func initFixture(t *testing.T) (sdk.Context, []sdk.AccAddress, keeper.Keeper, de ctrl := gomock.NewController(t) key := storetypes.NewKVStoreKey(types.StoreKey) testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) - encCfg := moduletestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{}, distribution.AppModule{}) + cdcOpts := codectestutil.CodecOptions{} + encCfg := moduletestutil.MakeTestEncodingConfig(cdcOpts, distribution.AppModule{}) ctx := testCtx.Ctx.WithHeaderInfo(header.Info{Time: time.Now()}) addrs := simtestutil.CreateIncrementalAccounts(2) @@ -59,6 +60,9 @@ func initFixture(t *testing.T) (sdk.Context, []sdk.AccAddress, keeper.Keeper, de env := runtime.NewEnvironment(runtime.NewKVStoreService(key), log.NewNopLogger()) + authorityAddr, err := cdcOpts.GetAddressCodec().BytesToString(authtypes.NewModuleAddress("gov")) + require.NoError(t, err) + distrKeeper := keeper.NewKeeper( encCfg.Codec, env, @@ -67,7 +71,7 @@ func initFixture(t *testing.T) (sdk.Context, []sdk.AccAddress, keeper.Keeper, de stakingKeeper, poolKeeper, "fee_collector", - authtypes.NewModuleAddress("gov").String(), + authorityAddr, ) params := types.DefaultParams() diff --git a/x/distribution/keeper/msg_server_test.go b/x/distribution/keeper/msg_server_test.go index a4aa0f97d0c8..8c5cad6d39ac 100644 --- a/x/distribution/keeper/msg_server_test.go +++ b/x/distribution/keeper/msg_server_test.go @@ -11,6 +11,7 @@ import ( "cosmossdk.io/x/distribution/keeper" "cosmossdk.io/x/distribution/types" + codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -18,6 +19,11 @@ func TestMsgSetWithdrawAddress(t *testing.T) { ctx, addrs, distrKeeper, _ := initFixture(t) msgServer := keeper.NewMsgServerImpl(distrKeeper) + addr0Str, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(addrs[0]) + require.NoError(t, err) + addr1Str, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(addrs[1]) + require.NoError(t, err) + cases := []struct { name string msg *types.MsgSetWithdrawAddress @@ -26,8 +32,8 @@ func TestMsgSetWithdrawAddress(t *testing.T) { { name: "success", msg: &types.MsgSetWithdrawAddress{ - DelegatorAddress: addrs[0].String(), - WithdrawAddress: addrs[1].String(), + DelegatorAddress: addr0Str, + WithdrawAddress: addr1Str, }, errMsg: "", }, @@ -35,14 +41,14 @@ func TestMsgSetWithdrawAddress(t *testing.T) { name: "invalid delegator address", msg: &types.MsgSetWithdrawAddress{ DelegatorAddress: "invalid", - WithdrawAddress: addrs[1].String(), + WithdrawAddress: addr1Str, }, errMsg: "invalid address", }, { name: "invalid withdraw address", msg: &types.MsgSetWithdrawAddress{ - DelegatorAddress: addrs[0].String(), + DelegatorAddress: addr0Str, WithdrawAddress: "invalid", }, errMsg: "invalid address", @@ -68,6 +74,11 @@ func TestMsgWithdrawDelegatorReward(t *testing.T) { dep.stakingKeeper.EXPECT().Validator(gomock.Any(), gomock.Any()).AnyTimes() msgServer := keeper.NewMsgServerImpl(distrKeeper) + addr0Str, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(addrs[0]) + require.NoError(t, err) + valAddr1Str, err := codectestutil.CodecOptions{}.GetValidatorCodec().BytesToString(addrs[1]) + require.NoError(t, err) + cases := []struct { name string preRun func() @@ -78,14 +89,14 @@ func TestMsgWithdrawDelegatorReward(t *testing.T) { name: "invalid delegator address", msg: &types.MsgWithdrawDelegatorReward{ DelegatorAddress: "invalid", - ValidatorAddress: sdk.ValAddress(addrs[1]).String(), + ValidatorAddress: valAddr1Str, }, errMsg: "invalid delegator address", }, { name: "invalid validator address", msg: &types.MsgWithdrawDelegatorReward{ - DelegatorAddress: addrs[0].String(), + DelegatorAddress: addr0Str, ValidatorAddress: "invalid", }, errMsg: "invalid validator address", @@ -93,8 +104,8 @@ func TestMsgWithdrawDelegatorReward(t *testing.T) { { name: "no validator", msg: &types.MsgWithdrawDelegatorReward{ - DelegatorAddress: addrs[0].String(), - ValidatorAddress: sdk.ValAddress(addrs[1]).String(), + DelegatorAddress: addr0Str, + ValidatorAddress: valAddr1Str, }, errMsg: "no validator distribution info", }, @@ -121,6 +132,9 @@ func TestMsgWithdrawValidatorCommission(t *testing.T) { ctx, addrs, distrKeeper, _ := initFixture(t) msgServer := keeper.NewMsgServerImpl(distrKeeper) + valAddr1Str, err := codectestutil.CodecOptions{}.GetValidatorCodec().BytesToString(addrs[1]) + require.NoError(t, err) + cases := []struct { name string preRun func() @@ -137,7 +151,7 @@ func TestMsgWithdrawValidatorCommission(t *testing.T) { { name: "no validator commission to withdraw", msg: &types.MsgWithdrawValidatorCommission{ - ValidatorAddress: sdk.ValAddress(addrs[1]).String(), + ValidatorAddress: valAddr1Str, }, errMsg: "no validator commission to withdraw", }, @@ -165,6 +179,9 @@ func TestMsgFundCommunityPool(t *testing.T) { dep.poolKeeper.EXPECT().FundCommunityPool(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes() msgServer := keeper.NewMsgServerImpl(distrKeeper) + addr0Str, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(addrs[0]) + require.NoError(t, err) + cases := []struct { name string msg *types.MsgFundCommunityPool //nolint:staticcheck // Testing deprecated method @@ -181,7 +198,7 @@ func TestMsgFundCommunityPool(t *testing.T) { { name: "success", msg: &types.MsgFundCommunityPool{ //nolint:staticcheck // Testing deprecated method - Depositor: addrs[0].String(), + Depositor: addr0Str, Amount: sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(1000))), }, }, @@ -205,6 +222,11 @@ func TestMsgUpdateParams(t *testing.T) { ctx, addrs, distrKeeper, _ := initFixture(t) msgServer := keeper.NewMsgServerImpl(distrKeeper) + authorityAddr, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(authtypes.NewModuleAddress("gov")) + require.NoError(t, err) + addr0Str, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(addrs[0]) + require.NoError(t, err) + cases := []struct { name string msg *types.MsgUpdateParams @@ -221,7 +243,7 @@ func TestMsgUpdateParams(t *testing.T) { { name: "incorrect authority", msg: &types.MsgUpdateParams{ - Authority: addrs[0].String(), + Authority: addr0Str, Params: types.DefaultParams(), }, errMsg: "expected authority account as only signer for proposal message", @@ -229,7 +251,7 @@ func TestMsgUpdateParams(t *testing.T) { { name: "invalid params", msg: &types.MsgUpdateParams{ - Authority: authtypes.NewModuleAddress("gov").String(), + Authority: authorityAddr, Params: types.Params{CommunityTax: math.LegacyNewDec(-1)}, }, errMsg: "community tax must be positive", @@ -237,7 +259,7 @@ func TestMsgUpdateParams(t *testing.T) { { name: "success", msg: &types.MsgUpdateParams{ - Authority: authtypes.NewModuleAddress("gov").String(), + Authority: authorityAddr, Params: types.DefaultParams(), }, }, @@ -262,6 +284,11 @@ func TestMsgCommunityPoolSpend(t *testing.T) { dep.poolKeeper.EXPECT().DistributeFromCommunityPool(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes() msgServer := keeper.NewMsgServerImpl(distrKeeper) + authorityAddr, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(authtypes.NewModuleAddress("gov")) + require.NoError(t, err) + addr0Str, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(addrs[0]) + require.NoError(t, err) + cases := []struct { name string msg *types.MsgCommunityPoolSpend //nolint:staticcheck // Testing deprecated method @@ -278,7 +305,7 @@ func TestMsgCommunityPoolSpend(t *testing.T) { { name: "incorrect authority", msg: &types.MsgCommunityPoolSpend{ //nolint:staticcheck // Testing deprecated method - Authority: addrs[0].String(), + Authority: addr0Str, Amount: sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(100))), }, errMsg: "expected authority account as only signer for proposal message", @@ -286,7 +313,7 @@ func TestMsgCommunityPoolSpend(t *testing.T) { { name: "invalid recipient address", msg: &types.MsgCommunityPoolSpend{ //nolint:staticcheck // Testing deprecated method - Authority: authtypes.NewModuleAddress("gov").String(), + Authority: authorityAddr, Recipient: "invalid", Amount: sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(100))), }, @@ -295,16 +322,16 @@ func TestMsgCommunityPoolSpend(t *testing.T) { { name: "invalid amount", msg: &types.MsgCommunityPoolSpend{ //nolint:staticcheck // Testing deprecated method - Authority: authtypes.NewModuleAddress("gov").String(), - Recipient: addrs[0].String(), + Authority: authorityAddr, + Recipient: addr0Str, }, errMsg: "invalid coins", }, { name: "success", msg: &types.MsgCommunityPoolSpend{ //nolint:staticcheck // Testing deprecated method - Authority: authtypes.NewModuleAddress("gov").String(), - Recipient: addrs[0].String(), + Authority: authorityAddr, + Recipient: addr0Str, Amount: sdk.NewCoins(sdk.NewCoin("stake", math.NewInt(1000))), }, }, diff --git a/x/distribution/migrations/v4/migrate_funds_test.go b/x/distribution/migrations/v4/migrate_funds_test.go index b8994061cbd8..470fc3cd07cc 100644 --- a/x/distribution/migrations/v4/migrate_funds_test.go +++ b/x/distribution/migrations/v4/migrate_funds_test.go @@ -10,6 +10,7 @@ import ( storetypes "cosmossdk.io/store/types" "cosmossdk.io/x/auth" authkeeper "cosmossdk.io/x/auth/keeper" + authtestutil "cosmossdk.io/x/auth/testutil" authtypes "cosmossdk.io/x/auth/types" "cosmossdk.io/x/bank" bankkeeper "cosmossdk.io/x/bank/keeper" @@ -37,23 +38,31 @@ func TestFundsMigration(t *testing.T) { cms := integration.CreateMultiStore(keys, logger) encCfg := moduletestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{}, auth.AppModule{}, bank.AppModule{}, distribution.AppModule{}) ctx := sdk.NewContext(cms, true, logger) - + addressCodec := addresscodec.NewBech32Codec(sdk.Bech32MainPrefix) maccPerms := map[string][]string{ pooltypes.ModuleName: nil, disttypes.ModuleName: {authtypes.Minter}, } - authority := authtypes.NewModuleAddress("gov") + authority, err := addressCodec.BytesToString(authtypes.NewModuleAddress("gov")) + require.NoError(t, err) + + // gomock initializations + ctrl := gomock.NewController(t) + acctsModKeeper := authtestutil.NewMockAccountsModKeeper(ctrl) + stakingKeeper := distrtestutil.NewMockStakingKeeper(ctrl) + poolKeeper := distrtestutil.NewMockPoolKeeper(ctrl) // create account keeper accountKeeper := authkeeper.NewAccountKeeper( runtime.NewEnvironment(runtime.NewKVStoreService(keys[authtypes.StoreKey]), log.NewNopLogger()), encCfg.Codec, authtypes.ProtoBaseAccount, + acctsModKeeper, maccPerms, - addresscodec.NewBech32Codec(sdk.Bech32MainPrefix), + addressCodec, sdk.Bech32MainPrefix, - authority.String(), + authority, ) // create bank keeper @@ -62,14 +71,9 @@ func TestFundsMigration(t *testing.T) { encCfg.Codec, accountKeeper, map[string]bool{}, - authority.String(), + authority, ) - // gomock initializations - ctrl := gomock.NewController(t) - stakingKeeper := distrtestutil.NewMockStakingKeeper(ctrl) - poolKeeper := distrtestutil.NewMockPoolKeeper(ctrl) - // create distribution keeper distrKeeper := keeper.NewKeeper( encCfg.Codec, @@ -79,7 +83,7 @@ func TestFundsMigration(t *testing.T) { stakingKeeper, poolKeeper, disttypes.ModuleName, - authority.String(), + authority, ) // Set feepool @@ -87,7 +91,7 @@ func TestFundsMigration(t *testing.T) { feepool := disttypes.FeePool{ CommunityPool: sdk.NewDecCoinsFromCoins(poolAmount), } - err := distrKeeper.FeePool.Set(ctx, feepool) + err = distrKeeper.FeePool.Set(ctx, feepool) require.NoError(t, err) distrAcc := authtypes.NewEmptyModuleAccount(disttypes.ModuleName) diff --git a/x/distribution/proto/buf.gen.gogo.yaml b/x/distribution/proto/buf.gen.gogo.yaml index 9c8ba0a4b1fd..db36231d0c82 100644 --- a/x/distribution/proto/buf.gen.gogo.yaml +++ b/x/distribution/proto/buf.gen.gogo.yaml @@ -2,7 +2,7 @@ version: v1 plugins: - name: gocosmos out: .. - opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any - name: grpc-gateway out: .. opt: logtostderr=true,allow_colon_final_segments=true diff --git a/x/distribution/simulation/operations.go b/x/distribution/simulation/operations.go index 1940617aacd8..6fdecf6e3c63 100644 --- a/x/distribution/simulation/operations.go +++ b/x/distribution/simulation/operations.go @@ -91,7 +91,16 @@ func SimulateMsgSetWithdrawAddress(txConfig client.TxConfig, ak types.AccountKee account := ak.GetAccount(ctx, simAccount.Address) spendable := bk.SpendableCoins(ctx, account.GetAddress()) - msg := types.NewMsgSetWithdrawAddress(simAccount.Address, simToAccount.Address) + addr, err := ak.AddressCodec().BytesToString(simAccount.Address) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, sdk.MsgTypeURL(&types.MsgSetWithdrawAddress{}), "error converting delegator address"), nil, err + } + toAddr, err := ak.AddressCodec().BytesToString(simToAccount.Address) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, sdk.MsgTypeURL(&types.MsgSetWithdrawAddress{}), "error converting withdraw address"), nil, err + } + + msg := types.NewMsgSetWithdrawAddress(addr, toAddr) txCtx := simulation.OperationInput{ R: r, @@ -142,7 +151,12 @@ func SimulateMsgWithdrawDelegatorReward(txConfig client.TxConfig, ak types.Accou account := ak.GetAccount(ctx, simAccount.Address) spendable := bk.SpendableCoins(ctx, account.GetAddress()) - msg := types.NewMsgWithdrawDelegatorReward(simAccount.Address.String(), validator.GetOperator()) + addr, err := ak.AddressCodec().BytesToString(simAccount.Address) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, sdk.MsgTypeURL(&types.MsgWithdrawDelegatorReward{}), "error converting delegator address"), nil, err + } + + msg := types.NewMsgWithdrawDelegatorReward(addr, validator.GetOperator()) txCtx := simulation.OperationInput{ R: r, diff --git a/x/distribution/simulation/proposals.go b/x/distribution/simulation/proposals.go index fadbf3bb93ef..98592d1f8e5f 100644 --- a/x/distribution/simulation/proposals.go +++ b/x/distribution/simulation/proposals.go @@ -32,7 +32,7 @@ func ProposalMsgs() []simtypes.WeightedProposalMsg { } // SimulateMsgUpdateParams returns a random MsgUpdateParams -func SimulateMsgUpdateParams(r *rand.Rand, _ sdk.Context, _ []simtypes.Account, _ coreaddress.Codec) (sdk.Msg, error) { +func SimulateMsgUpdateParams(r *rand.Rand, _ []simtypes.Account, cdc coreaddress.Codec) (sdk.Msg, error) { // use the default gov module account address as authority var authority sdk.AccAddress = address.Module("gov") @@ -40,8 +40,13 @@ func SimulateMsgUpdateParams(r *rand.Rand, _ sdk.Context, _ []simtypes.Account, params.CommunityTax = simtypes.RandomDecAmount(r, sdkmath.LegacyNewDec(1)) params.WithdrawAddrEnabled = r.Intn(2) == 0 + authorityAddr, err := cdc.BytesToString(authority) + if err != nil { + return nil, err + } + return &types.MsgUpdateParams{ - Authority: authority.String(), + Authority: authorityAddr, Params: params, }, nil } diff --git a/x/distribution/simulation/proposals_test.go b/x/distribution/simulation/proposals_test.go index cd9a4b81b35a..7903be80eb62 100644 --- a/x/distribution/simulation/proposals_test.go +++ b/x/distribution/simulation/proposals_test.go @@ -20,8 +20,7 @@ func TestProposalMsgs(t *testing.T) { // initialize parameters s := rand.NewSource(1) r := rand.New(s) - - ctx := sdk.NewContext(nil, true, nil) + addressCodec := codectestutil.CodecOptions{}.GetAddressCodec() accounts := simtypes.RandomAccounts(r, 3) // execute ProposalMsgs function @@ -34,12 +33,14 @@ func TestProposalMsgs(t *testing.T) { assert.Equal(t, simulation.OpWeightMsgUpdateParams, w0.AppParamsKey()) assert.Equal(t, simulation.DefaultWeightMsgUpdateParams, w0.DefaultWeight()) - msg, err := w0.MsgSimulatorFn()(r, ctx, accounts, codectestutil.CodecOptions{}.GetAddressCodec()) + msg, err := w0.MsgSimulatorFn()(r, accounts, addressCodec) assert.NilError(t, err) msgUpdateParams, ok := msg.(*types.MsgUpdateParams) assert.Assert(t, ok) - assert.Equal(t, sdk.AccAddress(address.Module("gov")).String(), msgUpdateParams.Authority) + addr, err := addressCodec.BytesToString(sdk.AccAddress(address.Module("gov"))) + assert.NilError(t, err) + assert.Equal(t, addr, msgUpdateParams.Authority) assert.DeepEqual(t, sdkmath.LegacyNewDec(0), msgUpdateParams.Params.CommunityTax) assert.Equal(t, true, msgUpdateParams.Params.WithdrawAddrEnabled) } diff --git a/x/distribution/testutil/staking_helper.go b/x/distribution/testutil/staking_helper.go index b3bbd3028e56..d84e92cc476c 100644 --- a/x/distribution/testutil/staking_helper.go +++ b/x/distribution/testutil/staking_helper.go @@ -3,6 +3,7 @@ package testutil import ( "fmt" + "cosmossdk.io/core/address" "cosmossdk.io/math" "cosmossdk.io/x/distribution/keeper" stakingtypes "cosmossdk.io/x/staking/types" @@ -11,9 +12,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -func CreateValidator(pk cryptotypes.PubKey, stake math.Int) (stakingtypes.Validator, error) { - valConsAddr := sdk.GetConsAddress(pk) - val, err := stakingtypes.NewValidator(sdk.ValAddress(valConsAddr).String(), pk, stakingtypes.Description{Moniker: "TestValidator"}) +func CreateValidator(pk cryptotypes.PubKey, operator string, stake math.Int) (stakingtypes.Validator, error) { + val, err := stakingtypes.NewValidator(operator, pk, stakingtypes.Description{Moniker: "TestValidator"}) val.Tokens = stake val.DelegatorShares = math.LegacyNewDecFromInt(val.Tokens) return val, err @@ -112,6 +112,7 @@ func Delegate( amount math.Int, delegation *stakingtypes.Delegation, sk *MockStakingKeeper, + addressCodec address.Codec, ) ( newShares math.LegacyDec, updatedDel stakingtypes.Delegation, @@ -125,7 +126,14 @@ func Delegate( err = distrKeeper.Hooks().BeforeDelegationSharesModified(ctx, delegator, valBz) } else { err = distrKeeper.Hooks().BeforeDelegationCreated(ctx, delegator, valBz) - del := stakingtypes.NewDelegation(delegator.String(), validator.GetOperator(), math.LegacyZeroDec()) + if err != nil { + return math.LegacyZeroDec(), stakingtypes.Delegation{}, err + } + delAddr, err := addressCodec.BytesToString(delegator) + if err != nil { + return math.LegacyZeroDec(), stakingtypes.Delegation{}, err + } + del := stakingtypes.NewDelegation(delAddr, validator.GetOperator(), math.LegacyZeroDec()) delegation = &del } diff --git a/x/distribution/types/genesis.go b/x/distribution/types/genesis.go index 0affa8c34736..d973fb94f473 100644 --- a/x/distribution/types/genesis.go +++ b/x/distribution/types/genesis.go @@ -1,11 +1,7 @@ package types -import ( - sdk "github.com/cosmos/cosmos-sdk/types" -) - func NewGenesisState( - params Params, fp FeePool, dwis []DelegatorWithdrawInfo, pp sdk.ConsAddress, r []ValidatorOutstandingRewardsRecord, + params Params, fp FeePool, dwis []DelegatorWithdrawInfo, pp string, r []ValidatorOutstandingRewardsRecord, acc []ValidatorAccumulatedCommissionRecord, historical []ValidatorHistoricalRewardsRecord, cur []ValidatorCurrentRewardsRecord, dels []DelegatorStartingInfoRecord, slashes []ValidatorSlashEventRecord, ) *GenesisState { @@ -13,7 +9,7 @@ func NewGenesisState( Params: params, FeePool: fp, DelegatorWithdrawInfos: dwis, - PreviousProposer: pp.String(), + PreviousProposer: pp, OutstandingRewards: r, ValidatorAccumulatedCommissions: acc, ValidatorHistoricalRewards: historical, diff --git a/x/distribution/types/msg.go b/x/distribution/types/msg.go index 7388d797c331..faece58cd33d 100644 --- a/x/distribution/types/msg.go +++ b/x/distribution/types/msg.go @@ -15,10 +15,10 @@ var ( _ sdk.Msg = (*MsgDepositValidatorRewardsPool)(nil) ) -func NewMsgSetWithdrawAddress(delAddr, withdrawAddr sdk.AccAddress) *MsgSetWithdrawAddress { +func NewMsgSetWithdrawAddress(delAddr, withdrawAddr string) *MsgSetWithdrawAddress { return &MsgSetWithdrawAddress{ - DelegatorAddress: delAddr.String(), - WithdrawAddress: withdrawAddr.String(), + DelegatorAddress: delAddr, + WithdrawAddress: withdrawAddr, } } diff --git a/x/epochs/CHANGELOG.md b/x/epochs/CHANGELOG.md new file mode 100644 index 000000000000..5f3b69dfc2bc --- /dev/null +++ b/x/epochs/CHANGELOG.md @@ -0,0 +1,49 @@ + + +# Changelog + +## [Unreleased] + +### Features + +* [#19697](https://github.com/cosmos/cosmos-sdk/pull/19697) Upstream from Osmosis + + +### API Breaking Changes + + +### Improvements + + +### CLI Breaking Changes + + +### State Machine Breaking + + +### Client Breaking Changes + + +### Bug Fixes + diff --git a/x/epochs/README.md b/x/epochs/README.md new file mode 100644 index 000000000000..dbcf86d2300b --- /dev/null +++ b/x/epochs/README.md @@ -0,0 +1,187 @@ +# Epochs + +## Abstract + +Often in the SDK, we would like to run certain code every-so often. The +purpose of `epochs` module is to allow other modules to set that they +would like to be signaled once every period. So another module can +specify it wants to execute code once a week, starting at UTC-time = x. +`epochs` creates a generalized epoch interface to other modules so that +they can easily be signaled upon such events. + +## Contents + +1. **[Concept](#concepts)** +2. **[State](#state)** +3. **[Events](#events)** +4. **[Keeper](#keepers)** +5. **[Hooks](#hooks)** +6. **[Queries](#queries)** + +## Concepts + +The epochs module defines on-chain timers that execute at fixed time intervals. +Other SDK modules can then register logic to be executed at the timer ticks. +We refer to the period in between two timer ticks as an "epoch". + +Every timer has a unique identifier. +Every epoch will have a start time, and an end time, where `end time = start time + timer interval`. +On mainnet, we only utilize one identifier, with a time interval of `one day`. + +The timer will tick at the first block whose block time is greater than the timer end time, +and set the start as the prior timer end time. (Notably, it's not set to the block time!) +This means that if the chain has been down for a while, you will get one timer tick per block, +until the timer has caught up. + +## State + +The Epochs module keeps a single `EpochInfo` per identifier. +This contains the current state of the timer with the corresponding identifier. +Its fields are modified at every timer tick. +EpochInfos are initialized as part of genesis initialization or upgrade logic, +and are only modified on begin blockers. + +## Events + +The `epochs` module emits the following events: + +### BeginBlocker + +| Type | Attribute Key | Attribute Value | +| ----------- | ------------- | --------------- | +| epoch_start | epoch_number | {epoch_number} | +| epoch_start | start_time | {start_time} | + +### EndBlocker + +| Type | Attribute Key | Attribute Value | +| --------- | ------------- | --------------- | +| epoch_end | epoch_number | {epoch_number} | + +## Keepers + +### Keeper functions + +Epochs keeper module provides utility functions to manage epochs. + +``` go +// Keeper is the interface for epochs module keeper +type Keeper interface { + // GetEpochInfo returns epoch info by identifier + GetEpochInfo(ctx sdk.Context, identifier string) types.EpochInfo + // SetEpochInfo set epoch info + SetEpochInfo(ctx sdk.Context, epoch types.EpochInfo) + // DeleteEpochInfo delete epoch info + DeleteEpochInfo(ctx sdk.Context, identifier string) + // IterateEpochInfo iterate through epochs + IterateEpochInfo(ctx sdk.Context, fn func(index int64, epochInfo types.EpochInfo) (stop bool)) + // Get all epoch infos + AllEpochInfos(ctx sdk.Context) []types.EpochInfo +} +``` + +## Hooks + +```go + // the first block whose timestamp is after the duration is counted as the end of the epoch + AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber int64) + // new epoch is next block of epoch end block + BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64) +``` + +### How modules receive hooks + +On hook receiver function of other modules, they need to filter +`epochIdentifier` and only do executions for only specific +epochIdentifier. Filtering epochIdentifier could be in `Params` of other +modules so that they can be modified by governance. + +This is the standard dev UX of this: + +```golang +func (k MyModuleKeeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber int64) { + params := k.GetParams(ctx) + if epochIdentifier == params.DistrEpochIdentifier { + // my logic + } +} +``` + +### Panic isolation + +If a given epoch hook panics, its state update is reverted, but we keep +proceeding through the remaining hooks. This allows more advanced epoch +logic to be used, without concern over state machine halting, or halting +subsequent modules. + +This does mean that if there is behavior you expect from a prior epoch +hook, and that epoch hook reverted, your hook may also have an issue. So +do keep in mind "what if a prior hook didn't get executed" in the safety +checks you consider for a new epoch hook. + +## Queries + +The Epochs module provides the following queries to check the module's state. + +```protobuf +service Query { + // EpochInfos provide running epochInfos + rpc EpochInfos(QueryEpochsInfoRequest) returns (QueryEpochsInfoResponse) {} + // CurrentEpoch provide current epoch of specified identifier + rpc CurrentEpoch(QueryCurrentEpochRequest) returns (QueryCurrentEpochResponse) {} +} +``` + +### Epoch Infos + +Query the currently running epochInfos + +```sh + query epochs epoch-infos +``` + +::: details Example + +An example output: + +```sh +epochs: +- current_epoch: "183" + current_epoch_start_height: "2438409" + current_epoch_start_time: "2021-12-18T17:16:09.898160996Z" + duration: 86400s + epoch_counting_started: true + identifier: day + start_time: "2021-06-18T17:00:00Z" +- current_epoch: "26" + current_epoch_start_height: "2424854" + current_epoch_start_time: "2021-12-17T17:02:07.229632445Z" + duration: 604800s + epoch_counting_started: true + identifier: week + start_time: "2021-06-18T17:00:00Z" +``` + +::: + +### Current Epoch + +Query the current epoch by the specified identifier + +```sh + query epochs current-epoch [identifier] +``` + +::: details Example + +Query the current `day` epoch: + +```sh + query epochs current-epoch day +``` + +Which in this example outputs: + +```sh +current_epoch: "183" +``` diff --git a/x/epochs/autocli.go b/x/epochs/autocli.go new file mode 100644 index 000000000000..decba091d039 --- /dev/null +++ b/x/epochs/autocli.go @@ -0,0 +1,27 @@ +package epochs + +import ( + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + epochsv1beta1 "cosmossdk.io/api/cosmos/epochs/v1beta1" +) + +// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. +func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: &autocliv1.ServiceCommandDescriptor{ + Service: epochsv1beta1.Query_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "EpochInfos", + Use: "epoch-infos", + Short: "Query running epoch infos", + }, + { + RpcMethod: "CurrentEpoch", + Use: "current-epoch", + Short: "Query current epoch by specified identifier", + }, + }, + }, + } +} diff --git a/x/epochs/depinject.go b/x/epochs/depinject.go new file mode 100644 index 000000000000..0239cc0081a6 --- /dev/null +++ b/x/epochs/depinject.go @@ -0,0 +1,74 @@ +package epochs + +import ( + "fmt" + "sort" + + "golang.org/x/exp/maps" + + modulev1 "cosmossdk.io/api/cosmos/epochs/module/v1" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/depinject" + "cosmossdk.io/depinject/appconfig" + "cosmossdk.io/x/epochs/keeper" + "cosmossdk.io/x/epochs/types" + + "github.com/cosmos/cosmos-sdk/codec" +) + +var _ depinject.OnePerModuleType = AppModule{} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} + +func init() { + appconfig.RegisterModule(&modulev1.Module{}, + appconfig.Provide(ProvideModule), + appconfig.Invoke(InvokeSetHooks), + ) +} + +type ModuleInputs struct { + depinject.In + + Config *modulev1.Module + Cdc codec.Codec + Environment appmodule.Environment +} + +type ModuleOutputs struct { + depinject.Out + + EpochKeeper keeper.Keeper + Module appmodule.AppModule +} + +func ProvideModule(in ModuleInputs) ModuleOutputs { + k := keeper.NewKeeper(in.Environment, in.Cdc) + m := NewAppModule(in.Cdc, k) + return ModuleOutputs{EpochKeeper: k, Module: m} +} + +func InvokeSetHooks(keeper keeper.Keeper, hooks map[string]types.EpochHooksWrapper) error { + if hooks == nil { + return nil + } + + // Default ordering is lexical by module name. + // Explicit ordering can be added to the module config if required. + modNames := maps.Keys(hooks) + order := modNames + sort.Strings(order) + + var multiHooks types.MultiEpochHooks + for _, modName := range order { + hook, ok := hooks[modName] + if !ok { + return fmt.Errorf("can't find epoch hooks for module %s", modName) + } + multiHooks = append(multiHooks, hook) + } + + keeper.SetHooks(multiHooks) + return nil +} diff --git a/x/epochs/go.mod b/x/epochs/go.mod new file mode 100644 index 000000000000..139a8abd75aa --- /dev/null +++ b/x/epochs/go.mod @@ -0,0 +1,183 @@ +module cosmossdk.io/x/epochs + +go 1.21 + +require ( + cosmossdk.io/api v0.7.3 + cosmossdk.io/collections v0.4.0 + cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7 + cosmossdk.io/errors v1.0.1 + cosmossdk.io/log v1.3.1 + cosmossdk.io/math v1.3.0 // indirect + cosmossdk.io/store v1.1.0 + github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 // indirect + github.com/cosmos/cosmos-proto v1.0.0-beta.4 + github.com/cosmos/cosmos-sdk v0.51.0 + github.com/cosmos/gogoproto v1.4.12 + github.com/golang/protobuf v1.5.4 + github.com/grpc-ecosystem/grpc-gateway v1.16.0 + github.com/hashicorp/go-metrics v0.5.3 // indirect + github.com/spf13/cobra v1.8.0 // indirect + github.com/stretchr/testify v1.9.0 + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de + google.golang.org/grpc v1.63.2 + gotest.tools/v3 v3.5.1 // indirect +) + +require ( + buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.32.0-20230509103710-5e5b9fdd0180.1 // indirect + buf.build/gen/go/tendermint/tendermint/protocolbuffers/go v1.32.0-20231117195010-33ed361a9051.1 // indirect + cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 // indirect + cosmossdk.io/x/tx v0.13.1 // indirect + filippo.io/edwards25519 v1.1.0 // indirect + github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect + github.com/99designs/keyring v1.2.2 // indirect + github.com/DataDog/datadog-go v4.8.3+incompatible // indirect + github.com/DataDog/zstd v1.5.5 // indirect + github.com/Microsoft/go-winio v0.6.1 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect + github.com/cenkalti/backoff/v4 v4.1.3 // indirect + github.com/cespare/xxhash v1.1.0 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cockroachdb/errors v1.11.1 // indirect + github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect + github.com/cockroachdb/pebble v1.1.0 // indirect + github.com/cockroachdb/redact v1.1.5 // indirect + github.com/cometbft/cometbft-db v0.8.0 // indirect + github.com/cosmos/btcutil v1.0.5 // indirect + github.com/cosmos/cosmos-db v1.0.2 // indirect + github.com/cosmos/go-bip39 v1.0.0 // indirect + github.com/cosmos/gogogateway v1.2.0 // indirect + github.com/cosmos/iavl v1.1.1 // indirect + github.com/cosmos/ics23/go v0.10.0 // indirect + github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect + github.com/danieljoos/wincred v1.2.0 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect + github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect + github.com/dgraph-io/badger/v2 v2.2007.4 // indirect + github.com/dgraph-io/ristretto v0.1.1 // indirect + github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect + github.com/dustin/go-humanize v1.0.1 // indirect + github.com/dvsekhvalnov/jose2go v1.6.0 // indirect + github.com/emicklei/dot v1.6.1 // indirect + github.com/fatih/color v1.15.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/getsentry/sentry-go v0.27.0 // indirect + github.com/go-kit/kit v0.13.0 // indirect + github.com/go-kit/log v0.2.1 // indirect + github.com/go-logfmt/logfmt v0.6.0 // indirect + github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect + github.com/gogo/googleapis v1.4.1 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/glog v1.2.0 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/google/btree v1.1.2 // indirect + github.com/google/go-cmp v0.6.0 // indirect + github.com/gorilla/handlers v1.5.2 // indirect + github.com/gorilla/mux v1.8.1 // indirect + github.com/gorilla/websocket v1.5.0 // indirect + github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect + github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect + github.com/hashicorp/go-hclog v1.5.0 // indirect + github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-plugin v1.5.2 // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/yamux v0.1.1 // indirect + github.com/hdevalence/ed25519consensus v0.2.0 // indirect + github.com/huandu/skiplist v1.2.0 // indirect + github.com/iancoleman/strcase v0.3.0 // indirect + github.com/improbable-eng/grpc-web v0.15.0 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/jmhodges/levigo v1.0.0 // indirect + github.com/klauspost/compress v1.17.7 // indirect + github.com/kr/pretty v0.3.1 // indirect + github.com/kr/text v0.2.0 // indirect + github.com/libp2p/go-buffer-pool v0.1.0 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect + github.com/magiconair/properties v1.8.7 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mitchellh/go-testing-interface v1.14.1 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/mtibben/percent v0.2.1 // indirect + github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect + github.com/oklog/run v1.1.0 // indirect + github.com/pelletier/go-toml/v2 v2.2.0 // indirect + github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/prometheus/client_golang v1.19.0 // indirect + github.com/prometheus/client_model v0.6.0 // indirect + github.com/prometheus/common v0.52.2 // indirect + github.com/prometheus/procfs v0.13.0 // indirect + github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect + github.com/rs/cors v1.8.3 // indirect + github.com/rs/zerolog v1.32.0 // indirect + github.com/sagikazarmark/locafero v0.4.0 // indirect + github.com/sagikazarmark/slog-shim v0.1.0 // indirect + github.com/sasha-s/go-deadlock v0.3.1 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.11.0 // indirect + github.com/spf13/cast v1.6.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/spf13/viper v1.18.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 + github.com/zondax/hid v0.9.2 // indirect + github.com/zondax/ledger-go v0.14.3 // indirect + gitlab.com/yawning/secp256k1-voi v0.0.0-20230925100816-f2616030848b // indirect + gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 // indirect + go.etcd.io/bbolt v1.3.7 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/crypto v0.22.0 // indirect + golang.org/x/exp v0.0.0-20240314144324-c7f7c6466f7f + golang.org/x/mod v0.15.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect + golang.org/x/text v0.14.0 // indirect + golang.org/x/tools v0.18.0 // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/protobuf v1.33.0 + gopkg.in/ini.v1 v1.67.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + nhooyr.io/websocket v1.8.6 // indirect + pgregory.net/rapid v1.1.0 // indirect + sigs.k8s.io/yaml v1.4.0 // indirect +) + +require cosmossdk.io/depinject v1.0.0-alpha.4 + +require ( + cosmossdk.io/x/accounts v0.0.0-00010101000000-000000000000 // indirect + cosmossdk.io/x/bank v0.0.0-00010101000000-000000000000 // indirect + cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect + github.com/google/orderedcode v0.0.1 // indirect + github.com/lib/pq v1.10.7 // indirect + github.com/minio/highwayhash v1.0.2 // indirect +) + +replace github.com/cosmos/cosmos-sdk => ../../. + +// TODO remove post spinning out all modules +replace ( + cosmossdk.io/api => ../../api + cosmossdk.io/core => ../../core + cosmossdk.io/depinject => ../../depinject + cosmossdk.io/x/accounts => ../accounts + cosmossdk.io/x/auth => ../auth + cosmossdk.io/x/bank => ../bank + cosmossdk.io/x/staking => ../staking + cosmossdk.io/x/tx => ../tx +) diff --git a/x/epochs/go.sum b/x/epochs/go.sum new file mode 100644 index 000000000000..f886ba03f7d5 --- /dev/null +++ b/x/epochs/go.sum @@ -0,0 +1,1010 @@ +buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.32.0-20230509103710-5e5b9fdd0180.1 h1:7LKjxs607BNfGhtKLf+bi3SDJgpiGuTgOvemojsH8Hc= +buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.32.0-20230509103710-5e5b9fdd0180.1/go.mod h1:5GqIYthcy/ASmnKcaT26APpxMhZirnIHXHKki69zjWI= +buf.build/gen/go/tendermint/tendermint/protocolbuffers/go v1.32.0-20231117195010-33ed361a9051.1 h1:VooqQ3rklp3PwMTAE890M76w/8Z01OPa7RdgU9posFE= +buf.build/gen/go/tendermint/tendermint/protocolbuffers/go v1.32.0-20231117195010-33ed361a9051.1/go.mod h1:9KmeMJUsSG3IiIwK63Lh1ipZJrwd7KHrWZseJeHukcs= +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/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= +cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= +cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= +cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= +cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= +cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= +cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= +filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= +github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= +github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= +github.com/99designs/keyring v1.2.2 h1:pZd3neh/EmUzWONb35LxQfvuY7kiSXAq3HQd97+XBn0= +github.com/99designs/keyring v1.2.2/go.mod h1:wes/FrByc8j7lFOAGLGSNEg8f/PaI3cgTBqhFkHUrPk= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/DataDog/datadog-go v4.8.3+incompatible h1:fNGaYSuObuQb5nzeTQqowRAd9bpDIRRV4/gUtIBjh8Q= +github.com/DataDog/datadog-go v4.8.3+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= +github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= +github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= +github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= +github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= +github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= +github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= +github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= +github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= +github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= +github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= +github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= +github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= +github.com/btcsuite/btcd/btcutil v1.1.3/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= +github.com/bufbuild/protocompile v0.5.1 h1:mixz5lJX4Hiz4FpqFREJHIXLfaLBntfaJv1h+/jS+Qg= +github.com/bufbuild/protocompile v0.5.1/go.mod h1:G5iLmavmF4NsYtpZFvE3B/zFch2GIY8+wjsYLR/lc40= +github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= +github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= +github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= +github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= +github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= +github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= +github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= +github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= +github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/pebble v1.1.0 h1:pcFh8CdCIt2kmEpK0OIatq67Ln9uGDYY3d5XnE0LJG4= +github.com/cockroachdb/pebble v1.1.0/go.mod h1:sEHm5NOXxyiAoKWhoFxT8xMgd/f3RA6qUqQ1BXKrh2E= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= +github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= +github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= +github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= +github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= +github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= +github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= +github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= +github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= +github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= +github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU= +github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co= +github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= +github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= +github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= +github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= +github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= +github.com/cosmos/iavl v1.1.1 h1:64nTi8s3gEoGqhA8TyAWFWfz7/pg0anKzHNSc1ETc7Q= +github.com/cosmos/iavl v1.1.1/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= +github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= +github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= +github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= +github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8= +github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/danieljoos/wincred v1.2.0 h1:ozqKHaLK0W/ii4KVbbvluM91W2H3Sh0BncbUNPS7jLE= +github.com/danieljoos/wincred v1.2.0/go.mod h1:FzQLLMKBFdvu+osBrnFODiv32YGwCfx0SkRa/eYHgec= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= +github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= +github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= +github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= +github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= +github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= +github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= +github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= +github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/dvsekhvalnov/jose2go v1.6.0 h1:Y9gnSnP4qEI0+/uQkHvFXeD2PLPJeXEL+ySMEA2EjTY= +github.com/dvsekhvalnov/jose2go v1.6.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/emicklei/dot v1.6.1 h1:ujpDlBkkwgWUY+qPId5IwapRW/xEoligRSYjioR6DFI= +github.com/emicklei/dot v1.6.1/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= +github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= +github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= +github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= +github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= +github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= +github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= +github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= +github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= +github.com/go-kit/kit v0.13.0 h1:OoneCcHKHQ03LfBpoQCUfCluwd2Vt3ohz+kvbJneZAU= +github.com/go-kit/kit v0.13.0/go.mod h1:phqEHMMUbyrCFCTgH48JueqrM3md2HcAZ8N3XE4FKDg= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= +github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= +github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= +github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= +github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= +github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= +github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= +github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= +github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= +github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= +github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= +github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= +github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= +github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= +github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= +github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= +github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= +github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= +github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= +github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.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/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= +github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE= +github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w= +github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= +github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= +github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= +github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= +github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= +github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= +github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= +github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-metrics v0.5.3 h1:M5uADWMOGCTUNU1YuC4hfknOeHNaX54LDm4oYSucoNE= +github.com/hashicorp/go-metrics v0.5.3/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= +github.com/hashicorp/go-plugin v1.5.2/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4= +github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= +github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= +github.com/hdevalence/ed25519consensus v0.2.0 h1:37ICyZqdyj0lAZ8P4D1d1id3HqbbG1N3iBb1Tb4rdcU= +github.com/hdevalence/ed25519consensus v0.2.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3c= +github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0JrPVhn/06U= +github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= +github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= +github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= +github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= +github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= +github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= +github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg= +github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= +github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= +github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= +github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= +github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= +github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= +github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= +github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= +github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= +github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/grpc-proxy v0.0.0-20181017164139-0f1106ef9c76/go.mod h1:x5OoJHDHqxHS801UIuhqGl6QdSAEJvtausosHSdazIo= +github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= +github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= +github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= +github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= +github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a h1:dlRvE5fWabOchtH7znfiFCcOvmIYgOeAS5ifBXBlh9Q= +github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s= +github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= +github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= +github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= +github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= +github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= +github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= +github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= +github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= +github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= +github.com/opencontainers/runc v1.1.3/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= +github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= +github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= +github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= +github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= +github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= +github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= +github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= +github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= +github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= +github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= +github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= +github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= +github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= +github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= +github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= +github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= +github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= +github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= +github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= +github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= +github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= +github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= +github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= +github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= +github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= +github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +github.com/syndtr/goleveldb v1.0.1-0.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/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= +github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= +github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= +github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= +github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= +github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= +github.com/zondax/ledger-go v0.14.3/go.mod h1:IKKaoxupuB43g4NxeQmbLXv7T9AlQyie1UpHb342ycI= +gitlab.com/yawning/secp256k1-voi v0.0.0-20230925100816-f2616030848b h1:CzigHMRySiX3drau9C6Q5CAbNIApmLdat5jPMqChvDA= +gitlab.com/yawning/secp256k1-voi v0.0.0-20230925100816-f2616030848b/go.mod h1:/y/V339mxv2sZmYYR64O07VuCpdNZqCTwO8ZcouTMI8= +gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 h1:qwDnMxjkyLmAFgcfgTnfJrmYKWhHnci3GjDqcZp1M3Q= +gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02/go.mod h1:JTnUj0mpYiAsuZLmKjTx/ex3AtMowcCgnE7YNyCEP0I= +go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= +go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= +go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= +golang.org/x/exp v0.0.0-20240314144324-c7f7c6466f7f h1:3CW0unweImhOzd5FmYuRsD4Y4oQFKZIjAnKbjV4WIrw= +golang.org/x/exp v0.0.0-20240314144324-c7f7c6466f7f/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220315194320-039c03cc5b86/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= +golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= +gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= +nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= +sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/x/epochs/keeper/abci.go b/x/epochs/keeper/abci.go new file mode 100644 index 000000000000..e05399e9b02e --- /dev/null +++ b/x/epochs/keeper/abci.go @@ -0,0 +1,85 @@ +package keeper + +import ( + "context" + "fmt" + + "cosmossdk.io/x/epochs/types" + + "github.com/cosmos/cosmos-sdk/telemetry" +) + +// BeginBlocker of epochs module. +func (k Keeper) BeginBlocker(ctx context.Context) error { + defer telemetry.ModuleMeasureSince(types.ModuleName, telemetry.Now(), telemetry.MetricKeyBeginBlocker) + + logger := k.Logger() + headerInfo := k.environment.HeaderService.GetHeaderInfo(ctx) + err := k.EpochInfo.Walk( + ctx, + nil, + func(key string, epochInfo types.EpochInfo) (stop bool, err error) { + // If blocktime < initial epoch start time, return + if headerInfo.Time.Before(epochInfo.StartTime) { + return false, nil + } + // if epoch counting hasn't started, signal we need to start. + shouldInitialEpochStart := !epochInfo.EpochCountingStarted + + epochEndTime := epochInfo.CurrentEpochStartTime.Add(epochInfo.Duration) + shouldEpochStart := (headerInfo.Time.After(epochEndTime)) || shouldInitialEpochStart + + if !shouldEpochStart { + return false, nil + } + epochInfo.CurrentEpochStartHeight = headerInfo.Height + + if shouldInitialEpochStart { + epochInfo.EpochCountingStarted = true + epochInfo.CurrentEpoch = 1 + epochInfo.CurrentEpochStartTime = epochInfo.StartTime + logger.Debug(fmt.Sprintf("Starting new epoch with identifier %s epoch number %d", epochInfo.Identifier, epochInfo.CurrentEpoch)) + } else { + err := k.environment.EventService.EventManager(ctx).Emit(&types.EventEpochEnd{ + EpochNumber: epochInfo.CurrentEpoch, + }) + if err != nil { + return false, nil + } + + if err := k.environment.BranchService.Execute(ctx, func(ctx context.Context) error { + return k.AfterEpochEnd(ctx, epochInfo.Identifier, epochInfo.CurrentEpoch) + }); err != nil { + // purposely ignoring the error here not to halt the chain if the hook fails + logger.Error(fmt.Sprintf("Error after epoch end with identifier %s epoch number %d", epochInfo.Identifier, epochInfo.CurrentEpoch)) + } + + epochInfo.CurrentEpoch += 1 + epochInfo.CurrentEpochStartTime = epochInfo.CurrentEpochStartTime.Add(epochInfo.Duration) + logger.Debug(fmt.Sprintf("Starting epoch with identifier %s epoch number %d", epochInfo.Identifier, epochInfo.CurrentEpoch)) + } + + // emit new epoch start event, set epoch info, and run BeforeEpochStart hook + err = k.environment.EventService.EventManager(ctx).Emit(&types.EventEpochStart{ + EpochNumber: epochInfo.CurrentEpoch, + EpochStartTime: epochInfo.CurrentEpochStartTime.Unix(), + }) + if err != nil { + return false, err + } + err = k.EpochInfo.Set(ctx, epochInfo.Identifier, epochInfo) + if err != nil { + logger.Error(fmt.Sprintf("Error set epoch info with identifier %s epoch number %d", epochInfo.Identifier, epochInfo.CurrentEpoch)) + return false, nil + } + if err := k.environment.BranchService.Execute(ctx, func(ctx context.Context) error { + return k.BeforeEpochStart(ctx, epochInfo.Identifier, epochInfo.CurrentEpoch) + }); err != nil { + // purposely ignoring the error here not to halt the chain if the hook fails + logger.Error(fmt.Sprintf("Error before epoch start with identifier %s epoch number %d", epochInfo.Identifier, epochInfo.CurrentEpoch)) + } + return false, nil + }, + ) + return err +} diff --git a/x/epochs/keeper/abci_test.go b/x/epochs/keeper/abci_test.go new file mode 100644 index 000000000000..e3d5f84ff55d --- /dev/null +++ b/x/epochs/keeper/abci_test.go @@ -0,0 +1,186 @@ +package keeper_test + +import ( + "sort" + "testing" + "time" + + "github.com/stretchr/testify/require" + "golang.org/x/exp/maps" + + "cosmossdk.io/core/header" + "cosmossdk.io/x/epochs/types" +) + +// This test is responsible for testing how epochs increment based off +// of their initial conditions, and subsequent block height / times. +func (suite *KeeperTestSuite) TestEpochInfoBeginBlockChanges() { + block1Time := time.Unix(1656907200, 0).UTC() + const defaultIdentifier = "hourly" + const defaultDuration = time.Hour + // eps is short for epsilon - in this case a negligible amount of time. + const eps = time.Nanosecond + + tests := map[string]struct { + // if identifier, duration is not set, we make it defaultIdentifier and defaultDuration. + // EpochCountingStarted, if unspecified, is inferred by CurrentEpoch == 0 + // StartTime is inferred to be block1Time if left blank. + initialEpochInfo types.EpochInfo + blockHeightTimePairs map[int]time.Time + expEpochInfo types.EpochInfo + }{ + "First block running at exactly start time sets epoch tick": { + initialEpochInfo: types.EpochInfo{StartTime: block1Time, CurrentEpoch: 0, CurrentEpochStartTime: time.Time{}}, + expEpochInfo: types.EpochInfo{StartTime: block1Time, CurrentEpoch: 1, CurrentEpochStartTime: block1Time, CurrentEpochStartHeight: 1}, + }, + "First block run sets start time, subsequent blocks within timer interval do not cause timer tick": { + initialEpochInfo: types.EpochInfo{StartTime: block1Time, CurrentEpoch: 0, CurrentEpochStartTime: time.Time{}}, + blockHeightTimePairs: map[int]time.Time{2: block1Time.Add(time.Second), 3: block1Time.Add(time.Minute), 4: block1Time.Add(30 * time.Minute)}, + expEpochInfo: types.EpochInfo{StartTime: block1Time, CurrentEpoch: 1, CurrentEpochStartTime: block1Time, CurrentEpochStartHeight: 1}, + }, + "Second block at exactly timer interval later does not tick": { + initialEpochInfo: types.EpochInfo{StartTime: block1Time, CurrentEpoch: 0, CurrentEpochStartTime: time.Time{}}, + blockHeightTimePairs: map[int]time.Time{2: block1Time.Add(defaultDuration)}, + expEpochInfo: types.EpochInfo{StartTime: block1Time, CurrentEpoch: 1, CurrentEpochStartTime: block1Time, CurrentEpochStartHeight: 1}, + }, + "Second block at timer interval + epsilon later does tick": { + initialEpochInfo: types.EpochInfo{StartTime: block1Time, CurrentEpoch: 0, CurrentEpochStartTime: time.Time{}}, + blockHeightTimePairs: map[int]time.Time{2: block1Time.Add(defaultDuration).Add(eps)}, + expEpochInfo: types.EpochInfo{StartTime: block1Time, CurrentEpoch: 2, CurrentEpochStartTime: block1Time.Add(time.Hour), CurrentEpochStartHeight: 2}, + }, + "Downtime recovery (many intervals), first block causes 1 tick and sets current start time 1 interval ahead": { + initialEpochInfo: types.EpochInfo{StartTime: block1Time, CurrentEpoch: 0, CurrentEpochStartTime: time.Time{}}, + blockHeightTimePairs: map[int]time.Time{2: block1Time.Add(24 * time.Hour)}, + expEpochInfo: types.EpochInfo{StartTime: block1Time, CurrentEpoch: 2, CurrentEpochStartTime: block1Time.Add(time.Hour), CurrentEpochStartHeight: 2}, + }, + "Downtime recovery (many intervals), second block is at tick 2, w/ start time 2 intervals ahead": { + initialEpochInfo: types.EpochInfo{StartTime: block1Time, CurrentEpoch: 0, CurrentEpochStartTime: time.Time{}}, + blockHeightTimePairs: map[int]time.Time{2: block1Time.Add(24 * time.Hour), 3: block1Time.Add(24 * time.Hour).Add(eps)}, + expEpochInfo: types.EpochInfo{StartTime: block1Time, CurrentEpoch: 3, CurrentEpochStartTime: block1Time.Add(2 * time.Hour), CurrentEpochStartHeight: 3}, + }, + "Many blocks between first and second tick": { + initialEpochInfo: types.EpochInfo{StartTime: block1Time, CurrentEpoch: 1, CurrentEpochStartTime: block1Time}, + blockHeightTimePairs: map[int]time.Time{2: block1Time.Add(time.Second), 3: block1Time.Add(2 * time.Second), 4: block1Time.Add(time.Hour).Add(eps)}, + expEpochInfo: types.EpochInfo{StartTime: block1Time, CurrentEpoch: 2, CurrentEpochStartTime: block1Time.Add(time.Hour), CurrentEpochStartHeight: 4}, + }, + "Distinct identifier and duration still works": { + initialEpochInfo: types.EpochInfo{Identifier: "hello", Duration: time.Minute, StartTime: block1Time, CurrentEpoch: 0, CurrentEpochStartTime: time.Time{}}, + blockHeightTimePairs: map[int]time.Time{2: block1Time.Add(time.Second), 3: block1Time.Add(time.Minute).Add(eps)}, + expEpochInfo: types.EpochInfo{Identifier: "hello", Duration: time.Minute, StartTime: block1Time, CurrentEpoch: 2, CurrentEpochStartTime: block1Time.Add(time.Minute), CurrentEpochStartHeight: 3}, + }, + "StartTime in future won't get ticked on first block": { + initialEpochInfo: types.EpochInfo{StartTime: block1Time.Add(time.Second), CurrentEpoch: 0, CurrentEpochStartTime: time.Time{}}, + // currentEpochStartHeight is 1 because that's when the timer was created on-chain + expEpochInfo: types.EpochInfo{StartTime: block1Time.Add(time.Second), CurrentEpoch: 0, CurrentEpochStartTime: time.Time{}, CurrentEpochStartHeight: 1}, + }, + "StartTime in past will get ticked on first block": { + initialEpochInfo: types.EpochInfo{StartTime: block1Time.Add(-time.Second), CurrentEpoch: 0, CurrentEpochStartTime: time.Time{}}, + expEpochInfo: types.EpochInfo{StartTime: block1Time.Add(-time.Second), CurrentEpoch: 1, CurrentEpochStartTime: block1Time.Add(-time.Second), CurrentEpochStartHeight: 1}, + }, + } + for name, test := range tests { + suite.Run(name, func() { + suite.SetupTest() + suite.Ctx = suite.Ctx.WithHeaderInfo(header.Info{Height: 1, Time: block1Time}) + initialEpoch := initializeBlankEpochInfoFields(test.initialEpochInfo, defaultIdentifier, defaultDuration) + err := suite.EpochsKeeper.AddEpochInfo(suite.Ctx, initialEpoch) + suite.Require().NoError(err) + err = suite.EpochsKeeper.BeginBlocker(suite.Ctx) + suite.Require().NoError(err) + + // get sorted heights + heights := maps.Keys(test.blockHeightTimePairs) + sort.Slice(heights, func(i, j int) bool { return heights[i] < heights[j] }) + + for _, h := range heights { + // for each height in order, run begin block + suite.Ctx = suite.Ctx.WithHeaderInfo(header.Info{Height: int64(h), Time: test.blockHeightTimePairs[h]}) + err := suite.EpochsKeeper.BeginBlocker(suite.Ctx) + suite.Require().NoError(err) + } + expEpoch := initializeBlankEpochInfoFields(test.expEpochInfo, initialEpoch.Identifier, initialEpoch.Duration) + actEpoch, err := suite.EpochsKeeper.EpochInfo.Get(suite.Ctx, initialEpoch.Identifier) + suite.Require().NoError(err) + suite.Require().Equal(expEpoch, actEpoch) + }) + } +} + +// initializeBlankEpochInfoFields set identifier, duration and epochCountingStarted if blank in epoch +func initializeBlankEpochInfoFields(epoch types.EpochInfo, identifier string, duration time.Duration) types.EpochInfo { + if epoch.Identifier == "" { + epoch.Identifier = identifier + } + if epoch.Duration == time.Duration(0) { + epoch.Duration = duration + } + epoch.EpochCountingStarted = (epoch.CurrentEpoch != 0) + return epoch +} + +func TestEpochStartingOneMonthAfterInitGenesis(t *testing.T) { + ctx, epochsKeeper, _ := Setup(t) + // On init genesis, default epochs information is set + // To check init genesis again, should make it fresh status + epochInfos, err := epochsKeeper.AllEpochInfos(ctx) + require.NoError(t, err) + for _, epochInfo := range epochInfos { + err := epochsKeeper.EpochInfo.Remove(ctx, epochInfo.Identifier) + require.NoError(t, err) + } + + now := time.Now() + week := time.Hour * 24 * 7 + month := time.Hour * 24 * 30 + initialBlockHeight := int64(1) + ctx = ctx.WithHeaderInfo(header.Info{Height: initialBlockHeight, Time: now}) + + err = epochsKeeper.InitGenesis(ctx, types.GenesisState{ + Epochs: []types.EpochInfo{ + { + Identifier: "monthly", + StartTime: now.Add(month), + Duration: time.Hour * 24 * 30, + CurrentEpoch: 0, + CurrentEpochStartHeight: ctx.HeaderInfo().Height, + CurrentEpochStartTime: time.Time{}, + EpochCountingStarted: false, + }, + }, + }) + require.NoError(t, err) + + // epoch not started yet + epochInfo, err := epochsKeeper.EpochInfo.Get(ctx, "monthly") + require.NoError(t, err) + require.Equal(t, epochInfo.CurrentEpoch, int64(0)) + require.Equal(t, epochInfo.CurrentEpochStartHeight, initialBlockHeight) + require.Equal(t, epochInfo.CurrentEpochStartTime, time.Time{}) + require.Equal(t, epochInfo.EpochCountingStarted, false) + + // after 1 week + ctx = ctx.WithHeaderInfo(header.Info{Height: 2, Time: now.Add(week)}) + err = epochsKeeper.BeginBlocker(ctx) + require.NoError(t, err) + + // epoch not started yet + epochInfo, err = epochsKeeper.EpochInfo.Get(ctx, "monthly") + require.NoError(t, err) + require.Equal(t, epochInfo.CurrentEpoch, int64(0)) + require.Equal(t, epochInfo.CurrentEpochStartHeight, initialBlockHeight) + require.Equal(t, epochInfo.CurrentEpochStartTime, time.Time{}) + require.Equal(t, epochInfo.EpochCountingStarted, false) + + // after 1 month + ctx = ctx.WithHeaderInfo(header.Info{Height: 3, Time: now.Add(month)}) + err = epochsKeeper.BeginBlocker(ctx) + require.NoError(t, err) + + // epoch started + epochInfo, err = epochsKeeper.EpochInfo.Get(ctx, "monthly") + require.NoError(t, err) + require.Equal(t, epochInfo.CurrentEpoch, int64(1)) + require.Equal(t, epochInfo.CurrentEpochStartHeight, ctx.HeaderInfo().Height) + require.Equal(t, epochInfo.CurrentEpochStartTime.UTC().String(), now.Add(month).UTC().String()) + require.Equal(t, epochInfo.EpochCountingStarted, true) +} diff --git a/x/epochs/keeper/epoch.go b/x/epochs/keeper/epoch.go new file mode 100644 index 000000000000..de5f0f51f9e0 --- /dev/null +++ b/x/epochs/keeper/epoch.go @@ -0,0 +1,61 @@ +package keeper + +import ( + "context" + "fmt" + + "cosmossdk.io/x/epochs/types" +) + +// AddEpochInfo adds a new epoch info. Will return an error if the epoch fails validation, +// or re-uses an existing identifier. +// This method also sets the start time if left unset, and sets the epoch start height. +func (k Keeper) AddEpochInfo(ctx context.Context, epoch types.EpochInfo) error { + err := epoch.Validate() + if err != nil { + return err + } + // Check if identifier already exists + isExist, err := k.EpochInfo.Has(ctx, epoch.Identifier) + if err != nil { + return err + } + if isExist { + return fmt.Errorf("epoch with identifier %s already exists", epoch.Identifier) + } + + // Initialize empty and default epoch values + if epoch.StartTime.IsZero() { + epoch.StartTime = k.environment.HeaderService.GetHeaderInfo(ctx).Time + } + if epoch.CurrentEpochStartHeight == 0 { + epoch.CurrentEpochStartHeight = k.environment.HeaderService.GetHeaderInfo(ctx).Height + } + return k.EpochInfo.Set(ctx, epoch.Identifier, epoch) +} + +// AllEpochInfos iterate through epochs to return all epochs info. +func (k Keeper) AllEpochInfos(ctx context.Context) ([]types.EpochInfo, error) { + epochs := []types.EpochInfo{} + err := k.EpochInfo.Walk( + ctx, + nil, + func(key string, value types.EpochInfo) (stop bool, err error) { + epochs = append(epochs, value) + return false, nil + }, + ) + return epochs, err +} + +// NumBlocksSinceEpochStart returns the number of blocks since the epoch started. +// if the epoch started on block N, then calling this during block N (after BeforeEpochStart) +// would return 0. +// Calling it any point in block N+1 (assuming the epoch doesn't increment) would return 1. +func (k Keeper) NumBlocksSinceEpochStart(ctx context.Context, identifier string) (int64, error) { + epoch, err := k.EpochInfo.Get(ctx, identifier) + if err != nil { + return 0, fmt.Errorf("epoch with identifier %s not found", identifier) + } + return k.environment.HeaderService.GetHeaderInfo(ctx).Height - epoch.CurrentEpochStartHeight, nil +} diff --git a/x/epochs/keeper/epoch_test.go b/x/epochs/keeper/epoch_test.go new file mode 100644 index 000000000000..0977940afeca --- /dev/null +++ b/x/epochs/keeper/epoch_test.go @@ -0,0 +1,101 @@ +package keeper_test + +import ( + "time" + + "cosmossdk.io/core/header" + "cosmossdk.io/x/epochs/types" +) + +func (s *KeeperTestSuite) TestAddEpochInfo() { + defaultIdentifier := "default_add_epoch_info_id" + defaultDuration := time.Hour + startBlockHeight := int64(100) + startBlockTime := time.Unix(1656907200, 0).UTC() + tests := map[string]struct { + addedEpochInfo types.EpochInfo + expErr bool + expEpochInfo types.EpochInfo + }{ + "simple_add": { + addedEpochInfo: types.EpochInfo{ + Identifier: defaultIdentifier, + StartTime: time.Time{}, + Duration: defaultDuration, + CurrentEpoch: 0, + CurrentEpochStartHeight: 0, + CurrentEpochStartTime: time.Time{}, + EpochCountingStarted: false, + }, + expErr: false, + expEpochInfo: types.EpochInfo{ + Identifier: defaultIdentifier, + StartTime: startBlockTime, + Duration: defaultDuration, + CurrentEpoch: 0, + CurrentEpochStartHeight: startBlockHeight, + CurrentEpochStartTime: time.Time{}, + EpochCountingStarted: false, + }, + }, + "zero_duration": { + addedEpochInfo: types.EpochInfo{ + Identifier: defaultIdentifier, + StartTime: time.Time{}, + Duration: time.Duration(0), + CurrentEpoch: 0, + CurrentEpochStartHeight: 0, + CurrentEpochStartTime: time.Time{}, + EpochCountingStarted: false, + }, + expErr: true, + }, + } + for name, test := range tests { + s.Run(name, func() { + s.SetupTest() + s.Ctx = s.Ctx.WithHeaderInfo(header.Info{Height: startBlockHeight, Time: startBlockTime}) + err := s.EpochsKeeper.AddEpochInfo(s.Ctx, test.addedEpochInfo) + if !test.expErr { + s.Require().NoError(err) + actualEpochInfo, err := s.EpochsKeeper.EpochInfo.Get(s.Ctx, test.addedEpochInfo.Identifier) + s.Require().NoError(err) + s.Require().Equal(test.expEpochInfo, actualEpochInfo) + } else { + s.Require().Error(err) + } + }) + } +} + +func (s *KeeperTestSuite) TestDuplicateAddEpochInfo() { + identifier := "duplicate_add_epoch_info" + epochInfo := types.NewGenesisEpochInfo(identifier, time.Hour*24*30) + err := s.EpochsKeeper.AddEpochInfo(s.Ctx, epochInfo) + s.Require().NoError(err) + err = s.EpochsKeeper.AddEpochInfo(s.Ctx, epochInfo) + s.Require().Error(err) +} + +func (s *KeeperTestSuite) TestEpochLifeCycle() { + s.SetupTest() + + epochInfo := types.NewGenesisEpochInfo("monthly", time.Hour*24*30) + err := s.EpochsKeeper.AddEpochInfo(s.Ctx, epochInfo) + s.Require().NoError(err) + epochInfoSaved, err := s.EpochsKeeper.EpochInfo.Get(s.Ctx, "monthly") + s.Require().NoError(err) + // setup expected epoch info + expectedEpochInfo := epochInfo + expectedEpochInfo.StartTime = s.Ctx.BlockTime() + expectedEpochInfo.CurrentEpochStartHeight = s.Ctx.BlockHeight() + s.Require().Equal(expectedEpochInfo, epochInfoSaved) + + allEpochs, err := s.EpochsKeeper.AllEpochInfos(s.Ctx) + s.Require().NoError(err) + s.Require().Len(allEpochs, 4) + s.Require().Equal(allEpochs[0].Identifier, "day") // alphabetical order + s.Require().Equal(allEpochs[1].Identifier, "hour") + s.Require().Equal(allEpochs[2].Identifier, "monthly") + s.Require().Equal(allEpochs[3].Identifier, "week") +} diff --git a/x/epochs/keeper/genesis.go b/x/epochs/keeper/genesis.go new file mode 100644 index 000000000000..30cd316b9235 --- /dev/null +++ b/x/epochs/keeper/genesis.go @@ -0,0 +1,29 @@ +package keeper + +import ( + "context" + + "cosmossdk.io/x/epochs/types" +) + +// InitGenesis sets epoch info from genesis +func (k Keeper) InitGenesis(ctx context.Context, genState types.GenesisState) error { + for _, epoch := range genState.Epochs { + err := k.AddEpochInfo(ctx, epoch) + if err != nil { + return err + } + } + return nil +} + +// ExportGenesis returns the capability module's exported genesis. +func (k Keeper) ExportGenesis(ctx context.Context) (*types.GenesisState, error) { + genesis := types.DefaultGenesis() + epochs, err := k.AllEpochInfos(ctx) + if err != nil { + return nil, err + } + genesis.Epochs = epochs + return genesis, nil +} diff --git a/x/epochs/keeper/genesis_test.go b/x/epochs/keeper/genesis_test.go new file mode 100644 index 000000000000..4400cb65908f --- /dev/null +++ b/x/epochs/keeper/genesis_test.go @@ -0,0 +1,96 @@ +package keeper_test + +import ( + "testing" + "time" + + "github.com/stretchr/testify/require" + + "cosmossdk.io/core/header" + "cosmossdk.io/x/epochs/types" +) + +func TestEpochsExportGenesis(t *testing.T) { + ctx, epochsKeeper, _ := Setup(t) + + chainStartTime := ctx.HeaderInfo().Time + chainStartHeight := ctx.HeaderInfo().Height + + genesis, err := epochsKeeper.ExportGenesis(ctx) + require.NoError(t, err) + require.Len(t, genesis.Epochs, 3) + + expectedEpochs := types.DefaultGenesis().Epochs + for i := 0; i < len(expectedEpochs); i++ { + expectedEpochs[i].CurrentEpochStartHeight = chainStartHeight + expectedEpochs[i].StartTime = chainStartTime + } + require.Equal(t, expectedEpochs, genesis.Epochs) +} + +func TestEpochsInitGenesis(t *testing.T) { + ctx, epochsKeeper, _ := Setup(t) + + // On init genesis, default epochs information is set + // To check init genesis again, should make it fresh status + epochInfos, err := epochsKeeper.AllEpochInfos(ctx) + require.NoError(t, err) + for _, epochInfo := range epochInfos { + err := epochsKeeper.EpochInfo.Remove(ctx, epochInfo.Identifier) + require.NoError(t, err) + } + + // now := time.Now() + ctx.WithHeaderInfo(header.Info{Height: 1, Time: time.Now().UTC()}) + + // test genesisState validation + genesisState := types.GenesisState{ + Epochs: []types.EpochInfo{ + { + Identifier: "monthly", + StartTime: time.Time{}, + Duration: time.Hour * 24, + CurrentEpoch: 0, + CurrentEpochStartHeight: ctx.BlockHeight(), + CurrentEpochStartTime: time.Time{}, + EpochCountingStarted: true, + }, + { + Identifier: "monthly", + StartTime: time.Time{}, + Duration: time.Hour * 24, + CurrentEpoch: 0, + CurrentEpochStartHeight: ctx.BlockHeight(), + CurrentEpochStartTime: time.Time{}, + EpochCountingStarted: true, + }, + }, + } + require.EqualError(t, genesisState.Validate(), "epoch identifier should be unique") + + genesisState = types.GenesisState{ + Epochs: []types.EpochInfo{ + { + Identifier: "monthly", + StartTime: time.Time{}, + Duration: time.Hour * 24, + CurrentEpoch: 0, + CurrentEpochStartHeight: ctx.BlockHeight(), + CurrentEpochStartTime: time.Time{}, + EpochCountingStarted: true, + }, + }, + } + + err = epochsKeeper.InitGenesis(ctx, genesisState) + require.NoError(t, err) + epochInfo, err := epochsKeeper.EpochInfo.Get(ctx, "monthly") + require.NoError(t, err) + require.Equal(t, epochInfo.Identifier, "monthly") + require.Equal(t, epochInfo.StartTime.UTC().String(), ctx.HeaderInfo().Time.UTC().String()) + require.Equal(t, epochInfo.Duration, time.Hour*24) + require.Equal(t, epochInfo.CurrentEpoch, int64(0)) + require.Equal(t, epochInfo.CurrentEpochStartHeight, ctx.BlockHeight()) + require.Equal(t, epochInfo.CurrentEpochStartTime.UTC().String(), time.Time{}.String()) + require.Equal(t, epochInfo.EpochCountingStarted, true) +} diff --git a/x/epochs/keeper/grpc_query.go b/x/epochs/keeper/grpc_query.go new file mode 100644 index 000000000000..cdd1648ab04c --- /dev/null +++ b/x/epochs/keeper/grpc_query.go @@ -0,0 +1,51 @@ +package keeper + +import ( + "context" + "errors" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "cosmossdk.io/x/epochs/types" +) + +var _ types.QueryServer = Querier{} + +// Querier defines a wrapper around the x/epochs keeper providing gRPC method +// handlers. +type Querier struct { + Keeper +} + +// NewQuerier initializes new querier. +func NewQuerier(k Keeper) Querier { + return Querier{Keeper: k} +} + +// EpochInfos provide running epochInfos. +func (q Querier) EpochInfos(ctx context.Context, _ *types.QueryEpochsInfoRequest) (*types.QueryEpochsInfoResponse, error) { + epochs, err := q.Keeper.AllEpochInfos(ctx) + return &types.QueryEpochsInfoResponse{ + Epochs: epochs, + }, err +} + +// CurrentEpoch provides current epoch of specified identifier. +func (q Querier) CurrentEpoch(ctx context.Context, req *types.QueryCurrentEpochRequest) (*types.QueryCurrentEpochResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + if req.Identifier == "" { + return nil, status.Error(codes.InvalidArgument, "identifier is empty") + } + + info, err := q.Keeper.EpochInfo.Get(ctx, req.Identifier) + if err != nil { + return nil, errors.New("not available identifier") + } + + return &types.QueryCurrentEpochResponse{ + CurrentEpoch: info.CurrentEpoch, + }, nil +} diff --git a/x/epochs/keeper/grpc_query_test.go b/x/epochs/keeper/grpc_query_test.go new file mode 100644 index 000000000000..760c0e978bc2 --- /dev/null +++ b/x/epochs/keeper/grpc_query_test.go @@ -0,0 +1,22 @@ +package keeper_test + +import ( + "cosmossdk.io/x/epochs/types" +) + +func (s *KeeperTestSuite) TestQueryEpochInfos() { + s.SetupTest() + queryClient := s.queryClient + + // Check that querying epoch infos on default genesis returns the default genesis epoch infos + epochInfosResponse, err := queryClient.EpochInfos(s.Ctx, &types.QueryEpochsInfoRequest{}) + s.Require().NoError(err) + s.Require().Len(epochInfosResponse.Epochs, 3) + expectedEpochs := types.DefaultGenesis().Epochs + for id := range expectedEpochs { + expectedEpochs[id].StartTime = s.Ctx.BlockTime() + expectedEpochs[id].CurrentEpochStartHeight = s.Ctx.BlockHeight() + } + + s.Require().Equal(expectedEpochs, epochInfosResponse.Epochs) +} diff --git a/x/epochs/keeper/hooks.go b/x/epochs/keeper/hooks.go new file mode 100644 index 000000000000..f609843be35b --- /dev/null +++ b/x/epochs/keeper/hooks.go @@ -0,0 +1,27 @@ +package keeper + +import ( + "context" + + "cosmossdk.io/x/epochs/types" +) + +// Hooks gets the hooks for governance Keeper +func (k Keeper) Hooks() types.EpochHooks { + if k.hooks == nil { + // return a no-op implementation if no hooks are set + return types.MultiEpochHooks{} + } + + return k.hooks +} + +// AfterEpochEnd gets called at the end of the epoch, end of epoch is the timestamp of first block produced after epoch duration. +func (k Keeper) AfterEpochEnd(ctx context.Context, identifier string, epochNumber int64) error { + return k.Hooks().AfterEpochEnd(ctx, identifier, epochNumber) +} + +// BeforeEpochStart new epoch is next block of epoch end block +func (k Keeper) BeforeEpochStart(ctx context.Context, identifier string, epochNumber int64) error { + return k.Hooks().BeforeEpochStart(ctx, identifier, epochNumber) +} diff --git a/x/epochs/keeper/keeper.go b/x/epochs/keeper/keeper.go new file mode 100644 index 000000000000..a389b183a52e --- /dev/null +++ b/x/epochs/keeper/keeper.go @@ -0,0 +1,53 @@ +package keeper + +import ( + "cosmossdk.io/collections" + "cosmossdk.io/core/appmodule" + "cosmossdk.io/log" + "cosmossdk.io/x/epochs/types" + + "github.com/cosmos/cosmos-sdk/codec" +) + +type ( + Keeper struct { + cdc codec.BinaryCodec + environment appmodule.Environment + hooks types.EpochHooks + + Schema collections.Schema + EpochInfo collections.Map[string, types.EpochInfo] + } +) + +// NewKeeper returns a new keeper by codec and storeKey inputs. +func NewKeeper(env appmodule.Environment, cdc codec.BinaryCodec) Keeper { + sb := collections.NewSchemaBuilder(env.KVStoreService) + k := Keeper{ + cdc: cdc, + environment: env, + EpochInfo: collections.NewMap(sb, types.KeyPrefixEpoch, "epoch_info", collections.StringKey, codec.CollValue[types.EpochInfo](cdc)), + } + + schema, err := sb.Build() + if err != nil { + panic(err) + } + k.Schema = schema + return k +} + +// Set the gamm hooks. +func (k Keeper) SetHooks(eh types.EpochHooks) Keeper { + if k.hooks != nil { + panic("cannot set epochs hooks twice") + } + + k.hooks = eh + + return k +} + +func (k Keeper) Logger() log.Logger { + return k.environment.Logger +} diff --git a/x/epochs/keeper/keeper_test.go b/x/epochs/keeper/keeper_test.go new file mode 100644 index 000000000000..2310b0744b18 --- /dev/null +++ b/x/epochs/keeper/keeper_test.go @@ -0,0 +1,95 @@ +package keeper_test + +import ( + "testing" + "time" + + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" + + "cosmossdk.io/core/appmodule" + "cosmossdk.io/core/header" + "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" + epochskeeper "cosmossdk.io/x/epochs/keeper" + "cosmossdk.io/x/epochs/types" + + "github.com/cosmos/cosmos-sdk/baseapp" + codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" + "github.com/cosmos/cosmos-sdk/runtime" + "github.com/cosmos/cosmos-sdk/testutil" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" +) + +type KeeperTestSuite struct { + suite.Suite + Ctx sdk.Context + environment appmodule.Environment + EpochsKeeper epochskeeper.Keeper + queryClient types.QueryClient +} + +func (s *KeeperTestSuite) SetupTest() { + ctx, epochsKeeper, environment := Setup(s.T()) + + s.Ctx = ctx + s.EpochsKeeper = epochsKeeper + s.environment = environment + queryRouter := baseapp.NewGRPCQueryRouter() + cfg := module.NewConfigurator(nil, nil, queryRouter) + types.RegisterQueryServer(cfg.QueryServer(), epochskeeper.NewQuerier(s.EpochsKeeper)) + grpcQueryService := &baseapp.QueryServiceTestHelper{ + GRPCQueryRouter: queryRouter, + Ctx: s.Ctx, + } + encCfg := moduletestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{}) + grpcQueryService.SetInterfaceRegistry(encCfg.InterfaceRegistry) + s.queryClient = types.NewQueryClient(grpcQueryService) +} + +func Setup(t *testing.T) (sdk.Context, epochskeeper.Keeper, appmodule.Environment) { + t.Helper() + + key := storetypes.NewKVStoreKey(types.StoreKey) + storeService := runtime.NewKVStoreService(key) + environment := runtime.NewEnvironment(storeService, log.NewNopLogger()) + testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) + ctx := testCtx.Ctx.WithHeaderInfo(header.Info{Time: time.Now()}) + encCfg := moduletestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{}) + + epochsKeeper := epochskeeper.NewKeeper( + environment, + encCfg.Codec, + ) + epochsKeeper = epochsKeeper.SetHooks(types.NewMultiEpochHooks()) + ctx.WithHeaderInfo(header.Info{Height: 1, Time: time.Now().UTC(), ChainID: "epochs"}) + err := epochsKeeper.InitGenesis(ctx, *types.DefaultGenesis()) + require.NoError(t, err) + SetEpochStartTime(ctx, epochsKeeper) + + return ctx, epochsKeeper, environment +} + +func TestKeeperTestSuite(t *testing.T) { + suite.Run(t, new(KeeperTestSuite)) +} + +func SetEpochStartTime(ctx sdk.Context, epochsKeeper epochskeeper.Keeper) { + epochs, err := epochsKeeper.AllEpochInfos(ctx) + if err != nil { + panic(err) + } + for _, epoch := range epochs { + epoch.StartTime = ctx.BlockTime() + err := epochsKeeper.EpochInfo.Remove(ctx, epoch.Identifier) + if err != nil { + panic(err) + } + err = epochsKeeper.AddEpochInfo(ctx, epoch) + if err != nil { + panic(err) + } + } +} diff --git a/x/epochs/module.go b/x/epochs/module.go new file mode 100644 index 000000000000..807e14470838 --- /dev/null +++ b/x/epochs/module.go @@ -0,0 +1,132 @@ +package epochs + +import ( + "context" + "encoding/json" + "fmt" + + gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" + "google.golang.org/grpc" + + "cosmossdk.io/core/appmodule" + "cosmossdk.io/x/epochs/keeper" + "cosmossdk.io/x/epochs/simulation" + "cosmossdk.io/x/epochs/types" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" +) + +var ( + _ module.HasName = AppModule{} + _ module.HasAminoCodec = AppModule{} + _ module.HasGRPCGateway = AppModule{} + _ module.AppModuleSimulation = AppModule{} + _ module.HasGenesis = AppModule{} + + _ appmodule.AppModule = AppModule{} + _ appmodule.HasBeginBlocker = AppModule{} +) + +const ConsensusVersion = 1 + +// AppModule implements the AppModule interface for the epochs module. +type AppModule struct { + cdc codec.Codec + keeper keeper.Keeper +} + +// NewAppModule creates a new AppModule object. +func NewAppModule(cdc codec.Codec, keeper keeper.Keeper) AppModule { + return AppModule{ + cdc: cdc, + keeper: keeper, + } +} + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// Name returns the epochs module's name. +func (AppModule) Name() string { + return types.ModuleName +} + +// RegisterLegacyAminoCodec registers the epochs module's types for the given codec. +func (AppModule) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { +} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the epochs module. +func (AppModule) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *gwruntime.ServeMux) { + if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { + panic(err) + } +} + +// RegisterServices registers module services. +func (am AppModule) RegisterServices(registrar grpc.ServiceRegistrar) error { + types.RegisterQueryServer(registrar, keeper.NewQuerier(am.keeper)) + return nil +} + +// DefaultGenesis returns the epochs module's default genesis state. +func (am AppModule) DefaultGenesis() json.RawMessage { + return am.cdc.MustMarshalJSON(types.DefaultGenesis()) +} + +// ValidateGenesis performs genesis state validation for the epochs module. +func (am AppModule) ValidateGenesis(bz json.RawMessage) error { + var gs types.GenesisState + if err := am.cdc.UnmarshalJSON(bz, &gs); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + } + + return gs.Validate() +} + +// InitGenesis performs the epochs module's genesis initialization +func (am AppModule) InitGenesis(ctx context.Context, bz json.RawMessage) error { + var gs types.GenesisState + err := am.cdc.UnmarshalJSON(bz, &gs) + if err != nil { + return (fmt.Errorf("failed to unmarshal %s genesis state: %s", types.ModuleName, err)) + } + + return am.keeper.InitGenesis(ctx, gs) +} + +// ExportGenesis returns the epochs module's exported genesis state as raw JSON bytes. +func (am AppModule) ExportGenesis(ctx context.Context) (json.RawMessage, error) { + gs, err := am.keeper.ExportGenesis(ctx) + if err != nil { + return nil, err + } + return am.cdc.MarshalJSON(gs) +} + +// ConsensusVersion implements HasConsensusVersion +func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion } + +// BeginBlock executes all ABCI BeginBlock logic respective to the epochs module. +func (am AppModule) BeginBlock(ctx context.Context) error { + return am.keeper.BeginBlocker(ctx) +} + +// AppModuleSimulation functions + +// GenerateGenesisState creates a randomized GenState of the epochs module. +func (AppModule) GenerateGenesisState(simState *module.SimulationState) { + simulation.RandomizedGenState(simState) +} + +// RegisterStoreDecoder registers a decoder for epochs module's types +func (am AppModule) RegisterStoreDecoder(sdr simtypes.StoreDecoderRegistry) { + sdr[types.StoreKey] = simtypes.NewStoreDecoderFuncFromCollectionsSchema(am.keeper.Schema) +} + +// WeightedOperations returns the all the gov module operations with their respective weights. +func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { + return nil +} diff --git a/x/epochs/proto/buf.gen.gogo.yaml b/x/epochs/proto/buf.gen.gogo.yaml new file mode 100644 index 000000000000..db36231d0c82 --- /dev/null +++ b/x/epochs/proto/buf.gen.gogo.yaml @@ -0,0 +1,8 @@ +version: v1 +plugins: + - name: gocosmos + out: .. + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any + - name: grpc-gateway + out: .. + opt: logtostderr=true,allow_colon_final_segments=true diff --git a/x/epochs/proto/buf.gen.pulsar.yaml b/x/epochs/proto/buf.gen.pulsar.yaml new file mode 100644 index 000000000000..88a5b0419d7f --- /dev/null +++ b/x/epochs/proto/buf.gen.pulsar.yaml @@ -0,0 +1,18 @@ +version: v1 +managed: + enabled: true + go_package_prefix: + default: cosmossdk.io/api + except: + - buf.build/googleapis/googleapis + - buf.build/cosmos/gogo-proto + - buf.build/cosmos/cosmos-proto + override: + buf.build/cosmos/cosmos-sdk: cosmossdk.io/api +plugins: + - name: go-pulsar + out: .. + opt: paths=source_relative + - name: go-grpc + out: .. + opt: paths=source_relative diff --git a/x/epochs/proto/buf.lock b/x/epochs/proto/buf.lock new file mode 100644 index 000000000000..08b5c2ec08aa --- /dev/null +++ b/x/epochs/proto/buf.lock @@ -0,0 +1,28 @@ +# Generated by buf. DO NOT EDIT. +version: v1 +deps: + - remote: buf.build + owner: cosmos + repository: cosmos-proto + commit: 1935555c206d4afb9e94615dfd0fad31 + digest: shake256:c74d91a3ac7ae07d579e90eee33abf9b29664047ac8816500cf22c081fec0d72d62c89ce0bebafc1f6fec7aa5315be72606717740ca95007248425102c365377 + - remote: buf.build + owner: cosmos + repository: cosmos-sdk + commit: cf13c7d232dd405180c2af616fa8a075 + digest: shake256:769a38e306a98339b549bc96991c97fae8bd3ceb1a7646c7bfe9a74e406ab068372970fbc5abda1891e2f3c36527cf2d3a25f631739d36900787226e564bb612 + - remote: buf.build + owner: cosmos + repository: gogo-proto + commit: 5e5b9fdd01804356895f8f79a6f1ddc1 + digest: shake256:0b85da49e2e5f9ebc4806eae058e2f56096ff3b1c59d1fb7c190413dd15f45dd456f0b69ced9059341c80795d2b6c943de15b120a9e0308b499e43e4b5fc2952 + - remote: buf.build + owner: googleapis + repository: googleapis + commit: 28151c0d0a1641bf938a7672c500e01d + digest: shake256:49215edf8ef57f7863004539deff8834cfb2195113f0b890dd1f67815d9353e28e668019165b9d872395871eeafcbab3ccfdb2b5f11734d3cca95be9e8d139de + - remote: buf.build + owner: protocolbuffers + repository: wellknowntypes + commit: 657250e6a39648cbb169d079a60bd9ba + digest: shake256:00de25001b8dd2e29d85fc4bcc3ede7aed886d76d67f5e0f7a9b320b90f871d3eb73507d50818d823a0512f3f8db77a11c043685528403e31ff3fef18323a9fb diff --git a/x/epochs/proto/buf.yaml b/x/epochs/proto/buf.yaml new file mode 100644 index 000000000000..1d0c41cef885 --- /dev/null +++ b/x/epochs/proto/buf.yaml @@ -0,0 +1,18 @@ +version: v1 +name: buf.build/mods/epochs +deps: + - buf.build/cosmos/cosmos-sdk # pin the Cosmos SDK version + - buf.build/cosmos/cosmos-proto + - buf.build/cosmos/gogo-proto + - buf.build/googleapis/googleapis +lint: + use: + - DEFAULT + - COMMENTS + - FILE_LOWER_SNAKE_CASE + except: + - UNARY_RPC + - COMMENT_FIELD + - SERVICE_SUFFIX + - PACKAGE_VERSION_SUFFIX + - RPC_REQUEST_STANDARD_NAME diff --git a/x/epochs/proto/cosmos/epochs/module/v1/module.proto b/x/epochs/proto/cosmos/epochs/module/v1/module.proto new file mode 100644 index 000000000000..1b860b3e504b --- /dev/null +++ b/x/epochs/proto/cosmos/epochs/module/v1/module.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package cosmos.epochs.module.v1; + +import "cosmos/app/v1alpha1/module.proto"; + +// Module is the config object of the authz module. +message Module { + option (cosmos.app.v1alpha1.module) = { + go_import: "cosmossdk.io/x/epochs" + }; +} \ No newline at end of file diff --git a/x/epochs/proto/cosmos/epochs/v1beta1/events.proto b/x/epochs/proto/cosmos/epochs/v1beta1/events.proto new file mode 100644 index 000000000000..b1460340caed --- /dev/null +++ b/x/epochs/proto/cosmos/epochs/v1beta1/events.proto @@ -0,0 +1,21 @@ +// Since: x/epochs 0.1.0 +syntax = "proto3"; + +package cosmos.epochs.v1beta1; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/epochs/v1beta1/genesis.proto"; + +option go_package = "cosmossdk.io/x/epochs/types"; + +// EventEpochEnd is an event emitted when an epoch end. +message EventEpochEnd { + int64 epoch_number = 1; +} + +// EventEpochStart is an event emitted when an epoch start. +message EventEpochStart { + + int64 epoch_number = 1; + int64 epoch_start_time = 2; +} diff --git a/x/epochs/proto/cosmos/epochs/v1beta1/genesis.proto b/x/epochs/proto/cosmos/epochs/v1beta1/genesis.proto new file mode 100644 index 000000000000..ce923ea84d69 --- /dev/null +++ b/x/epochs/proto/cosmos/epochs/v1beta1/genesis.proto @@ -0,0 +1,60 @@ +syntax = "proto3"; +package cosmos.epochs.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cosmossdk.io/x/epochs/types"; + +// EpochInfo is a struct that describes the data going into +// a timer defined by the x/epochs module. +message EpochInfo { + // identifier is a unique reference to this particular timer. + string identifier = 1; + // start_time is the time at which the timer first ever ticks. + // If start_time is in the future, the epoch will not begin until the start + // time. + google.protobuf.Timestamp start_time = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + // duration is the time in between epoch ticks. + // In order for intended behavior to be met, duration should + // be greater than the chains expected block time. + // Duration must be non-zero. + google.protobuf.Duration duration = 3 + [(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.jsontag) = "duration,omitempty"]; + // current_epoch is the current epoch number, or in other words, + // how many times has the timer 'ticked'. + // The first tick (current_epoch=1) is defined as + // the first block whose blocktime is greater than the EpochInfo start_time. + int64 current_epoch = 4; + // current_epoch_start_time describes the start time of the current timer + // interval. The interval is (current_epoch_start_time, + // current_epoch_start_time + duration] When the timer ticks, this is set to + // current_epoch_start_time = last_epoch_start_time + duration only one timer + // tick for a given identifier can occur per block. + // + // NOTE! The current_epoch_start_time may diverge significantly from the + // wall-clock time the epoch began at. Wall-clock time of epoch start may be + // >> current_epoch_start_time. Suppose current_epoch_start_time = 10, + // duration = 5. Suppose the chain goes offline at t=14, and comes back online + // at t=30, and produces blocks at every successive time. (t=31, 32, etc.) + // * The t=30 block will start the epoch for (10, 15] + // * The t=31 block will start the epoch for (15, 20] + // * The t=32 block will start the epoch for (20, 25] + // * The t=33 block will start the epoch for (25, 30] + // * The t=34 block will start the epoch for (30, 35] + // * The **t=36** block will start the epoch for (35, 40] + google.protobuf.Timestamp current_epoch_start_time = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + // epoch_counting_started is a boolean, that indicates whether this + // epoch timer has began yet. + bool epoch_counting_started = 6; + reserved 7; + // current_epoch_start_height is the block height at which the current epoch + // started. (The block height at which the timer last ticked) + int64 current_epoch_start_height = 8; +} + +// GenesisState defines the epochs module's genesis state. +message GenesisState { + repeated EpochInfo epochs = 1 [(gogoproto.nullable) = false]; +} diff --git a/x/epochs/proto/cosmos/epochs/v1beta1/query.proto b/x/epochs/proto/cosmos/epochs/v1beta1/query.proto new file mode 100644 index 000000000000..2bd57a51fe16 --- /dev/null +++ b/x/epochs/proto/cosmos/epochs/v1beta1/query.proto @@ -0,0 +1,33 @@ +syntax = "proto3"; +package cosmos.epochs.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/epochs/v1beta1/genesis.proto"; + +option go_package = "cosmossdk.io/x/epochs/types"; + +// Query defines the gRPC querier service. +service Query { + // EpochInfos provide running epochInfos + rpc EpochInfos(QueryEpochsInfoRequest) returns (QueryEpochsInfoResponse) { + option (google.api.http).get = "/cosmos/epochs/v1beta1/epochs"; + } + // CurrentEpoch provide current epoch of specified identifier + rpc CurrentEpoch(QueryCurrentEpochRequest) returns (QueryCurrentEpochResponse) { + option (google.api.http).get = "/cosmos/epochs/v1beta1/current_epoch"; + } +} + +message QueryEpochsInfoRequest {} +message QueryEpochsInfoResponse { + repeated EpochInfo epochs = 1 [(gogoproto.nullable) = false]; +} + +message QueryCurrentEpochRequest { + string identifier = 1; +} +message QueryCurrentEpochResponse { + int64 current_epoch = 1; +} \ No newline at end of file diff --git a/x/epochs/simulation/genesis.go b/x/epochs/simulation/genesis.go new file mode 100644 index 000000000000..c236faacbb8a --- /dev/null +++ b/x/epochs/simulation/genesis.go @@ -0,0 +1,46 @@ +package simulation + +import ( + "encoding/json" + "fmt" + "math/rand" + "strconv" + "time" + + "cosmossdk.io/x/epochs/types" + + "github.com/cosmos/cosmos-sdk/types/module" +) + +// GenCommunityTax randomized CommunityTax +func GenDuration(r *rand.Rand) time.Duration { + return time.Hour * time.Duration(r.Intn(168)+1) // between 1 hour to 1 week +} + +func RandomizedEpochs(r *rand.Rand) []types.EpochInfo { + // Gen max 10 epoch + n := r.Intn(11) + var epochs []types.EpochInfo + for i := 0; i < n; i++ { + identifier := "identifier-" + strconv.Itoa(i) + duration := GenDuration(r) + epoch := types.NewGenesisEpochInfo(identifier, duration) + epochs = append(epochs, epoch) + } + return epochs +} + +// RandomizedGenState generates a random GenesisState for distribution +func RandomizedGenState(simState *module.SimulationState) { + epochs := RandomizedEpochs(simState.Rand) + epochsGenesis := types.GenesisState{ + Epochs: epochs, + } + + bz, err := json.MarshalIndent(&epochsGenesis, "", " ") + if err != nil { + panic(err) + } + fmt.Printf("Selected randomly generated epochs parameters:\n%s\n", bz) + simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&epochsGenesis) +} diff --git a/x/epochs/sonar-project.properties b/x/epochs/sonar-project.properties new file mode 100644 index 000000000000..4f13ab19c8e0 --- /dev/null +++ b/x/epochs/sonar-project.properties @@ -0,0 +1,14 @@ +sonar.projectKey=cosmos-sdk-epochs +sonar.organization=cosmos + +sonar.projectName=Cosmos SDK - Epochs +sonar.project.monorepo.enabled=true + +sonar.sources=. +sonar.exclusions=**/*_test.go +sonar.tests=. +sonar.test.inclusions=**/*_test.go +sonar.go.coverage.reportPaths=coverage.out + +sonar.sourceEncoding=UTF-8 +sonar.scm.provider=git diff --git a/x/epochs/types/events.pb.go b/x/epochs/types/events.pb.go new file mode 100644 index 000000000000..2402a732224b --- /dev/null +++ b/x/epochs/types/events.pb.go @@ -0,0 +1,497 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/epochs/v1beta1/events.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// EventEpochEnd is an event emitted when an epoch end. +type EventEpochEnd struct { + EpochNumber int64 `protobuf:"varint,1,opt,name=epoch_number,json=epochNumber,proto3" json:"epoch_number,omitempty"` +} + +func (m *EventEpochEnd) Reset() { *m = EventEpochEnd{} } +func (m *EventEpochEnd) String() string { return proto.CompactTextString(m) } +func (*EventEpochEnd) ProtoMessage() {} +func (*EventEpochEnd) Descriptor() ([]byte, []int) { + return fileDescriptor_691f9b4b0a500cb4, []int{0} +} +func (m *EventEpochEnd) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventEpochEnd) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventEpochEnd.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EventEpochEnd) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventEpochEnd.Merge(m, src) +} +func (m *EventEpochEnd) XXX_Size() int { + return m.Size() +} +func (m *EventEpochEnd) XXX_DiscardUnknown() { + xxx_messageInfo_EventEpochEnd.DiscardUnknown(m) +} + +var xxx_messageInfo_EventEpochEnd proto.InternalMessageInfo + +func (m *EventEpochEnd) GetEpochNumber() int64 { + if m != nil { + return m.EpochNumber + } + return 0 +} + +// EventEpochStart is an event emitted when an epoch start. +type EventEpochStart struct { + EpochNumber int64 `protobuf:"varint,1,opt,name=epoch_number,json=epochNumber,proto3" json:"epoch_number,omitempty"` + EpochStartTime int64 `protobuf:"varint,2,opt,name=epoch_start_time,json=epochStartTime,proto3" json:"epoch_start_time,omitempty"` +} + +func (m *EventEpochStart) Reset() { *m = EventEpochStart{} } +func (m *EventEpochStart) String() string { return proto.CompactTextString(m) } +func (*EventEpochStart) ProtoMessage() {} +func (*EventEpochStart) Descriptor() ([]byte, []int) { + return fileDescriptor_691f9b4b0a500cb4, []int{1} +} +func (m *EventEpochStart) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventEpochStart) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventEpochStart.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EventEpochStart) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventEpochStart.Merge(m, src) +} +func (m *EventEpochStart) XXX_Size() int { + return m.Size() +} +func (m *EventEpochStart) XXX_DiscardUnknown() { + xxx_messageInfo_EventEpochStart.DiscardUnknown(m) +} + +var xxx_messageInfo_EventEpochStart proto.InternalMessageInfo + +func (m *EventEpochStart) GetEpochNumber() int64 { + if m != nil { + return m.EpochNumber + } + return 0 +} + +func (m *EventEpochStart) GetEpochStartTime() int64 { + if m != nil { + return m.EpochStartTime + } + return 0 +} + +func init() { + proto.RegisterType((*EventEpochEnd)(nil), "cosmos.epochs.v1beta1.EventEpochEnd") + proto.RegisterType((*EventEpochStart)(nil), "cosmos.epochs.v1beta1.EventEpochStart") +} + +func init() { + proto.RegisterFile("cosmos/epochs/v1beta1/events.proto", fileDescriptor_691f9b4b0a500cb4) +} + +var fileDescriptor_691f9b4b0a500cb4 = []byte{ + // 225 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x2d, 0xc8, 0x4f, 0xce, 0x28, 0xd6, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, + 0x34, 0xd4, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0x29, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, + 0x85, 0xa8, 0xd1, 0x83, 0xa8, 0xd1, 0x83, 0xaa, 0x91, 0x92, 0x84, 0x08, 0xc7, 0x83, 0x15, 0xe9, + 0x43, 0xd5, 0x80, 0x39, 0x52, 0xca, 0xd8, 0x4d, 0x4d, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x84, 0x2a, + 0x52, 0x32, 0xe2, 0xe2, 0x75, 0x05, 0x59, 0xe3, 0x0a, 0x52, 0xe4, 0x9a, 0x97, 0x22, 0xa4, 0xc8, + 0xc5, 0x03, 0xd6, 0x10, 0x9f, 0x57, 0x9a, 0x9b, 0x94, 0x5a, 0x24, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, + 0x1c, 0xc4, 0x0d, 0x16, 0xf3, 0x03, 0x0b, 0x29, 0xc5, 0x71, 0xf1, 0x23, 0xf4, 0x04, 0x97, 0x24, + 0x16, 0x95, 0x10, 0xa1, 0x4b, 0x48, 0x83, 0x4b, 0x00, 0xa2, 0xa4, 0x18, 0xa4, 0x23, 0xbe, 0x24, + 0x33, 0x37, 0x55, 0x82, 0x09, 0xac, 0x8c, 0x2f, 0x15, 0x6e, 0x50, 0x48, 0x66, 0x6e, 0xaa, 0x93, + 0xe9, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, + 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x49, 0x43, 0xbc, 0x54, 0x9c, + 0x92, 0xad, 0x97, 0x99, 0xaf, 0x5f, 0x01, 0xf3, 0x5a, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, + 0xd8, 0x47, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0d, 0x88, 0x5e, 0xe4, 0x4e, 0x01, 0x00, + 0x00, +} + +func (m *EventEpochEnd) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventEpochEnd) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventEpochEnd) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.EpochNumber != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.EpochNumber)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *EventEpochStart) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventEpochStart) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventEpochStart) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.EpochStartTime != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.EpochStartTime)) + i-- + dAtA[i] = 0x10 + } + if m.EpochNumber != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.EpochNumber)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { + offset -= sovEvents(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *EventEpochEnd) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.EpochNumber != 0 { + n += 1 + sovEvents(uint64(m.EpochNumber)) + } + return n +} + +func (m *EventEpochStart) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.EpochNumber != 0 { + n += 1 + sovEvents(uint64(m.EpochNumber)) + } + if m.EpochStartTime != 0 { + n += 1 + sovEvents(uint64(m.EpochStartTime)) + } + return n +} + +func sovEvents(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvents(x uint64) (n int) { + return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EventEpochEnd) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventEpochEnd: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventEpochEnd: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EpochNumber", wireType) + } + m.EpochNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EpochNumber |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventEpochStart) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventEpochStart: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventEpochStart: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EpochNumber", wireType) + } + m.EpochNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EpochNumber |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EpochStartTime", wireType) + } + m.EpochStartTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EpochStartTime |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEvents(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthEvents + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEvents + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEvents + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/epochs/types/genesis.go b/x/epochs/types/genesis.go new file mode 100644 index 000000000000..cf60354782b1 --- /dev/null +++ b/x/epochs/types/genesis.go @@ -0,0 +1,68 @@ +package types + +import ( + "errors" + "time" +) + +// DefaultIndex is the default capability global index. +const DefaultIndex uint64 = 1 + +func NewGenesisState(epochs []EpochInfo) *GenesisState { + return &GenesisState{Epochs: epochs} +} + +// DefaultGenesis returns the default Capability genesis state. +func DefaultGenesis() *GenesisState { + epochs := []EpochInfo{ + NewGenesisEpochInfo("day", time.Hour*24), // alphabetical order + NewGenesisEpochInfo("hour", time.Hour), + NewGenesisEpochInfo("week", time.Hour*24*7), + } + return NewGenesisState(epochs) +} + +// Validate performs basic genesis state validation returning an error upon any +// failure. +func (gs GenesisState) Validate() error { + epochIdentifiers := map[string]bool{} + for _, epoch := range gs.Epochs { + if err := epoch.Validate(); err != nil { + return err + } + if epochIdentifiers[epoch.Identifier] { + return errors.New("epoch identifier should be unique") + } + epochIdentifiers[epoch.Identifier] = true + } + return nil +} + +// Validate also validates epoch info. +func (epoch EpochInfo) Validate() error { + if epoch.Identifier == "" { + return errors.New("epoch identifier should NOT be empty") + } + if epoch.Duration == 0 { + return errors.New("epoch duration should NOT be 0") + } + if epoch.CurrentEpoch < 0 { + return errors.New("epoch CurrentEpoch must be non-negative") + } + if epoch.CurrentEpochStartHeight < 0 { + return errors.New("epoch CurrentEpochStartHeight must be non-negative") + } + return nil +} + +func NewGenesisEpochInfo(identifier string, duration time.Duration) EpochInfo { + return EpochInfo{ + Identifier: identifier, + StartTime: time.Time{}, + Duration: duration, + CurrentEpoch: 0, + CurrentEpochStartHeight: 0, + CurrentEpochStartTime: time.Time{}, + EpochCountingStarted: false, + } +} diff --git a/x/epochs/types/genesis.pb.go b/x/epochs/types/genesis.pb.go new file mode 100644 index 000000000000..ec2b83888d67 --- /dev/null +++ b/x/epochs/types/genesis.pb.go @@ -0,0 +1,821 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/epochs/v1beta1/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + _ "google.golang.org/protobuf/types/known/durationpb" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// EpochInfo is a struct that describes the data going into +// a timer defined by the x/epochs module. +type EpochInfo struct { + // identifier is a unique reference to this particular timer. + Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` + // start_time is the time at which the timer first ever ticks. + // If start_time is in the future, the epoch will not begin until the start + // time. + StartTime time.Time `protobuf:"bytes,2,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time"` + // duration is the time in between epoch ticks. + // In order for intended behavior to be met, duration should + // be greater than the chains expected block time. + // Duration must be non-zero. + Duration time.Duration `protobuf:"bytes,3,opt,name=duration,proto3,stdduration" json:"duration,omitempty"` + // current_epoch is the current epoch number, or in other words, + // how many times has the timer 'ticked'. + // The first tick (current_epoch=1) is defined as + // the first block whose blocktime is greater than the EpochInfo start_time. + CurrentEpoch int64 `protobuf:"varint,4,opt,name=current_epoch,json=currentEpoch,proto3" json:"current_epoch,omitempty"` + // current_epoch_start_time describes the start time of the current timer + // interval. The interval is (current_epoch_start_time, + // current_epoch_start_time + duration] When the timer ticks, this is set to + // current_epoch_start_time = last_epoch_start_time + duration only one timer + // tick for a given identifier can occur per block. + // + // NOTE! The current_epoch_start_time may diverge significantly from the + // wall-clock time the epoch began at. Wall-clock time of epoch start may be + // >> current_epoch_start_time. Suppose current_epoch_start_time = 10, + // duration = 5. Suppose the chain goes offline at t=14, and comes back online + // at t=30, and produces blocks at every successive time. (t=31, 32, etc.) + // * The t=30 block will start the epoch for (10, 15] + // * The t=31 block will start the epoch for (15, 20] + // * The t=32 block will start the epoch for (20, 25] + // * The t=33 block will start the epoch for (25, 30] + // * The t=34 block will start the epoch for (30, 35] + // * The **t=36** block will start the epoch for (35, 40] + CurrentEpochStartTime time.Time `protobuf:"bytes,5,opt,name=current_epoch_start_time,json=currentEpochStartTime,proto3,stdtime" json:"current_epoch_start_time"` + // epoch_counting_started is a boolean, that indicates whether this + // epoch timer has began yet. + EpochCountingStarted bool `protobuf:"varint,6,opt,name=epoch_counting_started,json=epochCountingStarted,proto3" json:"epoch_counting_started,omitempty"` + // current_epoch_start_height is the block height at which the current epoch + // started. (The block height at which the timer last ticked) + CurrentEpochStartHeight int64 `protobuf:"varint,8,opt,name=current_epoch_start_height,json=currentEpochStartHeight,proto3" json:"current_epoch_start_height,omitempty"` +} + +func (m *EpochInfo) Reset() { *m = EpochInfo{} } +func (m *EpochInfo) String() string { return proto.CompactTextString(m) } +func (*EpochInfo) ProtoMessage() {} +func (*EpochInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_3a3d6d4398875177, []int{0} +} +func (m *EpochInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EpochInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EpochInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EpochInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_EpochInfo.Merge(m, src) +} +func (m *EpochInfo) XXX_Size() int { + return m.Size() +} +func (m *EpochInfo) XXX_DiscardUnknown() { + xxx_messageInfo_EpochInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_EpochInfo proto.InternalMessageInfo + +func (m *EpochInfo) GetIdentifier() string { + if m != nil { + return m.Identifier + } + return "" +} + +func (m *EpochInfo) GetStartTime() time.Time { + if m != nil { + return m.StartTime + } + return time.Time{} +} + +func (m *EpochInfo) GetDuration() time.Duration { + if m != nil { + return m.Duration + } + return 0 +} + +func (m *EpochInfo) GetCurrentEpoch() int64 { + if m != nil { + return m.CurrentEpoch + } + return 0 +} + +func (m *EpochInfo) GetCurrentEpochStartTime() time.Time { + if m != nil { + return m.CurrentEpochStartTime + } + return time.Time{} +} + +func (m *EpochInfo) GetEpochCountingStarted() bool { + if m != nil { + return m.EpochCountingStarted + } + return false +} + +func (m *EpochInfo) GetCurrentEpochStartHeight() int64 { + if m != nil { + return m.CurrentEpochStartHeight + } + return 0 +} + +// GenesisState defines the epochs module's genesis state. +type GenesisState struct { + Epochs []EpochInfo `protobuf:"bytes,1,rep,name=epochs,proto3" json:"epochs"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_3a3d6d4398875177, []int{1} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetEpochs() []EpochInfo { + if m != nil { + return m.Epochs + } + return nil +} + +func init() { + proto.RegisterType((*EpochInfo)(nil), "cosmos.epochs.v1beta1.EpochInfo") + proto.RegisterType((*GenesisState)(nil), "cosmos.epochs.v1beta1.GenesisState") +} + +func init() { + proto.RegisterFile("cosmos/epochs/v1beta1/genesis.proto", fileDescriptor_3a3d6d4398875177) +} + +var fileDescriptor_3a3d6d4398875177 = []byte{ + // 436 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0x3f, 0x6f, 0xd3, 0x40, + 0x18, 0xc6, 0x73, 0x24, 0x04, 0xe7, 0x5a, 0x24, 0x74, 0x6a, 0xe1, 0x30, 0xd2, 0xd9, 0x6a, 0x17, + 0x0f, 0xe8, 0xac, 0x16, 0x98, 0x90, 0x18, 0x5c, 0x10, 0x7f, 0x06, 0x06, 0x07, 0x16, 0x24, 0x14, + 0x39, 0xf6, 0xc5, 0x39, 0x81, 0x7d, 0x96, 0xef, 0x35, 0xa2, 0xdf, 0xa2, 0x23, 0x1f, 0x88, 0xa1, + 0x63, 0x47, 0xa6, 0x82, 0x92, 0x8d, 0x4f, 0x81, 0x7c, 0x67, 0x47, 0x81, 0x76, 0x61, 0x4b, 0xee, + 0x79, 0xde, 0xdf, 0x73, 0xcf, 0xf9, 0xc5, 0x87, 0xa9, 0xd2, 0x85, 0xd2, 0xa1, 0xa8, 0x54, 0xba, + 0xd4, 0xe1, 0x97, 0xa3, 0xb9, 0x80, 0xe4, 0x28, 0xcc, 0x45, 0x29, 0xb4, 0xd4, 0xbc, 0xaa, 0x15, + 0x28, 0xb2, 0x6f, 0x4d, 0xdc, 0x9a, 0x78, 0x67, 0x72, 0xf7, 0x72, 0x95, 0x2b, 0xe3, 0x08, 0xdb, + 0x5f, 0xd6, 0xec, 0xb2, 0x5c, 0xa9, 0xfc, 0xb3, 0x08, 0xcd, 0xbf, 0x79, 0xb3, 0x08, 0xb3, 0xa6, + 0x4e, 0x40, 0xaa, 0xb2, 0xd3, 0xbd, 0x7f, 0x75, 0x90, 0x85, 0xd0, 0x90, 0x14, 0x95, 0x35, 0x1c, + 0x7c, 0x1f, 0xe2, 0xc9, 0x8b, 0x36, 0xe9, 0x75, 0xb9, 0x50, 0x84, 0x61, 0x2c, 0x33, 0x51, 0x82, + 0x5c, 0x48, 0x51, 0x53, 0xe4, 0xa3, 0x60, 0x12, 0x6f, 0x9d, 0x90, 0x13, 0x8c, 0x35, 0x24, 0x35, + 0xcc, 0x5a, 0x0c, 0xbd, 0xe1, 0xa3, 0x60, 0xe7, 0xd8, 0xe5, 0x36, 0x83, 0xf7, 0x19, 0xfc, 0x5d, + 0x9f, 0x11, 0x39, 0xe7, 0x97, 0xde, 0xe0, 0xec, 0xa7, 0x87, 0xe2, 0x89, 0x99, 0x6b, 0x15, 0xf2, + 0x1e, 0x3b, 0xfd, 0x2d, 0xe9, 0xd0, 0x20, 0xee, 0x5f, 0x41, 0x3c, 0xef, 0x0c, 0x11, 0x6b, 0x09, + 0xbf, 0x2f, 0x3d, 0xd2, 0x8f, 0x3c, 0x54, 0x85, 0x04, 0x51, 0x54, 0x70, 0xfa, 0xad, 0xe5, 0x6e, + 0x50, 0xe4, 0x10, 0xdf, 0x4e, 0x9b, 0xba, 0x16, 0x25, 0xcc, 0xcc, 0xd3, 0xd1, 0x91, 0x8f, 0x82, + 0x61, 0xbc, 0xdb, 0x1d, 0x9a, 0x92, 0xe4, 0x23, 0xa6, 0x7f, 0x99, 0x66, 0x5b, 0x75, 0x6e, 0xfe, + 0x47, 0x9d, 0xfd, 0x6d, 0xea, 0x74, 0x53, 0xed, 0x31, 0xbe, 0x6b, 0xb1, 0xa9, 0x6a, 0x4a, 0x90, + 0x65, 0x6e, 0xf9, 0x22, 0xa3, 0x63, 0x1f, 0x05, 0x4e, 0xbc, 0x67, 0xd4, 0x93, 0x4e, 0x9c, 0x5a, + 0x8d, 0x3c, 0xc5, 0xee, 0x75, 0x97, 0x5a, 0x0a, 0x99, 0x2f, 0x81, 0x3a, 0xa6, 0xc6, 0xbd, 0x2b, + 0x81, 0xaf, 0x8c, 0xfc, 0x66, 0xe4, 0xdc, 0xba, 0xe3, 0x1c, 0xbc, 0xc5, 0xbb, 0x2f, 0xed, 0x16, + 0x4d, 0x21, 0x01, 0x41, 0x9e, 0xe1, 0xb1, 0xdd, 0x1f, 0x8a, 0xfc, 0x61, 0xb0, 0x73, 0xec, 0xf3, + 0x6b, 0xb7, 0x8a, 0x6f, 0x3e, 0x7d, 0x34, 0x6a, 0xbb, 0xc5, 0xdd, 0x54, 0xf4, 0xe4, 0x7c, 0xc5, + 0xd0, 0xc5, 0x8a, 0xa1, 0x5f, 0x2b, 0x86, 0xce, 0xd6, 0x6c, 0x70, 0xb1, 0x66, 0x83, 0x1f, 0x6b, + 0x36, 0xf8, 0xf0, 0xc0, 0x82, 0x74, 0xf6, 0x89, 0x4b, 0x15, 0x7e, 0xed, 0x77, 0x19, 0x4e, 0x2b, + 0xa1, 0xe7, 0x63, 0xf3, 0x68, 0x8f, 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, 0x7e, 0x30, 0x02, 0x6b, + 0xe9, 0x02, 0x00, 0x00, +} + +func (m *EpochInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EpochInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EpochInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CurrentEpochStartHeight != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.CurrentEpochStartHeight)) + i-- + dAtA[i] = 0x40 + } + if m.EpochCountingStarted { + i-- + if m.EpochCountingStarted { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.CurrentEpochStartTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CurrentEpochStartTime):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintGenesis(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x2a + if m.CurrentEpoch != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.CurrentEpoch)) + i-- + dAtA[i] = 0x20 + } + n2, err2 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Duration):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintGenesis(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x1a + n3, err3 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StartTime):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintGenesis(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x12 + if len(m.Identifier) > 0 { + i -= len(m.Identifier) + copy(dAtA[i:], m.Identifier) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Identifier))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GenesisState) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Epochs) > 0 { + for iNdEx := len(m.Epochs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Epochs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *EpochInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Identifier) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StartTime) + n += 1 + l + sovGenesis(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Duration) + n += 1 + l + sovGenesis(uint64(l)) + if m.CurrentEpoch != 0 { + n += 1 + sovGenesis(uint64(m.CurrentEpoch)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CurrentEpochStartTime) + n += 1 + l + sovGenesis(uint64(l)) + if m.EpochCountingStarted { + n += 2 + } + if m.CurrentEpochStartHeight != 0 { + n += 1 + sovGenesis(uint64(m.CurrentEpochStartHeight)) + } + return n +} + +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Epochs) > 0 { + for _, e := range m.Epochs { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EpochInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EpochInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EpochInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Identifier", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Identifier = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.StartTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.Duration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentEpoch", wireType) + } + m.CurrentEpoch = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CurrentEpoch |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentEpochStartTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.CurrentEpochStartTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EpochCountingStarted", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EpochCountingStarted = bool(v != 0) + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentEpochStartHeight", wireType) + } + m.CurrentEpochStartHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CurrentEpochStartHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GenesisState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Epochs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Epochs = append(m.Epochs, EpochInfo{}) + if err := m.Epochs[len(m.Epochs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/epochs/types/hooks.go b/x/epochs/types/hooks.go new file mode 100644 index 000000000000..7f7232b3d661 --- /dev/null +++ b/x/epochs/types/hooks.go @@ -0,0 +1,53 @@ +package types + +import ( + "context" + "errors" +) + +type EpochHooks interface { + // the first block whose timestamp is after the duration is counted as the end of the epoch + AfterEpochEnd(ctx context.Context, epochIdentifier string, epochNumber int64) error + // new epoch is next block of epoch end block + BeforeEpochStart(ctx context.Context, epochIdentifier string, epochNumber int64) error + // Returns the name of the module implementing epoch hook. + GetModuleName() string +} + +var _ EpochHooks = MultiEpochHooks{} + +// combine multiple gamm hooks, all hook functions are run in array sequence. +type MultiEpochHooks []EpochHooks + +// GetModuleName implements EpochHooks. +func (MultiEpochHooks) GetModuleName() string { + return ModuleName +} + +func NewMultiEpochHooks(hooks ...EpochHooks) MultiEpochHooks { + return hooks +} + +// AfterEpochEnd is called when epoch is going to be ended, epochNumber is the number of epoch that is ending. +func (h MultiEpochHooks) AfterEpochEnd(ctx context.Context, epochIdentifier string, epochNumber int64) error { + var errs error + for i := range h { + errs = errors.Join(errs, h[i].AfterEpochEnd(ctx, epochIdentifier, epochNumber)) + } + return errs +} + +// BeforeEpochStart is called when epoch is going to be started, epochNumber is the number of epoch that is starting. +func (h MultiEpochHooks) BeforeEpochStart(ctx context.Context, epochIdentifier string, epochNumber int64) error { + var errs error + for i := range h { + errs = errors.Join(errs, h[i].BeforeEpochStart(ctx, epochIdentifier, epochNumber)) + } + return errs +} + +// StakingHooksWrapper is a wrapper for modules to inject StakingHooks using depinject. +type EpochHooksWrapper struct{ EpochHooks } + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (EpochHooksWrapper) IsOnePerModuleType() {} diff --git a/x/epochs/types/hooks_test.go b/x/epochs/types/hooks_test.go new file mode 100644 index 000000000000..51f00568f0d3 --- /dev/null +++ b/x/epochs/types/hooks_test.go @@ -0,0 +1,116 @@ +package types_test + +import ( + "context" + "testing" + + "github.com/stretchr/testify/suite" + + errors "cosmossdk.io/errors" + storetypes "cosmossdk.io/store/types" + "cosmossdk.io/x/epochs/types" + + "github.com/cosmos/cosmos-sdk/testutil" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +type KeeperTestSuite struct { + suite.Suite + Ctx sdk.Context +} + +func TestKeeperTestSuite(t *testing.T) { + suite.Run(t, new(KeeperTestSuite)) +} + +func (s *KeeperTestSuite) SetupTest() { + s.Ctx = testutil.DefaultContext(storetypes.NewKVStoreKey(types.StoreKey), storetypes.NewTransientStoreKey("transient_test")) +} + +var dummyErr = errors.New("9", 9, "dummyError") + +// dummyEpochHook is a struct satisfying the epoch hook interface, +// that maintains a counter for how many times its been successfully called, +// and a boolean for whether it should panic during its execution. +type dummyEpochHook struct { + successCounter int + shouldError bool +} + +// GetModuleName implements types.EpochHooks. +func (*dummyEpochHook) GetModuleName() string { + return "dummy" +} + +func (hook *dummyEpochHook) AfterEpochEnd(ctx context.Context, epochIdentifier string, epochNumber int64) error { + if hook.shouldError { + return dummyErr + } + hook.successCounter += 1 + return nil +} + +func (hook *dummyEpochHook) BeforeEpochStart(ctx context.Context, epochIdentifier string, epochNumber int64) error { + if hook.shouldError { + return dummyErr + } + hook.successCounter += 1 + return nil +} + +func (hook *dummyEpochHook) Clone() *dummyEpochHook { + newHook := dummyEpochHook{successCounter: hook.successCounter, shouldError: hook.shouldError} + return &newHook +} + +var _ types.EpochHooks = &dummyEpochHook{} + +func (s *KeeperTestSuite) TestHooksPanicRecovery() { + errorHook := dummyEpochHook{shouldError: true} + noErrorHook := dummyEpochHook{shouldError: false} + simpleHooks := []dummyEpochHook{errorHook, noErrorHook} + + tests := []struct { + hooks []dummyEpochHook + expectedCounterValues []int + lenEvents int + expErr bool + }{ + {[]dummyEpochHook{errorHook}, []int{0}, 0, true}, + {simpleHooks, []int{0, 1, 0, 1}, 2, true}, + } + + for tcIndex, tc := range tests { + for epochActionSelector := 0; epochActionSelector < 2; epochActionSelector++ { + s.SetupTest() + hookRefs := []types.EpochHooks{} + + for _, hook := range tc.hooks { + hookRefs = append(hookRefs, hook.Clone()) + } + + hooks := types.NewMultiEpochHooks(hookRefs...) + + if epochActionSelector == 0 { + err := hooks.BeforeEpochStart(s.Ctx, "id", 0) + if tc.expErr { + s.Require().Error(err) + } else { + s.Require().NoError(err) + } + } else if epochActionSelector == 1 { + err := hooks.AfterEpochEnd(s.Ctx, "id", 0) + if tc.expErr { + s.Require().Error(err) + } else { + s.Require().NoError(err) + } + } + + for i := 0; i < len(hooks); i++ { + epochHook := hookRefs[i].(*dummyEpochHook) + s.Require().Equal(tc.expectedCounterValues[i], epochHook.successCounter, "test case index %d", tcIndex) + } + } + } +} diff --git a/x/epochs/types/identifier.go b/x/epochs/types/identifier.go new file mode 100644 index 000000000000..bf0392d0c1c5 --- /dev/null +++ b/x/epochs/types/identifier.go @@ -0,0 +1,24 @@ +package types + +import ( + "fmt" +) + +func ValidateEpochIdentifierInterface(i interface{}) error { + v, ok := i.(string) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + if err := ValidateEpochIdentifierString(v); err != nil { + return err + } + + return nil +} + +func ValidateEpochIdentifierString(s string) error { + if s == "" { + return fmt.Errorf("empty distribution epoch identifier: %+v", s) + } + return nil +} diff --git a/x/epochs/types/keys.go b/x/epochs/types/keys.go new file mode 100644 index 000000000000..27d7a7245cc1 --- /dev/null +++ b/x/epochs/types/keys.go @@ -0,0 +1,16 @@ +package types + +import ( + "cosmossdk.io/collections" +) + +const ( + // ModuleName defines the module name. + ModuleName = "epochs" + + // StoreKey defines the primary module store key. + StoreKey = ModuleName +) + +// KeyPrefixEpoch defines prefix key for storing epochs. +var KeyPrefixEpoch = collections.NewPrefix(1) diff --git a/x/epochs/types/query.pb.go b/x/epochs/types/query.pb.go new file mode 100644 index 000000000000..8c7c5bd0a4f5 --- /dev/null +++ b/x/epochs/types/query.pb.go @@ -0,0 +1,911 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/epochs/v1beta1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type QueryEpochsInfoRequest struct { +} + +func (m *QueryEpochsInfoRequest) Reset() { *m = QueryEpochsInfoRequest{} } +func (m *QueryEpochsInfoRequest) String() string { return proto.CompactTextString(m) } +func (*QueryEpochsInfoRequest) ProtoMessage() {} +func (*QueryEpochsInfoRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_dacbc976c75f2414, []int{0} +} +func (m *QueryEpochsInfoRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryEpochsInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryEpochsInfoRequest.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 *QueryEpochsInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryEpochsInfoRequest.Merge(m, src) +} +func (m *QueryEpochsInfoRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryEpochsInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryEpochsInfoRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryEpochsInfoRequest proto.InternalMessageInfo + +type QueryEpochsInfoResponse struct { + Epochs []EpochInfo `protobuf:"bytes,1,rep,name=epochs,proto3" json:"epochs"` +} + +func (m *QueryEpochsInfoResponse) Reset() { *m = QueryEpochsInfoResponse{} } +func (m *QueryEpochsInfoResponse) String() string { return proto.CompactTextString(m) } +func (*QueryEpochsInfoResponse) ProtoMessage() {} +func (*QueryEpochsInfoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_dacbc976c75f2414, []int{1} +} +func (m *QueryEpochsInfoResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryEpochsInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryEpochsInfoResponse.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 *QueryEpochsInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryEpochsInfoResponse.Merge(m, src) +} +func (m *QueryEpochsInfoResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryEpochsInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryEpochsInfoResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryEpochsInfoResponse proto.InternalMessageInfo + +func (m *QueryEpochsInfoResponse) GetEpochs() []EpochInfo { + if m != nil { + return m.Epochs + } + return nil +} + +type QueryCurrentEpochRequest struct { + Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` +} + +func (m *QueryCurrentEpochRequest) Reset() { *m = QueryCurrentEpochRequest{} } +func (m *QueryCurrentEpochRequest) String() string { return proto.CompactTextString(m) } +func (*QueryCurrentEpochRequest) ProtoMessage() {} +func (*QueryCurrentEpochRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_dacbc976c75f2414, []int{2} +} +func (m *QueryCurrentEpochRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCurrentEpochRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCurrentEpochRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCurrentEpochRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCurrentEpochRequest.Merge(m, src) +} +func (m *QueryCurrentEpochRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryCurrentEpochRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCurrentEpochRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCurrentEpochRequest proto.InternalMessageInfo + +func (m *QueryCurrentEpochRequest) GetIdentifier() string { + if m != nil { + return m.Identifier + } + return "" +} + +type QueryCurrentEpochResponse struct { + CurrentEpoch int64 `protobuf:"varint,1,opt,name=current_epoch,json=currentEpoch,proto3" json:"current_epoch,omitempty"` +} + +func (m *QueryCurrentEpochResponse) Reset() { *m = QueryCurrentEpochResponse{} } +func (m *QueryCurrentEpochResponse) String() string { return proto.CompactTextString(m) } +func (*QueryCurrentEpochResponse) ProtoMessage() {} +func (*QueryCurrentEpochResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_dacbc976c75f2414, []int{3} +} +func (m *QueryCurrentEpochResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCurrentEpochResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCurrentEpochResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCurrentEpochResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCurrentEpochResponse.Merge(m, src) +} +func (m *QueryCurrentEpochResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryCurrentEpochResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCurrentEpochResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCurrentEpochResponse proto.InternalMessageInfo + +func (m *QueryCurrentEpochResponse) GetCurrentEpoch() int64 { + if m != nil { + return m.CurrentEpoch + } + return 0 +} + +func init() { + proto.RegisterType((*QueryEpochsInfoRequest)(nil), "cosmos.epochs.v1beta1.QueryEpochsInfoRequest") + proto.RegisterType((*QueryEpochsInfoResponse)(nil), "cosmos.epochs.v1beta1.QueryEpochsInfoResponse") + proto.RegisterType((*QueryCurrentEpochRequest)(nil), "cosmos.epochs.v1beta1.QueryCurrentEpochRequest") + proto.RegisterType((*QueryCurrentEpochResponse)(nil), "cosmos.epochs.v1beta1.QueryCurrentEpochResponse") +} + +func init() { proto.RegisterFile("cosmos/epochs/v1beta1/query.proto", fileDescriptor_dacbc976c75f2414) } + +var fileDescriptor_dacbc976c75f2414 = []byte{ + // 396 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xbf, 0x4e, 0xe3, 0x30, + 0x1c, 0xc7, 0xe3, 0xf6, 0xae, 0xd2, 0xf9, 0x7a, 0x8b, 0x75, 0x7f, 0x72, 0xb9, 0xbb, 0xb4, 0x97, + 0x02, 0xaa, 0x10, 0xc4, 0xb4, 0x88, 0x85, 0x01, 0xa1, 0x22, 0x06, 0x46, 0xb2, 0xc1, 0x82, 0xd2, + 0xd4, 0x0d, 0x16, 0x60, 0xa7, 0xb1, 0x8b, 0xe8, 0xca, 0x13, 0x20, 0x78, 0x00, 0xde, 0x84, 0xb9, + 0x63, 0x25, 0x16, 0x26, 0x84, 0x5a, 0x1e, 0x04, 0xd5, 0x36, 0x55, 0x11, 0x29, 0xea, 0x96, 0xd8, + 0x9f, 0xef, 0x9f, 0xdf, 0x2f, 0x81, 0xff, 0x23, 0x2e, 0xce, 0xb8, 0xc0, 0x24, 0xe1, 0xd1, 0xb1, + 0xc0, 0xe7, 0xb5, 0x26, 0x91, 0x61, 0x0d, 0x77, 0xba, 0x24, 0xed, 0xf9, 0x49, 0xca, 0x25, 0x47, + 0x3f, 0x34, 0xe2, 0x6b, 0xc4, 0x37, 0x88, 0xf3, 0x3d, 0xe6, 0x31, 0x57, 0x04, 0x1e, 0x3f, 0x69, + 0xd8, 0xf9, 0x1b, 0x73, 0x1e, 0x9f, 0x12, 0x1c, 0x26, 0x14, 0x87, 0x8c, 0x71, 0x19, 0x4a, 0xca, + 0x99, 0x30, 0xb7, 0xcb, 0x26, 0xad, 0x19, 0x0a, 0xa2, 0x33, 0x26, 0x89, 0x49, 0x18, 0x53, 0xa6, + 0x60, 0xc3, 0x56, 0xb2, 0x9b, 0xc5, 0x84, 0x11, 0x41, 0x8d, 0xa1, 0x67, 0xc3, 0x9f, 0xfb, 0x63, + 0x9b, 0x5d, 0x05, 0xed, 0xb1, 0x36, 0x0f, 0x48, 0xa7, 0x4b, 0x84, 0xf4, 0x0e, 0xe0, 0xaf, 0x77, + 0x37, 0x22, 0xe1, 0x4c, 0x10, 0xb4, 0x05, 0x0b, 0xda, 0xd4, 0x06, 0xe5, 0x7c, 0xf5, 0x6b, 0xbd, + 0xec, 0x67, 0x4e, 0xe8, 0x2b, 0xe9, 0x58, 0xd9, 0xf8, 0xd4, 0x7f, 0x2c, 0x59, 0x81, 0x51, 0x79, + 0x9b, 0xd0, 0x56, 0xd6, 0x3b, 0xdd, 0x34, 0x25, 0x4c, 0x2a, 0xcc, 0xc4, 0x22, 0x17, 0x42, 0xda, + 0x22, 0x4c, 0xd2, 0x36, 0x25, 0xa9, 0x0d, 0xca, 0xa0, 0xfa, 0x25, 0x98, 0x3a, 0xf1, 0xb6, 0xe1, + 0xef, 0x0c, 0xad, 0x29, 0x56, 0x81, 0xdf, 0x22, 0x7d, 0x7e, 0xa4, 0xa2, 0x94, 0x3e, 0x1f, 0x14, + 0xa3, 0x29, 0xb8, 0x7e, 0x97, 0x83, 0x9f, 0x95, 0x05, 0xba, 0x06, 0x10, 0x4e, 0x3a, 0x0a, 0xb4, + 0x3a, 0x63, 0x8c, 0xec, 0x05, 0x39, 0xfe, 0xbc, 0xb8, 0x2e, 0xe7, 0x2d, 0x5e, 0xde, 0x3f, 0xdf, + 0xe4, 0x4a, 0xe8, 0x1f, 0xce, 0xfe, 0x30, 0xfa, 0x15, 0xdd, 0x02, 0x58, 0x9c, 0x1e, 0x0e, 0xe1, + 0x8f, 0x72, 0x32, 0x56, 0xe8, 0xac, 0xcd, 0x2f, 0x30, 0xd5, 0x56, 0x54, 0xb5, 0x25, 0xb4, 0x30, + 0xa3, 0xda, 0x9b, 0xa5, 0x36, 0x36, 0xfa, 0x43, 0x17, 0x0c, 0x86, 0x2e, 0x78, 0x1a, 0xba, 0xe0, + 0x6a, 0xe4, 0x5a, 0x83, 0x91, 0x6b, 0x3d, 0x8c, 0x5c, 0xeb, 0xf0, 0x8f, 0x96, 0x8b, 0xd6, 0x89, + 0x4f, 0x39, 0xbe, 0x78, 0xb5, 0x91, 0xbd, 0x84, 0x88, 0x66, 0x41, 0xfd, 0x71, 0xeb, 0x2f, 0x01, + 0x00, 0x00, 0xff, 0xff, 0x49, 0x28, 0xbd, 0xf7, 0x32, 0x03, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // EpochInfos provide running epochInfos + EpochInfos(ctx context.Context, in *QueryEpochsInfoRequest, opts ...grpc.CallOption) (*QueryEpochsInfoResponse, error) + // CurrentEpoch provide current epoch of specified identifier + CurrentEpoch(ctx context.Context, in *QueryCurrentEpochRequest, opts ...grpc.CallOption) (*QueryCurrentEpochResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) EpochInfos(ctx context.Context, in *QueryEpochsInfoRequest, opts ...grpc.CallOption) (*QueryEpochsInfoResponse, error) { + out := new(QueryEpochsInfoResponse) + err := c.cc.Invoke(ctx, "/cosmos.epochs.v1beta1.Query/EpochInfos", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) CurrentEpoch(ctx context.Context, in *QueryCurrentEpochRequest, opts ...grpc.CallOption) (*QueryCurrentEpochResponse, error) { + out := new(QueryCurrentEpochResponse) + err := c.cc.Invoke(ctx, "/cosmos.epochs.v1beta1.Query/CurrentEpoch", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // EpochInfos provide running epochInfos + EpochInfos(context.Context, *QueryEpochsInfoRequest) (*QueryEpochsInfoResponse, error) + // CurrentEpoch provide current epoch of specified identifier + CurrentEpoch(context.Context, *QueryCurrentEpochRequest) (*QueryCurrentEpochResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) EpochInfos(ctx context.Context, req *QueryEpochsInfoRequest) (*QueryEpochsInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EpochInfos not implemented") +} +func (*UnimplementedQueryServer) CurrentEpoch(ctx context.Context, req *QueryCurrentEpochRequest) (*QueryCurrentEpochResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CurrentEpoch not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_EpochInfos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryEpochsInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).EpochInfos(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.epochs.v1beta1.Query/EpochInfos", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).EpochInfos(ctx, req.(*QueryEpochsInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_CurrentEpoch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCurrentEpochRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).CurrentEpoch(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.epochs.v1beta1.Query/CurrentEpoch", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).CurrentEpoch(ctx, req.(*QueryCurrentEpochRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.epochs.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "EpochInfos", + Handler: _Query_EpochInfos_Handler, + }, + { + MethodName: "CurrentEpoch", + Handler: _Query_CurrentEpoch_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/epochs/v1beta1/query.proto", +} + +func (m *QueryEpochsInfoRequest) 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 *QueryEpochsInfoRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryEpochsInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryEpochsInfoResponse) 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 *QueryEpochsInfoResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryEpochsInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Epochs) > 0 { + for iNdEx := len(m.Epochs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Epochs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryCurrentEpochRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCurrentEpochRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCurrentEpochRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Identifier) > 0 { + i -= len(m.Identifier) + copy(dAtA[i:], m.Identifier) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Identifier))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryCurrentEpochResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCurrentEpochResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCurrentEpochResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CurrentEpoch != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.CurrentEpoch)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryEpochsInfoRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryEpochsInfoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Epochs) > 0 { + for _, e := range m.Epochs { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryCurrentEpochRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Identifier) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryCurrentEpochResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CurrentEpoch != 0 { + n += 1 + sovQuery(uint64(m.CurrentEpoch)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryEpochsInfoRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryEpochsInfoRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryEpochsInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryEpochsInfoResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryEpochsInfoResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryEpochsInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Epochs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Epochs = append(m.Epochs, EpochInfo{}) + if err := m.Epochs[len(m.Epochs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCurrentEpochRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryCurrentEpochRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCurrentEpochRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Identifier", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Identifier = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCurrentEpochResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryCurrentEpochResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCurrentEpochResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentEpoch", wireType) + } + m.CurrentEpoch = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CurrentEpoch |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/epochs/types/query.pb.gw.go b/x/epochs/types/query.pb.gw.go new file mode 100644 index 000000000000..597407d62d1a --- /dev/null +++ b/x/epochs/types/query.pb.gw.go @@ -0,0 +1,236 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: cosmos/epochs/v1beta1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_EpochInfos_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryEpochsInfoRequest + var metadata runtime.ServerMetadata + + msg, err := client.EpochInfos(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_EpochInfos_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryEpochsInfoRequest + var metadata runtime.ServerMetadata + + msg, err := server.EpochInfos(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_CurrentEpoch_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_CurrentEpoch_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCurrentEpochRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_CurrentEpoch_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CurrentEpoch(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_CurrentEpoch_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCurrentEpochRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_CurrentEpoch_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CurrentEpoch(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_EpochInfos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_EpochInfos_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_EpochInfos_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_CurrentEpoch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_CurrentEpoch_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_CurrentEpoch_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_EpochInfos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_EpochInfos_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_EpochInfos_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_CurrentEpoch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_CurrentEpoch_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_CurrentEpoch_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_EpochInfos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1}, []string{"cosmos", "epochs", "v1beta1"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_CurrentEpoch_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "epochs", "v1beta1", "current_epoch"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_EpochInfos_0 = runtime.ForwardResponseMessage + + forward_Query_CurrentEpoch_0 = runtime.ForwardResponseMessage +) diff --git a/x/evidence/CHANGELOG.md b/x/evidence/CHANGELOG.md index 7683aa73566e..f92f3d5b2e44 100644 --- a/x/evidence/CHANGELOG.md +++ b/x/evidence/CHANGELOG.md @@ -27,6 +27,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Api Breaking Changes +* [#20016](https://github.com/cosmos/cosmos-sdk/pull/20016) `NewMsgSubmitEvidence` now takes a string as argument instead of an `AccAddress`. * [#19482](https://github.com/cosmos/cosmos-sdk/pull/19482) `appmodule.Environment` is passed to `NewKeeper` instead of individual services * [#19627](https://github.com/cosmos/cosmos-sdk/pull/19627) `NewAppModule` now takes in a `codec.Codec` as its first argument diff --git a/x/evidence/go.mod b/x/evidence/go.mod index f2458d5ec112..9524a40c6ba4 100644 --- a/x/evidence/go.mod +++ b/x/evidence/go.mod @@ -10,18 +10,18 @@ require ( cosmossdk.io/errors v1.0.1 cosmossdk.io/log v1.3.1 cosmossdk.io/math v1.3.0 - cosmossdk.io/store v1.0.2 - github.com/cometbft/cometbft v0.38.6 + cosmossdk.io/store v1.1.0 + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 github.com/cosmos/cosmos-proto v1.0.0-beta.4 github.com/cosmos/cosmos-sdk v0.51.0 - github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/gogoproto v1.4.12 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.9.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 - google.golang.org/grpc v1.62.1 + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de + google.golang.org/grpc v1.63.2 google.golang.org/protobuf v1.33.0 ) @@ -55,19 +55,19 @@ require ( github.com/cosmos/cosmos-db v1.0.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.0.0 // indirect + github.com/cosmos/iavl v1.1.1 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.6.0 // indirect - github.com/emicklei/dot v1.6.0 // indirect + github.com/emicklei/dot v1.6.1 // indirect github.com/fatih/color v1.15.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect @@ -106,7 +106,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -116,14 +116,14 @@ require ( github.com/mtibben/percent v0.2.1 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.0 // indirect github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.50.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/common v0.52.2 // indirect + github.com/prometheus/procfs v0.13.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect @@ -146,17 +146,17 @@ require ( gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 // indirect go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.21.0 // indirect - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect + golang.org/x/crypto v0.22.0 // indirect + golang.org/x/exp v0.0.0-20240314144324-c7f7c6466f7f // indirect golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.22.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.18.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect diff --git a/x/evidence/go.sum b/x/evidence/go.sum index 046ebfecd550..3bca594411c1 100644 --- a/x/evidence/go.sum +++ b/x/evidence/go.sum @@ -12,8 +12,8 @@ cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= -cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= +cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= +cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -118,8 +118,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -141,10 +141,10 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= -github.com/cosmos/iavl v1.0.0 h1:bw6t0Mv/mVCJvlMTOPHWLs5uUE3BRBfVWCRelOzl+so= -github.com/cosmos/iavl v1.0.0/go.mod h1:CmTGqMnRnucjxbjduneZXT+0vPgNElYvdefjX2q9tYc= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= +github.com/cosmos/iavl v1.1.1 h1:64nTi8s3gEoGqhA8TyAWFWfz7/pg0anKzHNSc1ETc7Q= +github.com/cosmos/iavl v1.1.1/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= @@ -162,8 +162,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= @@ -189,8 +189,8 @@ github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5m github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/emicklei/dot v1.6.0 h1:vUzuoVE8ipzS7QkES4UfxdpCwdU2U97m2Pb2tQCoYRY= -github.com/emicklei/dot v1.6.0/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= +github.com/emicklei/dot v1.6.1 h1:ujpDlBkkwgWUY+qPId5IwapRW/xEoligRSYjioR6DFI= +github.com/emicklei/dot v1.6.1/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -449,8 +449,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -553,8 +553,8 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= @@ -595,16 +595,16 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= -github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= +github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -749,13 +749,13 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20240314144324-c7f7c6466f7f h1:3CW0unweImhOzd5FmYuRsD4Y4oQFKZIjAnKbjV4WIrw= +golang.org/x/exp v0.0.0-20240314144324-c7f7c6466f7f/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -799,8 +799,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -812,8 +812,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -868,12 +868,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -927,12 +927,12 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -950,8 +950,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/x/evidence/keeper/abci.go b/x/evidence/keeper/abci.go index 0ad33d81a73d..5e5321e40f3e 100644 --- a/x/evidence/keeper/abci.go +++ b/x/evidence/keeper/abci.go @@ -3,7 +3,6 @@ package keeper import ( "context" "fmt" - "time" "cosmossdk.io/core/comet" "cosmossdk.io/x/evidence/types" @@ -15,7 +14,7 @@ import ( // BeginBlocker iterates through and handles any newly discovered evidence of // misbehavior submitted by CometBFT. Currently, only equivocation is handled. func (k Keeper) BeginBlocker(ctx context.Context) error { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) + defer telemetry.ModuleMeasureSince(types.ModuleName, telemetry.Now(), telemetry.MetricKeyBeginBlocker) bi := sdk.UnwrapSDKContext(ctx).CometInfo() diff --git a/x/evidence/keeper/keeper_test.go b/x/evidence/keeper/keeper_test.go index 61f9eb0ef4a2..1784b003b945 100644 --- a/x/evidence/keeper/keeper_test.go +++ b/x/evidence/keeper/keeper_test.go @@ -10,6 +10,7 @@ import ( "github.com/stretchr/testify/suite" "cosmossdk.io/collections" + coreaddress "cosmossdk.io/core/address" "cosmossdk.io/core/header" "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" @@ -74,6 +75,9 @@ type KeeperTestSuite struct { ctx sdk.Context + addressCodec coreaddress.Codec + consAddressCodec coreaddress.ConsensusAddressCodec + evidenceKeeper keeper.Keeper bankKeeper *evidencetestutil.MockBankKeeper accountKeeper *evidencetestutil.MockAccountKeeper @@ -91,6 +95,8 @@ func (suite *KeeperTestSuite) SetupTest() { tkey := storetypes.NewTransientStoreKey("evidence_transient_store") testCtx := testutil.DefaultContextWithDB(suite.T(), key, tkey) suite.ctx = testCtx.Ctx + suite.addressCodec = address.NewBech32Codec("cosmos") + suite.consAddressCodec = address.NewBech32Codec("cosmosvalcons") ctrl := gomock.NewController(suite.T()) @@ -137,11 +143,14 @@ func (suite *KeeperTestSuite) populateEvidence(ctx sdk.Context, numEvidence int) for i := 0; i < numEvidence; i++ { pk := ed25519.GenPrivKey() + consAddr, err := suite.consAddressCodec.BytesToString(pk.PubKey().Address()) + suite.Require().NoError(err) + evidence[i] = &types.Equivocation{ Height: 11, Power: 100, Time: time.Now().UTC(), - ConsensusAddress: sdk.ConsAddress(pk.PubKey().Address().Bytes()).String(), + ConsensusAddress: consAddr, } suite.Nil(suite.evidenceKeeper.SubmitEvidence(ctx, evidence[i])) @@ -153,12 +162,14 @@ func (suite *KeeperTestSuite) populateEvidence(ctx sdk.Context, numEvidence int) func (suite *KeeperTestSuite) TestSubmitValidEvidence() { ctx := suite.ctx.WithIsCheckTx(false) pk := ed25519.GenPrivKey() + consAddr, err := suite.consAddressCodec.BytesToString(pk.PubKey().Address()) + suite.Require().NoError(err) e := &types.Equivocation{ Height: 1, Power: 100, Time: time.Now().UTC(), - ConsensusAddress: sdk.ConsAddress(pk.PubKey().Address().Bytes()).String(), + ConsensusAddress: consAddr, } suite.Nil(suite.evidenceKeeper.SubmitEvidence(ctx, e)) @@ -171,12 +182,14 @@ func (suite *KeeperTestSuite) TestSubmitValidEvidence() { func (suite *KeeperTestSuite) TestSubmitValidEvidence_Duplicate() { ctx := suite.ctx.WithIsCheckTx(false) pk := ed25519.GenPrivKey() + consAddr, err := suite.consAddressCodec.BytesToString(pk.PubKey().Address()) + suite.Require().NoError(err) e := &types.Equivocation{ Height: 1, Power: 100, Time: time.Now().UTC(), - ConsensusAddress: sdk.ConsAddress(pk.PubKey().Address().Bytes()).String(), + ConsensusAddress: consAddr, } suite.Nil(suite.evidenceKeeper.SubmitEvidence(ctx, e)) @@ -190,14 +203,16 @@ func (suite *KeeperTestSuite) TestSubmitValidEvidence_Duplicate() { func (suite *KeeperTestSuite) TestSubmitInvalidEvidence() { ctx := suite.ctx.WithIsCheckTx(false) pk := ed25519.GenPrivKey() + consAddr, err := suite.consAddressCodec.BytesToString(pk.PubKey().Address()) + suite.Require().NoError(err) e := &types.Equivocation{ Height: 0, Power: 100, Time: time.Now().UTC(), - ConsensusAddress: sdk.ConsAddress(pk.PubKey().Address().Bytes()).String(), + ConsensusAddress: consAddr, } - err := suite.evidenceKeeper.SubmitEvidence(ctx, e) + err = suite.evidenceKeeper.SubmitEvidence(ctx, e) suite.ErrorIs(err, types.ErrInvalidEvidence) res, err := suite.evidenceKeeper.Evidences.Get(ctx, e.Hash()) diff --git a/x/evidence/keeper/msg_server_test.go b/x/evidence/keeper/msg_server_test.go index f5dd4b6b5fd2..86ac3447dcaa 100644 --- a/x/evidence/keeper/msg_server_test.go +++ b/x/evidence/keeper/msg_server_test.go @@ -6,30 +6,34 @@ import ( "cosmossdk.io/x/evidence/types" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" - sdk "github.com/cosmos/cosmos-sdk/types" ) func (s *KeeperTestSuite) TestSubmitEvidence() { pk := ed25519.GenPrivKey() + consAddr, err := s.consAddressCodec.BytesToString(pk.PubKey().Address()) + s.Require().NoError(err) e := &types.Equivocation{ Height: 1, Power: 100, Time: time.Now().UTC(), - ConsensusAddress: sdk.ConsAddress(pk.PubKey().Address().Bytes()).String(), + ConsensusAddress: consAddr, } - validEvidence, err := types.NewMsgSubmitEvidence(sdk.AccAddress(valAddress), e) + accAddr, err := s.addressCodec.BytesToString(valAddress) + s.Require().NoError(err) + + validEvidence, err := types.NewMsgSubmitEvidence(accAddr, e) s.Require().NoError(err) e2 := &types.Equivocation{ Height: 0, Power: 100, Time: time.Now().UTC(), - ConsensusAddress: sdk.ConsAddress(pk.PubKey().Address().Bytes()).String(), + ConsensusAddress: consAddr, } - invalidEvidence, err := types.NewMsgSubmitEvidence(sdk.AccAddress(valAddress), e2) + invalidEvidence, err := types.NewMsgSubmitEvidence(accAddr, e2) s.Require().NoError(err) testCases := []struct { @@ -47,7 +51,7 @@ func (s *KeeperTestSuite) TestSubmitEvidence() { { name: "missing evidence", req: &types.MsgSubmitEvidence{ - Submitter: sdk.AccAddress(valAddress).String(), + Submitter: accAddr, }, expErr: true, expErrMsg: "missing evidence: invalid evidence", diff --git a/x/evidence/proto/buf.gen.gogo.yaml b/x/evidence/proto/buf.gen.gogo.yaml index 9c8ba0a4b1fd..db36231d0c82 100644 --- a/x/evidence/proto/buf.gen.gogo.yaml +++ b/x/evidence/proto/buf.gen.gogo.yaml @@ -2,7 +2,7 @@ version: v1 plugins: - name: gocosmos out: .. - opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any - name: grpc-gateway out: .. opt: logtostderr=true,allow_colon_final_segments=true diff --git a/x/evidence/types/evidence_test.go b/x/evidence/types/evidence_test.go index 6e527bf371b8..bfa20f82a98d 100644 --- a/x/evidence/types/evidence_test.go +++ b/x/evidence/types/evidence_test.go @@ -16,20 +16,24 @@ import ( ) func TestEquivocation_Valid(t *testing.T) { + consCodec := address.NewBech32Codec("cosmosvalcons") n, _ := time.Parse(time.RFC3339, "2006-01-02T15:04:05Z") - addr := sdk.ConsAddress("foo_________________") + addr, err := consCodec.BytesToString(sdk.ConsAddress("foo_________________")) + require.NoError(t, err) e := types.Equivocation{ Height: 100, Time: n, Power: 1000000, - ConsensusAddress: addr.String(), + ConsensusAddress: addr, } + consAddr, err := consCodec.BytesToString(e.GetConsensusAddress(consCodec)) + require.NoError(t, err) require.Equal(t, e.GetTotalPower(), int64(0)) require.Equal(t, e.GetValidatorPower(), e.Power) require.Equal(t, e.GetTime(), e.Time) - require.Equal(t, e.GetConsensusAddress(address.NewBech32Codec("cosmosvalcons")).String(), e.ConsensusAddress) + require.Equal(t, consAddr, e.ConsensusAddress) require.Equal(t, e.GetHeight(), e.Height) require.Equal(t, e.Route(), types.RouteEquivocation) require.Equal(t, strings.ToUpper(hex.EncodeToString(e.Hash())), "1E10F9267BEA3A9A4AB5302C2C510CC1AFD7C54E232DA5B2E3360DFAFACF7A76") @@ -39,7 +43,7 @@ func TestEquivocation_Valid(t *testing.T) { require.Equal(t, int64(0), e.GetTotalPower()) require.Equal(t, e.Power, e.GetValidatorPower()) require.Equal(t, e.Time, e.GetTime()) - require.Equal(t, e.ConsensusAddress, e.GetConsensusAddress(address.NewBech32Codec("cosmosvalcons")).String()) + require.Equal(t, e.ConsensusAddress, consAddr) require.Equal(t, e.Height, e.GetHeight()) require.Equal(t, types.RouteEquivocation, e.Route()) require.Equal(t, "1E10F9267BEA3A9A4AB5302C2C510CC1AFD7C54E232DA5B2E3360DFAFACF7A76", strings.ToUpper(hex.EncodeToString(e.Hash()))) @@ -49,7 +53,8 @@ func TestEquivocation_Valid(t *testing.T) { func TestEquivocationValidateBasic(t *testing.T) { var zeroTime time.Time - addr := sdk.ConsAddress("foo_________________") + addr, err := address.NewBech32Codec("cosmosvalcons").BytesToString(sdk.ConsAddress("foo_________________")) + require.NoError(t, err) n, _ := time.Parse(time.RFC3339, "2006-01-02T15:04:05Z") testCases := []struct { @@ -57,10 +62,10 @@ func TestEquivocationValidateBasic(t *testing.T) { e types.Equivocation expectErr bool }{ - {"valid", types.Equivocation{100, n, 1000000, addr.String()}, false}, - {"invalid time", types.Equivocation{100, zeroTime, 1000000, addr.String()}, true}, - {"invalid height", types.Equivocation{0, n, 1000000, addr.String()}, true}, - {"invalid power", types.Equivocation{100, n, 0, addr.String()}, true}, + {"valid", types.Equivocation{100, n, 1000000, addr}, false}, + {"invalid time", types.Equivocation{100, zeroTime, 1000000, addr}, true}, + {"invalid height", types.Equivocation{0, n, 1000000, addr}, true}, + {"invalid power", types.Equivocation{100, n, 0, addr}, true}, {"invalid address", types.Equivocation{100, n, 1000000, ""}, true}, } diff --git a/x/evidence/types/genesis.pb.go b/x/evidence/types/genesis.pb.go index 38de45a6dc45..dddbba2e8fb3 100644 --- a/x/evidence/types/genesis.pb.go +++ b/x/evidence/types/genesis.pb.go @@ -5,8 +5,8 @@ package types import ( fmt "fmt" - types "github.com/cosmos/cosmos-sdk/codec/types" proto "github.com/cosmos/gogoproto/proto" + any "github.com/cosmos/gogoproto/types/any" io "io" math "math" math_bits "math/bits" @@ -26,7 +26,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the evidence module's genesis state. type GenesisState struct { // evidence defines all the evidence at genesis. - Evidence []*types.Any `protobuf:"bytes,1,rep,name=evidence,proto3" json:"evidence,omitempty"` + Evidence []*any.Any `protobuf:"bytes,1,rep,name=evidence,proto3" json:"evidence,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -62,7 +62,7 @@ func (m *GenesisState) XXX_DiscardUnknown() { var xxx_messageInfo_GenesisState proto.InternalMessageInfo -func (m *GenesisState) GetEvidence() []*types.Any { +func (m *GenesisState) GetEvidence() []*any.Any { if m != nil { return m.Evidence } @@ -220,7 +220,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Evidence = append(m.Evidence, &types.Any{}) + m.Evidence = append(m.Evidence, &any.Any{}) if err := m.Evidence[len(m.Evidence)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/x/evidence/types/msgs.go b/x/evidence/types/msgs.go index 8d65aca64dbc..92df414692a5 100644 --- a/x/evidence/types/msgs.go +++ b/x/evidence/types/msgs.go @@ -18,7 +18,7 @@ var ( ) // NewMsgSubmitEvidence returns a new MsgSubmitEvidence with a signer/submitter. -func NewMsgSubmitEvidence(s sdk.AccAddress, evi exported.Evidence) (*MsgSubmitEvidence, error) { +func NewMsgSubmitEvidence(s string, evi exported.Evidence) (*MsgSubmitEvidence, error) { msg, ok := evi.(proto.Message) if !ok { return nil, fmt.Errorf("cannot proto marshal %T", evi) @@ -27,7 +27,7 @@ func NewMsgSubmitEvidence(s sdk.AccAddress, evi exported.Evidence) (*MsgSubmitEv if err != nil { return nil, err } - return &MsgSubmitEvidence{Submitter: s.String(), Evidence: any}, nil + return &MsgSubmitEvidence{Submitter: s, Evidence: any}, nil } func (m MsgSubmitEvidence) GetEvidence() exported.Evidence { diff --git a/x/evidence/types/query.pb.go b/x/evidence/types/query.pb.go index 655a454a775e..55a32ace58ac 100644 --- a/x/evidence/types/query.pb.go +++ b/x/evidence/types/query.pb.go @@ -6,10 +6,10 @@ package types import ( context "context" fmt "fmt" - types "github.com/cosmos/cosmos-sdk/codec/types" query "github.com/cosmos/cosmos-sdk/types/query" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" + any "github.com/cosmos/gogoproto/types/any" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -92,7 +92,7 @@ func (m *QueryEvidenceRequest) GetHash() string { // QueryEvidenceResponse is the response type for the Query/Evidence RPC method. type QueryEvidenceResponse struct { // evidence returns the requested evidence. - Evidence *types.Any `protobuf:"bytes,1,opt,name=evidence,proto3" json:"evidence,omitempty"` + Evidence *any.Any `protobuf:"bytes,1,opt,name=evidence,proto3" json:"evidence,omitempty"` } func (m *QueryEvidenceResponse) Reset() { *m = QueryEvidenceResponse{} } @@ -128,7 +128,7 @@ func (m *QueryEvidenceResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryEvidenceResponse proto.InternalMessageInfo -func (m *QueryEvidenceResponse) GetEvidence() *types.Any { +func (m *QueryEvidenceResponse) GetEvidence() *any.Any { if m != nil { return m.Evidence } @@ -186,7 +186,7 @@ func (m *QueryAllEvidenceRequest) GetPagination() *query.PageRequest { // method. type QueryAllEvidenceResponse struct { // evidence returns all evidences. - Evidence []*types.Any `protobuf:"bytes,1,rep,name=evidence,proto3" json:"evidence,omitempty"` + Evidence []*any.Any `protobuf:"bytes,1,rep,name=evidence,proto3" json:"evidence,omitempty"` // pagination defines the pagination in the response. Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -224,7 +224,7 @@ func (m *QueryAllEvidenceResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryAllEvidenceResponse proto.InternalMessageInfo -func (m *QueryAllEvidenceResponse) GetEvidence() []*types.Any { +func (m *QueryAllEvidenceResponse) GetEvidence() []*any.Any { if m != nil { return m.Evidence } @@ -810,7 +810,7 @@ func (m *QueryEvidenceResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Evidence == nil { - m.Evidence = &types.Any{} + m.Evidence = &any.Any{} } if err := m.Evidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -981,7 +981,7 @@ func (m *QueryAllEvidenceResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Evidence = append(m.Evidence, &types.Any{}) + m.Evidence = append(m.Evidence, &any.Any{}) if err := m.Evidence[len(m.Evidence)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/x/evidence/types/tx.pb.go b/x/evidence/types/tx.pb.go index 2b11405a2e01..b849930f3a32 100644 --- a/x/evidence/types/tx.pb.go +++ b/x/evidence/types/tx.pb.go @@ -8,12 +8,12 @@ import ( context "context" fmt "fmt" _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" + any "github.com/cosmos/gogoproto/types/any" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -39,7 +39,7 @@ type MsgSubmitEvidence struct { // submitter is the signer account address of evidence. Submitter string `protobuf:"bytes,1,opt,name=submitter,proto3" json:"submitter,omitempty"` // evidence defines the evidence of misbehavior. - Evidence *types.Any `protobuf:"bytes,2,opt,name=evidence,proto3" json:"evidence,omitempty"` + Evidence *any.Any `protobuf:"bytes,2,opt,name=evidence,proto3" json:"evidence,omitempty"` } func (m *MsgSubmitEvidence) Reset() { *m = MsgSubmitEvidence{} } @@ -475,7 +475,7 @@ func (m *MsgSubmitEvidence) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Evidence == nil { - m.Evidence = &types.Any{} + m.Evidence = &any.Any{} } if err := m.Evidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/x/feegrant/client/cli/tx_test.go b/x/feegrant/client/cli/tx_test.go index ffdbcbb584f2..16f3bc8ae6fa 100644 --- a/x/feegrant/client/cli/tx_test.go +++ b/x/feegrant/client/cli/tx_test.go @@ -15,6 +15,7 @@ import ( _ "cosmossdk.io/api/cosmos/feegrant/v1beta1" v1 "cosmossdk.io/api/cosmos/gov/v1" v1beta1 "cosmossdk.io/api/cosmos/gov/v1beta1" + "cosmossdk.io/core/address" sdkmath "cosmossdk.io/math" "cosmossdk.io/x/feegrant" "cosmossdk.io/x/feegrant/client/cli" @@ -90,7 +91,7 @@ func (s *CLITestSuite) SetupSuite() { granter := accounts[0].Address grantee := accounts[1].Address - s.createGrant(granter, grantee) + s.createGrant(granter, grantee, s.baseCtx.AddressCodec) granteeStr, err := s.baseCtx.AddressCodec.BytesToString(grantee) s.Require().NoError(err) @@ -112,7 +113,7 @@ func (s *CLITestSuite) SetupSuite() { } // createGrant creates a new basic allowance fee grant from granter to grantee. -func (s *CLITestSuite) createGrant(granter, grantee sdk.Address) { +func (s *CLITestSuite) createGrant(granter, grantee sdk.AccAddress, addressCodec address.Codec) { commonFlags := []string{ fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), @@ -121,10 +122,15 @@ func (s *CLITestSuite) createGrant(granter, grantee sdk.Address) { fee := sdk.NewCoin("stake", sdkmath.NewInt(100)) + granterAddr, err := addressCodec.BytesToString(granter) + s.Require().NoError(err) + granteeAddr, err := addressCodec.BytesToString(grantee) + s.Require().NoError(err) + args := append( []string{ - granter.String(), - grantee.String(), + granterAddr, + granteeAddr, fmt.Sprintf("--%s=%s", cli.FlagSpendLimit, fee.String()), fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), fmt.Sprintf("--%s=%s", cli.FlagExpiration, getFormattedExpiration(oneYear)), @@ -143,10 +149,12 @@ func (s *CLITestSuite) createGrant(granter, grantee sdk.Address) { func (s *CLITestSuite) TestNewCmdFeeGrant() { granter := s.accounts[0] - alreadyExistedGrantee := s.addedGrantee clientCtx := s.clientCtx - - fromAddr, fromName, _, err := client.GetFromFields(s.baseCtx, s.kr, granter.String()) + granterAddr, err := s.baseCtx.AddressCodec.BytesToString(granter) + s.Require().NoError(err) + alreadyExistedGranteeAddr, err := s.baseCtx.AddressCodec.BytesToString(s.addedGrantee) + s.Require().NoError(err) + fromAddr, fromName, _, err := client.GetFromFields(s.baseCtx, s.kr, granterAddr) s.Require().Equal(fromAddr, granter) s.Require().NoError(err) @@ -180,7 +188,7 @@ func (s *CLITestSuite) TestNewCmdFeeGrant() { "wrong grantee address", append( []string{ - granter.String(), + granterAddr, "wrong_grantee", fmt.Sprintf("--%s=%s", cli.FlagSpendLimit, "100stake"), fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), @@ -206,7 +214,7 @@ func (s *CLITestSuite) TestNewCmdFeeGrant() { "valid basic fee grant", append( []string{ - granter.String(), + granterAddr, "cosmos1nph3cfzk6trsmfxkeu943nvach5qw4vwstnvkl", fmt.Sprintf("--%s=%s", cli.FlagSpendLimit, "100stake"), fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), @@ -232,7 +240,7 @@ func (s *CLITestSuite) TestNewCmdFeeGrant() { "valid basic fee grant with amino", append( []string{ - granter.String(), + granterAddr, "cosmos1v57fx2l2rt6ehujuu99u2fw05779m5e2ux4z2h", fmt.Sprintf("--%s=%s", cli.FlagSpendLimit, "100stake"), fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), @@ -246,7 +254,7 @@ func (s *CLITestSuite) TestNewCmdFeeGrant() { "valid basic fee grant without spend limit", append( []string{ - granter.String(), + granterAddr, "cosmos17h5lzptx3ghvsuhk7wx4c4hnl7rsswxjer97em", fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), }, @@ -258,7 +266,7 @@ func (s *CLITestSuite) TestNewCmdFeeGrant() { "valid basic fee grant without expiration", append( []string{ - granter.String(), + granterAddr, "cosmos16dlc38dcqt0uralyd8hksxyrny6kaeqfjvjwp5", fmt.Sprintf("--%s=%s", cli.FlagSpendLimit, "100stake"), fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), @@ -271,7 +279,7 @@ func (s *CLITestSuite) TestNewCmdFeeGrant() { "valid basic fee grant without spend-limit and expiration", append( []string{ - granter.String(), + granterAddr, "cosmos1ku40qup9vwag4wtf8cls9mkszxfthaklxkp3c8", fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), }, @@ -283,8 +291,8 @@ func (s *CLITestSuite) TestNewCmdFeeGrant() { "try to add existed grant", append( []string{ - granter.String(), - alreadyExistedGrantee.String(), + granterAddr, + alreadyExistedGranteeAddr, fmt.Sprintf("--%s=%s", cli.FlagSpendLimit, "100stake"), fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), }, @@ -296,7 +304,7 @@ func (s *CLITestSuite) TestNewCmdFeeGrant() { "invalid number of args(periodic fee grant)", append( []string{ - granter.String(), + granterAddr, "cosmos1nph3cfzk6trsmfxkeu943nvach5qw4vwstnvkl", fmt.Sprintf("--%s=%s", cli.FlagSpendLimit, "100stake"), fmt.Sprintf("--%s=%s", cli.FlagPeriodLimit, "10stake"), @@ -311,7 +319,7 @@ func (s *CLITestSuite) TestNewCmdFeeGrant() { "period mentioned and period limit omitted, invalid periodic grant", append( []string{ - granter.String(), + granterAddr, "cosmos1nph3cfzk6trsmfxkeu943nvach5qw4vwstnvkl", fmt.Sprintf("--%s=%s", cli.FlagSpendLimit, "100stake"), fmt.Sprintf("--%s=%d", cli.FlagPeriod, tenHours), @@ -326,7 +334,7 @@ func (s *CLITestSuite) TestNewCmdFeeGrant() { "period cannot be greater than the actual expiration(periodic fee grant)", append( []string{ - granter.String(), + granterAddr, "cosmos1nph3cfzk6trsmfxkeu943nvach5qw4vwstnvkl", fmt.Sprintf("--%s=%s", cli.FlagSpendLimit, "100stake"), fmt.Sprintf("--%s=%d", cli.FlagPeriod, tenHours), @@ -342,7 +350,7 @@ func (s *CLITestSuite) TestNewCmdFeeGrant() { "valid periodic fee grant", append( []string{ - granter.String(), + granterAddr, "cosmos1w55kgcf3ltaqdy4ww49nge3klxmrdavrr6frmp", fmt.Sprintf("--%s=%s", cli.FlagSpendLimit, "100stake"), fmt.Sprintf("--%s=%d", cli.FlagPeriod, oneHour), @@ -358,7 +366,7 @@ func (s *CLITestSuite) TestNewCmdFeeGrant() { "valid periodic fee grant without spend-limit", append( []string{ - granter.String(), + granterAddr, "cosmos1vevyks8pthkscvgazc97qyfjt40m6g9xe85ry8", fmt.Sprintf("--%s=%d", cli.FlagPeriod, oneHour), fmt.Sprintf("--%s=%s", cli.FlagPeriodLimit, "10stake"), @@ -373,7 +381,7 @@ func (s *CLITestSuite) TestNewCmdFeeGrant() { "valid periodic fee grant without expiration", append( []string{ - granter.String(), + granterAddr, "cosmos14cm33pvnrv2497tyt8sp9yavhmw83nwej3m0e8", fmt.Sprintf("--%s=%s", cli.FlagSpendLimit, "100stake"), fmt.Sprintf("--%s=%d", cli.FlagPeriod, oneHour), @@ -388,7 +396,7 @@ func (s *CLITestSuite) TestNewCmdFeeGrant() { "valid periodic fee grant without spend-limit and expiration", append( []string{ - granter.String(), + granterAddr, "cosmos12nyk4pcf4arshznkpz882e4l4ts0lt0ap8ce54", fmt.Sprintf("--%s=%d", cli.FlagPeriod, oneHour), fmt.Sprintf("--%s=%s", cli.FlagPeriodLimit, "10stake"), @@ -402,7 +410,7 @@ func (s *CLITestSuite) TestNewCmdFeeGrant() { "invalid expiration", append( []string{ - granter.String(), + granterAddr, "cosmos1vevyks8pthkscvgazc97qyfjt40m6g9xe85ry8", fmt.Sprintf("--%s=%d", cli.FlagPeriod, oneHour), fmt.Sprintf("--%s=%s", cli.FlagPeriodLimit, "10stake"), @@ -435,6 +443,8 @@ func (s *CLITestSuite) TestNewCmdFeeGrant() { func (s *CLITestSuite) TestTxWithFeeGrant() { clientCtx := s.clientCtx granter := s.addedGranter + granterAddr, err := s.baseCtx.AddressCodec.BytesToString(granter) + s.Require().NoError(err) // creating an account manually (This account won't be exist in state) k, _, err := s.baseCtx.Keyring.NewMnemonic("grantee", keyring.English, sdk.FullFundraiserPath, keyring.DefaultBIP39Passphrase, hd.Secp256k1) @@ -442,6 +452,8 @@ func (s *CLITestSuite) TestTxWithFeeGrant() { pub, err := k.GetPubKey() s.Require().NoError(err) grantee := sdk.AccAddress(pub.Address()) + granteeAddr, err := s.baseCtx.AddressCodec.BytesToString(grantee) + s.Require().NoError(err) commonFlags := []string{ fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), @@ -453,8 +465,8 @@ func (s *CLITestSuite) TestTxWithFeeGrant() { args := append( []string{ - granter.String(), - grantee.String(), + granterAddr, + granteeAddr, fmt.Sprintf("--%s=%s", cli.FlagSpendLimit, fee.String()), fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), fmt.Sprintf("--%s=%s", cli.FlagExpiration, getFormattedExpiration(oneYear)), @@ -477,30 +489,30 @@ func (s *CLITestSuite) TestTxWithFeeGrant() { }{ { name: "granted fee allowance for an account which is not in state and creating any tx with it by using --fee-granter shouldn't fail", - from: grantee.String(), - flags: []string{fmt.Sprintf("--%s=%s", flags.FlagFeeGranter, granter.String())}, + from: granteeAddr, + flags: []string{fmt.Sprintf("--%s=%s", flags.FlagFeeGranter, granterAddr)}, }, { name: "--fee-payer should also sign the tx (direct)", - from: grantee.String(), - flags: []string{fmt.Sprintf("--%s=%s", flags.FlagFeePayer, granter.String())}, + from: granteeAddr, + flags: []string{fmt.Sprintf("--%s=%s", flags.FlagFeePayer, granterAddr)}, expErrCode: 4, }, { name: "--fee-payer should also sign the tx (amino-json)", - from: grantee.String(), + from: granteeAddr, flags: []string{ - fmt.Sprintf("--%s=%s", flags.FlagFeePayer, granter.String()), + fmt.Sprintf("--%s=%s", flags.FlagFeePayer, granterAddr), fmt.Sprintf("--%s=%s", flags.FlagSignMode, flags.SignModeLegacyAminoJSON), }, expErrCode: 4, }, { name: "use --fee-payer and --fee-granter together works", - from: grantee.String(), + from: granteeAddr, flags: []string{ - fmt.Sprintf("--%s=%s", flags.FlagFeePayer, grantee.String()), - fmt.Sprintf("--%s=%s", flags.FlagFeeGranter, granter.String()), + fmt.Sprintf("--%s=%s", flags.FlagFeePayer, granteeAddr), + fmt.Sprintf("--%s=%s", flags.FlagFeeGranter, granterAddr), }, }, } @@ -547,11 +559,15 @@ func (s *CLITestSuite) msgSubmitLegacyProposal(clientCtx client.Context, from, t func (s *CLITestSuite) TestFilteredFeeAllowance() { granter := s.addedGranter + granterAddr, err := s.baseCtx.AddressCodec.BytesToString(granter) + s.Require().NoError(err) k, _, err := s.baseCtx.Keyring.NewMnemonic("grantee1", keyring.English, sdk.FullFundraiserPath, keyring.DefaultBIP39Passphrase, hd.Secp256k1) s.Require().NoError(err) pub, err := k.GetPubKey() s.Require().NoError(err) grantee := sdk.AccAddress(pub.Address()) + granteeAddr, err := s.baseCtx.AddressCodec.BytesToString(grantee) + s.Require().NoError(err) clientCtx := s.clientCtx commonFlags := []string{ @@ -585,7 +601,7 @@ func (s *CLITestSuite) TestFilteredFeeAllowance() { "invalid grantee address", append( []string{ - granter.String(), + granterAddr, "not an address", fmt.Sprintf("--%s=%s", cli.FlagAllowedMsgs, allowMsgs), fmt.Sprintf("--%s=%s", cli.FlagSpendLimit, spendLimit.String()), @@ -599,8 +615,8 @@ func (s *CLITestSuite) TestFilteredFeeAllowance() { "valid filter fee grant", append( []string{ - granter.String(), - grantee.String(), + granterAddr, + granteeAddr, fmt.Sprintf("--%s=%s", cli.FlagAllowedMsgs, allowMsgs), fmt.Sprintf("--%s=%s", cli.FlagSpendLimit, spendLimit.String()), fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), @@ -636,9 +652,9 @@ func (s *CLITestSuite) TestFilteredFeeAllowance() { { "valid proposal tx", func() error { - return s.msgSubmitLegacyProposal(s.baseCtx, grantee.String(), + return s.msgSubmitLegacyProposal(s.baseCtx, granteeAddr, "Text Proposal", "No desc", "Text", - fmt.Sprintf("--%s=%s", flags.FlagFeeGranter, granter.String()), + fmt.Sprintf("--%s=%s", flags.FlagFeeGranter, granterAddr), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(100))).String()), ) }, @@ -646,8 +662,8 @@ func (s *CLITestSuite) TestFilteredFeeAllowance() { { "valid weighted_vote tx", func() error { - return s.msgVote(s.baseCtx, grantee.String(), "0", "yes", - fmt.Sprintf("--%s=%s", flags.FlagFeeGranter, granter.String()), + return s.msgVote(s.baseCtx, granteeAddr, "0", "yes", + fmt.Sprintf("--%s=%s", flags.FlagFeeGranter, granterAddr), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(100))).String()), ) }, @@ -657,7 +673,7 @@ func (s *CLITestSuite) TestFilteredFeeAllowance() { func() error { args := append( []string{ - grantee.String(), + granteeAddr, "cosmos14cm33pvnrv2497tyt8sp9yavhmw83nwej3m0e8", fmt.Sprintf("--%s=%s", cli.FlagSpendLimit, "100stake"), fmt.Sprintf("--%s=%s", flags.FlagFeeGranter, granter), diff --git a/x/feegrant/feegrant.pb.go b/x/feegrant/feegrant.pb.go index b30f725c8a7f..6c0a332334d8 100644 --- a/x/feegrant/feegrant.pb.go +++ b/x/feegrant/feegrant.pb.go @@ -6,13 +6,13 @@ package feegrant import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" - types1 "github.com/cosmos/cosmos-sdk/codec/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + any "github.com/cosmos/gogoproto/types/any" _ "google.golang.org/protobuf/types/known/durationpb" _ "google.golang.org/protobuf/types/known/timestamppb" io "io" @@ -181,7 +181,7 @@ func (m *PeriodicAllowance) GetPeriodReset() time.Time { // AllowedMsgAllowance creates allowance only for specified message types. type AllowedMsgAllowance struct { // allowance can be any of basic and periodic fee allowance. - Allowance *types1.Any `protobuf:"bytes,1,opt,name=allowance,proto3" json:"allowance,omitempty"` + Allowance *any.Any `protobuf:"bytes,1,opt,name=allowance,proto3" json:"allowance,omitempty"` // allowed_messages are the messages for which the grantee has the access. AllowedMessages []string `protobuf:"bytes,2,rep,name=allowed_messages,json=allowedMessages,proto3" json:"allowed_messages,omitempty"` } @@ -226,7 +226,7 @@ type Grant struct { // grantee is the address of the user being granted an allowance of another user's funds. Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"` // allowance can be any of basic, periodic, allowed fee allowance. - Allowance *types1.Any `protobuf:"bytes,3,opt,name=allowance,proto3" json:"allowance,omitempty"` + Allowance *any.Any `protobuf:"bytes,3,opt,name=allowance,proto3" json:"allowance,omitempty"` } func (m *Grant) Reset() { *m = Grant{} } @@ -276,7 +276,7 @@ func (m *Grant) GetGrantee() string { return "" } -func (m *Grant) GetAllowance() *types1.Any { +func (m *Grant) GetAllowance() *any.Any { if m != nil { return m.Allowance } @@ -1056,7 +1056,7 @@ func (m *AllowedMsgAllowance) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Allowance == nil { - m.Allowance = &types1.Any{} + m.Allowance = &any.Any{} } if err := m.Allowance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1238,7 +1238,7 @@ func (m *Grant) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Allowance == nil { - m.Allowance = &types1.Any{} + m.Allowance = &any.Any{} } if err := m.Allowance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/x/feegrant/go.mod b/x/feegrant/go.mod index 7f341c716a56..6047d6c97250 100644 --- a/x/feegrant/go.mod +++ b/x/feegrant/go.mod @@ -15,17 +15,17 @@ require ( cosmossdk.io/x/bank v0.0.0-00010101000000-000000000000 cosmossdk.io/x/gov v0.0.0-20230925135524-a1bc045b3190 github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.6 + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 github.com/cosmos/cosmos-proto v1.0.0-beta.4 github.com/cosmos/cosmos-sdk v0.51.0 - github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/gogoproto v1.4.12 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.9.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 - google.golang.org/grpc v1.62.1 + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de + google.golang.org/grpc v1.63.2 google.golang.org/protobuf v1.33.0 gotest.tools/v3 v3.5.1 ) @@ -64,7 +64,7 @@ require ( github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect @@ -110,7 +110,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect @@ -121,13 +121,13 @@ require ( github.com/mtibben/percent v0.2.1 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.0 // indirect github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.50.0 // indirect + github.com/prometheus/common v0.52.2 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect @@ -151,17 +151,17 @@ require ( gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 // indirect go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.21.0 // indirect + golang.org/x/crypto v0.22.0 // indirect golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.22.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.18.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect diff --git a/x/feegrant/go.sum b/x/feegrant/go.sum index 1746f5fcaed9..1eb9acf193d8 100644 --- a/x/feegrant/go.sum +++ b/x/feegrant/go.sum @@ -126,8 +126,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -149,8 +149,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/cosmos/iavl v1.0.0 h1:bw6t0Mv/mVCJvlMTOPHWLs5uUE3BRBfVWCRelOzl+so= github.com/cosmos/iavl v1.0.0/go.mod h1:CmTGqMnRnucjxbjduneZXT+0vPgNElYvdefjX2q9tYc= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= @@ -170,8 +170,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= @@ -457,8 +457,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -563,8 +563,8 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= @@ -605,8 +605,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= -github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -759,8 +759,8 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= @@ -809,8 +809,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -822,8 +822,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -879,12 +879,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -938,12 +938,12 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -961,8 +961,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/x/feegrant/keeper/keeper.go b/x/feegrant/keeper/keeper.go index 02492e9d3d4c..d3a6e8a57e70 100644 --- a/x/feegrant/keeper/keeper.go +++ b/x/feegrant/keeper/keeper.go @@ -302,6 +302,7 @@ func (k Keeper) RemoveExpiredAllowances(ctx context.Context, limit int) error { rng := collections.NewPrefixUntilTripleRange[time.Time, sdk.AccAddress, sdk.AccAddress](exp) count := 0 + keysToRemove := []collections.Triple[time.Time, sdk.AccAddress, sdk.AccAddress]{} err := k.FeeAllowanceQueue.Walk(ctx, rng, func(key collections.Triple[time.Time, sdk.AccAddress, sdk.AccAddress], value bool) (stop bool, err error) { grantee, granter := key.K2(), key.K3() @@ -309,9 +310,7 @@ func (k Keeper) RemoveExpiredAllowances(ctx context.Context, limit int) error { return true, err } - if err := k.FeeAllowanceQueue.Remove(ctx, key); err != nil { - return true, err - } + keysToRemove = append(keysToRemove, key) // limit the amount of iterations to avoid taking too much time count++ @@ -325,5 +324,11 @@ func (k Keeper) RemoveExpiredAllowances(ctx context.Context, limit int) error { return err } + for _, key := range keysToRemove { + if err := k.FeeAllowanceQueue.Remove(ctx, key); err != nil { + return err + } + } + return nil } diff --git a/x/feegrant/proto/buf.gen.gogo.yaml b/x/feegrant/proto/buf.gen.gogo.yaml index 9c8ba0a4b1fd..db36231d0c82 100644 --- a/x/feegrant/proto/buf.gen.gogo.yaml +++ b/x/feegrant/proto/buf.gen.gogo.yaml @@ -2,7 +2,7 @@ version: v1 plugins: - name: gocosmos out: .. - opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any - name: grpc-gateway out: .. opt: logtostderr=true,allow_colon_final_segments=true diff --git a/x/feegrant/proto/cosmos/feegrant/v1beta1/query.proto b/x/feegrant/proto/cosmos/feegrant/v1beta1/query.proto index 591537acd9ef..b06c774139f7 100644 --- a/x/feegrant/proto/cosmos/feegrant/v1beta1/query.proto +++ b/x/feegrant/proto/cosmos/feegrant/v1beta1/query.proto @@ -12,7 +12,7 @@ option go_package = "cosmossdk.io/x/feegrant"; // Query defines the gRPC querier service. service Query { - // Allowance returns granted allwance to the grantee by the granter. + // Allowance returns granted allowance to the grantee by the granter. rpc Allowance(QueryAllowanceRequest) returns (QueryAllowanceResponse) { option (google.api.http).get = "/cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}"; } diff --git a/x/feegrant/query.pb.go b/x/feegrant/query.pb.go index a4673fc23302..675bcf038f46 100644 --- a/x/feegrant/query.pb.go +++ b/x/feegrant/query.pb.go @@ -415,7 +415,7 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type QueryClient interface { - // Allowance returns granted allwance to the grantee by the granter. + // Allowance returns granted allowance to the grantee by the granter. Allowance(ctx context.Context, in *QueryAllowanceRequest, opts ...grpc.CallOption) (*QueryAllowanceResponse, error) // Allowances returns all the grants for the given grantee address. Allowances(ctx context.Context, in *QueryAllowancesRequest, opts ...grpc.CallOption) (*QueryAllowancesResponse, error) @@ -462,7 +462,7 @@ func (c *queryClient) AllowancesByGranter(ctx context.Context, in *QueryAllowanc // QueryServer is the server API for Query service. type QueryServer interface { - // Allowance returns granted allwance to the grantee by the granter. + // Allowance returns granted allowance to the grantee by the granter. Allowance(context.Context, *QueryAllowanceRequest) (*QueryAllowanceResponse, error) // Allowances returns all the grants for the given grantee address. Allowances(context.Context, *QueryAllowancesRequest) (*QueryAllowancesResponse, error) diff --git a/x/feegrant/simulation/genesis.go b/x/feegrant/simulation/genesis.go index 14066e803326..289126f1fc85 100644 --- a/x/feegrant/simulation/genesis.go +++ b/x/feegrant/simulation/genesis.go @@ -4,6 +4,7 @@ import ( "math/rand" "time" + "cosmossdk.io/core/address" "cosmossdk.io/math" "cosmossdk.io/x/feegrant" @@ -13,14 +14,20 @@ import ( ) // genFeeGrants returns a slice of randomly generated allowances. -func genFeeGrants(r *rand.Rand, accounts []simtypes.Account) []feegrant.Grant { +func genFeeGrants(r *rand.Rand, accounts []simtypes.Account, addressCodec address.Codec) ([]feegrant.Grant, error) { allowances := make([]feegrant.Grant, len(accounts)-1) for i := 0; i < len(accounts)-1; i++ { - granter := accounts[i].Address - grantee := accounts[i+1].Address - allowances[i] = generateRandomAllowances(granter.String(), grantee.String(), r) // TODO decouple this from call .String() + granter, err := addressCodec.BytesToString(accounts[i].Address) + if err != nil { + return allowances, err + } + grantee, err := addressCodec.BytesToString(accounts[i+1].Address) + if err != nil { + return allowances, err + } + allowances[i] = generateRandomAllowances(granter, grantee, r) } - return allowances + return allowances, nil } func generateRandomAllowances(granter, grantee string, r *rand.Rand) feegrant.Grant { @@ -63,11 +70,15 @@ func generateRandomAllowances(granter, grantee string, r *rand.Rand) feegrant.Gr // RandomizedGenState generates a random GenesisState for feegrant func RandomizedGenState(simState *module.SimulationState) { var feegrants []feegrant.Grant + var err error simState.AppParams.GetOrGenerate( "feegrant", &feegrants, simState.Rand, - func(r *rand.Rand) { feegrants = genFeeGrants(r, simState.Accounts) }, + func(r *rand.Rand) { feegrants, err = genFeeGrants(r, simState.Accounts, simState.AddressCodec) }, ) + if err != nil { + panic(err) + } feegrantGenesis := feegrant.NewGenesisState(feegrants) bz, err := simState.Cdc.MarshalJSON(feegrantGenesis) diff --git a/x/feegrant/tx.pb.go b/x/feegrant/tx.pb.go index 7646b28741a1..1adcff142ba6 100644 --- a/x/feegrant/tx.pb.go +++ b/x/feegrant/tx.pb.go @@ -7,11 +7,11 @@ import ( context "context" fmt "fmt" _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" + any "github.com/cosmos/gogoproto/types/any" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -39,7 +39,7 @@ type MsgGrantAllowance struct { // grantee is the address of the user being granted an allowance of another user's funds. Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"` // allowance can be any of basic, periodic, allowed fee allowance. - Allowance *types.Any `protobuf:"bytes,3,opt,name=allowance,proto3" json:"allowance,omitempty"` + Allowance *any.Any `protobuf:"bytes,3,opt,name=allowance,proto3" json:"allowance,omitempty"` } func (m *MsgGrantAllowance) Reset() { *m = MsgGrantAllowance{} } @@ -89,7 +89,7 @@ func (m *MsgGrantAllowance) GetGrantee() string { return "" } -func (m *MsgGrantAllowance) GetAllowance() *types.Any { +func (m *MsgGrantAllowance) GetAllowance() *any.Any { if m != nil { return m.Allowance } @@ -925,7 +925,7 @@ func (m *MsgGrantAllowance) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Allowance == nil { - m.Allowance = &types.Any{} + m.Allowance = &any.Any{} } if err := m.Allowance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/x/genutil/client/cli/collect.go b/x/genutil/client/cli/collect.go index 7a029f10b2e2..3983a859b18e 100644 --- a/x/genutil/client/cli/collect.go +++ b/x/genutil/client/cli/collect.go @@ -6,7 +6,6 @@ import ( "github.com/spf13/cobra" - "cosmossdk.io/core/address" "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/client" @@ -18,7 +17,7 @@ import ( const flagGenTxDir = "gentx-dir" // CollectGenTxsCmd - return the cobra command to collect genesis transactions -func CollectGenTxsCmd(genBalIterator types.GenesisBalancesIterator, validator types.MessageValidator, valAddrCodec address.ValidatorAddressCodec) *cobra.Command { +func CollectGenTxsCmd(genBalIterator types.GenesisBalancesIterator, validator types.MessageValidator) *cobra.Command { cmd := &cobra.Command{ Use: "collect-gentxs", Short: "Collect genesis txs and output a genesis.json file", @@ -48,7 +47,7 @@ func CollectGenTxsCmd(genBalIterator types.GenesisBalancesIterator, validator ty toPrint := newPrintInfo(config.Moniker, appGenesis.ChainID, nodeID, genTxsDir, json.RawMessage("")) initCfg := types.NewInitConfig(appGenesis.ChainID, genTxsDir, nodeID, valPubKey) - appMessage, err := genutil.GenAppStateFromConfig(cdc, clientCtx.TxConfig, config, initCfg, appGenesis, genBalIterator, validator, valAddrCodec) + appMessage, err := genutil.GenAppStateFromConfig(cdc, clientCtx.TxConfig, config, initCfg, appGenesis, genBalIterator, validator, clientCtx.ValidatorAddressCodec, clientCtx.AddressCodec) if err != nil { return errors.Wrap(err, "failed to get genesis app state from config") } diff --git a/x/genutil/client/cli/commands.go b/x/genutil/client/cli/commands.go index 9bb9800d7224..5e1f671b77fc 100644 --- a/x/genutil/client/cli/commands.go +++ b/x/genutil/client/cli/commands.go @@ -32,7 +32,7 @@ func CommandsWithCustomMigrationMap(txConfig client.TxConfig, mm *module.Manager cmd.AddCommand( GenTxCmd(mm, txConfig, banktypes.GenesisBalancesIterator{}, txConfig.SigningContext().ValidatorAddressCodec()), MigrateGenesisCmd(migrationMap), - CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, gentxModule.GenTxValidator(), txConfig.SigningContext().ValidatorAddressCodec()), + CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, gentxModule.GenTxValidator()), ValidateGenesisCmd(mm), AddGenesisAccountCmd(txConfig.SigningContext().AddressCodec()), ExportCmd(appExport), diff --git a/x/genutil/client/cli/genaccount.go b/x/genutil/client/cli/genaccount.go index 2dfe5e7c7d0b..94bb3ec6f0e9 100644 --- a/x/genutil/client/cli/genaccount.go +++ b/x/genutil/client/cli/genaccount.go @@ -74,7 +74,7 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa vestingAmtStr, _ := cmd.Flags().GetString(flagVestingAmt) moduleNameStr, _ := cmd.Flags().GetString(flagModuleName) - return genutil.AddGenesisAccount(clientCtx.Codec, addr, appendflag, config.GenesisFile(), args[1], vestingAmtStr, vestingStart, vestingEnd, moduleNameStr) + return genutil.AddGenesisAccount(clientCtx.Codec, clientCtx.AddressCodec, addr, appendflag, config.GenesisFile(), args[1], vestingAmtStr, vestingStart, vestingEnd, moduleNameStr) }, } diff --git a/x/genutil/client/cli/genaccount_test.go b/x/genutil/client/cli/genaccount_test.go index f269ca7d6537..51cb42a3ac0e 100644 --- a/x/genutil/client/cli/genaccount_test.go +++ b/x/genutil/client/cli/genaccount_test.go @@ -25,6 +25,10 @@ import ( func TestAddGenesisAccountCmd(t *testing.T) { _, _, addr1 := testdata.KeyTestPubAddr() + ac := codectestutil.CodecOptions{}.GetAddressCodec() + addr1Str, err := ac.BytesToString(addr1) + require.NoError(t, err) + tests := []struct { name string addr string @@ -41,14 +45,14 @@ func TestAddGenesisAccountCmd(t *testing.T) { }, { name: "valid address", - addr: addr1.String(), + addr: addr1Str, denom: "1000atom", withKeyring: false, expectErr: false, }, { name: "multiple denoms", - addr: addr1.String(), + addr: addr1Str, denom: "1000atom, 2000stake", withKeyring: false, expectErr: false, @@ -75,7 +79,7 @@ func TestAddGenesisAccountCmd(t *testing.T) { require.NoError(t, err) serverCtx := server.NewContext(viper.New(), cfg, logger) - clientCtx := client.Context{}.WithCodec(appCodec).WithHomeDir(home) + clientCtx := client.Context{}.WithCodec(appCodec).WithHomeDir(home).WithAddressCodec(ac) if tc.withKeyring { path := hd.CreateHDPath(118, 0, 0).String() diff --git a/x/genutil/client/cli/gentx.go b/x/genutil/client/cli/gentx.go index 2c44794c23f2..533c1ae0dfde 100644 --- a/x/genutil/client/cli/gentx.go +++ b/x/genutil/client/cli/gentx.go @@ -122,7 +122,11 @@ $ %s gentx my-key-name 1000000stake --home=/path/to/home/dir --keyring-backend=o if err != nil { return err } - err = genutil.ValidateAccountInGenesis(genesisState, genBalIterator, addr, coins, cdc) + strAddr, err := clientCtx.AddressCodec.BytesToString(addr) + if err != nil { + return err + } + err = genutil.ValidateAccountInGenesis(genesisState, genBalIterator, strAddr, coins, cdc) if err != nil { return errors.Wrap(err, "failed to validate account in genesis") } diff --git a/x/genutil/collect.go b/x/genutil/collect.go index f57c0202d19f..9881ade81f57 100644 --- a/x/genutil/collect.go +++ b/x/genutil/collect.go @@ -25,11 +25,11 @@ import ( // GenAppStateFromConfig gets the genesis app state from the config func GenAppStateFromConfig(cdc codec.JSONCodec, txEncodingConfig client.TxEncodingConfig, config *cfg.Config, initCfg types.InitConfig, genesis *types.AppGenesis, genBalIterator types.GenesisBalancesIterator, - validator types.MessageValidator, valAddrCodec address.ValidatorAddressCodec, + validator types.MessageValidator, valAddrCodec address.ValidatorAddressCodec, addressCodec address.Codec, ) (appState json.RawMessage, err error) { // process genesis transactions, else create default genesis.json appGenTxs, persistentPeers, err := CollectTxs( - cdc, txEncodingConfig.TxJSONDecoder(), config.Moniker, initCfg.GenTxsDir, genesis, genBalIterator, validator, valAddrCodec) + cdc, txEncodingConfig.TxJSONDecoder(), config.Moniker, initCfg.GenTxsDir, genesis, genBalIterator, validator, valAddrCodec, addressCodec) if err != nil { return appState, err } @@ -68,7 +68,7 @@ func GenAppStateFromConfig(cdc codec.JSONCodec, txEncodingConfig client.TxEncodi // the list of appGenTxs, and persistent peers required to generate genesis.json. func CollectTxs(cdc codec.JSONCodec, txJSONDecoder sdk.TxDecoder, moniker, genTxsDir string, genesis *types.AppGenesis, genBalIterator types.GenesisBalancesIterator, - validator types.MessageValidator, valAddrCodec address.ValidatorAddressCodec, + validator types.MessageValidator, valAddrCodec address.ValidatorAddressCodec, addressCodec address.Codec, ) (appGenTxs []sdk.Tx, persistentPeers string, err error) { // prepare a map of all balances in genesis state to then validate // against the validators addresses @@ -142,7 +142,10 @@ func CollectTxs(cdc codec.JSONCodec, txJSONDecoder sdk.TxDecoder, moniker, genTx return appGenTxs, persistentPeers, err } - valAccAddr := sdk.AccAddress(valAddr).String() + valAccAddr, err := addressCodec.BytesToString(valAddr) + if err != nil { + return appGenTxs, persistentPeers, err + } delBal, delOk := balancesMap[valAccAddr] if !delOk { @@ -158,7 +161,7 @@ func CollectTxs(cdc codec.JSONCodec, txJSONDecoder sdk.TxDecoder, moniker, genTx if !valOk { _, file, no, ok := runtime.Caller(1) if ok { - fmt.Printf("CollectTxs-2, called from %s#%d - %s\n", file, no, sdk.AccAddress(msg.ValidatorAddress).String()) + fmt.Printf("CollectTxs-2, called from %s#%d - %s\n", file, no, valAccAddr) } return appGenTxs, persistentPeers, fmt.Errorf("account %s balance not in genesis state: %+v", valAddr, balancesMap) } diff --git a/x/genutil/collect_test.go b/x/genutil/collect_test.go index 35bc1ae2c3d8..fd8295728ee5 100644 --- a/x/genutil/collect_test.go +++ b/x/genutil/collect_test.go @@ -62,7 +62,7 @@ func TestCollectTxsHandlesDirectories(t *testing.T) { dnc := &doNothingUnmarshalJSON{cdc} if _, _, err := genutil.CollectTxs(dnc, txDecoder, "foo", testDir, genesis, balItr, types.DefaultMessageValidator, - addresscodec.NewBech32Codec("cosmosvaloper")); err != nil { + addresscodec.NewBech32Codec("cosmosvaloper"), addresscodec.NewBech32Codec("cosmos")); err != nil { t.Fatal(err) } } diff --git a/x/genutil/genaccounts.go b/x/genutil/genaccounts.go index 5ece341a47de..4c09ac71b1c5 100644 --- a/x/genutil/genaccounts.go +++ b/x/genutil/genaccounts.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" + "cosmossdk.io/core/address" authtypes "cosmossdk.io/x/auth/types" authvesting "cosmossdk.io/x/auth/vesting/types" banktypes "cosmossdk.io/x/bank/types" @@ -23,12 +24,18 @@ import ( // and coins to be appended to the account already in the genesis.json file. func AddGenesisAccount( cdc codec.Codec, + addressCodec address.Codec, accAddr sdk.AccAddress, appendAcct bool, genesisFileURL, amountStr, vestingAmtStr string, vestingStart, vestingEnd int64, moduleName string, ) error { + addr, err := addressCodec.BytesToString(accAddr) + if err != nil { + return err + } + coins, err := sdk.ParseCoinsNormalized(amountStr) if err != nil { return fmt.Errorf("failed to parse coins: %w", err) @@ -42,7 +49,7 @@ func AddGenesisAccount( // create concrete account type based on input parameters var genAccount authtypes.GenesisAccount - balances := banktypes.Balance{Address: accAddr.String(), Coins: coins.Sort()} + balances := banktypes.Balance{Address: addr, Coins: coins.Sort()} baseAccount := authtypes.NewBaseAccount(accAddr, nil, 0, 0) if !vestingAmt.IsZero() { @@ -96,12 +103,12 @@ func AddGenesisAccount( genesisB := banktypes.GetGenesisStateFromAppState(cdc, appState) for idx, acc := range genesisB.Balances { - if acc.Address != accAddr.String() { + if acc.Address != addr { continue } updatedCoins := acc.Coins.Add(coins...) - bankGenState.Balances[idx] = banktypes.Balance{Address: accAddr.String(), Coins: updatedCoins.Sort()} + bankGenState.Balances[idx] = banktypes.Balance{Address: addr, Coins: updatedCoins.Sort()} break } } else { @@ -124,8 +131,10 @@ func AddGenesisAccount( bankGenState.Balances = append(bankGenState.Balances, balances) } - bankGenState.Balances = banktypes.SanitizeGenesisBalances(bankGenState.Balances) - + bankGenState.Balances, err = banktypes.SanitizeGenesisBalances(bankGenState.Balances, addressCodec) + if err != nil { + return fmt.Errorf("failed to sanitize genesis balance: %w", err) + } bankGenState.Supply = bankGenState.Supply.Add(balances.Coins...) bankGenStateBz, err := cdc.MarshalJSON(bankGenState) diff --git a/x/genutil/gentx.go b/x/genutil/gentx.go index bbb1afeef5de..714e68b2dd08 100644 --- a/x/genutil/gentx.go +++ b/x/genutil/gentx.go @@ -41,7 +41,7 @@ func SetGenTxsInAppGenesisState( // balance in the set of genesis accounts. func ValidateAccountInGenesis( appGenesisState map[string]json.RawMessage, genBalIterator types.GenesisBalancesIterator, - addr sdk.Address, coins sdk.Coins, cdc codec.JSONCodec, + addr string, coins sdk.Coins, cdc codec.JSONCodec, ) error { var stakingData stakingtypes.GenesisState cdc.MustUnmarshalJSON(appGenesisState[stakingtypes.ModuleName], &stakingData) @@ -56,7 +56,7 @@ func ValidateAccountInGenesis( accAddress := bal.GetAddress() accCoins := bal.GetCoins() // ensure that account is in genesis - if strings.EqualFold(accAddress, addr.String()) { + if strings.EqualFold(accAddress, addr) { // ensure account contains enough funds of default bond denom if coins.AmountOf(bondDenom).GT(accCoins.AmountOf(bondDenom)) { err = fmt.Errorf( diff --git a/x/genutil/gentx_test.go b/x/genutil/gentx_test.go index 862e19042364..324ce95c6093 100644 --- a/x/genutil/gentx_test.go +++ b/x/genutil/gentx_test.go @@ -53,6 +53,7 @@ type GenTxTestSuite struct { } func (suite *GenTxTestSuite) SetupTest() { + valAc := codectestutil.CodecOptions{}.GetValidatorCodec() suite.encodingConfig = moduletestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{}, genutil.AppModule{}) key := storetypes.NewKVStoreKey("a_Store_Key") tkey := storetypes.NewTransientStoreKey("a_transient_store") @@ -67,11 +68,13 @@ func (suite *GenTxTestSuite) SetupTest() { var err error amount := sdk.NewInt64Coin(sdk.DefaultBondDenom, 50) one := math.OneInt() - suite.msg1, err = stakingtypes.NewMsgCreateValidator( - sdk.ValAddress(pk1.Address()).String(), pk1, amount, desc, comm, one) + pk1Addr, err := valAc.BytesToString(pk1.Address()) suite.NoError(err) - suite.msg2, err = stakingtypes.NewMsgCreateValidator( - sdk.ValAddress(pk2.Address()).String(), pk1, amount, desc, comm, one) + suite.msg1, err = stakingtypes.NewMsgCreateValidator(pk1Addr, pk1, amount, desc, comm, one) + suite.NoError(err) + pk2Addr, err := valAc.BytesToString(pk2.Address()) + suite.NoError(err) + suite.msg2, err = stakingtypes.NewMsgCreateValidator(pk2Addr, pk1, amount, desc, comm, one) suite.NoError(err) } @@ -161,8 +164,14 @@ func (suite *GenTxTestSuite) TestValidateAccountInGenesis() { var ( appGenesisState = make(map[string]json.RawMessage) coins sdk.Coins + ac = codectestutil.CodecOptions{}.GetAddressCodec() ) + addr1Str, err := ac.BytesToString(addr1) + suite.Require().NoError(err) + addr2Str, err := ac.BytesToString(addr2) + suite.Require().NoError(err) + testCases := []struct { msg string malleate func() @@ -180,7 +189,7 @@ func (suite *GenTxTestSuite) TestValidateAccountInGenesis() { func() { coins = sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 0)} balances := banktypes.Balance{ - Address: addr2.String(), + Address: addr2Str, Coins: sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 50)}, } appGenesisState[banktypes.ModuleName] = suite.setAccountBalance([]banktypes.Balance{balances}) @@ -192,7 +201,7 @@ func (suite *GenTxTestSuite) TestValidateAccountInGenesis() { func() { coins = sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 50)} balances := banktypes.Balance{ - Address: addr1.String(), + Address: addr1Str, Coins: sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 25)}, } appGenesisState[banktypes.ModuleName] = suite.setAccountBalance([]banktypes.Balance{balances}) @@ -204,7 +213,7 @@ func (suite *GenTxTestSuite) TestValidateAccountInGenesis() { func() { coins = sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 10)} balances := banktypes.Balance{ - Address: addr1.String(), + Address: addr1Str, Coins: sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 25)}, } appGenesisState[banktypes.ModuleName] = suite.setAccountBalance([]banktypes.Balance{balances}) @@ -221,10 +230,13 @@ func (suite *GenTxTestSuite) TestValidateAccountInGenesis() { suite.Require().NoError(err) appGenesisState[stakingtypes.ModuleName] = stakingGenesis + addr, err := addresscodec.NewBech32Codec("cosmos").BytesToString(addr1) + suite.Require().NoError(err) + tc.malleate() err = genutil.ValidateAccountInGenesis( appGenesisState, banktypes.GenesisBalancesIterator{}, - addr1, coins, cdc, + addr, coins, cdc, ) if tc.expPass { diff --git a/x/genutil/module.go b/x/genutil/module.go index 072b5077a1af..33e29b5c9b7c 100644 --- a/x/genutil/module.go +++ b/x/genutil/module.go @@ -7,7 +7,6 @@ import ( "cosmossdk.io/core/appmodule" "cosmossdk.io/core/genesis" - "cosmossdk.io/core/registry" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -93,6 +92,3 @@ func (am AppModule) GenTxValidator() types.MessageValidator { // ConsensusVersion implements HasConsensusVersion func (AppModule) ConsensusVersion() uint64 { return 1 } - -// RegisterInterfaces implements module.AppModule. -func (AppModule) RegisterInterfaces(registry.InterfaceRegistrar) {} diff --git a/x/genutil/proto/buf.gen.gogo.yaml b/x/genutil/proto/buf.gen.gogo.yaml index 9c8ba0a4b1fd..db36231d0c82 100644 --- a/x/genutil/proto/buf.gen.gogo.yaml +++ b/x/genutil/proto/buf.gen.gogo.yaml @@ -2,7 +2,7 @@ version: v1 plugins: - name: gocosmos out: .. - opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any - name: grpc-gateway out: .. opt: logtostderr=true,allow_colon_final_segments=true diff --git a/x/genutil/types/genesis_state_test.go b/x/genutil/types/genesis_state_test.go index bb97c2f00c85..b5741bef7f81 100644 --- a/x/genutil/types/genesis_state_test.go +++ b/x/genutil/types/genesis_state_test.go @@ -41,11 +41,16 @@ func TestNetGenesisState(t *testing.T) { func TestValidateGenesisMultipleMessages(t *testing.T) { desc := stakingtypes.NewDescription("testname", "", "", "", "") comm := stakingtypes.CommissionRates{} + valAc := codectestutil.CodecOptions{}.GetValidatorCodec() - msg1, err := stakingtypes.NewMsgCreateValidator(sdk.ValAddress(pk1.Address()).String(), pk1, sdk.NewInt64Coin(sdk.DefaultBondDenom, 50), desc, comm, math.OneInt()) + pk1Addr, err := valAc.BytesToString(pk1.Address()) + require.NoError(t, err) + msg1, err := stakingtypes.NewMsgCreateValidator(pk1Addr, pk1, sdk.NewInt64Coin(sdk.DefaultBondDenom, 50), desc, comm, math.OneInt()) require.NoError(t, err) - msg2, err := stakingtypes.NewMsgCreateValidator(sdk.ValAddress(pk2.Address()).String(), pk2, + pk2Addr, err := valAc.BytesToString(pk2.Address()) + require.NoError(t, err) + msg2, err := stakingtypes.NewMsgCreateValidator(pk2Addr, pk2, sdk.NewInt64Coin(sdk.DefaultBondDenom, 50), desc, comm, math.OneInt()) require.NoError(t, err) @@ -62,12 +67,13 @@ func TestValidateGenesisMultipleMessages(t *testing.T) { func TestValidateGenesisBadMessage(t *testing.T) { desc := stakingtypes.NewDescription("testname", "", "", "", "") - - msg1 := stakingtypes.NewMsgEditValidator(sdk.ValAddress(pk1.Address()).String(), desc, nil, nil) + pk1Addr, err := codectestutil.CodecOptions{}.GetValidatorCodec().BytesToString(pk1.Address()) + require.NoError(t, err) + msg1 := stakingtypes.NewMsgEditValidator(pk1Addr, desc, nil, nil) txConfig := moduletestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{}, staking.AppModule{}, genutil.AppModule{}).TxConfig txBuilder := txConfig.NewTxBuilder() - err := txBuilder.SetMsgs(msg1) + err = txBuilder.SetMsgs(msg1) require.NoError(t, err) tx := txBuilder.GetTx() diff --git a/x/gov/CHANGELOG.md b/x/gov/CHANGELOG.md index 94bc8b201fa7..722c5f5f780b 100644 --- a/x/gov/CHANGELOG.md +++ b/x/gov/CHANGELOG.md @@ -34,6 +34,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#18532](https://github.com/cosmos/cosmos-sdk/pull/18532) Add proposal types to proposals. * [#18620](https://github.com/cosmos/cosmos-sdk/pull/18620) Add optimistic proposals. * [#18762](https://github.com/cosmos/cosmos-sdk/pull/18762) Add multiple choice proposals. +* [#19853](https://github.com/cosmos/cosmos-sdk/pull/19853) Emit `depositor` in `EventTypeProposalDeposit` and `proposal_type` in `EventTypeSubmitProposal` ### Improvements @@ -61,6 +62,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### API Breaking Changes +* [#19850](https://github.com/cosmos/cosmos-sdk/pull/19850) Removes the use of Accounts String method: + * `NewDeposit`, `NewMsgDeposit`, `NewMsgVote`, `NewMsgVoteWeighted`, `NewVote`, `NewProposal`, `NewMsgSubmitProposal` now take a string as an argument instead of an `sdk.AccAddress`. + * `Prompt` and `PromptMetadata` take an address.Codec as arguments. + * `SetProposer` takes a String as an argument instead of a `fmt.Stringer`. * [#19481](https://github.com/cosmos/cosmos-sdk/pull/19481) Migrate module to use `appmodule.Environment`; `NewKeeper` now takes `appmodule.Environment` instead of a store service and no `baseapp.MessageRouter` anymore. * [#19481](https://github.com/cosmos/cosmos-sdk/pull/19481) v1beta1 proposal handlers now take a `context.Context` instead of an `sdk.Context`. * [#19592](https://github.com/cosmos/cosmos-sdk/pull/19592) `types.Config` and `types.DefaultConfig` have been moved to the keeper package in order to support the custom tallying function. diff --git a/x/gov/client/cli/prompt.go b/x/gov/client/cli/prompt.go index 8ab8a823cdcb..bb6706479bf1 100644 --- a/x/gov/client/cli/prompt.go +++ b/x/gov/client/cli/prompt.go @@ -12,6 +12,7 @@ import ( "github.com/manifoldco/promptui" "github.com/spf13/cobra" + "cosmossdk.io/core/address" authtypes "cosmossdk.io/x/auth/types" "cosmossdk.io/x/gov/types" @@ -64,7 +65,7 @@ var suggestedProposalTypes = []proposalType{ // namePrefix is the name to be displayed as "Enter " // TODO: when bringing this in autocli, use proto message instead // this will simplify the get address logic -func Prompt[T any](data T, namePrefix string) (T, error) { +func Prompt[T any](data T, namePrefix string, addressCodec address.Codec) (T, error) { v := reflect.ValueOf(&data).Elem() if v.Kind() == reflect.Interface { v = reflect.ValueOf(data) @@ -95,7 +96,11 @@ func Prompt[T any](data T, namePrefix string) (T, error) { if strings.EqualFold(fieldName, "authority") { // pre-fill with gov address - prompt.Default = authtypes.NewModuleAddress(types.ModuleName).String() + defaultAddr, err := addressCodec.BytesToString(authtypes.NewModuleAddress(types.ModuleName)) + if err != nil { + return data, err + } + prompt.Default = defaultAddr prompt.Validate = client.ValidatePromptAddress } @@ -158,8 +163,8 @@ type proposalType struct { } // Prompt the proposal type values and return the proposal and its metadata -func (p *proposalType) Prompt(cdc codec.Codec, skipMetadata bool) (*proposal, types.ProposalMetadata, error) { - metadata, err := PromptMetadata(skipMetadata) +func (p *proposalType) Prompt(cdc codec.Codec, skipMetadata bool, addressCodec address.Codec) (*proposal, types.ProposalMetadata, error) { + metadata, err := PromptMetadata(skipMetadata, addressCodec) if err != nil { return nil, metadata, fmt.Errorf("failed to set proposal metadata: %w", err) } @@ -185,7 +190,7 @@ func (p *proposalType) Prompt(cdc codec.Codec, skipMetadata bool) (*proposal, ty } // set messages field - result, err := Prompt(p.Msg, "msg") + result, err := Prompt(p.Msg, "msg", addressCodec) if err != nil { return nil, metadata, fmt.Errorf("failed to set proposal message: %w", err) } @@ -209,9 +214,9 @@ func getProposalSuggestions() []string { } // PromptMetadata prompts for proposal metadata or only title and summary if skip is true -func PromptMetadata(skip bool) (types.ProposalMetadata, error) { +func PromptMetadata(skip bool, addressCodec address.Codec) (types.ProposalMetadata, error) { if !skip { - metadata, err := Prompt(types.ProposalMetadata{}, "proposal") + metadata, err := Prompt(types.ProposalMetadata{}, "proposal", addressCodec) if err != nil { return metadata, fmt.Errorf("failed to set proposal metadata: %w", err) } @@ -306,7 +311,7 @@ func NewCmdDraftProposal() *cobra.Command { skipMetadataPrompt, _ := cmd.Flags().GetBool(flagSkipMetadata) - result, metadata, err := proposal.Prompt(clientCtx.Codec, skipMetadataPrompt) + result, metadata, err := proposal.Prompt(clientCtx.Codec, skipMetadataPrompt, clientCtx.AddressCodec) if err != nil { return err } diff --git a/x/gov/client/cli/prompt_test.go b/x/gov/client/cli/prompt_test.go index cfb23272a184..89110536d7e1 100644 --- a/x/gov/client/cli/prompt_test.go +++ b/x/gov/client/cli/prompt_test.go @@ -18,6 +18,8 @@ import ( "github.com/stretchr/testify/require" "cosmossdk.io/x/gov/client/cli" + + codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" ) type st struct { @@ -50,7 +52,7 @@ func TestPromptIntegerOverflow(t *testing.T) { _, err := fw.Write([]byte(overflowStr + "\n")) assert.NoError(t, err) - v, err := cli.Prompt(st{}, "") + v, err := cli.Prompt(st{}, "", codectestutil.CodecOptions{}.GetAddressCodec()) assert.Equal(t, st{}, v, "expected a value of zero") require.NotNil(t, err, "expected a report of an overflow") require.Contains(t, err.Error(), "range") @@ -81,7 +83,7 @@ func TestPromptParseInteger(t *testing.T) { readline.Stdin = fin _, err := fw.Write([]byte(tc.in + "\n")) assert.NoError(t, err) - v, err := cli.Prompt(st{}, "") + v, err := cli.Prompt(st{}, "", codectestutil.CodecOptions{}.GetAddressCodec()) assert.Nil(t, err, "expected a nil error") assert.Equal(t, tc.want, v.I, "expected %d = %d", tc.want, v.I) }) diff --git a/x/gov/client/cli/tx.go b/x/gov/client/cli/tx.go index d63e0dc24118..cdd56d144a78 100644 --- a/x/gov/client/cli/tx.go +++ b/x/gov/client/cli/tx.go @@ -138,7 +138,12 @@ metadata example: return err } - msg, err := v1.NewMsgSubmitProposal(msgs, deposit, clientCtx.GetFromAddress().String(), proposal.Metadata, proposal.Title, proposal.Summary, proposal.proposalType) + addr, err := clientCtx.AddressCodec.BytesToString(clientCtx.GetFromAddress()) + if err != nil { + return err + } + + msg, err := v1.NewMsgSubmitProposal(msgs, deposit, addr, proposal.Metadata, proposal.Title, proposal.Summary, proposal.proposalType) if err != nil { return fmt.Errorf("invalid message: %w", err) } @@ -203,7 +208,12 @@ $ %s tx gov submit-legacy-proposal --title="Test Proposal" --description="My awe return fmt.Errorf("failed to create proposal content: unknown proposal type %s", proposal.Type) } - msg, err := v1beta1.NewMsgSubmitProposal(content, amount, clientCtx.GetFromAddress()) + proposer, err := clientCtx.AddressCodec.BytesToString(clientCtx.GetFromAddress()) + if err != nil { + return err + } + + msg, err := v1beta1.NewMsgSubmitProposal(content, amount, proposer) if err != nil { return fmt.Errorf("invalid message: %w", err) } @@ -247,7 +257,10 @@ $ %s tx gov weighted-vote 1 yes=0.6,no=0.3,abstain=0.05,no-with-veto=0.05 --from } // Get voter address - from := clientCtx.GetFromAddress() + from, err := clientCtx.AddressCodec.BytesToString(clientCtx.GetFromAddress()) + if err != nil { + return err + } // validate that the proposal id is a uint proposalID, err := strconv.ParseUint(args[0], 10, 64) diff --git a/x/gov/client/cli/tx_test.go b/x/gov/client/cli/tx_test.go index dd903034e109..744f990653e1 100644 --- a/x/gov/client/cli/tx_test.go +++ b/x/gov/client/cli/tx_test.go @@ -68,35 +68,39 @@ func (s *CLITestSuite) SetupSuite() { s.clientCtx = ctxGen() val := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) + val0StrAddr, err := s.clientCtx.AddressCodec.BytesToString(val[0].Address) + s.Require().NoError(err) // create a proposal with deposit - _, err := govclitestutil.MsgSubmitLegacyProposal(s.clientCtx, val[0].Address.String(), + _, err = govclitestutil.MsgSubmitLegacyProposal(s.clientCtx, val0StrAddr, "Text Proposal 1", "Where is the title!?", v1beta1.ProposalTypeText, fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin("stake", v1.DefaultMinDepositTokens).String())) s.Require().NoError(err) // vote for proposal - _, err = govclitestutil.MsgVote(s.clientCtx, val[0].Address.String(), "1", "yes") + _, err = govclitestutil.MsgVote(s.clientCtx, val0StrAddr, "1", "yes") s.Require().NoError(err) // create a proposal without deposit - _, err = govclitestutil.MsgSubmitLegacyProposal(s.clientCtx, val[0].Address.String(), + _, err = govclitestutil.MsgSubmitLegacyProposal(s.clientCtx, val0StrAddr, "Text Proposal 2", "Where is the title!?", v1beta1.ProposalTypeText) s.Require().NoError(err) // create a proposal3 with deposit - _, err = govclitestutil.MsgSubmitLegacyProposal(s.clientCtx, val[0].Address.String(), + _, err = govclitestutil.MsgSubmitLegacyProposal(s.clientCtx, val0StrAddr, "Text Proposal 3", "Where is the title!?", v1beta1.ProposalTypeText, fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin("stake", v1.DefaultMinDepositTokens).String())) s.Require().NoError(err) // vote for proposal3 as val - _, err = govclitestutil.MsgVote(s.clientCtx, val[0].Address.String(), "3", "yes=0.6,no=0.3,abstain=0.05,no_with_veto=0.05") + _, err = govclitestutil.MsgVote(s.clientCtx, val0StrAddr, "3", "yes=0.6,no=0.3,abstain=0.05,no_with_veto=0.05") s.Require().NoError(err) } func (s *CLITestSuite) TestNewCmdSubmitProposal() { val := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) + val0StrAddr, err := s.clientCtx.AddressCodec.BytesToString(val[0].Address) + s.Require().NoError(err) // Create a legacy proposal JSON, make sure it doesn't pass this new CLI // command. @@ -150,7 +154,7 @@ func (s *CLITestSuite) TestNewCmdSubmitProposal() { "valid proposal", []string{ validPropFile.Name(), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, val0StrAddr), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10))).String()), @@ -180,6 +184,8 @@ func (s *CLITestSuite) TestNewCmdSubmitProposal() { func (s *CLITestSuite) TestNewCmdSubmitLegacyProposal() { val := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) + val0StrAddr, err := s.clientCtx.AddressCodec.BytesToString(val[0].Address) + s.Require().NoError(err) invalidProp := `{ "title": "", @@ -207,7 +213,7 @@ func (s *CLITestSuite) TestNewCmdSubmitLegacyProposal() { "invalid proposal (file)", []string{ fmt.Sprintf("--%s=%s", cli.FlagProposal, invalidPropFile.Name()), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, val0StrAddr), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10))).String()), }, @@ -219,7 +225,7 @@ func (s *CLITestSuite) TestNewCmdSubmitLegacyProposal() { fmt.Sprintf("--%s='Where is the title!?'", cli.FlagDescription), fmt.Sprintf("--%s=%s", cli.FlagProposalType, v1beta1.ProposalTypeText), fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin("stake", sdkmath.NewInt(5431)).String()), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, val0StrAddr), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10))).String()), }, @@ -230,7 +236,7 @@ func (s *CLITestSuite) TestNewCmdSubmitLegacyProposal() { []string{ fmt.Sprintf("--%s=%s", cli.FlagProposal, validPropFile.Name()), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, val0StrAddr), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10))).String()), @@ -244,7 +250,7 @@ func (s *CLITestSuite) TestNewCmdSubmitLegacyProposal() { fmt.Sprintf("--%s='Where is the title!?'", cli.FlagDescription), fmt.Sprintf("--%s=%s", cli.FlagProposalType, v1beta1.ProposalTypeText), fmt.Sprintf("--%s=%s", cli.FlagDeposit, sdk.NewCoin("stake", sdkmath.NewInt(5431)).String()), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, val0StrAddr), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10))).String()), @@ -274,6 +280,8 @@ func (s *CLITestSuite) TestNewCmdSubmitLegacyProposal() { func (s *CLITestSuite) TestNewCmdWeightedVote() { val := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) + val0StrAddr, err := s.clientCtx.AddressCodec.BytesToString(val[0].Address) + s.Require().NoError(err) testCases := []struct { name string @@ -285,7 +293,7 @@ func (s *CLITestSuite) TestNewCmdWeightedVote() { []string{ "abc", "yes", - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, val0StrAddr), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10))).String()), @@ -297,7 +305,7 @@ func (s *CLITestSuite) TestNewCmdWeightedVote() { []string{ "1", "AYE", - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, val0StrAddr), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10))).String()), @@ -309,7 +317,7 @@ func (s *CLITestSuite) TestNewCmdWeightedVote() { []string{ "1", "yes", - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, val0StrAddr), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10))).String()), @@ -321,7 +329,7 @@ func (s *CLITestSuite) TestNewCmdWeightedVote() { []string{ "1", "yes", - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, val0StrAddr), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--metadata=%s", "AQ=="), @@ -334,7 +342,7 @@ func (s *CLITestSuite) TestNewCmdWeightedVote() { []string{ "1", "yes/0.6,no/0.3,abstain/0.05,no_with_veto/0.05", - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, val0StrAddr), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10))).String()), @@ -346,7 +354,7 @@ func (s *CLITestSuite) TestNewCmdWeightedVote() { []string{ "1", "yes=0.6,no=0.3,abstain=0.05,no_with_veto=0.05", - fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, val0StrAddr), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10))).String()), diff --git a/x/gov/client/cli/util.go b/x/gov/client/cli/util.go index 760a6344683a..562b26f59328 100644 --- a/x/gov/client/cli/util.go +++ b/x/gov/client/cli/util.go @@ -201,5 +201,10 @@ func ReadGovPropCmdFlags(proposer string, flagSet *pflag.FlagSet) (*govv1.MsgSub // See also AddGovPropFlagsToCmd. // Deprecated: use ReadPropCmdFlags instead, as this depends on global bech32 prefixes. func ReadGovPropFlags(clientCtx client.Context, flagSet *pflag.FlagSet) (*govv1.MsgSubmitProposal, error) { - return ReadGovPropCmdFlags(clientCtx.GetFromAddress().String(), flagSet) + addr, err := clientCtx.AddressCodec.BytesToString(clientCtx.GetFromAddress()) + if err != nil { + return nil, err + } + + return ReadGovPropCmdFlags(addr, flagSet) } diff --git a/x/gov/client/cli/util_test.go b/x/gov/client/cli/util_test.go index 702d6d448ef6..2601a526fe1b 100644 --- a/x/gov/client/cli/util_test.go +++ b/x/gov/client/cli/util_test.go @@ -21,6 +21,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" + codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/testutil" "github.com/cosmos/cosmos-sdk/testutil/testdata" @@ -147,6 +148,9 @@ func TestParseSubmitLegacyProposal(t *testing.T) { func TestParseSubmitProposal(t *testing.T) { _, _, addr := testdata.KeyTestPubAddr() + addrStr, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(addr) + require.NoError(t, err) + interfaceRegistry := codectypes.NewInterfaceRegistry() cdc := codec.NewProtoCodec(interfaceRegistry) banktypes.RegisterInterfaces(interfaceRegistry) @@ -191,7 +195,7 @@ func TestParseSubmitProposal(t *testing.T) { badJSON := testutil.WriteToNewTempFile(t, "bad json") // nonexistent json - _, _, _, err := parseSubmitProposal(cdc, "fileDoesNotExist") + _, _, _, err = parseSubmitProposal(cdc, "fileDoesNotExist") require.Error(t, err) // invalid json @@ -206,17 +210,17 @@ func TestParseSubmitProposal(t *testing.T) { require.Len(t, msgs, 3) msg1, ok := msgs[0].(*banktypes.MsgSend) require.True(t, ok) - require.Equal(t, addr.String(), msg1.FromAddress) - require.Equal(t, addr.String(), msg1.ToAddress) + require.Equal(t, addrStr, msg1.FromAddress) + require.Equal(t, addrStr, msg1.ToAddress) require.Equal(t, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10))), msg1.Amount) msg2, ok := msgs[1].(*stakingtypes.MsgDelegate) require.True(t, ok) - require.Equal(t, addr.String(), msg2.DelegatorAddress) - require.Equal(t, addr.String(), msg2.ValidatorAddress) + require.Equal(t, addrStr, msg2.DelegatorAddress) + require.Equal(t, addrStr, msg2.ValidatorAddress) require.Equal(t, sdk.NewCoin("stake", sdkmath.NewInt(10)), msg2.Amount) msg3, ok := msgs[2].(*v1.MsgExecLegacyContent) require.True(t, ok) - require.Equal(t, addr.String(), msg3.Authority) + require.Equal(t, addrStr, msg3.Authority) textProp, ok := msg3.Content.GetCachedValue().(*v1beta1.TextProposal) require.True(t, ok) require.Equal(t, "My awesome title", textProp.Title) @@ -300,6 +304,8 @@ func TestReadGovPropFlags(t *testing.T) { argTitle := "--" + FlagTitle argSummary := "--" + FlagSummary + fromAddrStr, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(fromAddr) + require.NoError(t, err) // cz is a shorter way to define coins objects for these tests. cz := func(coins string) sdk.Coins { rv, err := sdk.ParseCoinsNormalized(coins) @@ -332,7 +338,7 @@ func TestReadGovPropFlags(t *testing.T) { args: []string{}, exp: &v1.MsgSubmitProposal{ InitialDeposit: nil, - Proposer: fromAddr.String(), + Proposer: fromAddrStr, Metadata: "", Title: "", Summary: "", @@ -547,7 +553,7 @@ func TestReadGovPropFlags(t *testing.T) { }, exp: &v1.MsgSubmitProposal{ InitialDeposit: cz("56depcoin"), - Proposer: fromAddr.String(), + Proposer: fromAddrStr, Metadata: "my proposal is cool", Title: "Simple Gov Prop Title", Summary: "This is just a test summary on a simple gov prop.", @@ -564,7 +570,7 @@ func TestReadGovPropFlags(t *testing.T) { }, exp: &v1.MsgSubmitProposal{ InitialDeposit: cz("78coolcoin"), - Proposer: fromAddr.String(), + Proposer: fromAddrStr, Metadata: "this proposal is cooler", Title: "This title is a *bit* more complex.", Summary: "This\nis\na\ncrazy\nsummary", @@ -614,7 +620,7 @@ func TestReadGovPropFlags(t *testing.T) { }, exp: &v1.MsgSubmitProposal{ InitialDeposit: nil, - Proposer: fromAddr.String(), + Proposer: fromAddrStr, Metadata: "worthless metadata", Title: "This is a Title", Summary: "This is a useless summary", @@ -631,7 +637,7 @@ func TestReadGovPropFlags(t *testing.T) { }, exp: &v1.MsgSubmitProposal{ InitialDeposit: cz("99mdcoin"), - Proposer: fromAddr.String(), + Proposer: fromAddrStr, Metadata: "", Title: "Bland Title", Summary: "Boring summary", @@ -647,7 +653,7 @@ func TestReadGovPropFlags(t *testing.T) { }, exp: &v1.MsgSubmitProposal{ InitialDeposit: cz("71whatcoin"), - Proposer: fromAddr.String(), + Proposer: fromAddrStr, Metadata: "this metadata does not have the title either", Title: "", Summary: "This is a summary on a titleless proposal.", @@ -664,7 +670,7 @@ func TestReadGovPropFlags(t *testing.T) { }, exp: &v1.MsgSubmitProposal{ InitialDeposit: cz("42musiccoin"), - Proposer: fromAddr.String(), + Proposer: fromAddrStr, Metadata: "28", Title: "Now This is What I Call A Governance Proposal 28", Summary: "", @@ -687,7 +693,8 @@ func TestReadGovPropFlags(t *testing.T) { flagSet := cmd.Flags() clientCtx := client.Context{ - FromAddress: tc.fromAddr, + FromAddress: tc.fromAddr, + AddressCodec: codectestutil.CodecOptions{}.GetAddressCodec(), } var msg *v1.MsgSubmitProposal diff --git a/x/gov/client/utils/query.go b/x/gov/client/utils/query.go index 6043c2823248..fdc5354f1f23 100644 --- a/x/gov/client/utils/query.go +++ b/x/gov/client/utils/query.go @@ -120,8 +120,13 @@ type QueryVoteParams struct { // QueryVoteByTxQuery will query for a single vote via a direct txs tags query. func QueryVoteByTxQuery(clientCtx client.Context, params QueryVoteParams) ([]byte, error) { + voterAddr, err := clientCtx.AddressCodec.BytesToString(params.Voter) + if err != nil { + return nil, err + } + q1 := fmt.Sprintf("%s.%s='%d'", types.EventTypeProposalVote, types.AttributeKeyProposalID, params.ProposalID) - q2 := fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeySender, params.Voter.String()) + q2 := fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeySender, voterAddr) q3 := fmt.Sprintf("%s.%s='%s'", sdk.EventTypeMessage, sdk.AttributeKeySender, params.Voter) searchResult, err := authtx.QueryTxsByEvents(clientCtx, defaultPage, defaultLimit, fmt.Sprintf("%s AND (%s OR %s)", q1, q2, q3), "") if err != nil { diff --git a/x/gov/client/utils/query_test.go b/x/gov/client/utils/query_test.go index 5c0aed3ac7fa..be2ffb621994 100644 --- a/x/gov/client/utils/query_test.go +++ b/x/gov/client/utils/query_test.go @@ -55,7 +55,8 @@ func (mock TxSearchMock) Block(ctx context.Context, height *int64) (*coretypes.R } func TestGetPaginatedVotes(t *testing.T) { - encCfg := moduletestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{}, gov.AppModule{}) + cdcOpts := codectestutil.CodecOptions{} + encCfg := moduletestutil.MakeTestEncodingConfig(cdcOpts, gov.AppModule{}) type testCase struct { description string @@ -65,16 +66,20 @@ func TestGetPaginatedVotes(t *testing.T) { } acc1 := make(sdk.AccAddress, 20) acc1[0] = 1 + acc1Str, err := cdcOpts.GetAddressCodec().BytesToString(acc1) + require.NoError(t, err) acc2 := make(sdk.AccAddress, 20) acc2[0] = 2 + acc2Str, err := cdcOpts.GetAddressCodec().BytesToString(acc2) + require.NoError(t, err) acc1Msgs := []sdk.Msg{ - v1.NewMsgVote(acc1, 0, v1.OptionYes, ""), - v1.NewMsgVote(acc1, 0, v1.OptionYes, ""), - v1.NewMsgDeposit(acc1, 0, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10)))), // should be ignored + v1.NewMsgVote(acc1Str, 0, v1.OptionYes, ""), + v1.NewMsgVote(acc1Str, 0, v1.OptionYes, ""), + v1.NewMsgDeposit(acc1Str, 0, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(10)))), // should be ignored } acc2Msgs := []sdk.Msg{ - v1.NewMsgVote(acc2, 0, v1.OptionYes, ""), - v1.NewMsgVoteWeighted(acc2, 0, v1.NewNonSplitVoteOption(v1.OptionYes), ""), + v1.NewMsgVote(acc2Str, 0, v1.OptionYes, ""), + v1.NewMsgVoteWeighted(acc2Str, 0, v1.NewNonSplitVoteOption(v1.OptionYes), ""), } for _, tc := range []testCase{ { @@ -86,8 +91,8 @@ func TestGetPaginatedVotes(t *testing.T) { acc2Msgs[:1], }, votes: []v1.Vote{ - v1.NewVote(0, acc1, v1.NewNonSplitVoteOption(v1.OptionYes), ""), - v1.NewVote(0, acc2, v1.NewNonSplitVoteOption(v1.OptionYes), ""), + v1.NewVote(0, acc1Str, v1.NewNonSplitVoteOption(v1.OptionYes), ""), + v1.NewVote(0, acc2Str, v1.NewNonSplitVoteOption(v1.OptionYes), ""), }, }, { @@ -99,8 +104,8 @@ func TestGetPaginatedVotes(t *testing.T) { acc2Msgs, }, votes: []v1.Vote{ - v1.NewVote(0, acc1, v1.NewNonSplitVoteOption(v1.OptionYes), ""), - v1.NewVote(0, acc1, v1.NewNonSplitVoteOption(v1.OptionYes), ""), + v1.NewVote(0, acc1Str, v1.NewNonSplitVoteOption(v1.OptionYes), ""), + v1.NewVote(0, acc1Str, v1.NewNonSplitVoteOption(v1.OptionYes), ""), }, }, { @@ -112,8 +117,8 @@ func TestGetPaginatedVotes(t *testing.T) { acc2Msgs, }, votes: []v1.Vote{ - v1.NewVote(0, acc2, v1.NewNonSplitVoteOption(v1.OptionYes), ""), - v1.NewVote(0, acc2, v1.NewNonSplitVoteOption(v1.OptionYes), ""), + v1.NewVote(0, acc2Str, v1.NewNonSplitVoteOption(v1.OptionYes), ""), + v1.NewVote(0, acc2Str, v1.NewNonSplitVoteOption(v1.OptionYes), ""), }, }, { @@ -123,7 +128,7 @@ func TestGetPaginatedVotes(t *testing.T) { msgs: [][]sdk.Msg{ acc1Msgs[:1], }, - votes: []v1.Vote{v1.NewVote(0, acc1, v1.NewNonSplitVoteOption(v1.OptionYes), "")}, + votes: []v1.Vote{v1.NewVote(0, acc1Str, v1.NewNonSplitVoteOption(v1.OptionYes), "")}, }, { description: "InvalidPage", diff --git a/x/gov/depinject.go b/x/gov/depinject.go index 0a24603c421c..72f9b4767169 100644 --- a/x/gov/depinject.go +++ b/x/gov/depinject.go @@ -76,6 +76,10 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { if in.Config.Authority != "" { authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority) } + authorityAddr, err := in.AccountKeeper.AddressCodec().BytesToString(authority) + if err != nil { + panic(err) + } k := keeper.NewKeeper( in.Cdc, @@ -85,7 +89,7 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { in.StakingKeeper, in.PoolKeeper, defaultConfig, - authority.String(), + authorityAddr, ) m := NewAppModule(in.Cdc, k, in.AccountKeeper, in.BankKeeper, in.PoolKeeper, in.LegacyProposalHandler...) hr := v1beta1.HandlerRoute{Handler: v1beta1.ProposalHandler, RouteKey: govtypes.RouterKey} diff --git a/x/gov/go.mod b/x/gov/go.mod index 54cd2315be84..c2f096cc7d7a 100644 --- a/x/gov/go.mod +++ b/x/gov/go.mod @@ -19,10 +19,10 @@ require ( cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 github.com/chzyer/readline v1.5.1 github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.6 + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 github.com/cosmos/cosmos-proto v1.0.0-beta.4 github.com/cosmos/cosmos-sdk v0.51.0 - github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/gogoproto v1.4.12 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 @@ -31,8 +31,8 @@ require ( github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.9.0 golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 - google.golang.org/grpc v1.62.1 + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de + google.golang.org/grpc v1.63.2 google.golang.org/protobuf v1.33.0 gotest.tools/v3 v3.5.1 ) @@ -66,7 +66,7 @@ require ( github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect @@ -112,7 +112,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -122,13 +122,13 @@ require ( github.com/mtibben/percent v0.2.1 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.0 // indirect github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.50.0 // indirect + github.com/prometheus/common v0.52.2 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect @@ -151,16 +151,16 @@ require ( gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 // indirect go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.21.0 // indirect + golang.org/x/crypto v0.22.0 // indirect golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.22.0 // indirect - golang.org/x/sync v0.6.0 - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.7.0 + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.18.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect diff --git a/x/gov/go.sum b/x/gov/go.sum index 1746f5fcaed9..1eb9acf193d8 100644 --- a/x/gov/go.sum +++ b/x/gov/go.sum @@ -126,8 +126,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -149,8 +149,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/cosmos/iavl v1.0.0 h1:bw6t0Mv/mVCJvlMTOPHWLs5uUE3BRBfVWCRelOzl+so= github.com/cosmos/iavl v1.0.0/go.mod h1:CmTGqMnRnucjxbjduneZXT+0vPgNElYvdefjX2q9tYc= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= @@ -170,8 +170,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= @@ -457,8 +457,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -563,8 +563,8 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= @@ -605,8 +605,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= -github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -759,8 +759,8 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= @@ -809,8 +809,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -822,8 +822,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -879,12 +879,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -938,12 +938,12 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -961,8 +961,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/x/gov/keeper/abci.go b/x/gov/keeper/abci.go index 9234377be88e..4969d4abfbda 100644 --- a/x/gov/keeper/abci.go +++ b/x/gov/keeper/abci.go @@ -21,41 +21,51 @@ import ( // EndBlocker is called every block. func (k Keeper) EndBlocker(ctx context.Context) error { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyEndBlocker) + defer telemetry.ModuleMeasureSince(types.ModuleName, telemetry.Now(), telemetry.MetricKeyEndBlocker) logger := k.Logger() // delete dead proposals from store and returns theirs deposits. // A proposal is dead when it's inactive and didn't get enough deposit on time to get into voting phase. rng := collections.NewPrefixUntilPairRange[time.Time, uint64](k.environment.HeaderService.GetHeaderInfo(ctx).Time) - err := k.InactiveProposalsQueue.Walk(ctx, rng, func(key collections.Pair[time.Time, uint64], _ uint64) (bool, error) { - proposal, err := k.Proposals.Get(ctx, key.K2()) + iter, err := k.InactiveProposalsQueue.Iterate(ctx, rng) + if err != nil { + return err + } + + inactiveProps, err := iter.KeyValues() + if err != nil { + return err + } + + for _, prop := range inactiveProps { + proposal, err := k.Proposals.Get(ctx, prop.Key.K2()) if err != nil { // if the proposal has an encoding error, this means it cannot be processed by x/gov // this could be due to some types missing their registration // instead of returning an error (i.e, halting the chain), we fail the proposal if errors.Is(err, collections.ErrEncoding) { - proposal.Id = key.K2() + proposal.Id = prop.Key.K2() if err := failUnsupportedProposal(logger, ctx, k, proposal, err.Error(), false); err != nil { - return false, err + return err } if err = k.DeleteProposal(ctx, proposal.Id); err != nil { - return false, err + return err } - return false, nil + continue } - return false, err + return err } if err = k.DeleteProposal(ctx, proposal.Id); err != nil { - return false, err + return err } params, err := k.Params.Get(ctx) if err != nil { - return false, err + return err } if !params.BurnProposalDepositPrevote { err = k.RefundAndDeleteDeposits(ctx, proposal.Id) // refund deposit if proposal got removed without getting 100% of the proposal @@ -64,7 +74,7 @@ func (k Keeper) EndBlocker(ctx context.Context) error { } if err != nil { - return false, err + return err } // called when proposal become inactive @@ -91,42 +101,49 @@ func (k Keeper) EndBlocker(ctx context.Context) error { "min_deposit", sdk.NewCoins(proposal.GetMinDepositFromParams(params)...).String(), "total_deposit", sdk.NewCoins(proposal.TotalDeposit...).String(), ) + } - return false, nil - }) + // fetch active proposals whose voting periods have ended (are passed the block time) + rng = collections.NewPrefixUntilPairRange[time.Time, uint64](k.environment.HeaderService.GetHeaderInfo(ctx).Time) + + iter, err = k.ActiveProposalsQueue.Iterate(ctx, rng) if err != nil { return err } - // fetch active proposals whose voting periods have ended (are passed the block time) - rng = collections.NewPrefixUntilPairRange[time.Time, uint64](k.environment.HeaderService.GetHeaderInfo(ctx).Time) - err = k.ActiveProposalsQueue.Walk(ctx, rng, func(key collections.Pair[time.Time, uint64], _ uint64) (bool, error) { - proposal, err := k.Proposals.Get(ctx, key.K2()) + activeProps, err := iter.KeyValues() + if err != nil { + return err + } + + // err = k.ActiveProposalsQueue.Walk(ctx, rng, func(key collections.Pair[time.Time, uint64], _ uint64) (bool, error) { + for _, prop := range activeProps { + proposal, err := k.Proposals.Get(ctx, prop.Key.K2()) if err != nil { // if the proposal has an encoding error, this means it cannot be processed by x/gov // this could be due to some types missing their registration // instead of returning an error (i.e, halting the chain), we fail the proposal if errors.Is(err, collections.ErrEncoding) { - proposal.Id = key.K2() + proposal.Id = prop.Key.K2() if err := failUnsupportedProposal(logger, ctx, k, proposal, err.Error(), true); err != nil { - return false, err + return err } if err = k.ActiveProposalsQueue.Remove(ctx, collections.Join(*proposal.VotingEndTime, proposal.Id)); err != nil { - return false, err + return err } - return false, nil + continue } - return false, err + return err } var tagValue, logMsg string passes, burnDeposits, tallyResults, err := k.Tally(ctx, proposal) if err != nil { - return false, err + return err } // Deposits are always burned if tally said so, regardless of the proposal type. @@ -154,7 +171,7 @@ func (k Keeper) EndBlocker(ctx context.Context) error { } if err = k.ActiveProposalsQueue.Remove(ctx, collections.Join(*proposal.VotingEndTime, proposal.Id)); err != nil { - return false, err + return err } switch { @@ -210,14 +227,14 @@ func (k Keeper) EndBlocker(ctx context.Context) error { proposal.Expedited = false // can be removed as never read but kept for state coherence params, err := k.Params.Get(ctx) if err != nil { - return false, err + return err } endTime := proposal.VotingStartTime.Add(*params.VotingPeriod) proposal.VotingEndTime = &endTime err = k.ActiveProposalsQueue.Set(ctx, collections.Join(*proposal.VotingEndTime, proposal.Id), proposal.Id) if err != nil { - return false, err + return err } if proposal.ProposalType == v1.ProposalType_PROPOSAL_TYPE_EXPEDITED { @@ -237,7 +254,7 @@ func (k Keeper) EndBlocker(ctx context.Context) error { proposal.FinalTallyResult = &tallyResults if err = k.Proposals.Set(ctx, proposal.Id, proposal); err != nil { - return false, err + return err } // call hook when proposal become active @@ -264,10 +281,8 @@ func (k Keeper) EndBlocker(ctx context.Context) error { ); err != nil { logger.Error("failed to emit event", "error", err) } - - return false, nil - }) - return err + } + return nil } // executes route(msg) and recovers from panic. diff --git a/x/gov/keeper/common_test.go b/x/gov/keeper/common_test.go index 1ab164143397..3e1be306d15f 100644 --- a/x/gov/keeper/common_test.go +++ b/x/gov/keeper/common_test.go @@ -35,7 +35,6 @@ var ( govAcct = authtypes.NewModuleAddress(types.ModuleName) poolAcct = authtypes.NewModuleAddress(protocolModuleName) govAcctStr = "cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn" - addrStr = addr.String() TestProposal = getTestProposal() ) @@ -49,7 +48,17 @@ const ( // getTestProposal creates and returns a test proposal message. func getTestProposal() []sdk.Msg { - legacyProposalMsg, err := v1.NewLegacyContent(v1beta1.NewTextProposal("Title", "description"), authtypes.NewModuleAddress(types.ModuleName).String()) + moduleAddr, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(authtypes.NewModuleAddress(types.ModuleName)) + if err != nil { + panic(err) + } + + legacyProposalMsg, err := v1.NewLegacyContent(v1beta1.NewTextProposal("Title", "description"), moduleAddr) + if err != nil { + panic(err) + } + + addrStr, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(addr) if err != nil { panic(err) } @@ -74,9 +83,12 @@ func mockAccountKeeperExpectations(ctx sdk.Context, m mocks) { m.acctKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec("cosmos")).AnyTimes() } -func mockDefaultExpectations(ctx sdk.Context, m mocks) { +func mockDefaultExpectations(ctx sdk.Context, m mocks) error { mockAccountKeeperExpectations(ctx, m) - trackMockBalances(m.bankKeeper) + err := trackMockBalances(m.bankKeeper) + if err != nil { + return err + } m.stakingKeeper.EXPECT().TokensFromConsensusPower(ctx, gomock.Any()).DoAndReturn(func(ctx sdk.Context, power int64) math.Int { return sdk.TokensFromConsensusPower(power, math.NewIntFromUint64(1000000)) }).AnyTimes() @@ -85,6 +97,7 @@ func mockDefaultExpectations(ctx sdk.Context, m mocks) { m.stakingKeeper.EXPECT().IterateBondedValidatorsByPower(gomock.Any(), gomock.Any()).AnyTimes() m.stakingKeeper.EXPECT().IterateDelegations(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes() m.stakingKeeper.EXPECT().TotalBondedTokens(gomock.Any()).Return(math.NewInt(10000000), nil).AnyTimes() + return nil } // setupGovKeeper creates a govKeeper as well as all its dependencies. @@ -124,21 +137,24 @@ func setupGovKeeper(t *testing.T, expectations ...func(sdk.Context, mocks)) ( poolKeeper: govtestutil.NewMockPoolKeeper(ctrl), } if len(expectations) == 0 { - mockDefaultExpectations(ctx, m) + err := mockDefaultExpectations(ctx, m) + require.NoError(t, err) } else { for _, exp := range expectations { exp(ctx, m) } } - // Gov keeper initializations + govAddr, err := m.acctKeeper.AddressCodec().BytesToString(govAcct) + require.NoError(t, err) - govKeeper := keeper.NewKeeper(encCfg.Codec, environment, m.acctKeeper, m.bankKeeper, m.stakingKeeper, m.poolKeeper, keeper.DefaultConfig(), govAcct.String()) + // Gov keeper initializations + govKeeper := keeper.NewKeeper(encCfg.Codec, environment, m.acctKeeper, m.bankKeeper, m.stakingKeeper, m.poolKeeper, keeper.DefaultConfig(), govAddr) require.NoError(t, govKeeper.ProposalID.Set(ctx, 1)) govRouter := v1beta1.NewRouter() // Also register legacy gov handlers to test them too. govRouter.AddRoute(types.RouterKey, v1beta1.ProposalHandler) govKeeper.SetLegacyRouter(govRouter) - err := govKeeper.Params.Set(ctx, v1.DefaultParams()) + err = govKeeper.Params.Set(ctx, v1.DefaultParams()) require.NoError(t, err) err = govKeeper.Constitution.Set(ctx, "constitution") require.NoError(t, err) @@ -152,9 +168,14 @@ func setupGovKeeper(t *testing.T, expectations ...func(sdk.Context, mocks)) ( // trackMockBalances sets up expected calls on the Mock BankKeeper, and also // locally tracks accounts balances (not modules balances). -func trackMockBalances(bankKeeper *govtestutil.MockBankKeeper) { +func trackMockBalances(bankKeeper *govtestutil.MockBankKeeper) error { + addressCdc := codectestutil.CodecOptions{}.GetAddressCodec() + poolAcctStr, err := addressCdc.BytesToString(poolAcct) + if err != nil { + return err + } balances := make(map[string]sdk.Coins) - balances[poolAcct.String()] = sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(0))) + balances[poolAcctStr] = sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(0))) // We don't track module account balances. bankKeeper.EXPECT().MintCoins(gomock.Any(), mintModuleName, gomock.Any()).AnyTimes() @@ -163,27 +184,44 @@ func trackMockBalances(bankKeeper *govtestutil.MockBankKeeper) { // But we do track normal account balances. bankKeeper.EXPECT().SendCoinsFromAccountToModule(gomock.Any(), gomock.Any(), types.ModuleName, gomock.Any()).DoAndReturn(func(_ sdk.Context, sender sdk.AccAddress, _ string, coins sdk.Coins) error { - newBalance, negative := balances[sender.String()].SafeSub(coins...) + senderAddr, err := addressCdc.BytesToString(sender) + if err != nil { + return err + } + newBalance, negative := balances[senderAddr].SafeSub(coins...) if negative { return fmt.Errorf("not enough balance") } - balances[sender.String()] = newBalance + balances[senderAddr] = newBalance return nil }).AnyTimes() bankKeeper.EXPECT().SendCoinsFromModuleToAccount(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).DoAndReturn(func(_ sdk.Context, module string, rcpt sdk.AccAddress, coins sdk.Coins) error { - balances[rcpt.String()] = balances[rcpt.String()].Add(coins...) + rcptAddr, err := addressCdc.BytesToString(rcpt) + if err != nil { + return err + } + balances[rcptAddr] = balances[rcptAddr].Add(coins...) return nil }).AnyTimes() - bankKeeper.EXPECT().GetAllBalances(gomock.Any(), gomock.Any()).DoAndReturn(func(_ sdk.Context, addr sdk.AccAddress) sdk.Coins { - return balances[addr.String()] + bankKeeper.EXPECT().GetAllBalances(gomock.Any(), gomock.Any()).DoAndReturn(func(_ sdk.Context, addr sdk.AccAddress) (sdk.Coins, error) { + addrStr, err := addressCdc.BytesToString(addr) + if err != nil { + return sdk.Coins{}, err + } + return balances[addrStr], nil }).AnyTimes() - bankKeeper.EXPECT().GetBalance(gomock.Any(), gomock.Any(), sdk.DefaultBondDenom).DoAndReturn(func(_ sdk.Context, addr sdk.AccAddress, _ string) sdk.Coin { - balances := balances[addr.String()] + bankKeeper.EXPECT().GetBalance(gomock.Any(), gomock.Any(), sdk.DefaultBondDenom).DoAndReturn(func(_ sdk.Context, addr sdk.AccAddress, _ string) (sdk.Coin, error) { + addrStr, err := addressCdc.BytesToString(addr) + if err != nil { + return sdk.Coin{}, err + } + balances := balances[addrStr] for _, balance := range balances { if balance.Denom == sdk.DefaultBondDenom { - return balance + return balance, nil } } - return sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(0)) + return sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(0)), nil }).AnyTimes() + return nil } diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index fc05386ce8e2..51b2e728fff1 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -165,7 +165,11 @@ func (k Keeper) AddDeposit(ctx context.Context, proposalID uint64, depositorAddr deposit.Amount = sdk.NewCoins(deposit.Amount...).Add(depositAmount...) case errors.IsOf(err, collections.ErrNotFound): // deposit doesn't exist - deposit = v1.NewDeposit(proposalID, depositorAddr, depositAmount) + addr, err := k.authKeeper.AddressCodec().BytesToString(depositorAddr) + if err != nil { + return false, err + } + deposit = v1.NewDeposit(proposalID, addr, depositAmount) default: // failed to get deposit return false, err @@ -177,8 +181,14 @@ func (k Keeper) AddDeposit(ctx context.Context, proposalID uint64, depositorAddr return false, err } + depositorStrAddr, err := k.authKeeper.AddressCodec().BytesToString(depositorAddr) + if err != nil { + return false, err + } + if err := k.environment.EventService.EventManager(ctx).EmitKV( types.EventTypeProposalDeposit, + event.NewAttribute(types.AttributeKeyDepositor, depositorStrAddr), event.NewAttribute(sdk.AttributeKeyAmount, depositAmount.String()), event.NewAttribute(types.AttributeKeyProposalID, fmt.Sprintf("%d", proposalID)), ); err != nil { @@ -247,7 +257,10 @@ func (k Keeper) ChargeDeposit(ctx context.Context, proposalID uint64, destAddres // burn the cancellation fee or send the cancellation charges to destination address. if !cancellationCharges.IsZero() { // get the pool module account address - poolAddress := k.authKeeper.GetModuleAddress(pooltypes.ModuleName) + poolAddress, err := k.authKeeper.AddressCodec().BytesToString(k.authKeeper.GetModuleAddress(pooltypes.ModuleName)) + if err != nil { + return err + } switch { case destAddress == "": // burn the cancellation charges from deposits @@ -255,7 +268,7 @@ func (k Keeper) ChargeDeposit(ctx context.Context, proposalID uint64, destAddres if err != nil { return err } - case poolAddress.String() == destAddress: + case poolAddress == destAddress: err := k.poolKeeper.FundCommunityPool(ctx, cancellationCharges, k.ModuleAccountAddress()) if err != nil { return err diff --git a/x/gov/keeper/deposit_test.go b/x/gov/keeper/deposit_test.go index afe696c4fc76..c0dbba8f91a4 100644 --- a/x/gov/keeper/deposit_test.go +++ b/x/gov/keeper/deposit_test.go @@ -40,8 +40,8 @@ func TestDeposits(t *testing.T) { t.Run(tc.name, func(t *testing.T) { govKeeper, mocks, _, ctx := setupGovKeeper(t) authKeeper, bankKeeper, stakingKeeper := mocks.acctKeeper, mocks.bankKeeper, mocks.stakingKeeper - trackMockBalances(bankKeeper) - + err := trackMockBalances(bankKeeper) + require.NoError(t, err) // With expedited proposals the minimum deposit is higher, so we must // initialize and deposit an amount depositMultiplier times larger // than the regular min deposit amount. @@ -53,6 +53,11 @@ func TestDeposits(t *testing.T) { TestAddrs := simtestutil.AddTestAddrsIncremental(bankKeeper, stakingKeeper, ctx, 2, sdkmath.NewInt(10000000*depositMultiplier)) authKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec("cosmos")).AnyTimes() + addr0Str, err := authKeeper.AddressCodec().BytesToString(TestAddrs[0]) + require.NoError(t, err) + addr1Str, err := authKeeper.AddressCodec().BytesToString(TestAddrs[1]) + require.NoError(t, err) + tp := TestProposal proposal, err := govKeeper.SubmitProposal(ctx, tp, "", "title", "summary", TestAddrs[0], tc.proposalType) require.NoError(t, err) @@ -80,7 +85,7 @@ func TestDeposits(t *testing.T) { deposit, err := govKeeper.Deposits.Get(ctx, collections.Join(proposalID, TestAddrs[0])) require.Nil(t, err) require.Equal(t, fourStake, sdk.NewCoins(deposit.Amount...)) - require.Equal(t, TestAddrs[0].String(), deposit.Depositor) + require.Equal(t, addr0Str, deposit.Depositor) proposal, err = govKeeper.Proposals.Get(ctx, proposalID) require.Nil(t, err) require.Equal(t, fourStake, sdk.NewCoins(proposal.TotalDeposit...)) @@ -93,7 +98,7 @@ func TestDeposits(t *testing.T) { deposit, err = govKeeper.Deposits.Get(ctx, collections.Join(proposalID, TestAddrs[0])) require.Nil(t, err) require.Equal(t, fourStake.Add(fiveStake...), sdk.NewCoins(deposit.Amount...)) - require.Equal(t, TestAddrs[0].String(), deposit.Depositor) + require.Equal(t, addr0Str, deposit.Depositor) proposal, err = govKeeper.Proposals.Get(ctx, proposalID) require.Nil(t, err) require.Equal(t, fourStake.Add(fiveStake...), sdk.NewCoins(proposal.TotalDeposit...)) @@ -105,7 +110,7 @@ func TestDeposits(t *testing.T) { require.True(t, votingStarted) deposit, err = govKeeper.Deposits.Get(ctx, collections.Join(proposalID, TestAddrs[1])) require.Nil(t, err) - require.Equal(t, TestAddrs[1].String(), deposit.Depositor) + require.Equal(t, addr1Str, deposit.Depositor) require.Equal(t, fourStake, sdk.NewCoins(deposit.Amount...)) proposal, err = govKeeper.Proposals.Get(ctx, proposalID) require.Nil(t, err) @@ -128,9 +133,9 @@ func TestDeposits(t *testing.T) { require.Len(t, deposits, 2) propDeposits, _ := govKeeper.GetDeposits(ctx, proposalID) require.Equal(t, deposits, propDeposits) - require.Equal(t, TestAddrs[0].String(), deposits[0].Depositor) + require.Equal(t, addr0Str, deposits[0].Depositor) require.Equal(t, fourStake.Add(fiveStake...), sdk.NewCoins(deposits[0].Amount...)) - require.Equal(t, TestAddrs[1].String(), deposits[1].Depositor) + require.Equal(t, addr1Str, deposits[1].Depositor) require.Equal(t, fourStake, sdk.NewCoins(deposits[1].Amount...)) // Test Refund Deposits @@ -214,7 +219,8 @@ func TestDepositAmount(t *testing.T) { t.Run(tc.name, func(t *testing.T) { govKeeper, mocks, _, ctx := setupGovKeeper(t) authKeeper, bankKeeper, stakingKeeper := mocks.acctKeeper, mocks.bankKeeper, mocks.stakingKeeper - trackMockBalances(bankKeeper) + err := trackMockBalances(bankKeeper) + require.NoError(t, err) testAddrs := simtestutil.AddTestAddrsIncremental(bankKeeper, stakingKeeper, ctx, 2, sdkmath.NewInt(1000000000000000)) authKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec("cosmos")).AnyTimes() @@ -222,7 +228,7 @@ func TestDepositAmount(t *testing.T) { params, _ := govKeeper.Params.Get(ctx) params.MinDepositRatio = tc.minDepositRatio params.MinDeposit = sdk.NewCoins(params.MinDeposit...).Add(sdk.NewCoin("zcoin", sdkmath.NewInt(10000))) // coins must be sorted by denom - err := govKeeper.Params.Set(ctx, params) + err = govKeeper.Params.Set(ctx, params) require.NoError(t, err) tp := TestProposal @@ -410,10 +416,14 @@ func TestChargeDeposit(t *testing.T) { params.ProposalCancelDest = "" case 1: // normal account address for proposal cancel dest address - params.ProposalCancelDest = TestAddrs[1].String() + addrStr, err := authKeeper.AddressCodec().BytesToString(TestAddrs[1]) + require.NoError(t, err) + params.ProposalCancelDest = addrStr default: // community address for proposal cancel dest address - params.ProposalCancelDest = authtypes.NewModuleAddress(protocolModuleName).String() + addrStr, err := authKeeper.AddressCodec().BytesToString(authtypes.NewModuleAddress(protocolModuleName)) + require.NoError(t, err) + params.ProposalCancelDest = addrStr } err := govKeeper.Params.Set(ctx, params) @@ -440,8 +450,11 @@ func TestChargeDeposit(t *testing.T) { // get the deposits allDeposits, _ := govKeeper.GetDeposits(ctx, proposalID) + addr0Str, err := authKeeper.AddressCodec().BytesToString(TestAddrs[0]) + require.NoError(t, err) + // charge cancellation charges for cancel proposal - err = govKeeper.ChargeDeposit(ctx, proposalID, TestAddrs[0].String(), params.ProposalCancelRatio) + err = govKeeper.ChargeDeposit(ctx, proposalID, addr0Str, params.ProposalCancelRatio) if tc.expectError { require.Error(t, err) return diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index 28ceb6236d9e..0d90df884de6 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -19,7 +19,8 @@ import ( func (suite *KeeperTestSuite) TestGRPCQueryProposal() { suite.reset() ctx, queryClient, addrs := suite.ctx, suite.queryClient, suite.addrs - + govAcctStr, err := suite.acctKeeper.AddressCodec().BytesToString(govAcct) + suite.Require().NoError(err) var ( req *v1.QueryProposalRequest expProposal v1.Proposal @@ -56,7 +57,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposal() { func() { req = &v1.QueryProposalRequest{ProposalId: 1} testProposal := v1beta1.NewTextProposal("Proposal", "testing proposal") - msgContent, err := v1.NewLegacyContent(testProposal, govAcct.String()) + msgContent, err := v1.NewLegacyContent(testProposal, govAcctStr) suite.Require().NoError(err) submittedProposal, err := suite.govKeeper.SubmitProposal(ctx, []sdk.Msg{msgContent}, "", "title", "summary", addrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) suite.Require().NoError(err) @@ -102,6 +103,8 @@ func (suite *KeeperTestSuite) TestGRPCQueryConstitution() { func (suite *KeeperTestSuite) TestLegacyGRPCQueryProposal() { suite.reset() ctx, queryClient, addrs := suite.ctx, suite.legacyQueryClient, suite.addrs + govAcctStr, err := suite.acctKeeper.AddressCodec().BytesToString(govAcct) + suite.Require().NoError(err) var ( req *v1beta1.QueryProposalRequest @@ -139,7 +142,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryProposal() { func() { req = &v1beta1.QueryProposalRequest{ProposalId: 1} testProposal := v1beta1.NewTextProposal("Proposal", "testing proposal") - msgContent, err := v1.NewLegacyContent(testProposal, govAcct.String()) + msgContent, err := v1.NewLegacyContent(testProposal, govAcctStr) suite.Require().NoError(err) submittedProposal, err := suite.govKeeper.SubmitProposal(ctx, []sdk.Msg{msgContent}, "", "title", "summary", addrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) suite.Require().NoError(err) @@ -155,7 +158,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryProposal() { func() { req = &v1beta1.QueryProposalRequest{ProposalId: 2} testProposal := v1beta1.NewTextProposal("Proposal", "testing proposal") - msgContent, err := v1.NewLegacyContent(testProposal, govAcct.String()) + msgContent, err := v1.NewLegacyContent(testProposal, govAcctStr) suite.Require().NoError(err) submittedProposal, err := suite.govKeeper.SubmitProposal(ctx, []sdk.Msg{msgContent}, "", "title", "summary", addrs[0], v1.ProposalType_PROPOSAL_TYPE_EXPEDITED) suite.Require().NoError(err) @@ -191,7 +194,8 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryProposal() { func (suite *KeeperTestSuite) TestGRPCQueryProposals() { suite.reset() ctx, queryClient, addrs := suite.ctx, suite.queryClient, suite.addrs - + addr0Str, err := suite.acctKeeper.AddressCodec().BytesToString(addrs[0]) + suite.Require().NoError(err) testProposals := []*v1.Proposal{} var ( @@ -216,7 +220,8 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { func() { // create 5 test proposals for i := 0; i < 5; i++ { - govAddress := suite.govKeeper.GetGovernanceAccount(suite.ctx).GetAddress() + govAddress, err := suite.acctKeeper.AddressCodec().BytesToString(suite.govKeeper.GetGovernanceAccount(suite.ctx).GetAddress()) + suite.Require().NoError(err) testProposal := []sdk.Msg{ v1.NewMsgVote(govAddress, uint64(i), v1.OptionYes, ""), } @@ -279,12 +284,12 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { "request with filter of deposit address", func() { depositCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, suite.stakingKeeper.TokensFromConsensusPower(ctx, 20))) - deposit := v1.NewDeposit(testProposals[0].Id, addrs[0], depositCoins) + deposit := v1.NewDeposit(testProposals[0].Id, addr0Str, depositCoins) err := suite.govKeeper.SetDeposit(ctx, deposit) suite.Require().NoError(err) req = &v1.QueryProposalsRequest{ - Depositor: addrs[0].String(), + Depositor: addr0Str, } expRes = &v1.QueryProposalsResponse{ @@ -302,7 +307,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { suite.Require().NoError(suite.govKeeper.AddVote(ctx, testProposals[1].Id, addrs[0], v1.NewNonSplitVoteOption(v1.OptionAbstain), "")) req = &v1.QueryProposalsRequest{ - Voter: addrs[0].String(), + Voter: addr0Str, } expRes = &v1.QueryProposalsResponse{ @@ -406,6 +411,8 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { func (suite *KeeperTestSuite) TestLegacyGRPCQueryProposals() { suite.reset() ctx, queryClient, addrs := suite.ctx, suite.legacyQueryClient, suite.addrs + govAcctStr, err := suite.acctKeeper.AddressCodec().BytesToString(govAcct) + suite.Require().NoError(err) var req *v1beta1.QueryProposalsRequest @@ -419,7 +426,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryProposals() { func() { req = &v1beta1.QueryProposalsRequest{} testProposal := v1beta1.NewTextProposal("Proposal", "testing proposal") - msgContent, err := v1.NewLegacyContent(testProposal, govAcct.String()) + msgContent, err := v1.NewLegacyContent(testProposal, govAcctStr) suite.Require().NoError(err) submittedProposal, err := suite.govKeeper.SubmitProposal(ctx, []sdk.Msg{msgContent}, "", "title", "summary", addrs[0], v1.ProposalType_PROPOSAL_TYPE_STANDARD) suite.Require().NoError(err) @@ -451,6 +458,10 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryProposals() { func (suite *KeeperTestSuite) TestGRPCQueryVote() { ctx, queryClient, addrs := suite.ctx, suite.queryClient, suite.addrs + addr0Str, err := suite.acctKeeper.AddressCodec().BytesToString(addrs[0]) + suite.Require().NoError(err) + addr1Str, err := suite.acctKeeper.AddressCodec().BytesToString(addrs[1]) + suite.Require().NoError(err) var ( req *v1.QueryVoteRequest @@ -475,7 +486,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { func() { req = &v1.QueryVoteRequest{ ProposalId: 0, - Voter: addrs[0].String(), + Voter: addr0Str, } }, false, @@ -495,7 +506,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { func() { req = &v1.QueryVoteRequest{ ProposalId: 3, - Voter: addrs[0].String(), + Voter: addr0Str, } }, false, @@ -509,7 +520,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { req = &v1.QueryVoteRequest{ ProposalId: proposal.Id, - Voter: addrs[0].String(), + Voter: addr0Str, } expRes = &v1.QueryVoteResponse{} @@ -526,10 +537,10 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { req = &v1.QueryVoteRequest{ ProposalId: proposal.Id, - Voter: addrs[0].String(), + Voter: addr0Str, } - expRes = &v1.QueryVoteResponse{Vote: &v1.Vote{ProposalId: proposal.Id, Voter: addrs[0].String(), Options: []*v1.WeightedVoteOption{{Option: v1.OptionAbstain, Weight: math.LegacyMustNewDecFromStr("1.0").String()}}}} + expRes = &v1.QueryVoteResponse{Vote: &v1.Vote{ProposalId: proposal.Id, Voter: addr0Str, Options: []*v1.WeightedVoteOption{{Option: v1.OptionAbstain, Weight: math.LegacyMustNewDecFromStr("1.0").String()}}}} }, true, }, @@ -538,7 +549,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { func() { req = &v1.QueryVoteRequest{ ProposalId: proposal.Id, - Voter: addrs[1].String(), + Voter: addr1Str, } expRes = &v1.QueryVoteResponse{} @@ -568,7 +579,10 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { func (suite *KeeperTestSuite) TestLegacyGRPCQueryVote() { ctx, queryClient, addrs := suite.ctx, suite.legacyQueryClient, suite.addrs - + addr0Str, err := suite.acctKeeper.AddressCodec().BytesToString(addrs[0]) + suite.Require().NoError(err) + addr1Str, err := suite.acctKeeper.AddressCodec().BytesToString(addrs[1]) + suite.Require().NoError(err) var ( req *v1beta1.QueryVoteRequest expRes *v1beta1.QueryVoteResponse @@ -592,7 +606,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryVote() { func() { req = &v1beta1.QueryVoteRequest{ ProposalId: 0, - Voter: addrs[0].String(), + Voter: addr0Str, } }, false, @@ -612,7 +626,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryVote() { func() { req = &v1beta1.QueryVoteRequest{ ProposalId: 3, - Voter: addrs[0].String(), + Voter: addr0Str, } }, false, @@ -626,7 +640,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryVote() { req = &v1beta1.QueryVoteRequest{ ProposalId: proposal.Id, - Voter: addrs[0].String(), + Voter: addr0Str, } expRes = &v1beta1.QueryVoteResponse{} @@ -643,10 +657,10 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryVote() { req = &v1beta1.QueryVoteRequest{ ProposalId: proposal.Id, - Voter: addrs[0].String(), + Voter: addr0Str, } - expRes = &v1beta1.QueryVoteResponse{Vote: v1beta1.Vote{ProposalId: proposal.Id, Voter: addrs[0].String(), Options: []v1beta1.WeightedVoteOption{{Option: v1beta1.OptionAbstain, Weight: math.LegacyMustNewDecFromStr("1.0")}}}} + expRes = &v1beta1.QueryVoteResponse{Vote: v1beta1.Vote{ProposalId: proposal.Id, Voter: addr0Str, Options: []v1beta1.WeightedVoteOption{{Option: v1beta1.OptionAbstain, Weight: math.LegacyMustNewDecFromStr("1.0")}}}} }, true, }, @@ -655,7 +669,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryVote() { func() { req = &v1beta1.QueryVoteRequest{ ProposalId: proposal.Id, - Voter: addrs[1].String(), + Voter: addr1Str, } expRes = &v1beta1.QueryVoteResponse{} @@ -688,6 +702,10 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() { ctx, queryClient := suite.ctx, suite.queryClient addrs := simtestutil.AddTestAddrsIncremental(suite.bankKeeper, suite.stakingKeeper, ctx, 2, math.NewInt(30000000)) + addr0Str, err := suite.acctKeeper.AddressCodec().BytesToString(addrs[0]) + suite.Require().NoError(err) + addr1Str, err := suite.acctKeeper.AddressCodec().BytesToString(addrs[1]) + suite.Require().NoError(err) var ( req *v1.QueryVotesRequest @@ -746,8 +764,8 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() { err := suite.govKeeper.Proposals.Set(suite.ctx, proposal.Id, proposal) suite.Require().NoError(err) votes = []*v1.Vote{ - {ProposalId: proposal.Id, Voter: addrs[0].String(), Options: v1.NewNonSplitVoteOption(v1.OptionAbstain)}, - {ProposalId: proposal.Id, Voter: addrs[1].String(), Options: v1.NewNonSplitVoteOption(v1.OptionYes)}, + {ProposalId: proposal.Id, Voter: addr0Str, Options: v1.NewNonSplitVoteOption(v1.OptionAbstain)}, + {ProposalId: proposal.Id, Voter: addr1Str, Options: v1.NewNonSplitVoteOption(v1.OptionYes)}, } codec := address.NewBech32Codec("cosmos") @@ -794,6 +812,10 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryVotes() { ctx, queryClient := suite.ctx, suite.legacyQueryClient addrs := simtestutil.AddTestAddrsIncremental(suite.bankKeeper, suite.stakingKeeper, ctx, 2, math.NewInt(30000000)) + addr0Str, err := suite.acctKeeper.AddressCodec().BytesToString(addrs[0]) + suite.Require().NoError(err) + addr1Str, err := suite.acctKeeper.AddressCodec().BytesToString(addrs[1]) + suite.Require().NoError(err) var ( req *v1beta1.QueryVotesRequest @@ -853,8 +875,8 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryVotes() { suite.Require().NoError(err) votes = []v1beta1.Vote{ - {ProposalId: proposal.Id, Voter: addrs[0].String(), Options: v1beta1.NewNonSplitVoteOption(v1beta1.OptionAbstain)}, - {ProposalId: proposal.Id, Voter: addrs[1].String(), Options: v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes)}, + {ProposalId: proposal.Id, Voter: addr0Str, Options: v1beta1.NewNonSplitVoteOption(v1beta1.OptionAbstain)}, + {ProposalId: proposal.Id, Voter: addr1Str, Options: v1beta1.NewNonSplitVoteOption(v1beta1.OptionYes)}, } codec := address.NewBech32Codec("cosmos") @@ -1095,6 +1117,8 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryParams() { func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { suite.reset() ctx, queryClient, addrs := suite.ctx, suite.queryClient, suite.addrs + addr0Str, err := suite.acctKeeper.AddressCodec().BytesToString(addrs[0]) + suite.Require().NoError(err) var ( req *v1.QueryDepositRequest @@ -1119,7 +1143,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { func() { req = &v1.QueryDepositRequest{ ProposalId: 0, - Depositor: addrs[0].String(), + Depositor: addr0Str, } }, false, @@ -1139,7 +1163,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { func() { req = &v1.QueryDepositRequest{ ProposalId: 2, - Depositor: addrs[0].String(), + Depositor: addr0Str, } }, false, @@ -1154,7 +1178,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { req = &v1.QueryDepositRequest{ ProposalId: proposal.Id, - Depositor: addrs[0].String(), + Depositor: addr0Str, } }, false, @@ -1163,13 +1187,13 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { "valid request", func() { depositCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, suite.stakingKeeper.TokensFromConsensusPower(ctx, 20))) - deposit := v1.NewDeposit(proposal.Id, addrs[0], depositCoins) + deposit := v1.NewDeposit(proposal.Id, addr0Str, depositCoins) err := suite.govKeeper.SetDeposit(ctx, deposit) suite.Require().NoError(err) req = &v1.QueryDepositRequest{ ProposalId: proposal.Id, - Depositor: addrs[0].String(), + Depositor: addr0Str, } expRes = &v1.QueryDepositResponse{Deposit: &deposit} @@ -1199,6 +1223,8 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { func (suite *KeeperTestSuite) TestLegacyGRPCQueryDeposit() { ctx, queryClient, addrs := suite.ctx, suite.legacyQueryClient, suite.addrs + addr0Str, err := suite.acctKeeper.AddressCodec().BytesToString(addrs[0]) + suite.Require().NoError(err) var ( req *v1beta1.QueryDepositRequest @@ -1223,7 +1249,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryDeposit() { func() { req = &v1beta1.QueryDepositRequest{ ProposalId: 0, - Depositor: addrs[0].String(), + Depositor: addr0Str, } }, false, @@ -1243,7 +1269,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryDeposit() { func() { req = &v1beta1.QueryDepositRequest{ ProposalId: 2, - Depositor: addrs[0].String(), + Depositor: addr0Str, } }, false, @@ -1258,7 +1284,7 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryDeposit() { req = &v1beta1.QueryDepositRequest{ ProposalId: proposal.Id, - Depositor: addrs[0].String(), + Depositor: addr0Str, } }, false, @@ -1267,14 +1293,14 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryDeposit() { "valid request", func() { depositCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, suite.stakingKeeper.TokensFromConsensusPower(ctx, 20))) - deposit := v1beta1.NewDeposit(proposal.Id, addrs[0], depositCoins) - v1deposit := v1.NewDeposit(proposal.Id, addrs[0], depositCoins) + deposit := v1beta1.NewDeposit(proposal.Id, addr0Str, depositCoins) + v1deposit := v1.NewDeposit(proposal.Id, addr0Str, depositCoins) err := suite.govKeeper.SetDeposit(ctx, v1deposit) suite.Require().NoError(err) req = &v1beta1.QueryDepositRequest{ ProposalId: proposal.Id, - Depositor: addrs[0].String(), + Depositor: addr0Str, } expRes = &v1beta1.QueryDepositResponse{Deposit: deposit} @@ -1304,6 +1330,10 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryDeposit() { func (suite *KeeperTestSuite) TestGRPCQueryDeposits() { ctx, queryClient, addrs := suite.ctx, suite.queryClient, suite.addrs + addr0Str, err := suite.acctKeeper.AddressCodec().BytesToString(addrs[0]) + suite.Require().NoError(err) + addr1Str, err := suite.acctKeeper.AddressCodec().BytesToString(addrs[1]) + suite.Require().NoError(err) var ( req *v1.QueryDepositsRequest @@ -1358,12 +1388,12 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposits() { "get deposits with default limit", func() { depositAmount1 := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, suite.stakingKeeper.TokensFromConsensusPower(ctx, 20))) - deposit1 := v1.NewDeposit(proposal.Id, addrs[0], depositAmount1) + deposit1 := v1.NewDeposit(proposal.Id, addr0Str, depositAmount1) err := suite.govKeeper.SetDeposit(ctx, deposit1) suite.Require().NoError(err) depositAmount2 := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, suite.stakingKeeper.TokensFromConsensusPower(ctx, 30))) - deposit2 := v1.NewDeposit(proposal.Id, addrs[1], depositAmount2) + deposit2 := v1.NewDeposit(proposal.Id, addr1Str, depositAmount2) err = suite.govKeeper.SetDeposit(ctx, deposit2) suite.Require().NoError(err) @@ -1403,6 +1433,10 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposits() { func (suite *KeeperTestSuite) TestLegacyGRPCQueryDeposits() { suite.reset() ctx, queryClient, addrs := suite.ctx, suite.legacyQueryClient, suite.addrs + addr0Str, err := suite.acctKeeper.AddressCodec().BytesToString(addrs[0]) + suite.Require().NoError(err) + addr1Str, err := suite.acctKeeper.AddressCodec().BytesToString(addrs[1]) + suite.Require().NoError(err) var ( req *v1beta1.QueryDepositsRequest @@ -1457,14 +1491,14 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryDeposits() { "get deposits with default limit", func() { depositAmount1 := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, suite.stakingKeeper.TokensFromConsensusPower(ctx, 20))) - deposit1 := v1beta1.NewDeposit(proposal.Id, addrs[0], depositAmount1) - v1deposit1 := v1.NewDeposit(proposal.Id, addrs[0], depositAmount1) + deposit1 := v1beta1.NewDeposit(proposal.Id, addr0Str, depositAmount1) + v1deposit1 := v1.NewDeposit(proposal.Id, addr0Str, depositAmount1) err := suite.govKeeper.SetDeposit(ctx, v1deposit1) suite.Require().NoError(err) depositAmount2 := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, suite.stakingKeeper.TokensFromConsensusPower(ctx, 30))) - deposit2 := v1beta1.NewDeposit(proposal.Id, addrs[1], depositAmount2) - v1deposit2 := v1.NewDeposit(proposal.Id, addrs[1], depositAmount2) + deposit2 := v1beta1.NewDeposit(proposal.Id, addr1Str, depositAmount2) + v1deposit2 := v1.NewDeposit(proposal.Id, addr1Str, depositAmount2) err = suite.govKeeper.SetDeposit(ctx, v1deposit2) suite.Require().NoError(err) diff --git a/x/gov/keeper/keeper_test.go b/x/gov/keeper/keeper_test.go index f24149a42183..1d6644f4aef1 100644 --- a/x/gov/keeper/keeper_test.go +++ b/x/gov/keeper/keeper_test.go @@ -72,7 +72,10 @@ func (suite *KeeperTestSuite) reset() { suite.legacyQueryClient = legacyQueryClient suite.msgSrvr = keeper.NewMsgServerImpl(suite.govKeeper) - suite.legacyMsgSrvr = keeper.NewLegacyMsgServerImpl(govAcct.String(), suite.msgSrvr) + govStrAcct, err := suite.acctKeeper.AddressCodec().BytesToString(govAcct) + suite.Require().NoError(err) + + suite.legacyMsgSrvr = keeper.NewLegacyMsgServerImpl(govStrAcct, suite.msgSrvr) suite.addrs = simtestutil.AddTestAddrsIncremental(bankKeeper, stakingKeeper, ctx, 3, sdkmath.NewInt(300000000)) suite.acctKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec("cosmos")).AnyTimes() diff --git a/x/gov/keeper/msg_server_test.go b/x/gov/keeper/msg_server_test.go index 994d4672825b..7015e047e7d7 100644 --- a/x/gov/keeper/msg_server_test.go +++ b/x/gov/keeper/msg_server_test.go @@ -9,6 +9,7 @@ import ( v1 "cosmossdk.io/x/gov/types/v1" "cosmossdk.io/x/gov/types/v1beta1" + codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" "github.com/cosmos/cosmos-sdk/codec/types" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" "github.com/cosmos/cosmos-sdk/testutil/testdata" @@ -24,17 +25,20 @@ var longAddressError = "address max length is 255" func (suite *KeeperTestSuite) TestMsgSubmitProposal() { suite.reset() - govAcct := suite.govKeeper.GetGovernanceAccount(suite.ctx).GetAddress() addrs := suite.addrs - proposer := addrs[0] + proposerAddr, err := suite.acctKeeper.AddressCodec().BytesToString(addrs[0]) + suite.Require().NoError(err) + + govStrAcct, err := suite.acctKeeper.AddressCodec().BytesToString(suite.govKeeper.GetGovernanceAccount(suite.ctx).GetAddress()) + suite.Require().NoError(err) coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100000))) initialDeposit := coins params, _ := suite.govKeeper.Params.Get(suite.ctx) minDeposit := params.MinDeposit bankMsg := &banktypes.MsgSend{ - FromAddress: govAcct.String(), - ToAddress: proposer.String(), + FromAddress: govStrAcct, + ToAddress: proposerAddr, Amount: coins, } @@ -63,7 +67,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { return v1.NewMsgSubmitProposal( nil, initialDeposit, - proposer.String(), + proposerAddr, "", "Proposal", "description of proposal", @@ -78,7 +82,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { return v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, initialDeposit, - proposer.String(), + proposerAddr, "", "", "description of proposal", @@ -93,7 +97,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { return v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, initialDeposit, - proposer.String(), + proposerAddr, "", "Proposal", "", @@ -108,7 +112,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { return v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, initialDeposit, - proposer.String(), + proposerAddr, "{\"title\":\"Proposal\", \"description\":\"description of proposal\"}", "Proposal2", "description of proposal", @@ -123,7 +127,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { return v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, initialDeposit, - proposer.String(), + proposerAddr, "{\"title\":\"Proposal\", \"description\":\"description of proposal\"}", "Proposal", "description", @@ -138,7 +142,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { return v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, initialDeposit, - proposer.String(), + proposerAddr, "Metadata", strings.Repeat("1", 256), "description of proposal", @@ -153,7 +157,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { return v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, initialDeposit, - proposer.String(), + proposerAddr, strings.Repeat("1", 257), "Proposal", "description of proposal", @@ -168,7 +172,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { return v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, initialDeposit, - proposer.String(), + proposerAddr, "", "Proposal", strings.Repeat("1", 10201), @@ -183,7 +187,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { return v1.NewMsgSubmitProposal( []sdk.Msg{testdata.NewTestMsg(govAcct, addrs[0])}, initialDeposit, - proposer.String(), + proposerAddr, "", "Proposal", "description of proposal", @@ -198,7 +202,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { return v1.NewMsgSubmitProposal( []sdk.Msg{testdata.NewTestMsg(addrs[0])}, initialDeposit, - proposer.String(), + proposerAddr, "", "Proposal", "description of proposal", @@ -213,7 +217,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { return v1.NewMsgSubmitProposal( []sdk.Msg{testdata.NewTestMsg(govAcct)}, initialDeposit, - proposer.String(), + proposerAddr, "", "Proposal", "description of proposal", @@ -228,7 +232,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { return v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, []sdk.Coin{sdk.NewCoin("invalid", sdkmath.NewInt(100))}, - proposer.String(), + proposerAddr, "", "Proposal", "description of proposal", @@ -243,7 +247,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { return v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, initialDeposit.Add(sdk.NewCoin("invalid", sdkmath.NewInt(100))), - proposer.String(), + proposerAddr, "", "Proposal", "description of proposal", @@ -258,7 +262,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { return v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, initialDeposit, - proposer.String(), + proposerAddr, "", "Proposal", "description of proposal", @@ -272,7 +276,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { return v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, minDeposit, - proposer.String(), + proposerAddr, "", "Proposal", "description of proposal", @@ -304,7 +308,8 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { func (suite *KeeperTestSuite) TestSubmitMultipleChoiceProposal() { suite.reset() addrs := suite.addrs - proposer := addrs[0] + proposerAddr, err := suite.acctKeeper.AddressCodec().BytesToString(addrs[0]) + suite.Require().NoError(err) initialDeposit := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100000))) cases := map[string]struct { @@ -316,7 +321,7 @@ func (suite *KeeperTestSuite) TestSubmitMultipleChoiceProposal() { preRun: func() (*v1.MsgSubmitMultipleChoiceProposal, error) { return v1.NewMultipleChoiceMsgSubmitProposal( initialDeposit, - proposer.String(), + proposerAddr, "mandatory metadata", "Proposal", "description of proposal", @@ -330,7 +335,7 @@ func (suite *KeeperTestSuite) TestSubmitMultipleChoiceProposal() { preRun: func() (*v1.MsgSubmitMultipleChoiceProposal, error) { return v1.NewMultipleChoiceMsgSubmitProposal( initialDeposit, - proposer.String(), + proposerAddr, "mandatory metadata", "Proposal", "description of proposal", @@ -347,7 +352,7 @@ func (suite *KeeperTestSuite) TestSubmitMultipleChoiceProposal() { preRun: func() (*v1.MsgSubmitMultipleChoiceProposal, error) { return v1.NewMultipleChoiceMsgSubmitProposal( initialDeposit, - proposer.String(), + proposerAddr, "mandatory metadata", "Proposal", "description of proposal", @@ -380,18 +385,23 @@ func (suite *KeeperTestSuite) TestMsgCancelProposal() { govAcct := suite.govKeeper.GetGovernanceAccount(suite.ctx).GetAddress() addrs := suite.addrs proposer := addrs[0] + proposerAddr, err := suite.acctKeeper.AddressCodec().BytesToString(proposer) + suite.Require().NoError(err) + + govStrAcct, err := suite.acctKeeper.AddressCodec().BytesToString(govAcct) + suite.Require().NoError(err) coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100000))) bankMsg := &banktypes.MsgSend{ - FromAddress: govAcct.String(), - ToAddress: proposer.String(), + FromAddress: govStrAcct, + ToAddress: proposerAddr, Amount: coins, } msg, err := v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, coins, - proposer.String(), + proposerAddr, "", "title", "summary", v1.ProposalType_PROPOSAL_TYPE_STANDARD, ) @@ -438,7 +448,7 @@ func (suite *KeeperTestSuite) TestMsgCancelProposal() { msg, err := v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, coins, - proposer.String(), + proposerAddr, "", "Proposal", "description of proposal", @@ -459,8 +469,10 @@ func (suite *KeeperTestSuite) TestMsgCancelProposal() { for name, tc := range cases { suite.Run(name, func() { proposalID := tc.preRun() - cancelProposalReq := v1.NewMsgCancelProposal(proposalID, tc.depositor.String()) - _, err := suite.msgSrvr.CancelProposal(suite.ctx, cancelProposalReq) + depositor, err := suite.acctKeeper.AddressCodec().BytesToString(tc.depositor) + suite.Require().NoError(err) + cancelProposalReq := v1.NewMsgCancelProposal(proposalID, depositor) + _, err = suite.msgSrvr.CancelProposal(suite.ctx, cancelProposalReq) if tc.expErr { suite.Require().Error(err) suite.Require().Contains(err.Error(), tc.expErrMsg) @@ -473,23 +485,26 @@ func (suite *KeeperTestSuite) TestMsgCancelProposal() { func (suite *KeeperTestSuite) TestMsgVote() { suite.reset() - govAcct := suite.govKeeper.GetGovernanceAccount(suite.ctx).GetAddress() addrs := suite.addrs proposer := addrs[0] + proposerAddr, err := suite.acctKeeper.AddressCodec().BytesToString(proposer) + suite.Require().NoError(err) + govStrAcct, err := suite.acctKeeper.AddressCodec().BytesToString(suite.govKeeper.GetGovernanceAccount(suite.ctx).GetAddress()) + suite.Require().NoError(err) coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100000))) params, _ := suite.govKeeper.Params.Get(suite.ctx) minDeposit := params.MinDeposit bankMsg := &banktypes.MsgSend{ - FromAddress: govAcct.String(), - ToAddress: proposer.String(), + FromAddress: govStrAcct, + ToAddress: proposerAddr, Amount: coins, } msg, err := v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, minDeposit, - proposer.String(), + proposerAddr, "", "Proposal", "description of proposal", @@ -503,12 +518,14 @@ func (suite *KeeperTestSuite) TestMsgVote() { proposalID := res.ProposalId cases := map[string]struct { - preRun func() uint64 - expErr bool - expErrMsg string - option v1.VoteOption - metadata string - voter sdk.AccAddress + preRun func() uint64 + expErr bool + expErrMsg string + expAddrErr bool + expAddrErrMsg string + option v1.VoteOption + metadata string + voter sdk.AccAddress }{ "empty voter": { preRun: func() uint64 { @@ -535,7 +552,7 @@ func (suite *KeeperTestSuite) TestMsgVote() { msg, err := v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, minDeposit, - proposer.String(), + proposerAddr, "", "Proposal", "description of proposal", @@ -559,7 +576,7 @@ func (suite *KeeperTestSuite) TestMsgVote() { msg, err := v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, coins, - proposer.String(), + proposerAddr, "", "Proposal", "description of proposal", @@ -592,18 +609,20 @@ func (suite *KeeperTestSuite) TestMsgVote() { preRun: func() uint64 { return proposalID }, - option: v1.VoteOption_VOTE_OPTION_ONE, - voter: sdk.AccAddress(strings.Repeat("a", 300)), - metadata: "", - expErr: true, - expErrMsg: longAddressError, + option: v1.VoteOption_VOTE_OPTION_ONE, + voter: sdk.AccAddress(strings.Repeat("a", 300)), + metadata: "", + expErr: true, + expErrMsg: "invalid voter address: empty address string is not allowed", + expAddrErr: true, + expAddrErrMsg: longAddressError, }, "all good": { preRun: func() uint64 { msg, err := v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, minDeposit, - proposer.String(), + proposerAddr, "", "Proposal", "description of proposal", @@ -626,8 +645,15 @@ func (suite *KeeperTestSuite) TestMsgVote() { for name, tc := range cases { suite.Run(name, func() { pID := tc.preRun() - voteReq := v1.NewMsgVote(tc.voter, pID, tc.option, tc.metadata) - _, err := suite.msgSrvr.Vote(suite.ctx, voteReq) + voter, err := suite.acctKeeper.AddressCodec().BytesToString(tc.voter) + if tc.expAddrErr { + suite.Require().Error(err) + suite.Require().Contains(err.Error(), tc.expAddrErrMsg) + } else { + suite.Require().NoError(err) + } + voteReq := v1.NewMsgVote(voter, pID, tc.option, tc.metadata) + _, err = suite.msgSrvr.Vote(suite.ctx, voteReq) if tc.expErr { suite.Require().Error(err) suite.Require().Contains(err.Error(), tc.expErrMsg) @@ -641,22 +667,26 @@ func (suite *KeeperTestSuite) TestMsgVote() { func (suite *KeeperTestSuite) TestMsgVoteWeighted() { suite.reset() govAcct := suite.govKeeper.GetGovernanceAccount(suite.ctx).GetAddress() + govStrAcct, err := suite.acctKeeper.AddressCodec().BytesToString(govAcct) + suite.Require().NoError(err) proposer := simtestutil.AddTestAddrsIncremental(suite.bankKeeper, suite.stakingKeeper, suite.ctx, 1, sdkmath.NewInt(50000000))[0] + proposerAddr, err := suite.acctKeeper.AddressCodec().BytesToString(proposer) + suite.Require().NoError(err) coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100000))) params, _ := suite.govKeeper.Params.Get(suite.ctx) minDeposit := params.MinDeposit bankMsg := &banktypes.MsgSend{ - FromAddress: govAcct.String(), - ToAddress: proposer.String(), + FromAddress: govStrAcct, + ToAddress: proposerAddr, Amount: coins, } msg, err := v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, minDeposit, - proposer.String(), + proposerAddr, "", "Proposal", "description of proposal", @@ -670,13 +700,15 @@ func (suite *KeeperTestSuite) TestMsgVoteWeighted() { proposalID := res.ProposalId cases := map[string]struct { - preRun func() uint64 - vote *v1.MsgVote - expErr bool - expErrMsg string - option v1.WeightedVoteOptions - metadata string - voter sdk.AccAddress + preRun func() uint64 + vote *v1.MsgVote + expErr bool + expErrMsg string + expAddrErr bool + expAddrErrMsg string + option v1.WeightedVoteOptions + metadata string + voter sdk.AccAddress }{ "empty voter": { preRun: func() uint64 { @@ -778,7 +810,7 @@ func (suite *KeeperTestSuite) TestMsgVoteWeighted() { msg, err := v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, minDeposit, - proposer.String(), + proposerAddr, "", "Proposal", "description of proposal", @@ -814,7 +846,7 @@ func (suite *KeeperTestSuite) TestMsgVoteWeighted() { msg, err := v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, coins, - proposer.String(), + proposerAddr, "", "Proposal", "description of proposal", @@ -847,18 +879,20 @@ func (suite *KeeperTestSuite) TestMsgVoteWeighted() { preRun: func() uint64 { return proposalID }, - option: v1.NewNonSplitVoteOption(v1.VoteOption_VOTE_OPTION_ONE), - voter: sdk.AccAddress(strings.Repeat("a", 300)), - metadata: "", - expErr: true, - expErrMsg: longAddressError, + option: v1.NewNonSplitVoteOption(v1.VoteOption_VOTE_OPTION_ONE), + voter: sdk.AccAddress(strings.Repeat("a", 300)), + metadata: "", + expErr: true, + expErrMsg: "invalid voter address: empty address string is not allowed", + expAddrErr: true, + expAddrErrMsg: longAddressError, }, "all good": { preRun: func() uint64 { msg, err := v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, minDeposit, - proposer.String(), + proposerAddr, "", "Proposal", "description of proposal", @@ -881,7 +915,7 @@ func (suite *KeeperTestSuite) TestMsgVoteWeighted() { msg, err := v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, minDeposit, - proposer.String(), + proposerAddr, "", "Proposal", "description of proposal", @@ -907,8 +941,15 @@ func (suite *KeeperTestSuite) TestMsgVoteWeighted() { for name, tc := range cases { suite.Run(name, func() { pID := tc.preRun() - voteReq := v1.NewMsgVoteWeighted(tc.voter, pID, tc.option, tc.metadata) - _, err := suite.msgSrvr.VoteWeighted(suite.ctx, voteReq) + voter, err := suite.acctKeeper.AddressCodec().BytesToString(tc.voter) + if tc.expAddrErr { + suite.Require().Error(err) + suite.Require().Contains(err.Error(), tc.expAddrErrMsg) + } else { + suite.Require().NoError(err) + } + voteReq := v1.NewMsgVoteWeighted(voter, pID, tc.option, tc.metadata) + _, err = suite.msgSrvr.VoteWeighted(suite.ctx, voteReq) if tc.expErr { suite.Require().Error(err) suite.Require().Contains(err.Error(), tc.expErrMsg) @@ -921,23 +962,26 @@ func (suite *KeeperTestSuite) TestMsgVoteWeighted() { func (suite *KeeperTestSuite) TestMsgDeposit() { suite.reset() - govAcct := suite.govKeeper.GetGovernanceAccount(suite.ctx).GetAddress() + govStrAcct, err := suite.acctKeeper.AddressCodec().BytesToString(suite.govKeeper.GetGovernanceAccount(suite.ctx).GetAddress()) + suite.Require().NoError(err) addrs := suite.addrs proposer := addrs[0] + proposerAddr, err := suite.acctKeeper.AddressCodec().BytesToString(proposer) + suite.Require().NoError(err) coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100000))) params, _ := suite.govKeeper.Params.Get(suite.ctx) minDeposit := sdk.Coins(params.MinDeposit) bankMsg := &banktypes.MsgSend{ - FromAddress: govAcct.String(), - ToAddress: proposer.String(), + FromAddress: govStrAcct, + ToAddress: proposerAddr, Amount: coins, } msg, err := v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, coins, - proposer.String(), + proposerAddr, "", "Proposal", "description of proposal", @@ -1007,8 +1051,10 @@ func (suite *KeeperTestSuite) TestMsgDeposit() { for name, tc := range cases { suite.Run(name, func() { proposalID := tc.preRun() - depositReq := v1.NewMsgDeposit(tc.depositor, proposalID, tc.deposit) - _, err := suite.msgSrvr.Deposit(suite.ctx, depositReq) + depositor, err := suite.acctKeeper.AddressCodec().BytesToString(tc.depositor) + suite.Require().NoError(err) + depositReq := v1.NewMsgDeposit(depositor, proposalID, tc.deposit) + _, err = suite.msgSrvr.Deposit(suite.ctx, depositReq) if tc.expErr { suite.Require().Error(err) suite.Require().Contains(err.Error(), tc.expErrMsg) @@ -1021,12 +1067,14 @@ func (suite *KeeperTestSuite) TestMsgDeposit() { // legacy msg server tests func (suite *KeeperTestSuite) TestLegacyMsgSubmitProposal() { - proposer := simtestutil.AddTestAddrsIncremental(suite.bankKeeper, suite.stakingKeeper, suite.ctx, 1, sdkmath.NewInt(50000000))[0] + proposer, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(simtestutil.AddTestAddrsIncremental(suite.bankKeeper, suite.stakingKeeper, suite.ctx, 1, sdkmath.NewInt(50000000))[0]) + suite.Require().NoError(err) coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100000))) initialDeposit := coins params, _ := suite.govKeeper.Params.Get(suite.ctx) minDeposit := params.MinDeposit - + address, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(sdk.AccAddress{}) + suite.Require().NoError(err) cases := map[string]struct { preRun func() (*v1beta1.MsgSubmitProposal, error) expErr bool @@ -1062,7 +1110,7 @@ func (suite *KeeperTestSuite) TestLegacyMsgSubmitProposal() { return v1beta1.NewMsgSubmitProposal( content, initialDeposit, - sdk.AccAddress{}, + address, ) }, expErr: true, @@ -1131,23 +1179,26 @@ func (suite *KeeperTestSuite) TestLegacyMsgSubmitProposal() { } func (suite *KeeperTestSuite) TestLegacyMsgVote() { - govAcct := suite.govKeeper.GetGovernanceAccount(suite.ctx).GetAddress() + govStrAcct, err := suite.acctKeeper.AddressCodec().BytesToString(suite.govKeeper.GetGovernanceAccount(suite.ctx).GetAddress()) + suite.Require().NoError(err) addrs := suite.addrs proposer := addrs[0] + proposerAddr, err := suite.acctKeeper.AddressCodec().BytesToString(proposer) + suite.Require().NoError(err) coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100000))) params, _ := suite.govKeeper.Params.Get(suite.ctx) minDeposit := params.MinDeposit bankMsg := &banktypes.MsgSend{ - FromAddress: govAcct.String(), - ToAddress: proposer.String(), + FromAddress: govStrAcct, + ToAddress: proposerAddr, Amount: coins, } msg, err := v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, minDeposit, - proposer.String(), + proposerAddr, "", "Proposal", "description of proposal", @@ -1161,12 +1212,14 @@ func (suite *KeeperTestSuite) TestLegacyMsgVote() { proposalID := res.ProposalId cases := map[string]struct { - preRun func() uint64 - expErr bool - expErrMsg string - option v1beta1.VoteOption - metadata string - voter sdk.AccAddress + preRun func() uint64 + expErr bool + expAddrErr bool + expErrMsg string + expAddrErrMsg string + option v1beta1.VoteOption + metadata string + voter sdk.AccAddress }{ "empty voter": { preRun: func() uint64 { @@ -1193,7 +1246,7 @@ func (suite *KeeperTestSuite) TestLegacyMsgVote() { msg, err := v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, coins, - proposer.String(), + proposerAddr, "", "Proposal", "description of proposal", @@ -1216,18 +1269,20 @@ func (suite *KeeperTestSuite) TestLegacyMsgVote() { preRun: func() uint64 { return proposalID }, - option: v1beta1.OptionYes, - voter: sdk.AccAddress(strings.Repeat("a", 300)), - metadata: "", - expErr: true, - expErrMsg: longAddressError, + option: v1beta1.OptionYes, + voter: sdk.AccAddress(strings.Repeat("a", 300)), + metadata: "", + expErr: true, + expErrMsg: "invalid voter address: empty address string is not allowed", + expAddrErr: true, + expAddrErrMsg: longAddressError, }, "all good": { preRun: func() uint64 { msg, err := v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, minDeposit, - proposer.String(), + proposerAddr, "", "Proposal", "description of proposal", @@ -1250,8 +1305,15 @@ func (suite *KeeperTestSuite) TestLegacyMsgVote() { for name, tc := range cases { suite.Run(name, func() { pID := tc.preRun() - voteReq := v1beta1.NewMsgVote(tc.voter, pID, tc.option) - _, err := suite.legacyMsgSrvr.Vote(suite.ctx, voteReq) + voter, err := suite.acctKeeper.AddressCodec().BytesToString(tc.voter) + if tc.expAddrErr { + suite.Require().Error(err) + suite.Require().Contains(err.Error(), tc.expAddrErrMsg) + } else { + suite.Require().NoError(err) + } + voteReq := v1beta1.NewMsgVote(voter, pID, tc.option) + _, err = suite.legacyMsgSrvr.Vote(suite.ctx, voteReq) if tc.expErr { suite.Require().Error(err) suite.Require().Contains(err.Error(), tc.expErrMsg) @@ -1264,23 +1326,26 @@ func (suite *KeeperTestSuite) TestLegacyMsgVote() { func (suite *KeeperTestSuite) TestLegacyVoteWeighted() { suite.reset() - govAcct := suite.govKeeper.GetGovernanceAccount(suite.ctx).GetAddress() + govStrAcct, err := suite.acctKeeper.AddressCodec().BytesToString(suite.govKeeper.GetGovernanceAccount(suite.ctx).GetAddress()) + suite.Require().NoError(err) addrs := suite.addrs proposer := addrs[0] + proposerAddr, err := suite.acctKeeper.AddressCodec().BytesToString(proposer) + suite.Require().NoError(err) coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100000))) params, _ := suite.govKeeper.Params.Get(suite.ctx) minDeposit := params.MinDeposit bankMsg := &banktypes.MsgSend{ - FromAddress: govAcct.String(), - ToAddress: proposer.String(), + FromAddress: govStrAcct, + ToAddress: proposerAddr, Amount: coins, } msg, err := v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, minDeposit, - proposer.String(), + proposerAddr, "", "Proposal", "description of proposal", @@ -1294,13 +1359,15 @@ func (suite *KeeperTestSuite) TestLegacyVoteWeighted() { proposalID := res.ProposalId cases := map[string]struct { - preRun func() uint64 - vote *v1beta1.MsgVote - expErr bool - expErrMsg string - option v1beta1.WeightedVoteOptions - metadata string - voter sdk.AccAddress + preRun func() uint64 + vote *v1beta1.MsgVote + expErr bool + expAddrErr bool + expErrMsg string + expAddrErrMsg string + option v1beta1.WeightedVoteOptions + metadata string + voter sdk.AccAddress }{ "empty voter": { preRun: func() uint64 { @@ -1430,7 +1497,7 @@ func (suite *KeeperTestSuite) TestLegacyVoteWeighted() { msg, err := v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, coins, - proposer.String(), + proposerAddr, "", "Proposal", "description of proposal", @@ -1464,17 +1531,19 @@ func (suite *KeeperTestSuite) TestLegacyVoteWeighted() { Weight: sdkmath.LegacyNewDec(1), }, }, - voter: sdk.AccAddress(strings.Repeat("a", 300)), - metadata: "", - expErr: true, - expErrMsg: longAddressError, + voter: sdk.AccAddress(strings.Repeat("a", 300)), + metadata: "", + expErr: true, + expErrMsg: "invalid voter address: empty address string is not allowed", + expAddrErr: true, + expAddrErrMsg: longAddressError, }, "all good": { preRun: func() uint64 { msg, err := v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, minDeposit, - proposer.String(), + proposerAddr, "", "Proposal", "description of proposal", @@ -1502,8 +1571,15 @@ func (suite *KeeperTestSuite) TestLegacyVoteWeighted() { for name, tc := range cases { suite.Run(name, func() { pID := tc.preRun() - voteReq := v1beta1.NewMsgVoteWeighted(tc.voter, pID, tc.option) - _, err := suite.legacyMsgSrvr.VoteWeighted(suite.ctx, voteReq) + voter, err := suite.acctKeeper.AddressCodec().BytesToString(tc.voter) + if tc.expAddrErr { + suite.Require().Error(err) + suite.Require().Contains(err.Error(), tc.expAddrErrMsg) + } else { + suite.Require().NoError(err) + } + voteReq := v1beta1.NewMsgVoteWeighted(voter, pID, tc.option) + _, err = suite.legacyMsgSrvr.VoteWeighted(suite.ctx, voteReq) if tc.expErr { suite.Require().Error(err) suite.Require().Contains(err.Error(), tc.expErrMsg) @@ -1515,23 +1591,26 @@ func (suite *KeeperTestSuite) TestLegacyVoteWeighted() { } func (suite *KeeperTestSuite) TestLegacyMsgDeposit() { - govAcct := suite.govKeeper.GetGovernanceAccount(suite.ctx).GetAddress() + govStrAcct, err := suite.acctKeeper.AddressCodec().BytesToString(suite.govKeeper.GetGovernanceAccount(suite.ctx).GetAddress()) + suite.Require().NoError(err) addrs := suite.addrs proposer := addrs[0] + proposerAddr, err := suite.acctKeeper.AddressCodec().BytesToString(proposer) + suite.Require().NoError(err) coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100000))) params, _ := suite.govKeeper.Params.Get(suite.ctx) minDeposit := params.MinDeposit bankMsg := &banktypes.MsgSend{ - FromAddress: govAcct.String(), - ToAddress: proposer.String(), + FromAddress: govStrAcct, + ToAddress: proposerAddr, Amount: coins, } msg, err := v1.NewMsgSubmitProposal( []sdk.Msg{bankMsg}, coins, - proposer.String(), + proposerAddr, "", "Proposal", "description of proposal", @@ -1583,8 +1662,10 @@ func (suite *KeeperTestSuite) TestLegacyMsgDeposit() { for name, tc := range cases { suite.Run(name, func() { proposalID := tc.preRun() - depositReq := v1beta1.NewMsgDeposit(tc.depositor, proposalID, tc.deposit) - _, err := suite.legacyMsgSrvr.Deposit(suite.ctx, depositReq) + depositor, err := suite.acctKeeper.AddressCodec().BytesToString(tc.depositor) + suite.Require().NoError(err) + depositReq := v1beta1.NewMsgDeposit(depositor, proposalID, tc.deposit) + _, err = suite.legacyMsgSrvr.Deposit(suite.ctx, depositReq) if tc.expErr { suite.Require().Error(err) suite.Require().Contains(err.Error(), tc.expErrMsg) @@ -2134,15 +2215,16 @@ func (suite *KeeperTestSuite) TestSubmitProposal_InitialDeposit() { suite.Run(name, func() { // Setup govKeeper, ctx := suite.govKeeper, suite.ctx - address := simtestutil.AddTestAddrs(suite.bankKeeper, suite.stakingKeeper, ctx, 1, tc.accountBalance[0].Amount)[0] + address, err := suite.acctKeeper.AddressCodec().BytesToString(simtestutil.AddTestAddrs(suite.bankKeeper, suite.stakingKeeper, ctx, 1, tc.accountBalance[0].Amount)[0]) + suite.Require().NoError(err) params := v1.DefaultParams() params.MinDeposit = tc.minDeposit params.MinInitialDepositRatio = tc.minInitialDepositRatio.String() - err := govKeeper.Params.Set(ctx, params) + err = govKeeper.Params.Set(ctx, params) suite.Require().NoError(err) - msg, err := v1.NewMsgSubmitProposal(TestProposal, tc.initialDeposit, address.String(), "test", "Proposal", "description of proposal", v1.ProposalType_PROPOSAL_TYPE_STANDARD) + msg, err := v1.NewMsgSubmitProposal(TestProposal, tc.initialDeposit, address, "test", "Proposal", "description of proposal", v1.ProposalType_PROPOSAL_TYPE_STANDARD) suite.Require().NoError(err) // System under test @@ -2159,10 +2241,12 @@ func (suite *KeeperTestSuite) TestSubmitProposal_InitialDeposit() { } func (suite *KeeperTestSuite) TestMsgSudoExec() { + addr0Str, err := suite.acctKeeper.AddressCodec().BytesToString(suite.addrs[0]) + suite.Require().NoError(err) // setup for valid use case params, _ := suite.govKeeper.Params.Get(suite.ctx) minDeposit := params.MinDeposit - proposal, err := v1.NewMsgSubmitProposal([]sdk.Msg{}, minDeposit, suite.addrs[0].String(), "{\"title\":\"Proposal\", \"summary\":\"description of proposal\"}", "Proposal", "description of proposal", v1.ProposalType_PROPOSAL_TYPE_STANDARD) + proposal, err := v1.NewMsgSubmitProposal([]sdk.Msg{}, minDeposit, addr0Str, "{\"title\":\"Proposal\", \"summary\":\"description of proposal\"}", "Proposal", "description of proposal", v1.ProposalType_PROPOSAL_TYPE_STANDARD) suite.Require().NoError(err) proposalResp, err := suite.msgSrvr.SubmitProposal(suite.ctx, proposal) suite.Require().NoError(err) @@ -2171,7 +2255,7 @@ func (suite *KeeperTestSuite) TestMsgSudoExec() { // normally it isn't possible as governance isn't the signer. // governance needs to sudo the vote. validMsg := &v1.MsgSudoExec{Authority: suite.govKeeper.GetAuthority()} - _, err = validMsg.SetSudoedMsg(v1.NewMsgVote(suite.addrs[0], proposalResp.ProposalId, v1.OptionYes, "")) + _, err = validMsg.SetSudoedMsg(v1.NewMsgVote(addr0Str, proposalResp.ProposalId, v1.OptionYes, "")) suite.Require().NoError(err) invalidMsg := &v1.MsgSudoExec{Authority: suite.govKeeper.GetAuthority()} diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index de732b8760f3..b3373f12ac2c 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -80,7 +80,11 @@ func (k Keeper) SubmitProposal(ctx context.Context, messages []sdk.Msg, metadata // assert that the governance module account is the only signer of the messages if !bytes.Equal(signers[0], k.GetGovernanceAccount(ctx).GetAddress()) { - return v1.Proposal{}, errorsmod.Wrapf(types.ErrInvalidSigner, sdk.AccAddress(signers[0]).String()) + addr, err := k.authKeeper.AddressCodec().BytesToString(signers[0]) + if err != nil { + return v1.Proposal{}, errorsmod.Wrapf(types.ErrInvalidSigner, err.Error()) + } + return v1.Proposal{}, errorsmod.Wrapf(types.ErrInvalidSigner, addr) } if err := k.environment.RouterService.MessageRouterService().CanInvoke(ctx, sdk.MsgTypeURL(msg)); err != nil { @@ -124,8 +128,12 @@ func (k Keeper) SubmitProposal(ctx context.Context, messages []sdk.Msg, metadata return v1.Proposal{}, err } + proposerAddr, err := k.authKeeper.AddressCodec().BytesToString(proposer) + if err != nil { + return v1.Proposal{}, err + } submitTime := k.environment.HeaderService.GetHeaderInfo(ctx).Time - proposal, err := v1.NewProposal(messages, proposalID, submitTime, submitTime.Add(*params.MaxDepositPeriod), metadata, title, summary, proposer, proposalType) + proposal, err := v1.NewProposal(messages, proposalID, submitTime, submitTime.Add(*params.MaxDepositPeriod), metadata, title, summary, proposerAddr, proposalType) if err != nil { return v1.Proposal{}, err } @@ -146,7 +154,9 @@ func (k Keeper) SubmitProposal(ctx context.Context, messages []sdk.Msg, metadata if err := k.environment.EventService.EventManager(ctx).EmitKV( types.EventTypeSubmitProposal, + event.NewAttribute(types.AttributeKeyProposalType, proposalType.String()), event.NewAttribute(types.AttributeKeyProposalID, fmt.Sprintf("%d", proposalID)), + event.NewAttribute(types.AttributeKeyProposalProposer, proposerAddr), event.NewAttribute(types.AttributeKeyProposalMessages, strings.Join(msgs, ",")), ); err != nil { return v1.Proposal{}, fmt.Errorf("failed to emit event: %w", err) diff --git a/x/gov/keeper/proposal_test.go b/x/gov/keeper/proposal_test.go index d691cf99b881..eb5e7b41abe0 100644 --- a/x/gov/keeper/proposal_test.go +++ b/x/gov/keeper/proposal_test.go @@ -13,6 +13,7 @@ import ( v1 "cosmossdk.io/x/gov/types/v1" "cosmossdk.io/x/gov/types/v1beta1" + codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -125,9 +126,11 @@ type invalidProposalRoute struct{ v1beta1.TextProposal } func (invalidProposalRoute) ProposalRoute() string { return "nonexistingroute" } func (suite *KeeperTestSuite) TestSubmitProposal() { - govAcct := suite.govKeeper.GetGovernanceAccount(suite.ctx).GetAddress().String() - _, _, randomAddr := testdata.KeyTestPubAddr() - + govAcct, err := suite.acctKeeper.AddressCodec().BytesToString(suite.govKeeper.GetGovernanceAccount(suite.ctx).GetAddress()) + suite.Require().NoError(err) + _, _, randomAddress := testdata.KeyTestPubAddr() + randomAddr, err := suite.acctKeeper.AddressCodec().BytesToString(randomAddress) + suite.Require().NoError(err) tp := v1beta1.TextProposal{Title: "title", Description: "description"} legacyProposal := func(content v1beta1.Content, authority string) []sdk.Msg { prop, err := v1.NewLegacyContent(content, authority) @@ -136,7 +139,7 @@ func (suite *KeeperTestSuite) TestSubmitProposal() { } // create custom message based params for x/gov/MsgUpdateParams - err := suite.govKeeper.MessageBasedParams.Set(suite.ctx, sdk.MsgTypeURL(&v1.MsgUpdateParams{}), v1.MessageBasedParams{ + err = suite.govKeeper.MessageBasedParams.Set(suite.ctx, sdk.MsgTypeURL(&v1.MsgUpdateParams{}), v1.MessageBasedParams{ VotingPeriod: func() *time.Duration { t := time.Hour * 24 * 7; return &t }(), Quorum: "0.4", Threshold: "0.5", @@ -161,7 +164,7 @@ func (suite *KeeperTestSuite) TestSubmitProposal() { {legacyProposal(&v1beta1.TextProposal{Title: "title", Description: ""}, govAcct), "", v1.ProposalType_PROPOSAL_TYPE_STANDARD, nil}, {legacyProposal(&v1beta1.TextProposal{Title: "title", Description: strings.Repeat("1234567890", 1000)}, govAcct), "", v1.ProposalType_PROPOSAL_TYPE_EXPEDITED, nil}, // error when signer is not gov acct - {legacyProposal(&tp, randomAddr.String()), "", v1.ProposalType_PROPOSAL_TYPE_STANDARD, types.ErrInvalidSigner}, + {legacyProposal(&tp, randomAddr), "", v1.ProposalType_PROPOSAL_TYPE_STANDARD, types.ErrInvalidSigner}, // error only when invalid route {legacyProposal(&invalidProposalRoute{}, govAcct), "", v1.ProposalType_PROPOSAL_TYPE_STANDARD, types.ErrNoProposalHandlerExists}, // error invalid multiple choice proposal @@ -181,7 +184,8 @@ func (suite *KeeperTestSuite) TestSubmitProposal() { } func (suite *KeeperTestSuite) TestCancelProposal() { - govAcct := suite.govKeeper.GetGovernanceAccount(suite.ctx).GetAddress().String() + govAcct, err := suite.acctKeeper.AddressCodec().BytesToString(suite.govKeeper.GetGovernanceAccount(suite.ctx).GetAddress()) + suite.Require().NoError(err) tp := v1beta1.TextProposal{Title: "title", Description: "description"} prop, err := v1.NewLegacyContent(&tp, govAcct) suite.Require().NoError(err) @@ -189,6 +193,11 @@ func (suite *KeeperTestSuite) TestCancelProposal() { suite.Require().NoError(err) proposalID := proposal.Id + addr0Str, err := suite.acctKeeper.AddressCodec().BytesToString(suite.addrs[0]) + suite.Require().NoError(err) + addr1Str, err := suite.acctKeeper.AddressCodec().BytesToString(suite.addrs[1]) + suite.Require().NoError(err) + proposal2, err := suite.govKeeper.SubmitProposal(suite.ctx, []sdk.Msg{prop}, "", "title", "summary", suite.addrs[1], v1.ProposalType_PROPOSAL_TYPE_EXPEDITED) suite.Require().NoError(err) proposal2ID := proposal2.Id @@ -227,14 +236,14 @@ func (suite *KeeperTestSuite) TestCancelProposal() { { name: "invalid proposal id", malleate: func() (uint64, string) { - return 10, suite.addrs[1].String() + return 10, addr1Str }, expectedErrMsg: "proposal 10 doesn't exist", }, { name: "valid proposalID but invalid proposer", malleate: func() (uint64, string) { - return proposalID, suite.addrs[1].String() + return proposalID, addr1Str }, expectedErrMsg: "invalid proposer", }, @@ -248,7 +257,7 @@ func (suite *KeeperTestSuite) TestCancelProposal() { proposal2.Status = v1.ProposalStatus_PROPOSAL_STATUS_PASSED err = suite.govKeeper.Proposals.Set(suite.ctx, proposal2.Id, proposal2) suite.Require().NoError(err) - return proposal2ID, suite.addrs[1].String() + return proposal2ID, addr1Str }, expectedErrMsg: "proposal should be in the deposit or voting period", }, @@ -267,14 +276,14 @@ func (suite *KeeperTestSuite) TestCancelProposal() { suite.ctx = suite.ctx.WithHeaderInfo(headerInfo) suite.Require().NoError(err) - return proposal2ID, suite.addrs[1].String() + return proposal2ID, addr1Str }, expectedErrMsg: "too late", }, { name: "valid proposer and proposal id", malleate: func() (uint64, string) { - return proposalID, suite.addrs[0].String() + return proposalID, addr0Str }, }, { @@ -294,7 +303,7 @@ func (suite *KeeperTestSuite) TestCancelProposal() { suite.Require().NoError(err) suite.Require().NotNil(vote) - return proposalID, suite.addrs[0].String() + return proposalID, addr0Str }, }, } @@ -321,7 +330,9 @@ func (suite *KeeperTestSuite) TestCancelProposal() { func TestMigrateProposalMessages(t *testing.T) { content := v1beta1.NewTextProposal("Test", "description") - contentMsg, err := v1.NewLegacyContent(content, sdk.AccAddress("test1").String()) + addr, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(sdk.AccAddress("test1")) + require.NoError(t, err) + contentMsg, err := v1.NewLegacyContent(content, addr) require.NoError(t, err) content, err = v1.LegacyContentFromMessage(contentMsg) require.NoError(t, err) diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index dc1b1c57285c..cc0790c27031 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -247,6 +247,7 @@ func defaultCalculateVoteResultsAndVotingPower( // iterate over all votes, tally up the voting power of each validator rng := collections.NewPrefixedPairRange[uint64, sdk.AccAddress](proposalID) + votesToRemove := []collections.Pair[uint64, sdk.AccAddress]{} if err := k.Votes.Walk(ctx, rng, func(key collections.Pair[uint64, sdk.AccAddress], vote v1.Vote) (bool, error) { // if validator, just record it in the map voter, err := k.authKeeper.AddressCodec().StringToBytes(vote.Voter) @@ -292,11 +293,19 @@ func defaultCalculateVoteResultsAndVotingPower( return false, err } - return false, k.Votes.Remove(ctx, collections.Join(vote.ProposalId, sdk.AccAddress(voter))) + votesToRemove = append(votesToRemove, key) + return false, nil }); err != nil { return math.LegacyDec{}, nil, err } + // remove all votes from store + for _, key := range votesToRemove { + if err := k.Votes.Remove(ctx, key); err != nil { + return math.LegacyDec{}, nil, err + } + } + // iterate over the validators again to tally their voting power for _, val := range validators { if len(val.Vote) == 0 { diff --git a/x/gov/keeper/tally_test.go b/x/gov/keeper/tally_test.go index 723cfb779f31..fa1109b03115 100644 --- a/x/gov/keeper/tally_test.go +++ b/x/gov/keeper/tally_test.go @@ -145,9 +145,13 @@ func TestTally_Standard(t *testing.T) { name: "one delegator votes: prop fails/burn deposit", setup: func(s tallyFixture) { setTotalBonded(s, 10000000) + del0Addr, err := s.mocks.acctKeeper.AddressCodec().BytesToString(s.delAddrs[0]) + require.NoError(t, err) + val0Addr, err := s.mocks.stakingKeeper.ValidatorAddressCodec().BytesToString(s.valAddrs[0]) + require.NoError(t, err) delegations := []stakingtypes.Delegation{{ - DelegatorAddress: s.delAddrs[0].String(), - ValidatorAddress: s.valAddrs[0].String(), + DelegatorAddress: del0Addr, + ValidatorAddress: val0Addr, Shares: sdkmath.LegacyNewDec(42), }} delegatorVote(s, s.delAddrs[0], delegations, v1.VoteOption_VOTE_OPTION_ONE) @@ -170,9 +174,13 @@ func TestTally_Standard(t *testing.T) { name: "one delegator votes yes, validator votes also yes: prop fails/burn deposit", setup: func(s tallyFixture) { setTotalBonded(s, 10000000) + del0Addr, err := s.mocks.acctKeeper.AddressCodec().BytesToString(s.delAddrs[0]) + require.NoError(t, err) + val0Addr, err := s.mocks.stakingKeeper.ValidatorAddressCodec().BytesToString(s.valAddrs[0]) + require.NoError(t, err) delegations := []stakingtypes.Delegation{{ - DelegatorAddress: s.delAddrs[0].String(), - ValidatorAddress: s.valAddrs[0].String(), + DelegatorAddress: del0Addr, + ValidatorAddress: val0Addr, Shares: sdkmath.LegacyNewDec(42), }} delegatorVote(s, s.delAddrs[0], delegations, v1.VoteOption_VOTE_OPTION_ONE) @@ -196,9 +204,13 @@ func TestTally_Standard(t *testing.T) { name: "one delegator votes yes, validator votes no: prop fails/burn deposit", setup: func(s tallyFixture) { setTotalBonded(s, 10000000) + del0Addr, err := s.mocks.acctKeeper.AddressCodec().BytesToString(s.delAddrs[0]) + require.NoError(t, err) + val0Addr, err := s.mocks.stakingKeeper.ValidatorAddressCodec().BytesToString(s.valAddrs[0]) + require.NoError(t, err) delegations := []stakingtypes.Delegation{{ - DelegatorAddress: s.delAddrs[0].String(), - ValidatorAddress: s.valAddrs[0].String(), + DelegatorAddress: del0Addr, + ValidatorAddress: val0Addr, Shares: sdkmath.LegacyNewDec(42), }} delegatorVote(s, s.delAddrs[0], delegations, v1.VoteOption_VOTE_OPTION_ONE) @@ -227,15 +239,21 @@ func TestTally_Standard(t *testing.T) { name: "delegator with mixed delegations: prop fails/burn deposit", setup: func(s tallyFixture) { setTotalBonded(s, 10000000) + del0Addr, err := s.mocks.acctKeeper.AddressCodec().BytesToString(s.delAddrs[0]) + require.NoError(t, err) + val0Addr, err := s.mocks.stakingKeeper.ValidatorAddressCodec().BytesToString(s.valAddrs[0]) + require.NoError(t, err) + val1Addr, err := s.mocks.stakingKeeper.ValidatorAddressCodec().BytesToString(s.valAddrs[1]) + require.NoError(t, err) delegations := []stakingtypes.Delegation{ { - DelegatorAddress: s.delAddrs[0].String(), - ValidatorAddress: s.valAddrs[0].String(), + DelegatorAddress: del0Addr, + ValidatorAddress: val0Addr, Shares: sdkmath.LegacyNewDec(21), }, { - DelegatorAddress: s.delAddrs[0].String(), - ValidatorAddress: s.valAddrs[1].String(), + DelegatorAddress: del0Addr, + ValidatorAddress: val1Addr, Shares: sdkmath.LegacyNewDec(21), }, } @@ -460,8 +478,10 @@ func TestTally_Standard(t *testing.T) { DoAndReturn( func(ctx context.Context, fn func(index int64, validator sdk.ValidatorI) bool) error { for i := int64(0); i < int64(numVals); i++ { + valAddr, err := mocks.stakingKeeper.ValidatorAddressCodec().BytesToString(valAddrs[i]) + require.NoError(t, err) fn(i, stakingtypes.Validator{ - OperatorAddress: valAddrs[i].String(), + OperatorAddress: valAddr, Status: stakingtypes.Bonded, Tokens: sdkmath.NewInt(1000000), DelegatorShares: sdkmath.LegacyNewDec(1000000), @@ -591,9 +611,13 @@ func TestTally_Expedited(t *testing.T) { name: "one delegator votes: prop fails/burn deposit", setup: func(s tallyFixture) { setTotalBonded(s, 10000000) + del0Addr, err := s.mocks.acctKeeper.AddressCodec().BytesToString(s.delAddrs[0]) + require.NoError(t, err) + val0Addr, err := s.mocks.stakingKeeper.ValidatorAddressCodec().BytesToString(s.valAddrs[0]) + require.NoError(t, err) delegations := []stakingtypes.Delegation{{ - DelegatorAddress: s.delAddrs[0].String(), - ValidatorAddress: s.valAddrs[0].String(), + DelegatorAddress: del0Addr, + ValidatorAddress: val0Addr, Shares: sdkmath.LegacyNewDec(42), }} delegatorVote(s, s.delAddrs[0], delegations, v1.VoteOption_VOTE_OPTION_ONE) @@ -616,9 +640,13 @@ func TestTally_Expedited(t *testing.T) { name: "one delegator votes yes, validator votes also yes: prop fails/burn deposit", setup: func(s tallyFixture) { setTotalBonded(s, 10000000) + del0Addr, err := s.mocks.acctKeeper.AddressCodec().BytesToString(s.delAddrs[0]) + require.NoError(t, err) + val0Addr, err := s.mocks.stakingKeeper.ValidatorAddressCodec().BytesToString(s.valAddrs[0]) + require.NoError(t, err) delegations := []stakingtypes.Delegation{{ - DelegatorAddress: s.delAddrs[0].String(), - ValidatorAddress: s.valAddrs[0].String(), + DelegatorAddress: del0Addr, + ValidatorAddress: val0Addr, Shares: sdkmath.LegacyNewDec(42), }} delegatorVote(s, s.delAddrs[0], delegations, v1.VoteOption_VOTE_OPTION_ONE) @@ -642,9 +670,13 @@ func TestTally_Expedited(t *testing.T) { name: "one delegator votes yes, validator votes no: prop fails/burn deposit", setup: func(s tallyFixture) { setTotalBonded(s, 10000000) + del0Addr, err := s.mocks.acctKeeper.AddressCodec().BytesToString(s.delAddrs[0]) + require.NoError(t, err) + val0Addr, err := s.mocks.stakingKeeper.ValidatorAddressCodec().BytesToString(s.valAddrs[0]) + require.NoError(t, err) delegations := []stakingtypes.Delegation{{ - DelegatorAddress: s.delAddrs[0].String(), - ValidatorAddress: s.valAddrs[0].String(), + DelegatorAddress: del0Addr, + ValidatorAddress: val0Addr, Shares: sdkmath.LegacyNewDec(42), }} delegatorVote(s, s.delAddrs[0], delegations, v1.VoteOption_VOTE_OPTION_ONE) @@ -673,15 +705,21 @@ func TestTally_Expedited(t *testing.T) { name: "delegator with mixed delegations: prop fails/burn deposit", setup: func(s tallyFixture) { setTotalBonded(s, 10000000) + del0Addr, err := s.mocks.acctKeeper.AddressCodec().BytesToString(s.delAddrs[0]) + require.NoError(t, err) + val0Addr, err := s.mocks.stakingKeeper.ValidatorAddressCodec().BytesToString(s.valAddrs[0]) + require.NoError(t, err) + val1Addr, err := s.mocks.stakingKeeper.ValidatorAddressCodec().BytesToString(s.valAddrs[1]) + require.NoError(t, err) delegations := []stakingtypes.Delegation{ { - DelegatorAddress: s.delAddrs[0].String(), - ValidatorAddress: s.valAddrs[0].String(), + DelegatorAddress: del0Addr, + ValidatorAddress: val0Addr, Shares: sdkmath.LegacyNewDec(21), }, { - DelegatorAddress: s.delAddrs[0].String(), - ValidatorAddress: s.valAddrs[1].String(), + DelegatorAddress: del0Addr, + ValidatorAddress: val1Addr, Shares: sdkmath.LegacyNewDec(21), }, } @@ -910,8 +948,10 @@ func TestTally_Expedited(t *testing.T) { DoAndReturn( func(ctx context.Context, fn func(index int64, validator sdk.ValidatorI) bool) error { for i := int64(0); i < int64(numVals); i++ { + valAddr, err := mocks.stakingKeeper.ValidatorAddressCodec().BytesToString(valAddrs[i]) + require.NoError(t, err) fn(i, stakingtypes.Validator{ - OperatorAddress: valAddrs[i].String(), + OperatorAddress: valAddr, Status: stakingtypes.Bonded, Tokens: sdkmath.NewInt(1000000), DelegatorShares: sdkmath.LegacyNewDec(1000000), @@ -1001,9 +1041,13 @@ func TestTally_Optimistic(t *testing.T) { name: "one delegator votes: threshold no not reached, prop passes", setup: func(s tallyFixture) { setTotalBonded(s, 10000000) + del0Addr, err := s.mocks.acctKeeper.AddressCodec().BytesToString(s.delAddrs[0]) + require.NoError(t, err) + val0Addr, err := s.mocks.stakingKeeper.ValidatorAddressCodec().BytesToString(s.valAddrs[0]) + require.NoError(t, err) delegations := []stakingtypes.Delegation{{ - DelegatorAddress: s.delAddrs[0].String(), - ValidatorAddress: s.valAddrs[0].String(), + DelegatorAddress: del0Addr, + ValidatorAddress: val0Addr, Shares: sdkmath.LegacyNewDec(42), }} delegatorVote(s, s.delAddrs[0], delegations, v1.VoteOption_VOTE_OPTION_THREE) @@ -1068,8 +1112,10 @@ func TestTally_Optimistic(t *testing.T) { DoAndReturn( func(ctx context.Context, fn func(index int64, validator sdk.ValidatorI) bool) error { for i := int64(0); i < int64(numVals); i++ { + valAddr, err := mocks.stakingKeeper.ValidatorAddressCodec().BytesToString(valAddrs[i]) + require.NoError(t, err) fn(i, stakingtypes.Validator{ - OperatorAddress: valAddrs[i].String(), + OperatorAddress: valAddr, Status: stakingtypes.Bonded, Tokens: sdkmath.NewInt(1000000), DelegatorShares: sdkmath.LegacyNewDec(1000000), @@ -1199,9 +1245,13 @@ func TestTally_MultipleChoice(t *testing.T) { name: "one delegator votes: prop fails/burn deposit", setup: func(s tallyFixture) { setTotalBonded(s, 10000000) + del0Addr, err := s.mocks.acctKeeper.AddressCodec().BytesToString(s.delAddrs[0]) + require.NoError(t, err) + val0Addr, err := s.mocks.stakingKeeper.ValidatorAddressCodec().BytesToString(s.valAddrs[0]) + require.NoError(t, err) delegations := []stakingtypes.Delegation{{ - DelegatorAddress: s.delAddrs[0].String(), - ValidatorAddress: s.valAddrs[0].String(), + DelegatorAddress: del0Addr, + ValidatorAddress: val0Addr, Shares: sdkmath.LegacyNewDec(42), }} delegatorVote(s, s.delAddrs[0], delegations, v1.VoteOption_VOTE_OPTION_ONE) @@ -1224,9 +1274,13 @@ func TestTally_MultipleChoice(t *testing.T) { name: "one delegator votes yes, validator votes also yes: prop fails/burn deposit", setup: func(s tallyFixture) { setTotalBonded(s, 10000000) + del0Addr, err := s.mocks.acctKeeper.AddressCodec().BytesToString(s.delAddrs[0]) + require.NoError(t, err) + val0Addr, err := s.mocks.stakingKeeper.ValidatorAddressCodec().BytesToString(s.valAddrs[0]) + require.NoError(t, err) delegations := []stakingtypes.Delegation{{ - DelegatorAddress: s.delAddrs[0].String(), - ValidatorAddress: s.valAddrs[0].String(), + DelegatorAddress: del0Addr, + ValidatorAddress: val0Addr, Shares: sdkmath.LegacyNewDec(42), }} delegatorVote(s, s.delAddrs[0], delegations, v1.VoteOption_VOTE_OPTION_ONE) @@ -1250,9 +1304,13 @@ func TestTally_MultipleChoice(t *testing.T) { name: "one delegator votes yes, validator votes no: prop fails/burn deposit", setup: func(s tallyFixture) { setTotalBonded(s, 10000000) + del0Addr, err := s.mocks.acctKeeper.AddressCodec().BytesToString(s.delAddrs[0]) + require.NoError(t, err) + val0Addr, err := s.mocks.stakingKeeper.ValidatorAddressCodec().BytesToString(s.valAddrs[0]) + require.NoError(t, err) delegations := []stakingtypes.Delegation{{ - DelegatorAddress: s.delAddrs[0].String(), - ValidatorAddress: s.valAddrs[0].String(), + DelegatorAddress: del0Addr, + ValidatorAddress: val0Addr, Shares: sdkmath.LegacyNewDec(42), }} delegatorVote(s, s.delAddrs[0], delegations, v1.VoteOption_VOTE_OPTION_ONE) @@ -1281,15 +1339,21 @@ func TestTally_MultipleChoice(t *testing.T) { name: "delegator with mixed delegations: prop fails/burn deposit", setup: func(s tallyFixture) { setTotalBonded(s, 10000000) + del0Addr, err := s.mocks.acctKeeper.AddressCodec().BytesToString(s.delAddrs[0]) + require.NoError(t, err) + val0Addr, err := s.mocks.stakingKeeper.ValidatorAddressCodec().BytesToString(s.valAddrs[0]) + require.NoError(t, err) + val1Addr, err := s.mocks.stakingKeeper.ValidatorAddressCodec().BytesToString(s.valAddrs[1]) + require.NoError(t, err) delegations := []stakingtypes.Delegation{ { - DelegatorAddress: s.delAddrs[0].String(), - ValidatorAddress: s.valAddrs[0].String(), + DelegatorAddress: del0Addr, + ValidatorAddress: val0Addr, Shares: sdkmath.LegacyNewDec(21), }, { - DelegatorAddress: s.delAddrs[0].String(), - ValidatorAddress: s.valAddrs[1].String(), + DelegatorAddress: del0Addr, + ValidatorAddress: val1Addr, Shares: sdkmath.LegacyNewDec(21), }, } @@ -1434,8 +1498,10 @@ func TestTally_MultipleChoice(t *testing.T) { DoAndReturn( func(ctx context.Context, fn func(index int64, validator sdk.ValidatorI) bool) error { for i := int64(0); i < int64(numVals); i++ { + valAddr, err := mocks.stakingKeeper.ValidatorAddressCodec().BytesToString(valAddrs[i]) + require.NoError(t, err) fn(i, stakingtypes.Validator{ - OperatorAddress: valAddrs[i].String(), + OperatorAddress: valAddr, Status: stakingtypes.Bonded, Tokens: sdkmath.NewInt(1000000), DelegatorShares: sdkmath.LegacyNewDec(1000000), diff --git a/x/gov/keeper/vote.go b/x/gov/keeper/vote.go index 41805fe0b891..1e635c34c0a1 100644 --- a/x/gov/keeper/vote.go +++ b/x/gov/keeper/vote.go @@ -68,7 +68,11 @@ func (k Keeper) AddVote(ctx context.Context, proposalID uint64, voterAddr sdk.Ac } } - vote := v1.NewVote(proposalID, voterAddr, options, metadata) + voterStrAddr, err := k.authKeeper.AddressCodec().BytesToString(voterAddr) + if err != nil { + return err + } + vote := v1.NewVote(proposalID, voterStrAddr, options, metadata) err = k.Votes.Set(ctx, collections.Join(proposalID, voterAddr), vote) if err != nil { return err @@ -80,7 +84,7 @@ func (k Keeper) AddVote(ctx context.Context, proposalID uint64, voterAddr sdk.Ac } return k.environment.EventService.EventManager(ctx).EmitKV(types.EventTypeProposalVote, - event.NewAttribute(types.AttributeKeyVoter, voterAddr.String()), + event.NewAttribute(types.AttributeKeyVoter, voterStrAddr), event.NewAttribute(types.AttributeKeyOption, options.String()), event.NewAttribute(types.AttributeKeyProposalID, fmt.Sprintf("%d", proposalID)), ) diff --git a/x/gov/keeper/vote_test.go b/x/gov/keeper/vote_test.go index 59905f8b07f5..b008f804f7e3 100644 --- a/x/gov/keeper/vote_test.go +++ b/x/gov/keeper/vote_test.go @@ -22,6 +22,11 @@ func TestVotes(t *testing.T) { addrs := simtestutil.AddTestAddrsIncremental(bankKeeper, stakingKeeper, ctx, 2, sdkmath.NewInt(10000000)) authKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec("cosmos")).AnyTimes() + addrs0Str, err := authKeeper.AddressCodec().BytesToString(addrs[0]) + require.NoError(t, err) + addrs1Str, err := authKeeper.AddressCodec().BytesToString(addrs[1]) + require.NoError(t, err) + tp := TestProposal proposal, err := govKeeper.SubmitProposal(ctx, tp, "", "title", "description", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), v1.ProposalType_PROPOSAL_TYPE_STANDARD) require.NoError(t, err) @@ -41,7 +46,7 @@ func TestVotes(t *testing.T) { require.NoError(t, govKeeper.AddVote(ctx, proposalID, addrs[0], v1.NewNonSplitVoteOption(v1.OptionAbstain), metadata)) vote, err := govKeeper.Votes.Get(ctx, collections.Join(proposalID, addrs[0])) require.Nil(t, err) - require.Equal(t, addrs[0].String(), vote.Voter) + require.Equal(t, addrs0Str, vote.Voter) require.Equal(t, proposalID, vote.ProposalId) require.True(t, len(vote.Options) == 1) require.Equal(t, v1.OptionAbstain, vote.Options[0].Option) @@ -50,7 +55,7 @@ func TestVotes(t *testing.T) { require.NoError(t, govKeeper.AddVote(ctx, proposalID, addrs[0], v1.NewNonSplitVoteOption(v1.OptionYes), "")) vote, err = govKeeper.Votes.Get(ctx, collections.Join(proposalID, addrs[0])) require.Nil(t, err) - require.Equal(t, addrs[0].String(), vote.Voter) + require.Equal(t, addrs0Str, vote.Voter) require.Equal(t, proposalID, vote.ProposalId) require.True(t, len(vote.Options) == 1) require.Equal(t, v1.OptionYes, vote.Options[0].Option) @@ -64,7 +69,7 @@ func TestVotes(t *testing.T) { }, "")) vote, err = govKeeper.Votes.Get(ctx, collections.Join(proposalID, addrs[1])) require.Nil(t, err) - require.Equal(t, addrs[1].String(), vote.Voter) + require.Equal(t, addrs1Str, vote.Voter) require.Equal(t, proposalID, vote.ProposalId) require.True(t, len(vote.Options) == 4) require.Equal(t, v1.OptionYes, vote.Options[0].Option) @@ -90,11 +95,11 @@ func TestVotes(t *testing.T) { return false, nil })) require.Equal(t, votes, propVotes) - require.Equal(t, addrs[0].String(), votes[0].Voter) + require.Equal(t, addrs0Str, votes[0].Voter) require.Equal(t, proposalID, votes[0].ProposalId) require.True(t, len(votes[0].Options) == 1) require.Equal(t, v1.OptionYes, votes[0].Options[0].Option) - require.Equal(t, addrs[1].String(), votes[1].Voter) + require.Equal(t, addrs1Str, votes[1].Voter) require.Equal(t, proposalID, votes[1].ProposalId) require.True(t, len(votes[1].Options) == 4) require.Equal(t, votes[1].Options[0].Weight, sdkmath.LegacyNewDecWithPrec(60, 2).String()) diff --git a/x/gov/module.go b/x/gov/module.go index 6effa507b528..f88ed628a4fe 100644 --- a/x/gov/module.go +++ b/x/gov/module.go @@ -123,7 +123,11 @@ func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) { // RegisterServices registers module services. func (am AppModule) RegisterServices(registrar grpc.ServiceRegistrar) error { msgServer := keeper.NewMsgServerImpl(am.keeper) - v1beta1.RegisterMsgServer(registrar, keeper.NewLegacyMsgServerImpl(am.accountKeeper.GetModuleAddress(govtypes.ModuleName).String(), msgServer)) + addr, err := am.accountKeeper.AddressCodec().BytesToString(am.accountKeeper.GetModuleAddress(govtypes.ModuleName)) + if err != nil { + return err + } + v1beta1.RegisterMsgServer(registrar, keeper.NewLegacyMsgServerImpl(addr, msgServer)) v1.RegisterMsgServer(registrar, msgServer) v1beta1.RegisterQueryServer(registrar, keeper.NewLegacyQueryServer(am.keeper)) diff --git a/x/gov/proto/buf.gen.gogo.yaml b/x/gov/proto/buf.gen.gogo.yaml index 9c8ba0a4b1fd..db36231d0c82 100644 --- a/x/gov/proto/buf.gen.gogo.yaml +++ b/x/gov/proto/buf.gen.gogo.yaml @@ -2,7 +2,7 @@ version: v1 plugins: - name: gocosmos out: .. - opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any - name: grpc-gateway out: .. opt: logtostderr=true,allow_colon_final_segments=true diff --git a/x/gov/simulation/operations.go b/x/gov/simulation/operations.go index 352ce952021c..6941bcc87d38 100644 --- a/x/gov/simulation/operations.go +++ b/x/gov/simulation/operations.go @@ -155,7 +155,7 @@ func SimulateMsgSubmitProposal( return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { msgs := []sdk.Msg{} - proposalMsg, err := msgSim(r, ctx, accs, ak.AddressCodec()) + proposalMsg, err := msgSim(r, accs, ak.AddressCodec()) if err != nil { return simtypes.OperationMsg{}, nil, err } @@ -185,8 +185,11 @@ func SimulateMsgSubmitLegacyProposal( return simtypes.NoOpMsg(types.ModuleName, TypeMsgSubmitProposal, "content is nil"), nil, nil } - govacc := k.GetGovernanceAccount(ctx) - contentMsg, err := v1.NewLegacyContent(content, govacc.GetAddress().String()) + govacc, err := ak.AddressCodec().BytesToString(k.GetGovernanceAccount(ctx).GetAddress()) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, TypeMsgSubmitProposal, "error getting governance account address"), nil, err + } + contentMsg, err := v1.NewLegacyContent(content, govacc) if err != nil { return simtypes.NoOpMsg(types.ModuleName, TypeMsgSubmitProposal, "error converting legacy content into proposal message"), nil, err } @@ -245,10 +248,14 @@ func simulateMsgSubmitProposal( proposalType = v1.ProposalType_PROPOSAL_TYPE_EXPEDITED } + accAddr, err := ak.AddressCodec().BytesToString(simAccount.Address) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, TypeMsgSubmitProposal, "error getting simAccount address"), nil, err + } msg, err := v1.NewMsgSubmitProposal( proposalMsgs, deposit, - simAccount.Address.String(), + accAddr, simtypes.RandStringOfLength(r, 100), simtypes.RandStringOfLength(r, 100), simtypes.RandStringOfLength(r, 100), @@ -343,7 +350,11 @@ func SimulateMsgDeposit( return simtypes.NoOpMsg(types.ModuleName, TypeMsgDeposit, "unable to generate deposit"), nil, err } - msg := v1.NewMsgDeposit(simAccount.Address, proposalID, deposit) + addr, err := ak.AddressCodec().BytesToString(simAccount.Address) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, TypeMsgDeposit, "unable to get simAccount address"), nil, err + } + msg := v1.NewMsgDeposit(addr, proposalID, deposit) account := ak.GetAccount(ctx, simAccount.Address) spendable := bk.SpendableCoins(ctx, account.GetAddress()) @@ -413,7 +424,11 @@ func operationSimulateMsgVote( } option := randomVotingOption(r) - msg := v1.NewMsgVote(simAccount.Address, proposalID, option, "") + addr, err := ak.AddressCodec().BytesToString(simAccount.Address) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, TypeMsgVote, "unable to get simAccount address"), nil, err + } + msg := v1.NewMsgVote(addr, proposalID, option, "") account := ak.GetAccount(ctx, simAccount.Address) spendable := bk.SpendableCoins(ctx, account.GetAddress()) @@ -476,7 +491,11 @@ func operationSimulateMsgVoteWeighted( } options := randomWeightedVotingOptions(r) - msg := v1.NewMsgVoteWeighted(simAccount.Address, proposalID, options, "") + addr, err := ak.AddressCodec().BytesToString(simAccount.Address) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, TypeMsgVoteWeighted, "unable to get simAccount address"), nil, err + } + msg := v1.NewMsgVoteWeighted(addr, proposalID, options, "") account := ak.GetAccount(ctx, simAccount.Address) spendable := bk.SpendableCoins(ctx, account.GetAddress()) @@ -516,7 +535,11 @@ func SimulateMsgCancelProposal( return simtypes.NoOpMsg(types.ModuleName, TypeMsgCancelProposal, "no proposals found"), nil, nil } - if proposal.Proposer != simAccount.Address.String() { + proposerAddr, err := ak.AddressCodec().BytesToString(simAccount.Address) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, TypeMsgCancelProposal, "invalid proposer"), nil, err + } + if proposal.Proposer != proposerAddr { return simtypes.NoOpMsg(types.ModuleName, TypeMsgCancelProposal, "invalid proposer"), nil, nil } @@ -527,7 +550,11 @@ func SimulateMsgCancelProposal( account := ak.GetAccount(ctx, simAccount.Address) spendable := bk.SpendableCoins(ctx, account.GetAddress()) - msg := v1.NewMsgCancelProposal(proposal.Id, account.GetAddress().String()) + accAddr, err := ak.AddressCodec().BytesToString(account.GetAddress()) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, TypeMsgCancelProposal, "could not get account address"), nil, err + } + msg := v1.NewMsgCancelProposal(proposal.Id, accAddr) txCtx := simulation.OperationInput{ R: r, diff --git a/x/gov/simulation/proposals.go b/x/gov/simulation/proposals.go index 91b5d67e7b85..bc508cce4ebb 100644 --- a/x/gov/simulation/proposals.go +++ b/x/gov/simulation/proposals.go @@ -27,7 +27,7 @@ func ProposalMsgs() []simtypes.WeightedProposalMsg { // SimulateTextProposal returns a random text proposal content. // A text proposal is a proposal that contains no msgs. -func SimulateTextProposal(r *rand.Rand, _ sdk.Context, _ []simtypes.Account, _ coreaddress.Codec) (sdk.Msg, error) { +func SimulateTextProposal(r *rand.Rand, _ []simtypes.Account, _ coreaddress.Codec) (sdk.Msg, error) { return nil, nil } diff --git a/x/gov/simulation/proposals_test.go b/x/gov/simulation/proposals_test.go index 42ef52a7db9d..41a4068e7bb3 100644 --- a/x/gov/simulation/proposals_test.go +++ b/x/gov/simulation/proposals_test.go @@ -18,7 +18,6 @@ func TestProposalMsgs(t *testing.T) { s := rand.NewSource(1) r := rand.New(s) - ctx := sdk.NewContext(nil, true, nil) accounts := simtypes.RandomAccounts(r, 3) // execute ProposalMsgs function @@ -31,7 +30,7 @@ func TestProposalMsgs(t *testing.T) { assert.Equal(t, simulation.OpWeightSubmitTextProposal, w0.AppParamsKey()) assert.Equal(t, simulation.DefaultWeightTextProposal, w0.DefaultWeight()) - msg, err := w0.MsgSimulatorFn()(r, ctx, accounts, codectestutil.CodecOptions{}.GetAddressCodec()) + msg, err := w0.MsgSimulatorFn()(r, accounts, codectestutil.CodecOptions{}.GetAddressCodec()) assert.NilError(t, err) assert.Assert(t, msg == nil) } diff --git a/x/gov/types/events.go b/x/gov/types/events.go index 2ca0fa8dbf9d..ca2a01d2cead 100644 --- a/x/gov/types/events.go +++ b/x/gov/types/events.go @@ -13,10 +13,12 @@ const ( AttributeKeyVoter = "voter" AttributeKeyOption = "option" AttributeKeyProposalID = "proposal_id" + AttributeKeyDepositor = "depositor" AttributeKeyProposalMessages = "proposal_messages" // Msg type_urls in the proposal AttributeKeyVotingPeriodStart = "voting_period_start" AttributeKeyProposalLog = "proposal_log" // log of proposal execution AttributeKeyProposalDepositError = "proposal_deposit_error" // error on proposal deposit refund/burn + AttributeKeyProposalProposer = "proposal_proposer" // account address of the proposer AttributeValueProposalDropped = "proposal_dropped" // didn't meet min deposit AttributeValueProposalPassed = "proposal_passed" // met vote quorum diff --git a/x/gov/types/v1/deposit.go b/x/gov/types/v1/deposit.go index 2ddbd8c221ac..a35d6928cf9a 100644 --- a/x/gov/types/v1/deposit.go +++ b/x/gov/types/v1/deposit.go @@ -7,8 +7,8 @@ import ( ) // NewDeposit creates a new Deposit instance -func NewDeposit(proposalID uint64, depositor sdk.AccAddress, amount sdk.Coins) Deposit { - return Deposit{proposalID, depositor.String(), amount} +func NewDeposit(proposalID uint64, depositor string, amount sdk.Coins) Deposit { + return Deposit{proposalID, depositor, amount} } // Deposits is a collection of Deposit objects diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index cc9b058d7ddd..eae89e2e78d4 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -6,12 +6,12 @@ package v1 import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" - types1 "github.com/cosmos/cosmos-sdk/codec/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + any "github.com/cosmos/gogoproto/types/any" _ "google.golang.org/protobuf/types/known/durationpb" _ "google.golang.org/protobuf/types/known/timestamppb" io "io" @@ -307,7 +307,7 @@ type Proposal struct { // id defines the unique id of the proposal. Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // messages are the arbitrary messages to be executed if the proposal passes. - Messages []*types1.Any `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages,omitempty"` + Messages []*any.Any `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages,omitempty"` // status defines the proposal status. Status ProposalStatus `protobuf:"varint,3,opt,name=status,proto3,enum=cosmos.gov.v1.ProposalStatus" json:"status,omitempty"` // final_tally_result is the final tally result of the proposal. When @@ -395,7 +395,7 @@ func (m *Proposal) GetId() uint64 { return 0 } -func (m *Proposal) GetMessages() []*types1.Any { +func (m *Proposal) GetMessages() []*any.Any { if m != nil { return m.Messages } @@ -3025,7 +3025,7 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Messages = append(m.Messages, &types1.Any{}) + m.Messages = append(m.Messages, &any.Any{}) if err := m.Messages[len(m.Messages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/x/gov/types/v1/msgs.go b/x/gov/types/v1/msgs.go index 010bc65605be..d25a9ed33aad 100644 --- a/x/gov/types/v1/msgs.go +++ b/x/gov/types/v1/msgs.go @@ -87,18 +87,18 @@ func NewMultipleChoiceMsgSubmitProposal( } // NewMsgDeposit creates a new MsgDeposit instance -func NewMsgDeposit(depositor sdk.AccAddress, proposalID uint64, amount sdk.Coins) *MsgDeposit { - return &MsgDeposit{proposalID, depositor.String(), amount} +func NewMsgDeposit(depositor string, proposalID uint64, amount sdk.Coins) *MsgDeposit { + return &MsgDeposit{proposalID, depositor, amount} } // NewMsgVote creates a message to cast a vote on an active proposal -func NewMsgVote(voter sdk.AccAddress, proposalID uint64, option VoteOption, metadata string) *MsgVote { - return &MsgVote{proposalID, voter.String(), option, metadata} +func NewMsgVote(voter string, proposalID uint64, option VoteOption, metadata string) *MsgVote { + return &MsgVote{proposalID, voter, option, metadata} } // NewMsgVoteWeighted creates a message to cast a vote on an active proposal -func NewMsgVoteWeighted(voter sdk.AccAddress, proposalID uint64, options WeightedVoteOptions, metadata string) *MsgVoteWeighted { - return &MsgVoteWeighted{proposalID, voter.String(), options, metadata} +func NewMsgVoteWeighted(voter string, proposalID uint64, options WeightedVoteOptions, metadata string) *MsgVoteWeighted { + return &MsgVoteWeighted{proposalID, voter, options, metadata} } // NewMsgExecLegacyContent creates a new MsgExecLegacyContent instance. diff --git a/x/gov/types/v1/msgs_test.go b/x/gov/types/v1/msgs_test.go index 29155a123be4..ad266b15e008 100644 --- a/x/gov/types/v1/msgs_test.go +++ b/x/gov/types/v1/msgs_test.go @@ -10,6 +10,7 @@ import ( v1 "cosmossdk.io/x/gov/types/v1" "github.com/cosmos/cosmos-sdk/codec" + codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -33,7 +34,9 @@ func init() { func TestMsgDepositGetSignBytes(t *testing.T) { addr := sdk.AccAddress("addr1") - msg := v1.NewMsgDeposit(addr, 0, coinsPos) + addrStr, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(addr) + require.NoError(t, err) + msg := v1.NewMsgDeposit(addrStr, 0, coinsPos) pc := codec.NewProtoCodec(types.NewInterfaceRegistry()) res, err := pc.MarshalAminoJSON(msg) require.NoError(t, err) @@ -44,6 +47,8 @@ func TestMsgDepositGetSignBytes(t *testing.T) { // this tests that Amino JSON MsgSubmitProposal.GetSignBytes() still works with Content as Any using the ModuleCdc func TestMsgSubmitProposal_GetSignBytes(t *testing.T) { pc := codec.NewProtoCodec(types.NewInterfaceRegistry()) + addr0Str, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(addrs[0]) + require.NoError(t, err) testcases := []struct { name string proposal []sdk.Msg @@ -54,7 +59,7 @@ func TestMsgSubmitProposal_GetSignBytes(t *testing.T) { }{ { "MsgVote", - []sdk.Msg{v1.NewMsgVote(addrs[0], 1, v1.OptionYes, "")}, + []sdk.Msg{v1.NewMsgVote(addr0Str, 1, v1.OptionYes, "")}, "gov/MsgVote", "Proposal for a governance vote msg", v1.ProposalType_PROPOSAL_TYPE_STANDARD, diff --git a/x/gov/types/v1/params.go b/x/gov/types/v1/params.go index 66efdf0d43c9..1f594e368cca 100644 --- a/x/gov/types/v1/params.go +++ b/x/gov/types/v1/params.go @@ -260,7 +260,7 @@ func (p Params) ValidateBasic(addressCodec address.Codec) error { } if len(p.ProposalCancelDest) != 0 { - _, err := sdk.AccAddressFromBech32(p.ProposalCancelDest) + _, err := addressCodec.StringToBytes(p.ProposalCancelDest) if err != nil { return fmt.Errorf("deposits destination address is invalid: %s", p.ProposalCancelDest) } diff --git a/x/gov/types/v1/proposal.go b/x/gov/types/v1/proposal.go index 47615313fe11..aec495ff2040 100644 --- a/x/gov/types/v1/proposal.go +++ b/x/gov/types/v1/proposal.go @@ -23,7 +23,7 @@ const ( ) // NewProposal creates a new Proposal instance -func NewProposal(messages []sdk.Msg, id uint64, submitTime, depositEndTime time.Time, metadata, title, summary string, proposer sdk.AccAddress, proposalType ProposalType) (Proposal, error) { +func NewProposal(messages []sdk.Msg, id uint64, submitTime, depositEndTime time.Time, metadata, title, summary, proposer string, proposalType ProposalType) (Proposal, error) { msgs, err := sdktx.SetMsgs(messages) if err != nil { return Proposal{}, err @@ -46,7 +46,7 @@ func NewProposal(messages []sdk.Msg, id uint64, submitTime, depositEndTime time. DepositEndTime: &depositEndTime, Title: title, Summary: summary, - Proposer: proposer.String(), + Proposer: proposer, ProposalType: proposalType, } diff --git a/x/gov/types/v1/proposals_test.go b/x/gov/types/v1/proposals_test.go index 2152a60e1bbb..01e01d392af7 100644 --- a/x/gov/types/v1/proposals_test.go +++ b/x/gov/types/v1/proposals_test.go @@ -37,7 +37,7 @@ func TestNestedAnys(t *testing.T) { testProposal := v1beta1.NewTextProposal("Proposal", "testing proposal") msgContent, err := v1.NewLegacyContent(testProposal, "cosmos1govacct") require.NoError(t, err) - proposal, err := v1.NewProposal([]sdk.Msg{msgContent}, 1, time.Now(), time.Now(), "", "title", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), v1.ProposalType_PROPOSAL_TYPE_STANDARD) + proposal, err := v1.NewProposal([]sdk.Msg{msgContent}, 1, time.Now(), time.Now(), "", "title", "summary", "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", v1.ProposalType_PROPOSAL_TYPE_STANDARD) require.NoError(t, err) require.NotPanics(t, func() { _ = proposal.String() }) @@ -46,12 +46,12 @@ func TestNestedAnys(t *testing.T) { func TestProposalSetExpedited(t *testing.T) { const startExpedited = false - proposal, err := v1.NewProposal([]sdk.Msg{}, 1, time.Now(), time.Now(), "", "title", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), v1.ProposalType_PROPOSAL_TYPE_STANDARD) + proposal, err := v1.NewProposal([]sdk.Msg{}, 1, time.Now(), time.Now(), "", "title", "summary", "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", v1.ProposalType_PROPOSAL_TYPE_STANDARD) require.NoError(t, err) require.Equal(t, startExpedited, proposal.Expedited) require.Equal(t, proposal.ProposalType, v1.ProposalType_PROPOSAL_TYPE_STANDARD) - proposal, err = v1.NewProposal([]sdk.Msg{}, 1, time.Now(), time.Now(), "", "title", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), v1.ProposalType_PROPOSAL_TYPE_EXPEDITED) + proposal, err = v1.NewProposal([]sdk.Msg{}, 1, time.Now(), time.Now(), "", "title", "summary", "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", v1.ProposalType_PROPOSAL_TYPE_EXPEDITED) require.NoError(t, err) require.Equal(t, !startExpedited, proposal.Expedited) require.Equal(t, proposal.ProposalType, v1.ProposalType_PROPOSAL_TYPE_EXPEDITED) @@ -73,7 +73,7 @@ func TestProposalGetMinDepositFromParams(t *testing.T) { } for _, tc := range testcases { - proposal, err := v1.NewProposal([]sdk.Msg{}, 1, time.Now(), time.Now(), "", "title", "summary", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), tc.proposalType) + proposal, err := v1.NewProposal([]sdk.Msg{}, 1, time.Now(), time.Now(), "", "title", "summary", "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", tc.proposalType) require.NoError(t, err) actualMinDeposit := proposal.GetMinDepositFromParams(v1.DefaultParams()) diff --git a/x/gov/types/v1/tx.pb.go b/x/gov/types/v1/tx.pb.go index ca922adfee29..362ba39ebedb 100644 --- a/x/gov/types/v1/tx.pb.go +++ b/x/gov/types/v1/tx.pb.go @@ -7,15 +7,15 @@ import ( context "context" fmt "fmt" _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types1 "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + any "github.com/cosmos/gogoproto/types/any" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -42,7 +42,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // proposal Content. type MsgSubmitProposal struct { // messages are the arbitrary messages to be executed if proposal passes. - Messages []*types.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` + Messages []*any.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` // initial_deposit is the deposit value that must be paid at proposal submission. InitialDeposit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=initial_deposit,json=initialDeposit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"initial_deposit"` // proposer is the account address of the proposer. @@ -104,7 +104,7 @@ func (m *MsgSubmitProposal) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSubmitProposal proto.InternalMessageInfo -func (m *MsgSubmitProposal) GetMessages() []*types.Any { +func (m *MsgSubmitProposal) GetMessages() []*any.Any { if m != nil { return m.Messages } @@ -211,7 +211,7 @@ func (m *MsgSubmitProposalResponse) GetProposalId() uint64 { // This ensures backwards compatibility with v1beta1.MsgSubmitProposal. type MsgExecLegacyContent struct { // content is the proposal's content. - Content *types.Any `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` + Content *any.Any `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` // authority must be the gov module address. Authority string `protobuf:"bytes,2,opt,name=authority,proto3" json:"authority,omitempty"` } @@ -249,7 +249,7 @@ func (m *MsgExecLegacyContent) XXX_DiscardUnknown() { var xxx_messageInfo_MsgExecLegacyContent proto.InternalMessageInfo -func (m *MsgExecLegacyContent) GetContent() *types.Any { +func (m *MsgExecLegacyContent) GetContent() *any.Any { if m != nil { return m.Content } @@ -527,7 +527,7 @@ type MsgDeposit struct { // depositor defines the deposit addresses from the proposals. Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"` // amount to be deposited by depositor. - Amount []types1.Coin `protobuf:"bytes,3,rep,name=amount,proto3" json:"amount"` + Amount []types.Coin `protobuf:"bytes,3,rep,name=amount,proto3" json:"amount"` } func (m *MsgDeposit) Reset() { *m = MsgDeposit{} } @@ -577,7 +577,7 @@ func (m *MsgDeposit) GetDepositor() string { return "" } -func (m *MsgDeposit) GetAmount() []types1.Coin { +func (m *MsgDeposit) GetAmount() []types.Coin { if m != nil { return m.Amount } @@ -1099,7 +1099,7 @@ type MsgSudoExec struct { // authority is the address that controls the module (defaults to x/gov unless overwritten). Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` // msg is the arbitrary message to be executed. - Msg *types.Any `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` + Msg *any.Any `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` } func (m *MsgSudoExec) Reset() { *m = MsgSudoExec{} } @@ -1142,7 +1142,7 @@ func (m *MsgSudoExec) GetAuthority() string { return "" } -func (m *MsgSudoExec) GetMsg() *types.Any { +func (m *MsgSudoExec) GetMsg() *any.Any { if m != nil { return m.Msg } @@ -2976,7 +2976,7 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Messages = append(m.Messages, &types.Any{}) + m.Messages = append(m.Messages, &any.Any{}) if err := m.Messages[len(m.Messages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3010,7 +3010,7 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.InitialDeposit = append(m.InitialDeposit, types1.Coin{}) + m.InitialDeposit = append(m.InitialDeposit, types.Coin{}) if err := m.InitialDeposit[len(m.InitialDeposit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3331,7 +3331,7 @@ func (m *MsgExecLegacyContent) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Content == nil { - m.Content = &types.Any{} + m.Content = &any.Any{} } if err := m.Content.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -3968,7 +3968,7 @@ func (m *MsgDeposit) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Amount = append(m.Amount, types1.Coin{}) + m.Amount = append(m.Amount, types.Coin{}) if err := m.Amount[len(m.Amount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4489,7 +4489,7 @@ func (m *MsgSubmitMultipleChoiceProposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.InitialDeposit = append(m.InitialDeposit, types1.Coin{}) + m.InitialDeposit = append(m.InitialDeposit, types.Coin{}) if err := m.InitialDeposit[len(m.InitialDeposit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -5039,7 +5039,7 @@ func (m *MsgSudoExec) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Msg == nil { - m.Msg = &types.Any{} + m.Msg = &any.Any{} } if err := m.Msg.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/x/gov/types/v1/vote.go b/x/gov/types/v1/vote.go index fcd40a061660..f88b5a627e1a 100644 --- a/x/gov/types/v1/vote.go +++ b/x/gov/types/v1/vote.go @@ -6,8 +6,6 @@ import ( "strings" "cosmossdk.io/math" - - sdk "github.com/cosmos/cosmos-sdk/types" ) const ( @@ -25,8 +23,8 @@ const ( ) // NewVote creates a new Vote instance -func NewVote(proposalID uint64, voter sdk.AccAddress, options WeightedVoteOptions, metadata string) Vote { - return Vote{ProposalId: proposalID, Voter: voter.String(), Options: options, Metadata: metadata} +func NewVote(proposalID uint64, voter string, options WeightedVoteOptions, metadata string) Vote { + return Vote{ProposalId: proposalID, Voter: voter, Options: options, Metadata: metadata} } // Empty returns whether a vote is empty. diff --git a/x/gov/types/v1beta1/deposit.go b/x/gov/types/v1beta1/deposit.go index c9945b420990..48d901a2b197 100644 --- a/x/gov/types/v1beta1/deposit.go +++ b/x/gov/types/v1beta1/deposit.go @@ -7,8 +7,8 @@ import ( ) // NewDeposit creates a new Deposit instance -func NewDeposit(proposalID uint64, depositor sdk.AccAddress, amount sdk.Coins) Deposit { - return Deposit{proposalID, depositor.String(), amount} +func NewDeposit(proposalID uint64, depositor string, amount sdk.Coins) Deposit { + return Deposit{proposalID, depositor, amount} } // Empty returns whether a deposit is empty. diff --git a/x/gov/types/v1beta1/gov.pb.go b/x/gov/types/v1beta1/gov.pb.go index 21c15f41ff13..488c60381cc9 100644 --- a/x/gov/types/v1beta1/gov.pb.go +++ b/x/gov/types/v1beta1/gov.pb.go @@ -7,13 +7,13 @@ import ( cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" - types1 "github.com/cosmos/cosmos-sdk/codec/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + any "github.com/cosmos/gogoproto/types/any" _ "google.golang.org/protobuf/types/known/durationpb" _ "google.golang.org/protobuf/types/known/timestamppb" io "io" @@ -257,7 +257,7 @@ type Proposal struct { // proposal_id defines the unique id of the proposal. ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` // content is the proposal's content. - Content *types1.Any `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` + Content *any.Any `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` // status defines the proposal status. Status ProposalStatus `protobuf:"varint,3,opt,name=status,proto3,enum=cosmos.gov.v1beta1.ProposalStatus" json:"status,omitempty"` // final_tally_result is the final tally result of the proposal. When @@ -1843,7 +1843,7 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Content == nil { - m.Content = &types1.Any{} + m.Content = &any.Any{} } if err := m.Content.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/x/gov/types/v1beta1/msgs.go b/x/gov/types/v1beta1/msgs.go index 1f8a62019f05..298f26c592eb 100644 --- a/x/gov/types/v1beta1/msgs.go +++ b/x/gov/types/v1beta1/msgs.go @@ -24,10 +24,10 @@ var ( ) // NewMsgSubmitProposal creates a new MsgSubmitProposal. -func NewMsgSubmitProposal(content Content, initialDeposit sdk.Coins, proposer sdk.AccAddress) (*MsgSubmitProposal, error) { +func NewMsgSubmitProposal(content Content, initialDeposit sdk.Coins, proposer string) (*MsgSubmitProposal, error) { m := &MsgSubmitProposal{ InitialDeposit: initialDeposit, - Proposer: proposer.String(), + Proposer: proposer, } err := m.SetContent(content) if err != nil { @@ -54,8 +54,8 @@ func (m *MsgSubmitProposal) SetInitialDeposit(coins sdk.Coins) { } // SetProposer sets the given proposer address for MsgSubmitProposal. -func (m *MsgSubmitProposal) SetProposer(address fmt.Stringer) { - m.Proposer = address.String() +func (m *MsgSubmitProposal) SetProposer(address string) { + m.Proposer = address } // SetContent sets the content for MsgSubmitProposal. @@ -79,16 +79,16 @@ func (m MsgSubmitProposal) UnpackInterfaces(unpacker codectypes.AnyUnpacker) err } // NewMsgDeposit creates a new MsgDeposit instance -func NewMsgDeposit(depositor sdk.AccAddress, proposalID uint64, amount sdk.Coins) *MsgDeposit { - return &MsgDeposit{proposalID, depositor.String(), amount} +func NewMsgDeposit(depositor string, proposalID uint64, amount sdk.Coins) *MsgDeposit { + return &MsgDeposit{proposalID, depositor, amount} } // NewMsgVote creates a message to cast a vote on an active proposal -func NewMsgVote(voter sdk.AccAddress, proposalID uint64, option VoteOption) *MsgVote { - return &MsgVote{proposalID, voter.String(), option} +func NewMsgVote(voter string, proposalID uint64, option VoteOption) *MsgVote { + return &MsgVote{proposalID, voter, option} } // NewMsgVoteWeighted creates a message to cast a vote on an active proposal. -func NewMsgVoteWeighted(voter sdk.AccAddress, proposalID uint64, options WeightedVoteOptions) *MsgVoteWeighted { - return &MsgVoteWeighted{proposalID, voter.String(), options} +func NewMsgVoteWeighted(voter string, proposalID uint64, options WeightedVoteOptions) *MsgVoteWeighted { + return &MsgVoteWeighted{proposalID, voter, options} } diff --git a/x/gov/types/v1beta1/msgs_test.go b/x/gov/types/v1beta1/msgs_test.go index a190c80c3a70..791a8c9f6da7 100644 --- a/x/gov/types/v1beta1/msgs_test.go +++ b/x/gov/types/v1beta1/msgs_test.go @@ -6,6 +6,7 @@ import ( "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/codec" + codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -20,7 +21,8 @@ func init() { } func TestMsgDepositGetSignBytes(t *testing.T) { - addr := sdk.AccAddress("addr1") + addr, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(sdk.AccAddress("addr1")) + require.NoError(t, err) msg := NewMsgDeposit(addr, 0, coinsPos) pc := codec.NewProtoCodec(types.NewInterfaceRegistry()) res, err := pc.MarshalAminoJSON(msg) @@ -32,7 +34,9 @@ func TestMsgDepositGetSignBytes(t *testing.T) { // this tests that Amino JSON MsgSubmitProposal.GetSignBytes() still works with Content as Any using the ModuleCdc func TestMsgSubmitProposal_GetSignBytes(t *testing.T) { - msg, err := NewMsgSubmitProposal(NewTextProposal("test", "abcd"), sdk.NewCoins(), sdk.AccAddress{}) + addr, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(sdk.AccAddress{}) + require.NoError(t, err) + msg, err := NewMsgSubmitProposal(NewTextProposal("test", "abcd"), sdk.NewCoins(), addr) require.NoError(t, err) pc := codec.NewProtoCodec(types.NewInterfaceRegistry()) bz, err := pc.MarshalAminoJSON(msg) diff --git a/x/gov/types/v1beta1/tx.pb.go b/x/gov/types/v1beta1/tx.pb.go index 9d4e1f38586b..914ea13d3d2a 100644 --- a/x/gov/types/v1beta1/tx.pb.go +++ b/x/gov/types/v1beta1/tx.pb.go @@ -7,14 +7,14 @@ import ( context "context" fmt "fmt" _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types1 "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" + any "github.com/cosmos/gogoproto/types/any" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -38,7 +38,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // proposal Content. type MsgSubmitProposal struct { // content is the proposal's content. - Content *types.Any `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` + Content *any.Any `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` // initial_deposit is the deposit value that must be paid at proposal submission. InitialDeposit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=initial_deposit,json=initialDeposit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"initial_deposit"` // proposer is the account address of the proposer. @@ -1125,7 +1125,7 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Content == nil { - m.Content = &types.Any{} + m.Content = &any.Any{} } if err := m.Content.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1160,7 +1160,7 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.InitialDeposit = append(m.InitialDeposit, types1.Coin{}) + m.InitialDeposit = append(m.InitialDeposit, types.Coin{}) if err := m.InitialDeposit[len(m.InitialDeposit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -1751,7 +1751,7 @@ func (m *MsgDeposit) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Amount = append(m.Amount, types1.Coin{}) + m.Amount = append(m.Amount, types.Coin{}) if err := m.Amount[len(m.Amount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/x/group/CHANGELOG.md b/x/group/CHANGELOG.md index 0f6182d12bda..1f682c85b90c 100644 --- a/x/group/CHANGELOG.md +++ b/x/group/CHANGELOG.md @@ -32,6 +32,11 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### API Breaking Changes +* [#19916](https://github.com/cosmos/cosmos-sdk/pull/19916) Removes the use of Address String methods: + * `NewMsgCreateGroupPolicy` now takes a string as argument instead of an `AccAddress`. + * `NewMsgUpdateGroupPolicyDecisionPolicy` now takes strings as argument instead of `AccAddress`. + * `NewGroupPolicyInfo` address and admin arguments are now strings instead of `AccAddress`. + * `MigrateGenState` now takes an address codec as argument. * [#19638](https://github.com/cosmos/cosmos-sdk/pull/19638) Migrate module to use `appmodule.Environment` router service so no `baseapp.MessageRouter` is required is `NewKeeper` anymore. * [#19489](https://github.com/cosmos/cosmos-sdk/pull/19489) `appmodule.Environment` is received on the Keeper to get access to different application services. * [#19410](https://github.com/cosmos/cosmos-sdk/pull/19410) Migrate to Store Service. diff --git a/x/group/client/cli/prompt.go b/x/group/client/cli/prompt.go index 62056573f689..3cb018e02548 100644 --- a/x/group/client/cli/prompt.go +++ b/x/group/client/cli/prompt.go @@ -9,6 +9,7 @@ import ( "github.com/manifoldco/promptui" "github.com/spf13/cobra" + "cosmossdk.io/core/address" govcli "cosmossdk.io/x/gov/client/cli" govtypes "cosmossdk.io/x/gov/types" @@ -31,9 +32,9 @@ type proposalType struct { } // Prompt the proposal type values and return the proposal and its metadata. -func (p *proposalType) Prompt(cdc codec.Codec, skipMetadata bool) (*Proposal, govtypes.ProposalMetadata, error) { +func (p *proposalType) Prompt(cdc codec.Codec, skipMetadata bool, addressCodec address.Codec) (*Proposal, govtypes.ProposalMetadata, error) { // set metadata - metadata, err := govcli.PromptMetadata(skipMetadata) + metadata, err := govcli.PromptMetadata(skipMetadata, addressCodec) if err != nil { return nil, metadata, fmt.Errorf("failed to set proposal metadata: %w", err) } @@ -71,7 +72,7 @@ func (p *proposalType) Prompt(cdc codec.Codec, skipMetadata bool) (*Proposal, go } // set messages field - result, err := govcli.Prompt(p.Msg, "msg") + result, err := govcli.Prompt(p.Msg, "msg", addressCodec) if err != nil { return nil, metadata, fmt.Errorf("failed to set proposal message: %w", err) } @@ -142,7 +143,7 @@ func NewCmdDraftProposal() *cobra.Command { skipMetadataPrompt, _ := cmd.Flags().GetBool(flagSkipMetadata) - result, metadata, err := proposal.Prompt(clientCtx.Codec, skipMetadataPrompt) + result, metadata, err := proposal.Prompt(clientCtx.Codec, skipMetadataPrompt, clientCtx.AddressCodec) if err != nil { return err } diff --git a/x/group/client/cli/tx.go b/x/group/client/cli/tx.go index 09b62061aa9b..52c998ebed60 100644 --- a/x/group/client/cli/tx.go +++ b/x/group/client/cli/tx.go @@ -98,8 +98,13 @@ Where members.json contains: } } + admin, err := clientCtx.AddressCodec.BytesToString(clientCtx.GetFromAddress()) + if err != nil { + return err + } + msg := &group.MsgCreateGroup{ - Admin: clientCtx.GetFromAddress().String(), + Admin: admin, Members: members, Metadata: args[1], } @@ -174,8 +179,13 @@ Set a member's weight to "0" to delete it. return errZeroGroupID } + admin, err := clientCtx.AddressCodec.BytesToString(clientCtx.GetFromAddress()) + if err != nil { + return err + } + msg := &group.MsgUpdateGroupMembers{ - Admin: clientCtx.GetFromAddress().String(), + Admin: admin, MemberUpdates: members, GroupId: groupID, } @@ -268,8 +278,13 @@ and policy.json contains: return err } + admin, err := clientCtx.AddressCodec.BytesToString(clientCtx.GetFromAddress()) + if err != nil { + return err + } + msg, err := group.NewMsgCreateGroupWithPolicy( - clientCtx.GetFromAddress().String(), + admin, members, args[1], args[2], @@ -350,8 +365,13 @@ Here, we can use percentage decision policy when needed, where 0 < percentage <= return err } + admin, err := clientCtx.AddressCodec.BytesToString(clientCtx.GetFromAddress()) + if err != nil { + return err + } + msg, err := group.NewMsgCreateGroupPolicy( - clientCtx.GetFromAddress(), + admin, groupID, args[2], policy, @@ -398,9 +418,18 @@ func MsgUpdateGroupPolicyDecisionPolicyCmd() *cobra.Command { return err } + adminAddr, err := clientCtx.AddressCodec.BytesToString(clientCtx.GetFromAddress()) + if err != nil { + return err + } + accAddr, err := clientCtx.AddressCodec.BytesToString(accountAddress) + if err != nil { + return err + } + msg, err := group.NewMsgUpdateGroupPolicyDecisionPolicy( - clientCtx.GetFromAddress(), - accountAddress, + adminAddr, + accAddr, policy, ) if err != nil { diff --git a/x/group/client/cli/tx_test.go b/x/group/client/cli/tx_test.go index dbc768f2d4e7..8f68ad67908c 100644 --- a/x/group/client/cli/tx_test.go +++ b/x/group/client/cli/tx_test.go @@ -72,6 +72,8 @@ func (s *CLITestSuite) SetupSuite() { accounts := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) val := accounts[0] + valAddr, err := s.baseCtx.AddressCodec.BytesToString(val.Address) + s.Require().NoError(err) ctxGen := func() client.Context { bz, _ := s.encCfg.Codec.Marshal(&sdk.TxResponse{}) @@ -94,9 +96,14 @@ func (s *CLITestSuite) SetupSuite() { from := val.Address coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(2000))) + fromAddr, err := s.baseCtx.AddressCodec.BytesToString(from) + s.Require().NoError(err) + toAddr, err := s.baseCtx.AddressCodec.BytesToString(account) + s.Require().NoError(err) + msgSend := &banktypes.MsgSend{ - FromAddress: from.String(), - ToAddress: account.String(), + FromAddress: fromAddr, + ToAddress: toAddr, Amount: coins, } @@ -113,12 +120,12 @@ func (s *CLITestSuite) SetupSuite() { "metadata": "%s" } ] - }`, val.Address.String(), validMetadata) + }`, valAddr, validMetadata) validMembersFile := testutil.WriteToNewTempFile(s.T(), validMembers) out, err := clitestutil.ExecTestCLICmd(s.clientCtx, groupcli.MsgCreateGroupCmd(), append( []string{ - val.Address.String(), + valAddr, validMetadata, validMembersFile.Name(), }, @@ -131,11 +138,13 @@ func (s *CLITestSuite) SetupSuite() { s.Require().NoError(s.clientCtx.Codec.UnmarshalJSON(out.Bytes(), &txResp), out.String()) s.Require().Equal(uint32(0), txResp.Code, out.String()) - s.group = &group.GroupInfo{Id: 1, Admin: val.Address.String(), Metadata: validMetadata, TotalWeight: "3", Version: 1} + s.group = &group.GroupInfo{Id: 1, Admin: valAddr, Metadata: validMetadata, TotalWeight: "3", Version: 1} } func (s *CLITestSuite) TestTxCreateGroup() { accounts := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) + account0Addr, err := s.baseCtx.AddressCodec.BytesToString(accounts[0].Address) + s.Require().NoError(err) cmd := groupcli.MsgCreateGroupCmd() cmd.SetOutput(io.Discard) @@ -144,13 +153,13 @@ func (s *CLITestSuite) TestTxCreateGroup() { "address": "%s", "weight": "1", "metadata": "%s" - }]}`, accounts[0].Address.String(), validMetadata) + }]}`, account0Addr, validMetadata) validMembersFile := testutil.WriteToNewTempFile(s.T(), validMembers) invalidMembersWeight := fmt.Sprintf(`{"members": [{ "address": "%s", "weight": "0" - }]}`, accounts[0].Address.String()) + }]}`, account0Addr) invalidMembersWeightFile := testutil.WriteToNewTempFile(s.T(), invalidMembersWeight) testCases := []struct { @@ -163,34 +172,34 @@ func (s *CLITestSuite) TestTxCreateGroup() { name: "correct data", args: append( []string{ - accounts[0].Address.String(), + account0Addr, "", validMembersFile.Name(), }, s.commonFlags..., ), - expCmdOutput: fmt.Sprintf("%s %s %s", accounts[0].Address.String(), "", validMembersFile.Name()), + expCmdOutput: fmt.Sprintf("%s %s %s", account0Addr, "", validMembersFile.Name()), expectErrMsg: "", }, { "with amino-json", append( []string{ - accounts[0].Address.String(), + account0Addr, "", validMembersFile.Name(), fmt.Sprintf("--%s=%s", flags.FlagSignMode, flags.SignModeLegacyAminoJSON), }, s.commonFlags..., ), - fmt.Sprintf("%s %s %s", accounts[0].Address.String(), "", validMembersFile.Name()), + fmt.Sprintf("%s %s %s", account0Addr, "", validMembersFile.Name()), "", }, { "invalid members weight", append( []string{ - accounts[0].Address.String(), + account0Addr, "null", invalidMembersWeightFile.Name(), }, @@ -203,7 +212,7 @@ func (s *CLITestSuite) TestTxCreateGroup() { "no member provided", append( []string{ - accounts[0].Address.String(), + account0Addr, "null", "doesnotexist.json", }, @@ -244,6 +253,9 @@ func (s *CLITestSuite) TestTxUpdateGroupMembers() { accounts := testutil.CreateKeyringAccounts(s.T(), s.kr, 3) groupPolicyAddress := accounts[2] + account0Addr, err := s.baseCtx.AddressCodec.BytesToString(accounts[0].Address) + s.Require().NoError(err) + cmd := groupcli.MsgUpdateGroupMembersCmd() cmd.SetOutput(io.Discard) @@ -276,53 +288,53 @@ func (s *CLITestSuite) TestTxUpdateGroupMembers() { "correct data", append( []string{ - accounts[0].Address.String(), + account0Addr, groupID, validUpdatedMembersFileName, }, s.commonFlags..., ), - fmt.Sprintf("%s %s %s", accounts[0].Address.String(), groupID, validUpdatedMembersFileName), + fmt.Sprintf("%s %s %s", account0Addr, groupID, validUpdatedMembersFileName), "", }, { "with amino-json", append( []string{ - accounts[0].Address.String(), + account0Addr, groupID, validUpdatedMembersFileName, fmt.Sprintf("--%s=%s", flags.FlagSignMode, flags.SignModeLegacyAminoJSON), }, s.commonFlags..., ), - fmt.Sprintf("%s %s %s --%s=%s", accounts[0].Address.String(), groupID, validUpdatedMembersFileName, flags.FlagSignMode, flags.SignModeLegacyAminoJSON), + fmt.Sprintf("%s %s %s --%s=%s", account0Addr, groupID, validUpdatedMembersFileName, flags.FlagSignMode, flags.SignModeLegacyAminoJSON), "", }, { "group id invalid", append( []string{ - accounts[0].Address.String(), + account0Addr, "0", validUpdatedMembersFileName, }, s.commonFlags..., ), - fmt.Sprintf("%s %s %s", accounts[0].Address.String(), "0", validUpdatedMembersFileName), + fmt.Sprintf("%s %s %s", account0Addr, "0", validUpdatedMembersFileName), "group id cannot be 0", }, { "group member weight invalid", append( []string{ - accounts[0].Address.String(), + account0Addr, groupID, invalidMembersMetadataFileName, }, s.commonFlags..., ), - fmt.Sprintf("%s %s %s", accounts[0].Address.String(), groupID, invalidMembersMetadataFileName), + fmt.Sprintf("%s %s %s", account0Addr, groupID, invalidMembersMetadataFileName), "invalid weight -1", }, } @@ -358,6 +370,9 @@ func (s *CLITestSuite) TestTxUpdateGroupMembers() { func (s *CLITestSuite) TestTxCreateGroupWithPolicy() { accounts := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) + account0Addr, err := s.baseCtx.AddressCodec.BytesToString(accounts[0].Address) + s.Require().NoError(err) + cmd := groupcli.MsgCreateGroupWithPolicyCmd() cmd.SetOutput(io.Discard) @@ -365,13 +380,13 @@ func (s *CLITestSuite) TestTxCreateGroupWithPolicy() { "address": "%s", "weight": "1", "metadata": "%s" - }]}`, accounts[0].Address.String(), validMetadata) + }]}`, account0Addr, validMetadata) validMembersFile := testutil.WriteToNewTempFile(s.T(), validMembers) invalidMembersWeight := fmt.Sprintf(`{"members": [{ "address": "%s", "weight": "0" - }]}`, accounts[0].Address.String()) + }]}`, account0Addr) invalidMembersWeightFile := testutil.WriteToNewTempFile(s.T(), invalidMembersWeight) thresholdDecisionPolicyFile := testutil.WriteToNewTempFile(s.T(), `{"@type": "/cosmos.group.v1.ThresholdDecisionPolicy","threshold": "1","windows": {"voting_period":"1s"}}`) @@ -386,7 +401,7 @@ func (s *CLITestSuite) TestTxCreateGroupWithPolicy() { "correct data", append( []string{ - accounts[0].Address.String(), + account0Addr, validMetadata, validMetadata, validMembersFile.Name(), @@ -396,13 +411,13 @@ func (s *CLITestSuite) TestTxCreateGroupWithPolicy() { s.commonFlags..., ), "", - fmt.Sprintf("%s %s %s %s %s --%s=%v", accounts[0].Address.String(), validMetadata, validMetadata, validMembersFile.Name(), thresholdDecisionPolicyFile.Name(), groupcli.FlagGroupPolicyAsAdmin, false), + fmt.Sprintf("%s %s %s %s %s --%s=%v", account0Addr, validMetadata, validMetadata, validMembersFile.Name(), thresholdDecisionPolicyFile.Name(), groupcli.FlagGroupPolicyAsAdmin, false), }, { "group-policy-as-admin is true", append( []string{ - accounts[0].Address.String(), + account0Addr, validMetadata, validMetadata, validMembersFile.Name(), @@ -412,13 +427,13 @@ func (s *CLITestSuite) TestTxCreateGroupWithPolicy() { s.commonFlags..., ), "", - fmt.Sprintf("%s %s %s %s %s --%s=%v", accounts[0].Address.String(), validMetadata, validMetadata, validMembersFile.Name(), thresholdDecisionPolicyFile.Name(), groupcli.FlagGroupPolicyAsAdmin, true), + fmt.Sprintf("%s %s %s %s %s --%s=%v", account0Addr, validMetadata, validMetadata, validMembersFile.Name(), thresholdDecisionPolicyFile.Name(), groupcli.FlagGroupPolicyAsAdmin, true), }, { "with amino-json", append( []string{ - accounts[0].Address.String(), + account0Addr, validMetadata, validMetadata, validMembersFile.Name(), @@ -429,13 +444,13 @@ func (s *CLITestSuite) TestTxCreateGroupWithPolicy() { s.commonFlags..., ), "", - fmt.Sprintf("%s %s %s %s %s --%s=%v --%s=%s", accounts[0].Address.String(), validMetadata, validMetadata, validMembersFile.Name(), thresholdDecisionPolicyFile.Name(), groupcli.FlagGroupPolicyAsAdmin, false, flags.FlagSignMode, flags.SignModeLegacyAminoJSON), + fmt.Sprintf("%s %s %s %s %s --%s=%v --%s=%s", account0Addr, validMetadata, validMetadata, validMembersFile.Name(), thresholdDecisionPolicyFile.Name(), groupcli.FlagGroupPolicyAsAdmin, false, flags.FlagSignMode, flags.SignModeLegacyAminoJSON), }, { "invalid members weight", append( []string{ - accounts[0].Address.String(), + account0Addr, validMetadata, validMetadata, invalidMembersWeightFile.Name(), @@ -445,7 +460,7 @@ func (s *CLITestSuite) TestTxCreateGroupWithPolicy() { s.commonFlags..., ), "weight must be positive", - fmt.Sprintf("%s %s %s %s %s --%s=%v", accounts[0].Address.String(), validMetadata, validMetadata, invalidMembersWeightFile.Name(), thresholdDecisionPolicyFile.Name(), groupcli.FlagGroupPolicyAsAdmin, false), + fmt.Sprintf("%s %s %s %s %s --%s=%v", account0Addr, validMetadata, validMetadata, invalidMembersWeightFile.Name(), thresholdDecisionPolicyFile.Name(), groupcli.FlagGroupPolicyAsAdmin, false), }, } for _, tc := range testCases { @@ -478,7 +493,8 @@ func (s *CLITestSuite) TestTxCreateGroupWithPolicy() { func (s *CLITestSuite) TestTxCreateGroupPolicy() { accounts := testutil.CreateKeyringAccounts(s.T(), s.kr, 2) - val := accounts[0] + valAddr, err := s.baseCtx.AddressCodec.BytesToString(accounts[0].Address) + s.Require().NoError(err) groupID := s.group.Id @@ -501,7 +517,7 @@ func (s *CLITestSuite) TestTxCreateGroupPolicy() { "correct data", append( []string{ - val.Address.String(), + valAddr, fmt.Sprintf("%v", groupID), validMetadata, thresholdDecisionPolicyFile.Name(), @@ -509,13 +525,13 @@ func (s *CLITestSuite) TestTxCreateGroupPolicy() { s.commonFlags..., ), "", - fmt.Sprintf("%s %s %s %s", val.Address.String(), fmt.Sprintf("%v", groupID), validMetadata, thresholdDecisionPolicyFile.Name()), + fmt.Sprintf("%s %s %s %s", valAddr, fmt.Sprintf("%v", groupID), validMetadata, thresholdDecisionPolicyFile.Name()), }, { "correct data with percentage decision policy", append( []string{ - val.Address.String(), + valAddr, fmt.Sprintf("%v", groupID), validMetadata, percentageDecisionPolicyFile.Name(), @@ -523,13 +539,13 @@ func (s *CLITestSuite) TestTxCreateGroupPolicy() { s.commonFlags..., ), "", - fmt.Sprintf("%s %s %s %s", val.Address.String(), fmt.Sprintf("%v", groupID), validMetadata, percentageDecisionPolicyFile.Name()), + fmt.Sprintf("%s %s %s %s", valAddr, fmt.Sprintf("%v", groupID), validMetadata, percentageDecisionPolicyFile.Name()), }, { "with amino-json", append( []string{ - val.Address.String(), + valAddr, fmt.Sprintf("%v", groupID), validMetadata, thresholdDecisionPolicyFile.Name(), @@ -538,7 +554,7 @@ func (s *CLITestSuite) TestTxCreateGroupPolicy() { s.commonFlags..., ), "", - fmt.Sprintf("%s %s %s %s --%s=%s", val.Address.String(), fmt.Sprintf("%v", groupID), validMetadata, thresholdDecisionPolicyFile.Name(), flags.FlagSignMode, flags.SignModeLegacyAminoJSON), + fmt.Sprintf("%s %s %s %s --%s=%s", valAddr, fmt.Sprintf("%v", groupID), validMetadata, thresholdDecisionPolicyFile.Name(), flags.FlagSignMode, flags.SignModeLegacyAminoJSON), }, { "wrong admin", @@ -558,7 +574,7 @@ func (s *CLITestSuite) TestTxCreateGroupPolicy() { "invalid percentage decision policy with negative value", append( []string{ - val.Address.String(), + valAddr, fmt.Sprintf("%v", groupID), validMetadata, invalidNegativePercentageDecisionPolicyFile.Name(), @@ -566,13 +582,13 @@ func (s *CLITestSuite) TestTxCreateGroupPolicy() { s.commonFlags..., ), "expected a positive decimal", - fmt.Sprintf("%s %s %s %s", val.Address.String(), fmt.Sprintf("%v", groupID), validMetadata, invalidNegativePercentageDecisionPolicyFile.Name()), + fmt.Sprintf("%s %s %s %s", valAddr, fmt.Sprintf("%v", groupID), validMetadata, invalidNegativePercentageDecisionPolicyFile.Name()), }, { "invalid percentage decision policy with value greater than 1", append( []string{ - val.Address.String(), + valAddr, fmt.Sprintf("%v", groupID), validMetadata, invalidPercentageDecisionPolicyFile.Name(), @@ -580,7 +596,7 @@ func (s *CLITestSuite) TestTxCreateGroupPolicy() { s.commonFlags..., ), "percentage must be > 0 and <= 1", - fmt.Sprintf("%s %s %s %s", val.Address.String(), fmt.Sprintf("%v", groupID), validMetadata, invalidPercentageDecisionPolicyFile.Name()), + fmt.Sprintf("%s %s %s %s", valAddr, fmt.Sprintf("%v", groupID), validMetadata, invalidPercentageDecisionPolicyFile.Name()), }, } @@ -614,9 +630,12 @@ func (s *CLITestSuite) TestTxCreateGroupPolicy() { func (s *CLITestSuite) TestTxUpdateGroupPolicyDecisionPolicy() { accounts := testutil.CreateKeyringAccounts(s.T(), s.kr, 3) - newAdmin := accounts[0] - groupPolicyAdmin := accounts[1] - groupPolicyAddress := accounts[2] + newAdmin, err := s.baseCtx.AddressCodec.BytesToString(accounts[0].Address) + s.Require().NoError(err) + groupPolicyAdmin, err := s.baseCtx.AddressCodec.BytesToString(accounts[1].Address) + s.Require().NoError(err) + groupPolicyAddress, err := s.baseCtx.AddressCodec.BytesToString(accounts[2].Address) + s.Require().NoError(err) commonFlags := s.commonFlags commonFlags = append(commonFlags, fmt.Sprintf("--%s=%d", flags.FlagGas, 300000)) @@ -637,53 +656,53 @@ func (s *CLITestSuite) TestTxUpdateGroupPolicyDecisionPolicy() { "correct data", append( []string{ - groupPolicyAdmin.Address.String(), - groupPolicyAddress.Address.String(), + groupPolicyAdmin, + groupPolicyAddress, thresholdDecisionPolicy.Name(), }, commonFlags..., ), - fmt.Sprintf("%s %s %s", groupPolicyAdmin.Address.String(), groupPolicyAddress.Address.String(), thresholdDecisionPolicy.Name()), + fmt.Sprintf("%s %s %s", groupPolicyAdmin, groupPolicyAddress, thresholdDecisionPolicy.Name()), "", }, { "correct data with percentage decision policy", append( []string{ - groupPolicyAdmin.Address.String(), - groupPolicyAddress.Address.String(), + groupPolicyAdmin, + groupPolicyAddress, percentageDecisionPolicy.Name(), }, commonFlags..., ), - fmt.Sprintf("%s %s %s", groupPolicyAdmin.Address.String(), groupPolicyAddress.Address.String(), percentageDecisionPolicy.Name()), + fmt.Sprintf("%s %s %s", groupPolicyAdmin, groupPolicyAddress, percentageDecisionPolicy.Name()), "", }, { "with amino-json", append( []string{ - groupPolicyAdmin.Address.String(), - groupPolicyAddress.Address.String(), + groupPolicyAdmin, + groupPolicyAddress, thresholdDecisionPolicy.Name(), fmt.Sprintf("--%s=%s", flags.FlagSignMode, flags.SignModeLegacyAminoJSON), }, commonFlags..., ), - fmt.Sprintf("%s %s %s --%s=%s", groupPolicyAdmin.Address.String(), groupPolicyAddress.Address.String(), thresholdDecisionPolicy.Name(), flags.FlagSignMode, flags.SignModeLegacyAminoJSON), + fmt.Sprintf("%s %s %s --%s=%s", groupPolicyAdmin, groupPolicyAddress, thresholdDecisionPolicy.Name(), flags.FlagSignMode, flags.SignModeLegacyAminoJSON), "", }, { "wrong admin", append( []string{ - newAdmin.Address.String(), + newAdmin, "invalid", thresholdDecisionPolicy.Name(), }, commonFlags..., ), - fmt.Sprintf("%s %s %s", newAdmin.Address.String(), "invalid", thresholdDecisionPolicy.Name()), + fmt.Sprintf("%s %s %s", newAdmin, "invalid", thresholdDecisionPolicy.Name()), "decoding bech32 failed", }, } @@ -718,13 +737,17 @@ func (s *CLITestSuite) TestTxUpdateGroupPolicyDecisionPolicy() { func (s *CLITestSuite) TestTxSubmitProposal() { accounts := testutil.CreateKeyringAccounts(s.T(), s.kr, 2) - groupPolicyAddress := accounts[1].Address + + groupPolicyAddress, err := s.baseCtx.AddressCodec.BytesToString(accounts[1].Address) + s.Require().NoError(err) + account0Addr, err := s.baseCtx.AddressCodec.BytesToString(accounts[0].Address) + s.Require().NoError(err) p := groupcli.Proposal{ - GroupPolicyAddress: groupPolicyAddress.String(), + GroupPolicyAddress: groupPolicyAddress, Messages: []json.RawMessage{}, Metadata: validMetadata, - Proposers: []string{accounts[0].Address.String()}, + Proposers: []string{account0Addr}, } bz, err := json.Marshal(&p) s.Require().NoError(err) diff --git a/x/group/genesis_test.go b/x/group/genesis_test.go index 500fad8ae7ce..1671908fd63f 100644 --- a/x/group/genesis_test.go +++ b/x/group/genesis_test.go @@ -8,6 +8,7 @@ import ( banktypes "cosmossdk.io/x/bank/types" + codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -22,15 +23,21 @@ var ( func TestGenesisStateValidate(t *testing.T) { submittedAt := time.Now().UTC() timeout := submittedAt.Add(time.Second * 1).UTC() + addressCodec := codectestutil.CodecOptions{}.GetAddressCodec() + + accStrAddr, err := addressCodec.BytesToString(accAddr) + require.NoError(t, err) + memberStrAdrr, err := addressCodec.BytesToString(memberAddr) + require.NoError(t, err) groupPolicy := &GroupPolicyInfo{ - Address: accAddr.String(), + Address: accStrAddr, GroupId: 1, - Admin: accAddr.String(), + Admin: accStrAddr, Version: 1, Metadata: "policy metadata", } - err := groupPolicy.SetDecisionPolicy(&ThresholdDecisionPolicy{ + err = groupPolicy.SetDecisionPolicy(&ThresholdDecisionPolicy{ Threshold: "1", Windows: &DecisionPolicyWindows{ VotingPeriod: time.Second, @@ -40,9 +47,9 @@ func TestGenesisStateValidate(t *testing.T) { // create another group policy to set invalid decision policy for testing groupPolicy2 := &GroupPolicyInfo{ - Address: accAddr.String(), + Address: accStrAddr, GroupId: 1, - Admin: accAddr.String(), + Admin: accStrAddr, Version: 1, Metadata: "policy metadata", } @@ -56,12 +63,12 @@ func TestGenesisStateValidate(t *testing.T) { proposal := &Proposal{ Id: 1, - GroupPolicyAddress: accAddr.String(), + GroupPolicyAddress: accStrAddr, Metadata: "proposal metadata", GroupVersion: 1, GroupPolicyVersion: 1, Proposers: []string{ - memberAddr.String(), + memberStrAdrr, }, SubmitTime: submittedAt, Status: PROPOSAL_STATUS_ACCEPTED, @@ -75,8 +82,8 @@ func TestGenesisStateValidate(t *testing.T) { ExecutorResult: PROPOSAL_EXECUTOR_RESULT_SUCCESS, } err = proposal.SetMsgs([]sdk.Msg{&banktypes.MsgSend{ - FromAddress: accAddr.String(), - ToAddress: memberAddr.String(), + FromAddress: accStrAddr, + ToAddress: memberStrAdrr, Amount: sdk.Coins{sdk.NewInt64Coin("test", 100)}, }}) require.NoError(t, err) @@ -90,13 +97,13 @@ func TestGenesisStateValidate(t *testing.T) { "valid genesisState", GenesisState{ GroupSeq: 2, - Groups: []*GroupInfo{{Id: 1, Admin: accAddr.String(), Metadata: "1", Version: 1, TotalWeight: "1"}, {Id: 2, Admin: accAddr.String(), Metadata: "2", Version: 2, TotalWeight: "2"}}, - GroupMembers: []*GroupMember{{GroupId: 1, Member: &Member{Address: memberAddr.String(), Weight: "1", Metadata: "member metadata"}}, {GroupId: 2, Member: &Member{Address: memberAddr.String(), Weight: "2", Metadata: "member metadata"}}}, + Groups: []*GroupInfo{{Id: 1, Admin: accStrAddr, Metadata: "1", Version: 1, TotalWeight: "1"}, {Id: 2, Admin: accStrAddr, Metadata: "2", Version: 2, TotalWeight: "2"}}, + GroupMembers: []*GroupMember{{GroupId: 1, Member: &Member{Address: memberStrAdrr, Weight: "1", Metadata: "member metadata"}}, {GroupId: 2, Member: &Member{Address: memberStrAdrr, Weight: "2", Metadata: "member metadata"}}}, GroupPolicySeq: 1, GroupPolicies: []*GroupPolicyInfo{groupPolicy}, ProposalSeq: 1, Proposals: []*Proposal{proposal}, - Votes: []*Vote{{ProposalId: proposal.Id, Voter: memberAddr.String(), SubmitTime: submittedAt, Option: VOTE_OPTION_YES}}, + Votes: []*Vote{{ProposalId: proposal.Id, Voter: memberStrAdrr, SubmitTime: submittedAt, Option: VOTE_OPTION_YES}}, }, false, }, @@ -111,7 +118,7 @@ func TestGenesisStateValidate(t *testing.T) { Groups: []*GroupInfo{ { Id: 0, - Admin: accAddr.String(), + Admin: accStrAddr, Metadata: "1", Version: 1, TotalWeight: "1", @@ -141,7 +148,7 @@ func TestGenesisStateValidate(t *testing.T) { Groups: []*GroupInfo{ { Id: 1, - Admin: accAddr.String(), + Admin: accStrAddr, Metadata: "1", Version: 0, TotalWeight: "1", @@ -156,7 +163,7 @@ func TestGenesisStateValidate(t *testing.T) { Groups: []*GroupInfo{ { Id: 1, - Admin: accAddr.String(), + Admin: accStrAddr, Metadata: "1", Version: 1, TotalWeight: "-1", @@ -171,7 +178,7 @@ func TestGenesisStateValidate(t *testing.T) { Groups: []*GroupInfo{ { Id: 1, - Admin: accAddr.String(), + Admin: accStrAddr, Metadata: "1", Version: 1, TotalWeight: "1", @@ -181,7 +188,7 @@ func TestGenesisStateValidate(t *testing.T) { { Address: "invalid address", GroupId: 1, - Admin: accAddr.String(), + Admin: accStrAddr, Version: 1, Metadata: "policy metadata", }, @@ -195,7 +202,7 @@ func TestGenesisStateValidate(t *testing.T) { Groups: []*GroupInfo{ { Id: 1, - Admin: accAddr.String(), + Admin: accStrAddr, Metadata: "1", Version: 1, TotalWeight: "1", @@ -203,7 +210,7 @@ func TestGenesisStateValidate(t *testing.T) { }, GroupPolicies: []*GroupPolicyInfo{ { - Address: accAddr.String(), + Address: accStrAddr, GroupId: 1, Admin: "invalid admin", Version: 1, @@ -219,7 +226,7 @@ func TestGenesisStateValidate(t *testing.T) { Groups: []*GroupInfo{ { Id: 1, - Admin: accAddr.String(), + Admin: accStrAddr, Metadata: "1", Version: 1, TotalWeight: "1", @@ -227,9 +234,9 @@ func TestGenesisStateValidate(t *testing.T) { }, GroupPolicies: []*GroupPolicyInfo{ { - Address: accAddr.String(), + Address: accStrAddr, GroupId: 0, - Admin: accAddr.String(), + Admin: accStrAddr, Version: 1, Metadata: "policy metadata", }, @@ -243,7 +250,7 @@ func TestGenesisStateValidate(t *testing.T) { Groups: []*GroupInfo{ { Id: 1, - Admin: accAddr.String(), + Admin: accStrAddr, Metadata: "1", Version: 1, TotalWeight: "1", @@ -251,9 +258,9 @@ func TestGenesisStateValidate(t *testing.T) { }, GroupPolicies: []*GroupPolicyInfo{ { - Address: accAddr.String(), + Address: accStrAddr, GroupId: 1, - Admin: accAddr.String(), + Admin: accStrAddr, Version: 0, Metadata: "policy metadata", }, @@ -267,7 +274,7 @@ func TestGenesisStateValidate(t *testing.T) { Groups: []*GroupInfo{ { Id: 1, - Admin: accAddr.String(), + Admin: accStrAddr, Metadata: "1", Version: 1, TotalWeight: "1", @@ -275,9 +282,9 @@ func TestGenesisStateValidate(t *testing.T) { }, GroupPolicies: []*GroupPolicyInfo{ { - Address: accAddr.String(), + Address: accStrAddr, GroupId: 1, - Admin: accAddr.String(), + Admin: accStrAddr, Version: 1, Metadata: "policy metadata", DecisionPolicy: groupPolicy2.DecisionPolicy, @@ -292,7 +299,7 @@ func TestGenesisStateValidate(t *testing.T) { Groups: []*GroupInfo{ { Id: 1, - Admin: accAddr.String(), + Admin: accStrAddr, Metadata: "1", Version: 1, TotalWeight: "1", @@ -302,7 +309,7 @@ func TestGenesisStateValidate(t *testing.T) { { GroupId: 0, Member: &Member{ - Address: memberAddr.String(), + Address: memberStrAdrr, Weight: "1", Metadata: "member metadata", }, }, @@ -316,7 +323,7 @@ func TestGenesisStateValidate(t *testing.T) { Groups: []*GroupInfo{ { Id: 1, - Admin: accAddr.String(), + Admin: accStrAddr, Metadata: "1", Version: 1, TotalWeight: "1", @@ -340,7 +347,7 @@ func TestGenesisStateValidate(t *testing.T) { Groups: []*GroupInfo{ { Id: 1, - Admin: accAddr.String(), + Admin: accStrAddr, Metadata: "1", Version: 1, TotalWeight: "1", @@ -350,7 +357,7 @@ func TestGenesisStateValidate(t *testing.T) { { GroupId: 1, Member: &Member{ - Address: memberAddr.String(), + Address: memberStrAdrr, Weight: "-1", Metadata: "member metadata", }, }, @@ -364,7 +371,7 @@ func TestGenesisStateValidate(t *testing.T) { Groups: []*GroupInfo{ { Id: 1, - Admin: accAddr.String(), + Admin: accStrAddr, Metadata: "1", Version: 1, TotalWeight: "1", @@ -376,7 +383,7 @@ func TestGenesisStateValidate(t *testing.T) { Proposals: []*Proposal{ { Id: 0, - GroupPolicyAddress: accAddr.String(), + GroupPolicyAddress: accStrAddr, Metadata: "proposal metadata", GroupVersion: 1, GroupPolicyVersion: 1, @@ -391,7 +398,7 @@ func TestGenesisStateValidate(t *testing.T) { Groups: []*GroupInfo{ { Id: 1, - Admin: accAddr.String(), + Admin: accStrAddr, Metadata: "1", Version: 1, TotalWeight: "1", @@ -418,7 +425,7 @@ func TestGenesisStateValidate(t *testing.T) { Groups: []*GroupInfo{ { Id: 1, - Admin: accAddr.String(), + Admin: accStrAddr, Metadata: "1", Version: 1, TotalWeight: "1", @@ -430,7 +437,7 @@ func TestGenesisStateValidate(t *testing.T) { Proposals: []*Proposal{ { Id: 1, - GroupPolicyAddress: accAddr.String(), + GroupPolicyAddress: accStrAddr, Metadata: "proposal metadata", GroupVersion: 0, GroupPolicyVersion: 1, @@ -445,7 +452,7 @@ func TestGenesisStateValidate(t *testing.T) { Groups: []*GroupInfo{ { Id: 1, - Admin: accAddr.String(), + Admin: accStrAddr, Metadata: "1", Version: 1, TotalWeight: "1", @@ -457,7 +464,7 @@ func TestGenesisStateValidate(t *testing.T) { Proposals: []*Proposal{ { Id: 1, - GroupPolicyAddress: accAddr.String(), + GroupPolicyAddress: accStrAddr, Metadata: "proposal metadata", GroupVersion: 1, GroupPolicyVersion: 0, @@ -472,7 +479,7 @@ func TestGenesisStateValidate(t *testing.T) { Groups: []*GroupInfo{ { Id: 1, - Admin: accAddr.String(), + Admin: accStrAddr, Metadata: "1", Version: 1, TotalWeight: "1", @@ -484,12 +491,12 @@ func TestGenesisStateValidate(t *testing.T) { Proposals: []*Proposal{ { Id: 1, - GroupPolicyAddress: accAddr.String(), + GroupPolicyAddress: accStrAddr, Metadata: "proposal metadata", GroupVersion: 1, GroupPolicyVersion: 1, Proposers: []string{ - memberAddr.String(), + memberStrAdrr, }, SubmitTime: submittedAt, Status: PROPOSAL_STATUS_ACCEPTED, @@ -510,7 +517,7 @@ func TestGenesisStateValidate(t *testing.T) { Groups: []*GroupInfo{ { Id: 1, - Admin: accAddr.String(), + Admin: accStrAddr, Metadata: "1", Version: 1, TotalWeight: "1", @@ -522,12 +529,12 @@ func TestGenesisStateValidate(t *testing.T) { Proposals: []*Proposal{ { Id: 1, - GroupPolicyAddress: accAddr.String(), + GroupPolicyAddress: accStrAddr, Metadata: "proposal metadata", GroupVersion: 1, GroupPolicyVersion: 1, Proposers: []string{ - memberAddr.String(), + memberStrAdrr, }, SubmitTime: submittedAt, Status: PROPOSAL_STATUS_ACCEPTED, @@ -548,7 +555,7 @@ func TestGenesisStateValidate(t *testing.T) { Groups: []*GroupInfo{ { Id: 1, - Admin: accAddr.String(), + Admin: accStrAddr, Metadata: "1", Version: 1, TotalWeight: "1", @@ -560,12 +567,12 @@ func TestGenesisStateValidate(t *testing.T) { Proposals: []*Proposal{ { Id: 1, - GroupPolicyAddress: accAddr.String(), + GroupPolicyAddress: accStrAddr, Metadata: "proposal metadata", GroupVersion: 1, GroupPolicyVersion: 1, Proposers: []string{ - memberAddr.String(), + memberStrAdrr, }, SubmitTime: submittedAt, Status: PROPOSAL_STATUS_ACCEPTED, @@ -586,7 +593,7 @@ func TestGenesisStateValidate(t *testing.T) { Groups: []*GroupInfo{ { Id: 1, - Admin: accAddr.String(), + Admin: accStrAddr, Metadata: "1", Version: 1, TotalWeight: "1", @@ -598,12 +605,12 @@ func TestGenesisStateValidate(t *testing.T) { Proposals: []*Proposal{ { Id: 1, - GroupPolicyAddress: accAddr.String(), + GroupPolicyAddress: accStrAddr, Metadata: "proposal metadata", GroupVersion: 1, GroupPolicyVersion: 1, Proposers: []string{ - memberAddr.String(), + memberStrAdrr, }, SubmitTime: submittedAt, Status: PROPOSAL_STATUS_ACCEPTED, @@ -624,7 +631,7 @@ func TestGenesisStateValidate(t *testing.T) { Groups: []*GroupInfo{ { Id: 1, - Admin: accAddr.String(), + Admin: accStrAddr, Metadata: "1", Version: 1, TotalWeight: "1", @@ -653,7 +660,7 @@ func TestGenesisStateValidate(t *testing.T) { Groups: []*GroupInfo{ { Id: 1, - Admin: accAddr.String(), + Admin: accStrAddr, Metadata: "1", Version: 1, TotalWeight: "1", @@ -668,7 +675,7 @@ func TestGenesisStateValidate(t *testing.T) { Votes: []*Vote{ { ProposalId: 0, - Voter: memberAddr.String(), + Voter: memberStrAdrr, SubmitTime: submittedAt, Option: VOTE_OPTION_YES, }, @@ -682,7 +689,7 @@ func TestGenesisStateValidate(t *testing.T) { Groups: []*GroupInfo{ { Id: 1, - Admin: accAddr.String(), + Admin: accStrAddr, Metadata: "1", Version: 1, TotalWeight: "1", @@ -697,7 +704,7 @@ func TestGenesisStateValidate(t *testing.T) { Votes: []*Vote{ { ProposalId: 2, - Voter: memberAddr.String(), + Voter: memberStrAdrr, SubmitTime: submittedAt, Option: VOTE_OPTION_YES, }, @@ -711,7 +718,7 @@ func TestGenesisStateValidate(t *testing.T) { Groups: []*GroupInfo{ { Id: 1, - Admin: accAddr.String(), + Admin: accStrAddr, Metadata: "1", Version: 1, TotalWeight: "1", @@ -726,7 +733,7 @@ func TestGenesisStateValidate(t *testing.T) { Votes: []*Vote{ { ProposalId: proposal.Id, - Voter: memberAddr.String(), + Voter: memberStrAdrr, SubmitTime: submittedAt, Option: VOTE_OPTION_UNSPECIFIED, }, diff --git a/x/group/go.mod b/x/group/go.mod index e9034adfdc8b..4b45ce70f450 100644 --- a/x/group/go.mod +++ b/x/group/go.mod @@ -10,6 +10,7 @@ require ( cosmossdk.io/log v1.3.1 cosmossdk.io/math v1.3.0 cosmossdk.io/store v1.0.2 + cosmossdk.io/x/accounts v0.0.0-00010101000000-000000000000 cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 cosmossdk.io/x/authz v0.0.0-00010101000000-000000000000 cosmossdk.io/x/bank v0.0.0-00010101000000-000000000000 @@ -17,11 +18,11 @@ require ( cosmossdk.io/x/mint v0.0.0-00010101000000-000000000000 cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 github.com/cockroachdb/apd/v2 v2.0.2 - github.com/cometbft/cometbft v0.38.6 + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.4 github.com/cosmos/cosmos-sdk v0.51.0 - github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/gogoproto v1.4.12 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 @@ -29,8 +30,8 @@ require ( github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.9.0 golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 - google.golang.org/grpc v1.62.1 + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de + google.golang.org/grpc v1.63.2 google.golang.org/protobuf v1.33.0 pgregory.net/rapid v1.1.0 ) @@ -39,7 +40,6 @@ require ( buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.32.0-20230509103710-5e5b9fdd0180.1 // indirect buf.build/gen/go/tendermint/tendermint/protocolbuffers/go v1.32.0-20231117195010-33ed361a9051.1 // indirect cosmossdk.io/collections v0.4.0 // indirect - cosmossdk.io/x/accounts v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/tx v0.13.1 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect @@ -68,7 +68,7 @@ require ( github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect @@ -114,7 +114,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -124,13 +124,13 @@ require ( github.com/mtibben/percent v0.2.1 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.0 // indirect github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.50.0 // indirect + github.com/prometheus/common v0.52.2 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect @@ -154,16 +154,16 @@ require ( gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 // indirect go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.21.0 // indirect + golang.org/x/crypto v0.22.0 // indirect golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.22.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.18.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect diff --git a/x/group/go.sum b/x/group/go.sum index 8220ce575da3..44e31afd28ff 100644 --- a/x/group/go.sum +++ b/x/group/go.sum @@ -126,8 +126,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -149,8 +149,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/cosmos/iavl v1.0.0 h1:bw6t0Mv/mVCJvlMTOPHWLs5uUE3BRBfVWCRelOzl+so= github.com/cosmos/iavl v1.0.0/go.mod h1:CmTGqMnRnucjxbjduneZXT+0vPgNElYvdefjX2q9tYc= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= @@ -170,8 +170,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= @@ -457,8 +457,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -563,8 +563,8 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= @@ -605,8 +605,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= -github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -759,8 +759,8 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= @@ -809,8 +809,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -822,8 +822,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -879,12 +879,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -938,12 +938,12 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -961,8 +961,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/x/group/keeper/abci_test.go b/x/group/keeper/abci_test.go index 8206cbd0b108..0db99839d51c 100644 --- a/x/group/keeper/abci_test.go +++ b/x/group/keeper/abci_test.go @@ -71,16 +71,19 @@ func (s *IntegrationTestSuite) SetupTest() { func (s *IntegrationTestSuite) TestEndBlockerPruning() { ctx := s.ctx - addr1 := s.addrs[0] - addr2 := s.addrs[1] - addr3 := s.addrs[2] + addr1, err := s.addressCodec.BytesToString(s.addrs[0]) + s.Require().NoError(err) + addr2, err := s.addressCodec.BytesToString(s.addrs[1]) + s.Require().NoError(err) + addr3, err := s.addressCodec.BytesToString(s.addrs[2]) + s.Require().NoError(err) - addr1st, err := s.addressCodec.BytesToString(addr1) + addr1st, err := s.addressCodec.BytesToString(s.addrs[0]) s.Require().NoError(err) // Initial group, group policy and balance setup members := []group.MemberRequest{ - {Address: addr1st, Weight: "1"}, {Address: addr2.String(), Weight: "2"}, + {Address: addr1st, Weight: "1"}, {Address: addr2, Weight: "2"}, } groupRes, err := s.groupKeeper.CreateGroup(ctx, &group.MsgCreateGroup{ @@ -90,7 +93,7 @@ func (s *IntegrationTestSuite) TestEndBlockerPruning() { s.Require().NoError(err) groupRes2, err := s.groupKeeper.CreateGroup(ctx, &group.MsgCreateGroup{ - Admin: addr2.String(), + Admin: addr2, Members: members, }) s.Require().NoError(err) @@ -105,7 +108,7 @@ func (s *IntegrationTestSuite) TestEndBlockerPruning() { ) policyReq := &group.MsgCreateGroupPolicy{ - Admin: addr1.String(), + Admin: addr1, GroupId: groupID, } @@ -121,7 +124,7 @@ func (s *IntegrationTestSuite) TestEndBlockerPruning() { ) policyReq2 := &group.MsgCreateGroupPolicy{ - Admin: addr2.String(), + Admin: addr2, GroupId: groupID2, } @@ -142,15 +145,15 @@ func (s *IntegrationTestSuite) TestEndBlockerPruning() { msgSend1 := &banktypes.MsgSend{ FromAddress: policyRes.Address, - ToAddress: addr2.String(), + ToAddress: addr2, Amount: sdk.Coins{sdk.NewInt64Coin("test", 100)}, } msgSend2 := &banktypes.MsgSend{ FromAddress: policyRes2.Address, - ToAddress: addr2.String(), + ToAddress: addr2, Amount: sdk.Coins{sdk.NewInt64Coin("test", 100)}, } - proposers := []string{addr2.String()} + proposers := []string{addr2} specs := map[string]struct { setupProposal func(ctx sdk.Context) uint64 @@ -165,7 +168,7 @@ func (s *IntegrationTestSuite) TestEndBlockerPruning() { msgs := []sdk.Msg{msgSend1} pID, err := submitProposalAndVoteHelper(s, s.app, ctx, msgs, proposers, groupPolicyAddr, group.VOTE_OPTION_YES) s.Require().NoError(err) - _, err = s.groupKeeper.Exec(ctx, &group.MsgExec{Executor: addr3.String(), ProposalId: pID}) + _, err = s.groupKeeper.Exec(ctx, &group.MsgExec{Executor: addr3, ProposalId: pID}) s.Require().NoError(err) s.Require().NoError(testutil.FundAccount(ctx, s.bankKeeper, groupPolicyAddr, sdk.Coins{sdk.NewInt64Coin("test", 10002)})) @@ -180,7 +183,7 @@ func (s *IntegrationTestSuite) TestEndBlockerPruning() { msgs := []sdk.Msg{msgSend1, msgSend1} pID, err := submitProposalAndVoteHelper(s, s.app, ctx, msgs, proposers, groupPolicyAddr, group.VOTE_OPTION_YES) s.Require().NoError(err) - _, err = s.groupKeeper.Exec(ctx, &group.MsgExec{Executor: addr3.String(), ProposalId: pID}) + _, err = s.groupKeeper.Exec(ctx, &group.MsgExec{Executor: addr3, ProposalId: pID}) s.Require().NoError(err) s.Require().NoError(testutil.FundAccount(ctx, s.bankKeeper, groupPolicyAddr, sdk.Coins{sdk.NewInt64Coin("test", 10002)})) @@ -195,7 +198,7 @@ func (s *IntegrationTestSuite) TestEndBlockerPruning() { msgs := []sdk.Msg{msgSend1} pID, err := submitProposalAndVoteHelper(s, s.app, ctx, msgs, proposers, groupPolicyAddr, group.VOTE_OPTION_NO) s.Require().NoError(err) - _, err = s.groupKeeper.Exec(ctx, &group.MsgExec{Executor: addr3.String(), ProposalId: pID}) + _, err = s.groupKeeper.Exec(ctx, &group.MsgExec{Executor: addr3, ProposalId: pID}) s.Require().NoError(err) s.Require().NoError(testutil.FundAccount(ctx, s.bankKeeper, groupPolicyAddr, sdk.Coins{sdk.NewInt64Coin("test", 10002)})) @@ -210,7 +213,7 @@ func (s *IntegrationTestSuite) TestEndBlockerPruning() { setupProposal: func(ctx sdk.Context) uint64 { pID, err := submitProposalHelper(s, s.app, ctx, []sdk.Msg{msgSend1}, proposers, groupPolicyAddr) s.Require().NoError(err) - _, err = s.groupKeeper.Exec(ctx, &group.MsgExec{Executor: addr3.String(), ProposalId: pID}) + _, err = s.groupKeeper.Exec(ctx, &group.MsgExec{Executor: addr3, ProposalId: pID}) s.Require().NoError(err) s.Require().NoError(testutil.FundAccount(ctx, s.bankKeeper, groupPolicyAddr, sdk.Coins{sdk.NewInt64Coin("test", 10002)})) @@ -225,11 +228,11 @@ func (s *IntegrationTestSuite) TestEndBlockerPruning() { pID, err := submitProposalHelper(s, s.app, ctx, []sdk.Msg{msgSend1}, proposers, groupPolicyAddr) s.Require().NoError(err) _, err = s.groupKeeper.UpdateGroupPolicyMetadata(ctx, &group.MsgUpdateGroupPolicyMetadata{ - Admin: addr1.String(), + Admin: addr1, GroupPolicyAddress: policyRes.Address, }) s.Require().NoError(err) - _, err = s.groupKeeper.Exec(ctx, &group.MsgExec{Executor: addr3.String(), ProposalId: pID}) + _, err = s.groupKeeper.Exec(ctx, &group.MsgExec{Executor: addr3, ProposalId: pID}) s.Require().Error(err) // since proposal with status Aborted cannot be executed s.Require().NoError(testutil.FundAccount(ctx, s.bankKeeper, groupPolicyAddr, sdk.Coins{sdk.NewInt64Coin("test", 10002)})) @@ -244,7 +247,7 @@ func (s *IntegrationTestSuite) TestEndBlockerPruning() { msgs := []sdk.Msg{msgSend1} pID, err := submitProposalAndVoteHelper(s, s.app, ctx, msgs, proposers, groupPolicyAddr, group.VOTE_OPTION_YES) s.Require().NoError(err) - _, err = s.groupKeeper.Exec(ctx, &group.MsgExec{Executor: s.addrs[2].String(), ProposalId: pID}) + _, err = s.groupKeeper.Exec(ctx, &group.MsgExec{Executor: addr3, ProposalId: pID}) s.Require().NoError(err) return pID }, @@ -290,7 +293,7 @@ func (s *IntegrationTestSuite) TestEndBlockerPruning() { policy := group.NewThresholdDecisionPolicy("3", time.Second, 0) msg := &group.MsgUpdateGroupPolicyDecisionPolicy{ - Admin: s.addrs[1].String(), + Admin: addr2, GroupPolicyAddress: policyRes2.Address, } err = msg.SetDecisionPolicy(policy) @@ -312,7 +315,7 @@ func (s *IntegrationTestSuite) TestEndBlockerPruning() { policy := group.NewThresholdDecisionPolicy("3", time.Second, 0) msg := &group.MsgUpdateGroupPolicyDecisionPolicy{ - Admin: s.addrs[1].String(), + Admin: addr2, GroupPolicyAddress: policyRes2.Address, } err = msg.SetDecisionPolicy(policy) @@ -372,14 +375,22 @@ func (s *IntegrationTestSuite) TestEndBlockerTallying() { ctx := s.ctx addrs := s.addrs + addr0, err := s.addressCodec.BytesToString(addrs[0]) + s.Require().NoError(err) + addr1, err := s.addressCodec.BytesToString(addrs[1]) + s.Require().NoError(err) + addr2, err := s.addressCodec.BytesToString(addrs[2]) + s.Require().NoError(err) + addr3, err := s.addressCodec.BytesToString(addrs[3]) + s.Require().NoError(err) // Initial group, group policy and balance setup members := []group.MemberRequest{ - {Address: addrs[1].String(), Weight: "1"}, {Address: addrs[2].String(), Weight: "2"}, + {Address: addr1, Weight: "1"}, {Address: addr2, Weight: "2"}, } groupRes, err := s.groupKeeper.CreateGroup(ctx, &group.MsgCreateGroup{ - Admin: addrs[0].String(), + Admin: addr0, Members: members, }) s.Require().NoError(err) @@ -393,7 +404,7 @@ func (s *IntegrationTestSuite) TestEndBlockerTallying() { ) policyReq := &group.MsgCreateGroupPolicy{ - Admin: addrs[0].String(), + Admin: addr0, GroupId: groupID, } @@ -409,11 +420,11 @@ func (s *IntegrationTestSuite) TestEndBlockerTallying() { msgSend := &banktypes.MsgSend{ FromAddress: policyRes.Address, - ToAddress: addrs[3].String(), + ToAddress: addr3, Amount: sdk.Coins{sdk.NewInt64Coin("test", 100)}, } - proposers := []string{addrs[2].String()} + proposers := []string{addr2} specs := map[string]struct { preRun func(sdkCtx sdk.Context) uint64 @@ -461,7 +472,7 @@ func (s *IntegrationTestSuite) TestEndBlockerTallying() { "tally after voting period (not passing)": { preRun: func(sdkCtx sdk.Context) uint64 { // `addrs[1]` has weight 1 - pID, err := submitProposalAndVoteHelper(s, app, ctx, []sdk.Msg{msgSend}, []string{addrs[1].String()}, groupPolicyAddr, group.VOTE_OPTION_YES) + pID, err := submitProposalAndVoteHelper(s, app, ctx, []sdk.Msg{msgSend}, []string{addr1}, groupPolicyAddr, group.VOTE_OPTION_YES) s.Require().NoError(err) return pID @@ -556,11 +567,13 @@ func (s *IntegrationTestSuite) TestEndBlockerTallying() { } func submitProposalHelper(s *IntegrationTestSuite, app *runtime.App, ctx context.Context, msgs []sdk.Msg, proposers []string, groupPolicyAddr sdk.AccAddress) (uint64, error) { + gpAddr, err := s.addressCodec.BytesToString(groupPolicyAddr) + s.Require().NoError(err) proposalReq := &group.MsgSubmitProposal{ - GroupPolicyAddress: groupPolicyAddr.String(), + GroupPolicyAddress: gpAddr, Proposers: proposers, } - err := proposalReq.SetMsgs(msgs) + err = proposalReq.SetMsgs(msgs) if err != nil { return 0, err } diff --git a/x/group/keeper/genesis_test.go b/x/group/keeper/genesis_test.go index ee92089f8c22..9e61244079b3 100644 --- a/x/group/keeper/genesis_test.go +++ b/x/group/keeper/genesis_test.go @@ -9,6 +9,7 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" + coreaddress "cosmossdk.io/core/address" "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" authtypes "cosmossdk.io/x/auth/types" @@ -32,10 +33,11 @@ import ( type GenesisTestSuite struct { suite.Suite - ctx context.Context - sdkCtx sdk.Context - keeper keeper.Keeper - cdc *codec.ProtoCodec + ctx context.Context + sdkCtx sdk.Context + keeper keeper.Keeper + cdc *codec.ProtoCodec + addressCodec coreaddress.Codec } func TestGenesisTestSuite(t *testing.T) { @@ -73,6 +75,7 @@ func (s *GenesisTestSuite) SetupTest() { s.sdkCtx = testCtx.Ctx s.cdc = codec.NewProtoCodec(encCfg.InterfaceRegistry) s.ctx = s.sdkCtx + s.addressCodec = address.NewBech32Codec("cosmos") env := runtime.NewEnvironment(storeService, log.NewNopLogger(), runtime.EnvWithRouterService(bApp.GRPCQueryRouter(), bApp.MsgServiceRouter())) s.keeper = keeper.NewKeeper(env, s.cdc, accountKeeper, group.DefaultConfig()) @@ -86,14 +89,19 @@ func (s *GenesisTestSuite) TestInitExportGenesis() { submittedAt := time.Now().UTC() timeout := submittedAt.Add(time.Second * 1).UTC() + accStrAddr, err := s.addressCodec.BytesToString(accAddr) + s.Require().NoError(err) + memberStrAddr, err := s.addressCodec.BytesToString(memberAddr) + s.Require().NoError(err) + groupPolicy := &group.GroupPolicyInfo{ - Address: accAddr.String(), + Address: accStrAddr, GroupId: 1, - Admin: accAddr.String(), + Admin: accStrAddr, Version: 1, Metadata: "policy metadata", } - err := groupPolicy.SetDecisionPolicy(&group.ThresholdDecisionPolicy{ + err = groupPolicy.SetDecisionPolicy(&group.ThresholdDecisionPolicy{ Threshold: "1", Windows: &group.DecisionPolicyWindows{ VotingPeriod: time.Second, @@ -103,12 +111,12 @@ func (s *GenesisTestSuite) TestInitExportGenesis() { proposal := &group.Proposal{ Id: 1, - GroupPolicyAddress: accAddr.String(), + GroupPolicyAddress: accStrAddr, Metadata: "proposal metadata", GroupVersion: 1, GroupPolicyVersion: 1, Proposers: []string{ - memberAddr.String(), + memberStrAddr, }, SubmitTime: submittedAt, Status: group.PROPOSAL_STATUS_ACCEPTED, @@ -122,21 +130,21 @@ func (s *GenesisTestSuite) TestInitExportGenesis() { ExecutorResult: group.PROPOSAL_EXECUTOR_RESULT_SUCCESS, } err = proposal.SetMsgs([]sdk.Msg{&banktypes.MsgSend{ - FromAddress: accAddr.String(), - ToAddress: memberAddr.String(), + FromAddress: accStrAddr, + ToAddress: memberStrAddr, Amount: sdk.Coins{sdk.NewInt64Coin("test", 100)}, }}) s.Require().NoError(err) genesisState := &group.GenesisState{ GroupSeq: 2, - Groups: []*group.GroupInfo{{Id: 1, Admin: accAddr.String(), Metadata: "1", Version: 1, TotalWeight: "1"}, {Id: 2, Admin: accAddr.String(), Metadata: "2", Version: 2, TotalWeight: "2"}}, - GroupMembers: []*group.GroupMember{{GroupId: 1, Member: &group.Member{Address: memberAddr.String(), Weight: "1", Metadata: "member metadata"}}, {GroupId: 2, Member: &group.Member{Address: memberAddr.String(), Weight: "2", Metadata: "member metadata"}}}, + Groups: []*group.GroupInfo{{Id: 1, Admin: accStrAddr, Metadata: "1", Version: 1, TotalWeight: "1"}, {Id: 2, Admin: accStrAddr, Metadata: "2", Version: 2, TotalWeight: "2"}}, + GroupMembers: []*group.GroupMember{{GroupId: 1, Member: &group.Member{Address: memberStrAddr, Weight: "1", Metadata: "member metadata"}}, {GroupId: 2, Member: &group.Member{Address: memberStrAddr, Weight: "2", Metadata: "member metadata"}}}, GroupPolicySeq: 1, GroupPolicies: []*group.GroupPolicyInfo{groupPolicy}, ProposalSeq: 1, Proposals: []*group.Proposal{proposal}, - Votes: []*group.Vote{{ProposalId: proposal.Id, Voter: memberAddr.String(), SubmitTime: submittedAt, Option: group.VOTE_OPTION_YES}}, + Votes: []*group.Vote{{ProposalId: proposal.Id, Voter: memberStrAddr, SubmitTime: submittedAt, Option: group.VOTE_OPTION_YES}}, } genesisBytes, err := cdc.MarshalJSON(genesisState) s.Require().NoError(err) diff --git a/x/group/keeper/grpc_query.go b/x/group/keeper/grpc_query.go index 5f3bc4cbc37d..6884616d851f 100644 --- a/x/group/keeper/grpc_query.go +++ b/x/group/keeper/grpc_query.go @@ -214,12 +214,12 @@ func (k Keeper) getProposal(ctx context.Context, proposalID uint64) (group.Propo // VoteByProposalVoter queries a vote given a voter and a proposal ID. func (k Keeper) VoteByProposalVoter(ctx context.Context, request *group.QueryVoteByProposalVoterRequest) (*group.QueryVoteByProposalVoterResponse, error) { - addr, err := k.accKeeper.AddressCodec().StringToBytes(request.Voter) + _, err := k.accKeeper.AddressCodec().StringToBytes(request.Voter) if err != nil { return nil, err } proposalID := request.ProposalId - vote, err := k.getVote(ctx, proposalID, addr) + vote, err := k.getVote(ctx, proposalID, request.Voter) if err != nil { return nil, err } @@ -309,9 +309,9 @@ func (k Keeper) GroupsByMember(ctx context.Context, request *group.QueryGroupsBy } // getVote gets the vote info for the given proposal id and voter address. -func (k Keeper) getVote(ctx context.Context, proposalID uint64, voter sdk.AccAddress) (group.Vote, error) { +func (k Keeper) getVote(ctx context.Context, proposalID uint64, voter string) (group.Vote, error) { var v group.Vote - return v, k.voteTable.GetOne(k.environment.KVStoreService.OpenKVStore(ctx), orm.PrimaryKey(&group.Vote{ProposalId: proposalID, Voter: voter.String()}), &v) + return v, k.voteTable.GetOne(k.environment.KVStoreService.OpenKVStore(ctx), orm.PrimaryKey(&group.Vote{ProposalId: proposalID, Voter: voter}), &v) } // getVotesByProposal returns an iterator for the given proposal id and page request. diff --git a/x/group/keeper/grpc_query_test.go b/x/group/keeper/grpc_query_test.go index dccc77656925..d8da1ad1fc54 100644 --- a/x/group/keeper/grpc_query_test.go +++ b/x/group/keeper/grpc_query_test.go @@ -32,7 +32,7 @@ type fixture struct { ctx types.Context keeper groupkeeper.Keeper queryClient group.QueryClient - addrs []types.AccAddress + addrs []string defaultGroup *group.MsgCreateGroupWithPolicyResponse } @@ -56,13 +56,19 @@ func initKeeper(t *testing.T) *fixture { encCfg.TxConfig.TxDecoder(), ) - addrs := simtestutil.CreateIncrementalAccounts(6) + addressCodec := address.NewBech32Codec("cosmos") + accAddrs := simtestutil.CreateIncrementalAccounts(6) + addrs := make([]string, len(accAddrs)) + ctrl := gomock.NewController(t) accountKeeper := grouptestutil.NewMockAccountKeeper(ctrl) - for _, addr := range addrs { + var err error + for i, addr := range accAddrs { accountKeeper.EXPECT().GetAccount(gomock.Any(), addr).Return(authtypes.NewBaseAccountWithAddress(addr)).AnyTimes() + addrs[i], err = addressCodec.BytesToString(addr) + require.NoError(t, err) } - accountKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec("cosmos")).AnyTimes() + accountKeeper.EXPECT().AddressCodec().Return(addressCodec).AnyTimes() // group policy expected calls accountKeeper.EXPECT().GetAccount(gomock.Any(), gomock.Any()).Return(nil).AnyTimes() @@ -77,13 +83,13 @@ func initKeeper(t *testing.T) *fixture { queryClient := group.NewQueryClient(queryHelper) msgGroupAndPolicy := &group.MsgCreateGroupWithPolicy{ - Admin: addrs[0].String(), + Admin: addrs[0], Members: []group.MemberRequest{ - {Address: addrs[1].String(), Weight: "1"}, - {Address: addrs[3].String(), Weight: "2"}, + {Address: addrs[1], Weight: "1"}, + {Address: addrs[3], Weight: "2"}, }, } - err := msgGroupAndPolicy.SetDecisionPolicy(group.NewThresholdDecisionPolicy("2", time.Second, 20)) + err = msgGroupAndPolicy.SetDecisionPolicy(group.NewThresholdDecisionPolicy("2", time.Second, 20)) require.NoError(t, err) resp, err := groupKeeper.CreateGroupWithPolicy(ctx, msgGroupAndPolicy) @@ -152,7 +158,7 @@ func TestQueryGroupPolicyInfo(t *testing.T) { }, { name: "unexisting address", - req: group.QueryGroupPolicyInfoRequest{Address: fixture.addrs[5].String()}, + req: group.QueryGroupPolicyInfoRequest{Address: fixture.addrs[5]}, expErrMsg: "group policy: not found", }, { @@ -232,13 +238,13 @@ func TestQueryGroupsByAdmin(t *testing.T) { }{ { name: "valid admin", - req: group.QueryGroupsByAdminRequest{Admin: fixture.addrs[0].String()}, + req: group.QueryGroupsByAdminRequest{Admin: fixture.addrs[0]}, postRun: func(resp *group.QueryGroupsByAdminResponse) { require.Len(t, resp.Groups, 1) }, expErrMsg: "", }, { name: "unexisting address", - req: group.QueryGroupsByAdminRequest{Admin: fixture.addrs[5].String()}, + req: group.QueryGroupsByAdminRequest{Admin: fixture.addrs[5]}, postRun: func(resp *group.QueryGroupsByAdminResponse) { require.Len(t, resp.Groups, 0) }, expErrMsg: "", }, @@ -319,13 +325,13 @@ func TestQueryGroupPoliciesByAdmin(t *testing.T) { }{ { name: "valid admin", - req: group.QueryGroupPoliciesByAdminRequest{Admin: fixture.addrs[0].String()}, + req: group.QueryGroupPoliciesByAdminRequest{Admin: fixture.addrs[0]}, postRun: func(resp *group.QueryGroupPoliciesByAdminResponse) { require.Len(t, resp.GroupPolicies, 1) }, expErrMsg: "", }, { name: "unexisting address", - req: group.QueryGroupPoliciesByAdminRequest{Admin: fixture.addrs[5].String()}, + req: group.QueryGroupPoliciesByAdminRequest{Admin: fixture.addrs[5]}, postRun: func(resp *group.QueryGroupPoliciesByAdminResponse) { require.Len(t, resp.GroupPolicies, 0) }, expErrMsg: "", }, @@ -358,31 +364,31 @@ func TestQueryGroupsByMember(t *testing.T) { fixture := initKeeper(t) members := []group.MemberRequest{ - {Address: fixture.addrs[3].String(), Weight: "1"}, {Address: fixture.addrs[4].String(), Weight: "2"}, + {Address: fixture.addrs[3], Weight: "1"}, {Address: fixture.addrs[4], Weight: "2"}, } _, err := fixture.keeper.CreateGroup(fixture.ctx, &group.MsgCreateGroup{ - Admin: fixture.addrs[1].String(), + Admin: fixture.addrs[1], Members: members, }) require.NoError(t, err) // not part of any group resp, err := fixture.queryClient.GroupsByMember(context.Background(), &group.QueryGroupsByMemberRequest{ - Address: fixture.addrs[5].String(), + Address: fixture.addrs[5], }) require.NoError(t, err) require.Len(t, resp.Groups, 0) // expect one group resp, err = fixture.queryClient.GroupsByMember(context.Background(), &group.QueryGroupsByMemberRequest{ - Address: fixture.addrs[4].String(), + Address: fixture.addrs[4], }) require.NoError(t, err) require.Len(t, resp.Groups, 1) // expect two groups resp, err = fixture.queryClient.GroupsByMember(context.Background(), &group.QueryGroupsByMemberRequest{ - Address: fixture.addrs[3].String(), + Address: fixture.addrs[3], }) require.NoError(t, err) require.Len(t, resp.Groups, 2) @@ -392,10 +398,10 @@ func TestQueryGroups(t *testing.T) { fixture := initKeeper(t) members := []group.MemberRequest{ - {Address: fixture.addrs[3].String(), Weight: "1"}, + {Address: fixture.addrs[3], Weight: "1"}, } _, err := fixture.keeper.CreateGroup(fixture.ctx, &group.MsgCreateGroup{ - Admin: fixture.addrs[2].String(), + Admin: fixture.addrs[2], Members: members, }) require.NoError(t, err) diff --git a/x/group/keeper/invariants_test.go b/x/group/keeper/invariants_test.go index d452fcc9157d..aef29597c63f 100644 --- a/x/group/keeper/invariants_test.go +++ b/x/group/keeper/invariants_test.go @@ -15,6 +15,7 @@ import ( "cosmossdk.io/x/group/keeper" "github.com/cosmos/cosmos-sdk/codec" + codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil/testdata" @@ -52,6 +53,7 @@ func (s *invariantTestSuite) SetupSuite() { func (s *invariantTestSuite) TestGroupTotalWeightInvariant() { sdkCtx, _ := s.ctx.CacheContext() curCtx, cdc, key := sdkCtx, s.cdc, s.key + addressCodec := codectestutil.CodecOptions{}.GetAddressCodec() // Group Table groupTable, err := orm.NewAutoUInt64Table([2]byte{keeper.GroupTablePrefix}, keeper.GroupTableSeqPrefix, &group.GroupInfo{}, cdc) @@ -70,6 +72,11 @@ func (s *invariantTestSuite) TestGroupTotalWeightInvariant() { _, _, addr1 := testdata.KeyTestPubAddr() _, _, addr2 := testdata.KeyTestPubAddr() + addr1Str, err := addressCodec.BytesToString(addr1) + s.Require().NoError(err) + addr2Str, err := addressCodec.BytesToString(addr2) + s.Require().NoError(err) + specs := map[string]struct { groupsInfo *group.GroupInfo groupMembers []*group.GroupMember @@ -78,7 +85,7 @@ func (s *invariantTestSuite) TestGroupTotalWeightInvariant() { "invariant not broken": { groupsInfo: &group.GroupInfo{ Id: 1, - Admin: addr1.String(), + Admin: addr1Str, Version: 1, TotalWeight: "3", }, @@ -86,14 +93,14 @@ func (s *invariantTestSuite) TestGroupTotalWeightInvariant() { { GroupId: 1, Member: &group.Member{ - Address: addr1.String(), + Address: addr1Str, Weight: "1", }, }, { GroupId: 1, Member: &group.Member{ - Address: addr2.String(), + Address: addr2Str, Weight: "2", }, }, @@ -104,7 +111,7 @@ func (s *invariantTestSuite) TestGroupTotalWeightInvariant() { "group's TotalWeight must be equal to sum of its members weight ": { groupsInfo: &group.GroupInfo{ Id: 1, - Admin: addr1.String(), + Admin: addr1Str, Version: 1, TotalWeight: "3", }, @@ -112,14 +119,14 @@ func (s *invariantTestSuite) TestGroupTotalWeightInvariant() { { GroupId: 1, Member: &group.Member{ - Address: addr1.String(), + Address: addr1Str, Weight: "2", }, }, { GroupId: 1, Member: &group.Member{ - Address: addr2.String(), + Address: addr2Str, Weight: "2", }, }, diff --git a/x/group/keeper/keeper_test.go b/x/group/keeper/keeper_test.go index 4188ccd91299..b6a61d186689 100644 --- a/x/group/keeper/keeper_test.go +++ b/x/group/keeper/keeper_test.go @@ -37,17 +37,19 @@ const minExecutionPeriod = 5 * time.Second type TestSuite struct { suite.Suite - sdkCtx sdk.Context - ctx context.Context - addrs []sdk.AccAddress - groupID uint64 - groupPolicyAddr sdk.AccAddress - policy group.DecisionPolicy - groupKeeper keeper.Keeper - blockTime time.Time - bankKeeper *grouptestutil.MockBankKeeper - accountKeeper *grouptestutil.MockAccountKeeper - environment appmodule.Environment + sdkCtx sdk.Context + ctx context.Context + addrs []sdk.AccAddress + addrsStr []string + groupID uint64 + groupPolicyAddr sdk.AccAddress + groupPolicyStrAddr string + policy group.DecisionPolicy + groupKeeper keeper.Keeper + blockTime time.Time + bankKeeper *grouptestutil.MockBankKeeper + accountKeeper *grouptestutil.MockAccountKeeper + environment appmodule.Environment } func (s *TestSuite) SetupTest() { @@ -56,15 +58,20 @@ func (s *TestSuite) SetupTest() { testCtx := testutil.DefaultContextWithDB(s.T(), key, storetypes.NewTransientStoreKey("transient_test")) encCfg := moduletestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{}, module.AppModule{}, bank.AppModule{}) + addressCodec := address.NewBech32Codec("cosmos") s.addrs = simtestutil.CreateIncrementalAccounts(6) + s.addrsStr = make([]string, len(s.addrs)) // setup gomock and initialize some globally expected executions ctrl := gomock.NewController(s.T()) s.accountKeeper = grouptestutil.NewMockAccountKeeper(ctrl) + var err error for i := range s.addrs { s.accountKeeper.EXPECT().GetAccount(gomock.Any(), s.addrs[i]).Return(authtypes.NewBaseAccountWithAddress(s.addrs[i])).AnyTimes() + s.addrsStr[i], err = addressCodec.BytesToString(s.addrs[i]) + s.Require().NoError(err) } - s.accountKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec("cosmos")).AnyTimes() + s.accountKeeper.EXPECT().AddressCodec().Return(addressCodec).AnyTimes() s.bankKeeper = grouptestutil.NewMockBankKeeper(ctrl) @@ -87,13 +94,13 @@ func (s *TestSuite) SetupTest() { // Initial group, group policy and balance setup members := []group.MemberRequest{ - {Address: s.addrs[4].String(), Weight: "1"}, {Address: s.addrs[1].String(), Weight: "2"}, + {Address: s.addrsStr[4], Weight: "1"}, {Address: s.addrsStr[1], Weight: "2"}, } s.setNextAccount() groupRes, err := s.groupKeeper.CreateGroup(s.ctx, &group.MsgCreateGroup{ - Admin: s.addrs[0].String(), + Admin: s.addrsStr[0], Members: members, }) s.Require().NoError(err) @@ -105,7 +112,7 @@ func (s *TestSuite) SetupTest() { minExecutionPeriod, // Must wait 5 seconds before executing proposal ) policyReq := &group.MsgCreateGroupPolicy{ - Admin: s.addrs[0].String(), + Admin: s.addrsStr[0], GroupId: s.groupID, } err = policyReq.SetDecisionPolicy(policy) @@ -118,11 +125,12 @@ func (s *TestSuite) SetupTest() { policyRes, err := s.groupKeeper.CreateGroupPolicy(s.ctx, policyReq) s.Require().NoError(err) - addrbz, err := address.NewBech32Codec("cosmos").StringToBytes(policyRes.Address) + addrbz, err := addressCodec.StringToBytes(policyRes.Address) s.Require().NoError(err) s.policy = policy s.groupPolicyAddr = addrbz - + s.groupPolicyStrAddr, err = addressCodec.BytesToString(s.groupPolicyAddr) + s.Require().NoError(err) s.bankKeeper.EXPECT().MintCoins(s.sdkCtx, minttypes.ModuleName, sdk.Coins{sdk.NewInt64Coin("test", 100000)}).Return(nil).AnyTimes() err = s.bankKeeper.MintCoins(s.sdkCtx, minttypes.ModuleName, sdk.Coins{sdk.NewInt64Coin("test", 100000)}) s.Require().NoError(err) @@ -157,20 +165,17 @@ func TestKeeperTestSuite(t *testing.T) { } func (s *TestSuite) TestProposalsByVPEnd() { - addrs := s.addrs - addr2 := addrs[1] - votingPeriod := s.policy.GetVotingPeriod() ctx := s.sdkCtx now := time.Now() msgSend := &banktypes.MsgSend{ - FromAddress: s.groupPolicyAddr.String(), - ToAddress: addr2.String(), + FromAddress: s.groupPolicyStrAddr, + ToAddress: s.addrsStr[1], Amount: sdk.Coins{sdk.NewInt64Coin("test", 100)}, } - proposers := []string{addr2.String()} + proposers := []string{s.addrsStr[1]} specs := map[string]struct { preRun func(sdkCtx sdk.Context) uint64 @@ -225,7 +230,7 @@ func (s *TestSuite) TestProposalsByVPEnd() { "tally after voting period (not passing)": { preRun: func(sdkCtx sdk.Context) uint64 { // `s.addrs[4]` has weight 1 - return submitProposalAndVote(s.ctx, s, []sdk.Msg{msgSend}, []string{s.addrs[4].String()}, group.VOTE_OPTION_YES) + return submitProposalAndVote(s.ctx, s, []sdk.Msg{msgSend}, []string{s.addrsStr[4]}, group.VOTE_OPTION_YES) }, admin: proposers[0], newCtx: ctx.WithHeaderInfo(header.Info{Time: now.Add(votingPeriod).Add(time.Hour)}), @@ -297,19 +302,17 @@ func (s *TestSuite) TestProposalsByVPEnd() { } func (s *TestSuite) TestPruneProposals() { - addrs := s.addrs expirationTime := time.Hour * 24 * 15 // 15 days groupID := s.groupID - accountAddr := s.groupPolicyAddr msgSend := &banktypes.MsgSend{ - FromAddress: s.groupPolicyAddr.String(), - ToAddress: addrs[0].String(), + FromAddress: s.groupPolicyStrAddr, + ToAddress: s.addrsStr[0], Amount: sdk.Coins{sdk.NewInt64Coin("test", 100)}, } policyReq := &group.MsgCreateGroupPolicy{ - Admin: addrs[0].String(), + Admin: s.addrsStr[0], GroupId: groupID, } @@ -323,8 +326,8 @@ func (s *TestSuite) TestPruneProposals() { s.Require().NoError(err) req := &group.MsgSubmitProposal{ - GroupPolicyAddress: accountAddr.String(), - Proposers: []string{addrs[1].String()}, + GroupPolicyAddress: s.groupPolicyStrAddr, + Proposers: []string{s.addrsStr[1]}, } err = req.SetMsgs([]sdk.Msg{msgSend}) s.Require().NoError(err) @@ -351,7 +354,7 @@ func submitProposal( proposers []string, ) uint64 { proposalReq := &group.MsgSubmitProposal{ - GroupPolicyAddress: s.groupPolicyAddr.String(), + GroupPolicyAddress: s.groupPolicyStrAddr, Proposers: proposers, } err := proposalReq.SetMsgs(msgs) @@ -383,15 +386,18 @@ func (s *TestSuite) createGroupAndGroupPolicy( members []group.MemberRequest, policy group.DecisionPolicy, ) (policyAddr string, groupID uint64) { + adminAddr, err := s.accountKeeper.AddressCodec().BytesToString(admin) + s.Require().NoError(err) + groupRes, err := s.groupKeeper.CreateGroup(s.ctx, &group.MsgCreateGroup{ - Admin: admin.String(), + Admin: adminAddr, Members: members, }) s.Require().NoError(err) groupID = groupRes.GroupId groupPolicy := &group.MsgCreateGroupPolicy{ - Admin: admin.String(), + Admin: adminAddr, GroupId: groupID, } @@ -410,17 +416,14 @@ func (s *TestSuite) createGroupAndGroupPolicy( } func (s *TestSuite) TestTallyProposalsAtVPEnd() { - addrs := s.addrs - addr1 := addrs[0] - addr2 := addrs[1] votingPeriod := 4 * time.Minute minExecutionPeriod := votingPeriod + group.DefaultConfig().MaxExecutionPeriod groupMsg := &group.MsgCreateGroupWithPolicy{ - Admin: addr1.String(), + Admin: s.addrsStr[0], Members: []group.MemberRequest{ - {Address: addr1.String(), Weight: "1"}, - {Address: addr2.String(), Weight: "1"}, + {Address: s.addrsStr[0], Weight: "1"}, + {Address: s.addrsStr[1], Weight: "1"}, }, } policy := group.NewThresholdDecisionPolicy( @@ -440,14 +443,14 @@ func (s *TestSuite) TestTallyProposalsAtVPEnd() { proposalRes, err := s.groupKeeper.SubmitProposal(s.ctx, &group.MsgSubmitProposal{ GroupPolicyAddress: accountAddr, - Proposers: []string{addr1.String()}, + Proposers: []string{s.addrsStr[0]}, Messages: nil, }) s.Require().NoError(err) _, err = s.groupKeeper.Vote(s.ctx, &group.MsgVote{ ProposalId: proposalRes.ProposalId, - Voter: addr1.String(), + Voter: s.addrsStr[0], Option: group.VOTE_OPTION_YES, }) s.Require().NoError(err) @@ -473,19 +476,15 @@ func (s *TestSuite) TestTallyProposalsAtVPEnd() { // TestTallyProposalsAtVPEnd_GroupMemberLeaving test that the node doesn't // panic if a member leaves after the voting period end. func (s *TestSuite) TestTallyProposalsAtVPEnd_GroupMemberLeaving() { - addrs := s.addrs - addr1 := addrs[0] - addr2 := addrs[1] - addr3 := addrs[2] votingPeriod := 4 * time.Minute minExecutionPeriod := votingPeriod + group.DefaultConfig().MaxExecutionPeriod groupMsg := &group.MsgCreateGroupWithPolicy{ - Admin: addr1.String(), + Admin: s.addrsStr[0], Members: []group.MemberRequest{ - {Address: addr1.String(), Weight: "0.3"}, - {Address: addr2.String(), Weight: "7"}, - {Address: addr3.String(), Weight: "0.6"}, + {Address: s.addrsStr[0], Weight: "0.3"}, + {Address: s.addrsStr[1], Weight: "7"}, + {Address: s.addrsStr[2], Weight: "0.6"}, }, } policy := group.NewThresholdDecisionPolicy( @@ -505,7 +504,7 @@ func (s *TestSuite) TestTallyProposalsAtVPEnd_GroupMemberLeaving() { proposalRes, err := s.groupKeeper.SubmitProposal(s.ctx, &group.MsgSubmitProposal{ GroupPolicyAddress: accountAddr, - Proposers: []string{addr1.String()}, + Proposers: []string{s.addrsStr[0]}, Messages: nil, }) s.Require().NoError(err) @@ -513,13 +512,13 @@ func (s *TestSuite) TestTallyProposalsAtVPEnd_GroupMemberLeaving() { // group members vote _, err = s.groupKeeper.Vote(s.ctx, &group.MsgVote{ ProposalId: proposalRes.ProposalId, - Voter: addr1.String(), + Voter: s.addrsStr[0], Option: group.VOTE_OPTION_NO, }) s.Require().NoError(err) _, err = s.groupKeeper.Vote(s.ctx, &group.MsgVote{ ProposalId: proposalRes.ProposalId, - Voter: addr2.String(), + Voter: s.addrsStr[1], Option: group.VOTE_OPTION_NO, }) s.Require().NoError(err) @@ -538,7 +537,7 @@ func (s *TestSuite) TestTallyProposalsAtVPEnd_GroupMemberLeaving() { // member 2 (high weight) leaves group. _, err = s.groupKeeper.LeaveGroup(ctx, &group.MsgLeaveGroup{ - Address: addr2.String(), + Address: s.addrsStr[1], GroupId: groupRes.GroupId, }) s.Require().NoError(err) diff --git a/x/group/keeper/msg_server.go b/x/group/keeper/msg_server.go index 34bb77a7a511..caf0a1a47b3d 100644 --- a/x/group/keeper/msg_server.go +++ b/x/group/keeper/msg_server.go @@ -401,10 +401,15 @@ func (k Keeper) CreateGroupPolicy(ctx context.Context, msg *group.MsgCreateGroup break } + accountStrAddr, err := k.accKeeper.AddressCodec().BytesToString(accountAddr) + if err != nil { + return nil, errorsmod.Wrap(err, "could not generate address") + } + groupPolicy, err := group.NewGroupPolicyInfo( - accountAddr, + accountStrAddr, msg.GetGroupID(), - reqGroupAdmin, + msg.GetAdmin(), msg.GetMetadata(), 1, policy, @@ -418,11 +423,11 @@ func (k Keeper) CreateGroupPolicy(ctx context.Context, msg *group.MsgCreateGroup return nil, errorsmod.Wrap(err, "could not create group policy") } - if err := k.environment.EventService.EventManager(ctx).Emit(&group.EventCreateGroupPolicy{Address: accountAddr.String()}); err != nil { + if err := k.environment.EventService.EventManager(ctx).Emit(&group.EventCreateGroupPolicy{Address: accountStrAddr}); err != nil { return nil, err } - return &group.MsgCreateGroupPolicyResponse{Address: accountAddr.String()}, nil + return &group.MsgCreateGroupPolicyResponse{Address: accountStrAddr}, nil } func (k Keeper) UpdateGroupPolicyAdmin(ctx context.Context, msg *group.MsgUpdateGroupPolicyAdmin) (*group.MsgUpdateGroupPolicyAdminResponse, error) { @@ -579,7 +584,7 @@ func (k Keeper) SubmitProposal(ctx context.Context, msg *group.MsgSubmitProposal } // Check that if the messages require signers, they are all equal to the given account address of group policy. - if err := ensureMsgAuthZ(msgs, groupPolicyAddr, k.cdc); err != nil { + if err := ensureMsgAuthZ(msgs, groupPolicyAddr, k.cdc, k.accKeeper.AddressCodec()); err != nil { return nil, err } diff --git a/x/group/keeper/msg_server_test.go b/x/group/keeper/msg_server_test.go index b3024521d289..a5f3e58de814 100644 --- a/x/group/keeper/msg_server_test.go +++ b/x/group/keeper/msg_server_test.go @@ -41,8 +41,10 @@ func (s *TestSuite) createGroupAndGetMembers(numMembers int) []*group.GroupMembe addressPool := simtestutil.CreateIncrementalAccounts(numMembers) members := make([]group.MemberRequest, numMembers) for i := 0; i < len(members); i++ { + addr, err := s.accountKeeper.AddressCodec().BytesToString(addressPool[i]) + s.Require().NoError(err) members[i] = group.MemberRequest{ - Address: addressPool[i].String(), + Address: addr, Weight: "1", } s.accountKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec("cosmos")).AnyTimes() @@ -64,17 +66,11 @@ func (s *TestSuite) createGroupAndGetMembers(numMembers int) []*group.GroupMembe } func (s *TestSuite) TestCreateGroup() { - addrs := s.addrs - addr1 := addrs[0] - addr3 := addrs[2] - addr5 := addrs[4] - addr6 := addrs[5] - members := []group.MemberRequest{{ - Address: addr5.String(), + Address: s.addrsStr[4], Weight: "1", }, { - Address: addr6.String(), + Address: s.addrsStr[5], Weight: "2", }} @@ -82,14 +78,14 @@ func (s *TestSuite) TestCreateGroup() { { Id: s.groupID, Version: 1, - Admin: addr1.String(), + Admin: s.addrsStr[0], TotalWeight: "3", CreatedAt: s.blockTime, }, { Id: 2, Version: 1, - Admin: addr1.String(), + Admin: s.addrsStr[0], TotalWeight: "3", CreatedAt: s.blockTime, }, @@ -103,14 +99,14 @@ func (s *TestSuite) TestCreateGroup() { }{ "all good": { req: &group.MsgCreateGroup{ - Admin: addr1.String(), + Admin: s.addrsStr[0], Members: members, }, expGroups: expGroups, }, "group metadata: metadata too long": { req: &group.MsgCreateGroup{ - Admin: addr1.String(), + Admin: s.addrsStr[0], Members: members, Metadata: strings.Repeat("a", 256), }, @@ -119,7 +115,7 @@ func (s *TestSuite) TestCreateGroup() { }, "invalid member address": { req: &group.MsgCreateGroup{ - Admin: addr1.String(), + Admin: s.addrsStr[0], Members: []group.MemberRequest{{ Address: "invalid", Weight: "1", @@ -130,9 +126,9 @@ func (s *TestSuite) TestCreateGroup() { }, "member metadata too long": { req: &group.MsgCreateGroup{ - Admin: addr1.String(), + Admin: s.addrsStr[0], Members: []group.MemberRequest{{ - Address: addr3.String(), + Address: s.addrsStr[2], Weight: "1", Metadata: strings.Repeat("a", 256), }}, @@ -142,9 +138,9 @@ func (s *TestSuite) TestCreateGroup() { }, "zero member weight": { req: &group.MsgCreateGroup{ - Admin: addr1.String(), + Admin: s.addrsStr[0], Members: []group.MemberRequest{{ - Address: addr3.String(), + Address: s.addrsStr[2], Weight: "0", }}, }, @@ -153,9 +149,9 @@ func (s *TestSuite) TestCreateGroup() { }, "invalid member weight - Inf": { req: &group.MsgCreateGroup{ - Admin: addr1.String(), + Admin: s.addrsStr[0], Members: []group.MemberRequest{{ - Address: addr3.String(), + Address: s.addrsStr[2], Weight: "inf", }}, }, @@ -164,9 +160,9 @@ func (s *TestSuite) TestCreateGroup() { }, "invalid member weight - NaN": { req: &group.MsgCreateGroup{ - Admin: addr1.String(), + Admin: s.addrsStr[0], Members: []group.MemberRequest{{ - Address: addr3.String(), + Address: s.addrsStr[2], Weight: "NaN", }}, }, @@ -225,7 +221,7 @@ func (s *TestSuite) TestCreateGroup() { } // query groups by admin - groupsRes, err := s.groupKeeper.GroupsByAdmin(s.ctx, &group.QueryGroupsByAdminRequest{Admin: addr1.String()}) + groupsRes, err := s.groupKeeper.GroupsByAdmin(s.ctx, &group.QueryGroupsByAdminRequest{Admin: s.addrsStr[0]}) s.Require().NoError(err) loadedGroups := groupsRes.Groups s.Require().Equal(len(spec.expGroups), len(loadedGroups)) @@ -242,20 +238,14 @@ func (s *TestSuite) TestCreateGroup() { } func (s *TestSuite) TestUpdateGroupMembers() { - addrs := s.addrs - addr3 := addrs[2] - addr4 := addrs[3] - addr5 := addrs[4] - addr6 := addrs[5] - - member1 := addr5.String() - member2 := addr6.String() + member1 := s.addrsStr[4] + member2 := s.addrsStr[5] members := []group.MemberRequest{{ Address: member1, Weight: "1", }} - myAdmin := addr4.String() + myAdmin := s.addrsStr[3] groupRes, err := s.groupKeeper.CreateGroup(s.ctx, &group.MsgCreateGroup{ Admin: myAdmin, Members: members, @@ -460,7 +450,7 @@ func (s *TestSuite) TestUpdateGroupMembers() { GroupId: groupID, Admin: myAdmin, MemberUpdates: []group.MemberRequest{{ - Address: addr4.String(), + Address: s.addrsStr[3], Weight: "0", }}, }, @@ -483,7 +473,7 @@ func (s *TestSuite) TestUpdateGroupMembers() { "with wrong admin": { req: &group.MsgUpdateGroupMembers{ GroupId: groupID, - Admin: addr3.String(), + Admin: s.addrsStr[2], MemberUpdates: []group.MemberRequest{{ Address: member1, Weight: "2", @@ -578,18 +568,12 @@ func (s *TestSuite) TestUpdateGroupMembers() { } func (s *TestSuite) TestUpdateGroupAdmin() { - addrs := s.addrs - addr1 := addrs[0] - addr2 := addrs[1] - addr3 := addrs[2] - addr4 := addrs[3] - members := []group.MemberRequest{{ - Address: addr1.String(), + Address: s.addrsStr[0], Weight: "1", }} - oldAdmin := addr2.String() - newAdmin := addr3.String() + oldAdmin := s.addrsStr[1] + newAdmin := s.addrsStr[2] groupRes, err := s.groupKeeper.CreateGroup(s.ctx, &group.MsgCreateGroup{ Admin: oldAdmin, Members: members, @@ -637,7 +621,7 @@ func (s *TestSuite) TestUpdateGroupAdmin() { "with wrong admin": { req: &group.MsgUpdateGroupAdmin{ GroupId: groupID, - Admin: addr4.String(), + Admin: s.addrsStr[3], NewAdmin: newAdmin, }, expErr: true, @@ -696,11 +680,7 @@ func (s *TestSuite) TestUpdateGroupAdmin() { } func (s *TestSuite) TestUpdateGroupMetadata() { - addrs := s.addrs - addr1 := addrs[0] - addr3 := addrs[2] - - oldAdmin := addr1.String() + oldAdmin := s.addrsStr[0] groupID := s.groupID specs := map[string]struct { @@ -724,7 +704,7 @@ func (s *TestSuite) TestUpdateGroupMetadata() { "with wrong admin": { req: &group.MsgUpdateGroupMetadata{ GroupId: groupID, - Admin: addr3.String(), + Admin: s.addrsStr[2], }, expErr: true, expStored: &group.GroupInfo{ @@ -773,19 +753,13 @@ func (s *TestSuite) TestUpdateGroupMetadata() { } func (s *TestSuite) TestCreateGroupWithPolicy() { - addrs := s.addrs - addr1 := addrs[0] - addr3 := addrs[2] - addr5 := addrs[4] - addr6 := addrs[5] - s.setNextAccount() members := []group.MemberRequest{{ - Address: addr5.String(), + Address: s.addrsStr[4], Weight: "1", }, { - Address: addr6.String(), + Address: s.addrsStr[5], Weight: "2", }} @@ -798,7 +772,7 @@ func (s *TestSuite) TestCreateGroupWithPolicy() { }{ "all good": { req: &group.MsgCreateGroupWithPolicy{ - Admin: addr1.String(), + Admin: s.addrsStr[0], Members: members, GroupPolicyAsAdmin: false, }, @@ -813,7 +787,7 @@ func (s *TestSuite) TestCreateGroupWithPolicy() { }, "group policy as admin is true": { req: &group.MsgCreateGroupWithPolicy{ - Admin: addr1.String(), + Admin: s.addrsStr[0], Members: members, GroupPolicyAsAdmin: true, }, @@ -828,7 +802,7 @@ func (s *TestSuite) TestCreateGroupWithPolicy() { }, "group metadata too long": { req: &group.MsgCreateGroupWithPolicy{ - Admin: addr1.String(), + Admin: s.addrsStr[0], Members: members, GroupPolicyAsAdmin: false, GroupMetadata: strings.Repeat("a", 256), @@ -843,7 +817,7 @@ func (s *TestSuite) TestCreateGroupWithPolicy() { }, "group policy metadata: metadata too long": { req: &group.MsgCreateGroupWithPolicy{ - Admin: addr1.String(), + Admin: s.addrsStr[0], Members: members, GroupPolicyAsAdmin: false, GroupPolicyMetadata: strings.Repeat("a", 256), @@ -858,9 +832,9 @@ func (s *TestSuite) TestCreateGroupWithPolicy() { }, "member metadata too long": { req: &group.MsgCreateGroupWithPolicy{ - Admin: addr1.String(), + Admin: s.addrsStr[0], Members: []group.MemberRequest{{ - Address: addr3.String(), + Address: s.addrsStr[2], Weight: "1", Metadata: strings.Repeat("a", 256), }}, @@ -876,9 +850,9 @@ func (s *TestSuite) TestCreateGroupWithPolicy() { }, "zero member weight": { req: &group.MsgCreateGroupWithPolicy{ - Admin: addr1.String(), + Admin: s.addrsStr[0], Members: []group.MemberRequest{{ - Address: addr3.String(), + Address: s.addrsStr[2], Weight: "0", }}, GroupPolicyAsAdmin: false, @@ -893,7 +867,7 @@ func (s *TestSuite) TestCreateGroupWithPolicy() { }, "invalid member address": { req: &group.MsgCreateGroupWithPolicy{ - Admin: addr1.String(), + Admin: s.addrsStr[0], Members: []group.MemberRequest{{ Address: "invalid", Weight: "1", @@ -910,7 +884,7 @@ func (s *TestSuite) TestCreateGroupWithPolicy() { }, "decision policy threshold > total group weight": { req: &group.MsgCreateGroupWithPolicy{ - Admin: addr1.String(), + Admin: s.addrsStr[0], Members: members, GroupPolicyAsAdmin: false, }, @@ -999,13 +973,9 @@ func (s *TestSuite) TestCreateGroupWithPolicy() { } func (s *TestSuite) TestCreateGroupPolicy() { - addrs := s.addrs - addr1 := addrs[0] - addr4 := addrs[3] - s.setNextAccount() groupRes, err := s.groupKeeper.CreateGroup(s.ctx, &group.MsgCreateGroup{ - Admin: addr1.String(), + Admin: s.addrsStr[0], Members: nil, }) s.Require().NoError(err) @@ -1019,7 +989,7 @@ func (s *TestSuite) TestCreateGroupPolicy() { }{ "all good": { req: &group.MsgCreateGroupPolicy{ - Admin: addr1.String(), + Admin: s.addrsStr[0], GroupId: myGroupID, }, policy: group.NewThresholdDecisionPolicy( @@ -1030,7 +1000,7 @@ func (s *TestSuite) TestCreateGroupPolicy() { }, "all good with percentage decision policy": { req: &group.MsgCreateGroupPolicy{ - Admin: addr1.String(), + Admin: s.addrsStr[0], GroupId: myGroupID, }, policy: group.NewPercentageDecisionPolicy( @@ -1041,7 +1011,7 @@ func (s *TestSuite) TestCreateGroupPolicy() { }, "decision policy threshold > total group weight": { req: &group.MsgCreateGroupPolicy{ - Admin: addr1.String(), + Admin: s.addrsStr[0], GroupId: myGroupID, }, policy: group.NewThresholdDecisionPolicy( @@ -1052,7 +1022,7 @@ func (s *TestSuite) TestCreateGroupPolicy() { }, "group id does not exists": { req: &group.MsgCreateGroupPolicy{ - Admin: addr1.String(), + Admin: s.addrsStr[0], GroupId: 9999, }, policy: group.NewThresholdDecisionPolicy( @@ -1065,7 +1035,7 @@ func (s *TestSuite) TestCreateGroupPolicy() { }, "admin not group admin": { req: &group.MsgCreateGroupPolicy{ - Admin: addr4.String(), + Admin: s.addrsStr[3], GroupId: myGroupID, }, policy: group.NewThresholdDecisionPolicy( @@ -1078,7 +1048,7 @@ func (s *TestSuite) TestCreateGroupPolicy() { }, "metadata too long": { req: &group.MsgCreateGroupPolicy{ - Admin: addr1.String(), + Admin: s.addrsStr[0], GroupId: myGroupID, Metadata: strings.Repeat("a", 256), }, @@ -1092,7 +1062,7 @@ func (s *TestSuite) TestCreateGroupPolicy() { }, "percentage decision policy with negative value": { req: &group.MsgCreateGroupPolicy{ - Admin: addr1.String(), + Admin: s.addrsStr[0], GroupId: myGroupID, }, policy: group.NewPercentageDecisionPolicy( @@ -1105,7 +1075,7 @@ func (s *TestSuite) TestCreateGroupPolicy() { }, "percentage decision policy with value greater than 1": { req: &group.MsgCreateGroupPolicy{ - Admin: addr1.String(), + Admin: s.addrsStr[0], GroupId: myGroupID, }, policy: group.NewPercentageDecisionPolicy( @@ -1162,9 +1132,13 @@ func (s *TestSuite) TestUpdateGroupPolicyAdmin() { addrs := s.addrs addr1 := addrs[0] addr2 := addrs[1] - addr5 := addrs[4] - admin, newAdmin := addr1, addr2 + admin := addr1 + adminAddr, err := s.accountKeeper.AddressCodec().BytesToString(admin) + s.Require().NoError(err) + newAdmin, err := s.accountKeeper.AddressCodec().BytesToString(addr2) + s.Require().NoError(err) + policy := group.NewThresholdDecisionPolicy( "1", time.Second, @@ -1181,12 +1155,12 @@ func (s *TestSuite) TestUpdateGroupPolicyAdmin() { }{ "with wrong admin": { req: &group.MsgUpdateGroupPolicyAdmin{ - Admin: addr5.String(), + Admin: s.addrsStr[4], GroupPolicyAddress: groupPolicyAddr, - NewAdmin: newAdmin.String(), + NewAdmin: newAdmin, }, expGroupPolicy: &group.GroupPolicyInfo{ - Admin: admin.String(), + Admin: adminAddr, Address: groupPolicyAddr, GroupId: myGroupID, Version: 2, @@ -1198,12 +1172,12 @@ func (s *TestSuite) TestUpdateGroupPolicyAdmin() { }, "with wrong group policy": { req: &group.MsgUpdateGroupPolicyAdmin{ - Admin: admin.String(), - GroupPolicyAddress: addr5.String(), - NewAdmin: newAdmin.String(), + Admin: adminAddr, + GroupPolicyAddress: s.addrsStr[4], + NewAdmin: newAdmin, }, expGroupPolicy: &group.GroupPolicyInfo{ - Admin: admin.String(), + Admin: adminAddr, Address: groupPolicyAddr, GroupId: myGroupID, Version: 2, @@ -1215,12 +1189,12 @@ func (s *TestSuite) TestUpdateGroupPolicyAdmin() { }, "correct data": { req: &group.MsgUpdateGroupPolicyAdmin{ - Admin: admin.String(), + Admin: adminAddr, GroupPolicyAddress: groupPolicyAddr, - NewAdmin: newAdmin.String(), + NewAdmin: newAdmin, }, expGroupPolicy: &group.GroupPolicyInfo{ - Admin: newAdmin.String(), + Admin: newAdmin, Address: groupPolicyAddr, GroupId: myGroupID, Version: 2, @@ -1231,12 +1205,12 @@ func (s *TestSuite) TestUpdateGroupPolicyAdmin() { }, "with invalid new admin address": { req: &group.MsgUpdateGroupPolicyAdmin{ - Admin: admin.String(), + Admin: adminAddr, GroupPolicyAddress: groupPolicyAddr, NewAdmin: "%s", }, expGroupPolicy: &group.GroupPolicyInfo{ - Admin: admin.String(), + Admin: adminAddr, Address: groupPolicyAddr, GroupId: myGroupID, Version: 2, @@ -1271,10 +1245,11 @@ func (s *TestSuite) TestUpdateGroupPolicyAdmin() { func (s *TestSuite) TestUpdateGroupPolicyDecisionPolicy() { addrs := s.addrs - addr1 := addrs[0] - addr5 := addrs[4] - admin := addr1 + admin := addrs[0] + adminAddr, err := s.accountKeeper.AddressCodec().BytesToString(admin) + s.Require().NoError(err) + policy := group.NewThresholdDecisionPolicy( "1", time.Second, @@ -1294,7 +1269,7 @@ func (s *TestSuite) TestUpdateGroupPolicyDecisionPolicy() { }{ "with wrong admin": { req: &group.MsgUpdateGroupPolicyDecisionPolicy{ - Admin: addr5.String(), + Admin: s.addrsStr[4], GroupPolicyAddress: groupPolicyAddr, }, policy: policy, @@ -1304,8 +1279,8 @@ func (s *TestSuite) TestUpdateGroupPolicyDecisionPolicy() { }, "with wrong group policy": { req: &group.MsgUpdateGroupPolicyDecisionPolicy{ - Admin: admin.String(), - GroupPolicyAddress: addr5.String(), + Admin: adminAddr, + GroupPolicyAddress: s.addrsStr[4], }, policy: policy, expGroupPolicy: &group.GroupPolicyInfo{}, @@ -1314,7 +1289,7 @@ func (s *TestSuite) TestUpdateGroupPolicyDecisionPolicy() { }, "invalid percentage decision policy with negative value": { req: &group.MsgUpdateGroupPolicyDecisionPolicy{ - Admin: admin.String(), + Admin: adminAddr, GroupPolicyAddress: groupPolicyAddr, }, policy: group.NewPercentageDecisionPolicy( @@ -1323,7 +1298,7 @@ func (s *TestSuite) TestUpdateGroupPolicyDecisionPolicy() { 0, ), expGroupPolicy: &group.GroupPolicyInfo{ - Admin: admin.String(), + Admin: adminAddr, Address: groupPolicyAddr, GroupId: myGroupID, Version: 2, @@ -1335,7 +1310,7 @@ func (s *TestSuite) TestUpdateGroupPolicyDecisionPolicy() { }, "invalid percentage decision policy with value greater than 1": { req: &group.MsgUpdateGroupPolicyDecisionPolicy{ - Admin: admin.String(), + Admin: adminAddr, GroupPolicyAddress: groupPolicyAddr, }, policy: group.NewPercentageDecisionPolicy( @@ -1344,7 +1319,7 @@ func (s *TestSuite) TestUpdateGroupPolicyDecisionPolicy() { 0, ), expGroupPolicy: &group.GroupPolicyInfo{ - Admin: admin.String(), + Admin: adminAddr, Address: groupPolicyAddr, GroupId: myGroupID, Version: 2, @@ -1356,7 +1331,7 @@ func (s *TestSuite) TestUpdateGroupPolicyDecisionPolicy() { }, "correct data": { req: &group.MsgUpdateGroupPolicyDecisionPolicy{ - Admin: admin.String(), + Admin: adminAddr, GroupPolicyAddress: groupPolicyAddr, }, policy: group.NewThresholdDecisionPolicy( @@ -1365,7 +1340,7 @@ func (s *TestSuite) TestUpdateGroupPolicyDecisionPolicy() { 0, ), expGroupPolicy: &group.GroupPolicyInfo{ - Admin: admin.String(), + Admin: adminAddr, Address: groupPolicyAddr, GroupId: myGroupID, Version: 2, @@ -1380,7 +1355,7 @@ func (s *TestSuite) TestUpdateGroupPolicyDecisionPolicy() { return s.createGroupAndGroupPolicy(admin, nil, policy) }, req: &group.MsgUpdateGroupPolicyDecisionPolicy{ - Admin: admin.String(), + Admin: adminAddr, GroupPolicyAddress: groupPolicyAddr, }, policy: group.NewPercentageDecisionPolicy( @@ -1389,7 +1364,7 @@ func (s *TestSuite) TestUpdateGroupPolicyDecisionPolicy() { 0, ), expGroupPolicy: &group.GroupPolicyInfo{ - Admin: admin.String(), + Admin: adminAddr, DecisionPolicy: nil, Version: 2, CreatedAt: s.blockTime, @@ -1435,11 +1410,10 @@ func (s *TestSuite) TestUpdateGroupPolicyDecisionPolicy() { } func (s *TestSuite) TestUpdateGroupPolicyMetadata() { - addrs := s.addrs - addr1 := addrs[0] - addr5 := addrs[4] + admin := s.addrs[0] + adminAddr, err := s.accountKeeper.AddressCodec().BytesToString(admin) + s.Require().NoError(err) - admin := addr1 policy := group.NewThresholdDecisionPolicy( "1", time.Second, @@ -1457,7 +1431,7 @@ func (s *TestSuite) TestUpdateGroupPolicyMetadata() { }{ "with wrong admin": { req: &group.MsgUpdateGroupPolicyMetadata{ - Admin: addr5.String(), + Admin: s.addrsStr[4], GroupPolicyAddress: groupPolicyAddr, }, expGroupPolicy: &group.GroupPolicyInfo{}, @@ -1466,8 +1440,8 @@ func (s *TestSuite) TestUpdateGroupPolicyMetadata() { }, "with wrong group policy": { req: &group.MsgUpdateGroupPolicyMetadata{ - Admin: admin.String(), - GroupPolicyAddress: addr5.String(), + Admin: adminAddr, + GroupPolicyAddress: s.addrsStr[4], }, expGroupPolicy: &group.GroupPolicyInfo{}, expErr: true, @@ -1475,7 +1449,7 @@ func (s *TestSuite) TestUpdateGroupPolicyMetadata() { }, "with metadata too long": { req: &group.MsgUpdateGroupPolicyMetadata{ - Admin: admin.String(), + Admin: adminAddr, GroupPolicyAddress: groupPolicyAddr, Metadata: strings.Repeat("a", 1001), }, @@ -1485,11 +1459,11 @@ func (s *TestSuite) TestUpdateGroupPolicyMetadata() { }, "correct data": { req: &group.MsgUpdateGroupPolicyMetadata{ - Admin: admin.String(), + Admin: adminAddr, GroupPolicyAddress: groupPolicyAddr, }, expGroupPolicy: &group.GroupPolicyInfo{ - Admin: admin.String(), + Admin: adminAddr, Address: groupPolicyAddr, GroupId: myGroupID, Version: 2, @@ -1540,12 +1514,12 @@ func (s *TestSuite) TestUpdateGroupPolicyMetadata() { func (s *TestSuite) TestGroupPoliciesByAdminOrGroup() { addrs := s.addrs - addr2 := addrs[1] - admin := addr2 + admin, err := s.accountKeeper.AddressCodec().BytesToString(addrs[1]) + s.Require().NoError(err) groupRes, err := s.groupKeeper.CreateGroup(s.ctx, &group.MsgCreateGroup{ - Admin: admin.String(), + Admin: admin, Members: nil, }) s.Require().NoError(err) @@ -1573,7 +1547,7 @@ func (s *TestSuite) TestGroupPoliciesByAdminOrGroup() { expectAccs := make([]*group.GroupPolicyInfo, count) for i := range expectAccs { req := &group.MsgCreateGroupPolicy{ - Admin: admin.String(), + Admin: admin, GroupId: myGroupID, } err := req.SetDecisionPolicy(policies[i]) @@ -1585,7 +1559,7 @@ func (s *TestSuite) TestGroupPoliciesByAdminOrGroup() { expectAcc := &group.GroupPolicyInfo{ Address: res.Address, - Admin: admin.String(), + Admin: admin, GroupId: myGroupID, Version: uint64(1), CreatedAt: s.blockTime, @@ -1621,7 +1595,7 @@ func (s *TestSuite) TestGroupPoliciesByAdminOrGroup() { // no group policy noPolicies, err := s.groupKeeper.GroupPoliciesByAdmin(s.ctx, &group.QueryGroupPoliciesByAdminRequest{ - Admin: addrs[2].String(), + Admin: s.addrsStr[2], }) s.Require().NoError(err) policyAccs = noPolicies.GroupPolicies @@ -1629,7 +1603,7 @@ func (s *TestSuite) TestGroupPoliciesByAdminOrGroup() { // query group policy by admin policiesByAdminRes, err := s.groupKeeper.GroupPoliciesByAdmin(s.ctx, &group.QueryGroupPoliciesByAdminRequest{ - Admin: admin.String(), + Admin: admin, }) s.Require().NoError(err) policyAccs = policiesByAdminRes.GroupPolicies @@ -1653,17 +1627,15 @@ func (s *TestSuite) TestGroupPoliciesByAdminOrGroup() { func (s *TestSuite) TestSubmitProposal() { addrs := s.addrs - addr1 := addrs[0] addr2 := addrs[1] // Has weight 2 - addr4 := addrs[3] - addr5 := addrs[4] // Has weight 1 myGroupID := s.groupID - accountAddr := s.groupPolicyAddr + accountAddr, err := s.accountKeeper.AddressCodec().BytesToString(s.groupPolicyAddr) + s.Require().NoError(err) // Create a new group policy to test TRY_EXEC policyReq := &group.MsgCreateGroupPolicy{ - Admin: addr1.String(), + Admin: s.addrsStr[0], GroupId: myGroupID, } noMinExecPeriodPolicy := group.NewThresholdDecisionPolicy( @@ -1671,7 +1643,7 @@ func (s *TestSuite) TestSubmitProposal() { time.Second, 0, // no MinExecutionPeriod to test TRY_EXEC ) - err := policyReq.SetDecisionPolicy(noMinExecPeriodPolicy) + err = policyReq.SetDecisionPolicy(noMinExecPeriodPolicy) s.Require().NoError(err) s.setNextAccount() res, err := s.groupKeeper.CreateGroupPolicy(s.ctx, policyReq) @@ -1695,11 +1667,11 @@ func (s *TestSuite) TestSubmitProposal() { msgSend := &banktypes.MsgSend{ FromAddress: res.Address, - ToAddress: addr2.String(), + ToAddress: s.addrsStr[1], Amount: sdk.Coins{sdk.NewInt64Coin("test", 100)}, } defaultProposal := group.Proposal{ - GroupPolicyAddress: accountAddr.String(), + GroupPolicyAddress: accountAddr, Status: group.PROPOSAL_STATUS_SUBMITTED, FinalTallyResult: group.TallyResult{ YesCount: "0", @@ -1720,20 +1692,20 @@ func (s *TestSuite) TestSubmitProposal() { }{ "all good with minimal fields set": { req: &group.MsgSubmitProposal{ - GroupPolicyAddress: accountAddr.String(), - Proposers: []string{addr2.String()}, + GroupPolicyAddress: accountAddr, + Proposers: []string{s.addrsStr[1]}, }, expProposal: defaultProposal, postRun: func(sdkCtx sdk.Context) {}, }, "all good with good msg payload": { req: &group.MsgSubmitProposal{ - GroupPolicyAddress: accountAddr.String(), - Proposers: []string{addr2.String()}, + GroupPolicyAddress: accountAddr, + Proposers: []string{s.addrsStr[1]}, }, msgs: []sdk.Msg{&banktypes.MsgSend{ - FromAddress: accountAddr.String(), - ToAddress: addr2.String(), + FromAddress: accountAddr, + ToAddress: s.addrsStr[1], Amount: sdk.Coins{sdk.NewInt64Coin("token", 100)}, }}, expProposal: defaultProposal, @@ -1741,8 +1713,8 @@ func (s *TestSuite) TestSubmitProposal() { }, "title != metadata.title": { req: &group.MsgSubmitProposal{ - GroupPolicyAddress: accountAddr.String(), - Proposers: []string{addr2.String()}, + GroupPolicyAddress: accountAddr, + Proposers: []string{s.addrsStr[1]}, Metadata: "{\"title\":\"title\",\"summary\":\"description\"}", Title: "title2", Summary: "description", @@ -1753,8 +1725,8 @@ func (s *TestSuite) TestSubmitProposal() { }, "summary != metadata.summary": { req: &group.MsgSubmitProposal{ - GroupPolicyAddress: accountAddr.String(), - Proposers: []string{addr2.String()}, + GroupPolicyAddress: accountAddr, + Proposers: []string{s.addrsStr[1]}, Metadata: "{\"title\":\"title\",\"summary\":\"description of proposal\"}", Title: "title", Summary: "description", @@ -1765,8 +1737,8 @@ func (s *TestSuite) TestSubmitProposal() { }, "metadata too long": { req: &group.MsgSubmitProposal{ - GroupPolicyAddress: accountAddr.String(), - Proposers: []string{addr2.String()}, + GroupPolicyAddress: accountAddr, + Proposers: []string{s.addrsStr[1]}, Metadata: strings.Repeat("a", 256), }, expErr: true, @@ -1775,8 +1747,8 @@ func (s *TestSuite) TestSubmitProposal() { }, "summary too long": { req: &group.MsgSubmitProposal{ - GroupPolicyAddress: accountAddr.String(), - Proposers: []string{addr2.String()}, + GroupPolicyAddress: accountAddr, + Proposers: []string{s.addrsStr[1]}, Metadata: "{\"title\":\"title\",\"summary\":\"description\"}", Summary: strings.Repeat("a", 256*40), }, @@ -1786,7 +1758,7 @@ func (s *TestSuite) TestSubmitProposal() { }, "group policy required": { req: &group.MsgSubmitProposal{ - Proposers: []string{addr2.String()}, + Proposers: []string{s.addrsStr[1]}, }, expErr: true, expErrMsg: "empty address string is not allowed", @@ -1794,8 +1766,8 @@ func (s *TestSuite) TestSubmitProposal() { }, "existing group policy required": { req: &group.MsgSubmitProposal{ - GroupPolicyAddress: addr1.String(), - Proposers: []string{addr2.String()}, + GroupPolicyAddress: s.addrsStr[0], + Proposers: []string{s.addrsStr[1]}, }, expErr: true, expErrMsg: "not found", @@ -1804,7 +1776,7 @@ func (s *TestSuite) TestSubmitProposal() { "decision policy threshold > total group weight": { req: &group.MsgSubmitProposal{ GroupPolicyAddress: bigThresholdAddr, - Proposers: []string{addr2.String()}, + Proposers: []string{s.addrsStr[1]}, }, expErr: false, expProposal: group.Proposal{ @@ -1817,8 +1789,8 @@ func (s *TestSuite) TestSubmitProposal() { }, "only group members can create a proposal": { req: &group.MsgSubmitProposal{ - GroupPolicyAddress: accountAddr.String(), - Proposers: []string{addr4.String()}, + GroupPolicyAddress: accountAddr, + Proposers: []string{s.addrsStr[3]}, }, expErr: true, expErrMsg: "not in group", @@ -1826,8 +1798,8 @@ func (s *TestSuite) TestSubmitProposal() { }, "all proposers must be in group": { req: &group.MsgSubmitProposal{ - GroupPolicyAddress: accountAddr.String(), - Proposers: []string{addr2.String(), addr4.String()}, + GroupPolicyAddress: accountAddr, + Proposers: []string{s.addrsStr[1], s.addrsStr[3]}, }, expErr: true, expErrMsg: "not in group", @@ -1835,8 +1807,8 @@ func (s *TestSuite) TestSubmitProposal() { }, "admin that is not a group member can not create proposal": { req: &group.MsgSubmitProposal{ - GroupPolicyAddress: accountAddr.String(), - Proposers: []string{addr1.String()}, + GroupPolicyAddress: accountAddr, + Proposers: []string{s.addrsStr[0]}, }, expErr: true, expErrMsg: "not in group", @@ -1844,10 +1816,10 @@ func (s *TestSuite) TestSubmitProposal() { }, "reject msgs that are not authz by group policy": { req: &group.MsgSubmitProposal{ - GroupPolicyAddress: accountAddr.String(), - Proposers: []string{addr2.String()}, + GroupPolicyAddress: accountAddr, + Proposers: []string{s.addrsStr[1]}, }, - msgs: []sdk.Msg{&testdata.TestMsg{Signers: []string{addr1.String()}}}, + msgs: []sdk.Msg{&testdata.TestMsg{Signers: []string{s.addrsStr[0]}}}, expErr: true, expErrMsg: "msg does not have group policy authorization", postRun: func(sdkCtx sdk.Context) {}, @@ -1860,7 +1832,7 @@ func (s *TestSuite) TestSubmitProposal() { }, req: &group.MsgSubmitProposal{ GroupPolicyAddress: res.Address, - Proposers: []string{addr2.String()}, + Proposers: []string{s.addrsStr[1]}, Exec: group.Exec_EXEC_TRY, }, msgs: []sdk.Msg{msgSend}, @@ -1890,7 +1862,7 @@ func (s *TestSuite) TestSubmitProposal() { "with try exec, not enough yes votes for proposal to pass": { req: &group.MsgSubmitProposal{ GroupPolicyAddress: res.Address, - Proposers: []string{addr5.String()}, + Proposers: []string{s.addrsStr[4]}, Exec: group.Exec_EXEC_TRY, }, msgs: []sdk.Msg{msgSend}, @@ -1959,17 +1931,13 @@ func (s *TestSuite) TestSubmitProposal() { } func (s *TestSuite) TestWithdrawProposal() { - addrs := s.addrs - addr2 := addrs[1] - addr5 := addrs[4] - msgSend := &banktypes.MsgSend{ - FromAddress: s.groupPolicyAddr.String(), - ToAddress: addr2.String(), + FromAddress: s.groupPolicyStrAddr, + ToAddress: s.addrsStr[1], Amount: sdk.Coins{sdk.NewInt64Coin("test", 100)}, } - proposers := []string{addr2.String()} + proposers := []string{s.addrsStr[1]} proposalID := submitProposal(s.ctx, s, []sdk.Msg{msgSend}, proposers) specs := map[string]struct { @@ -1983,7 +1951,7 @@ func (s *TestSuite) TestWithdrawProposal() { preRun: func(sdkCtx sdk.Context) uint64 { return submitProposal(s.ctx, s, []sdk.Msg{msgSend}, proposers) }, - admin: addr5.String(), + admin: s.addrsStr[4], expErrMsg: "unauthorized", postRun: func(sdkCtx sdk.Context) {}, }, @@ -2065,19 +2033,14 @@ func (s *TestSuite) TestWithdrawProposal() { } func (s *TestSuite) TestVote() { - addrs := s.addrs - addr1 := addrs[0] - addr2 := addrs[1] - addr3 := addrs[2] - addr4 := addrs[3] - addr5 := addrs[4] + addr5 := s.addrs[4] members := []group.MemberRequest{ - {Address: addr4.String(), Weight: "1"}, - {Address: addr3.String(), Weight: "2"}, + {Address: s.addrsStr[3], Weight: "1"}, + {Address: s.addrsStr[2], Weight: "2"}, } groupRes, err := s.groupKeeper.CreateGroup(s.ctx, &group.MsgCreateGroup{ - Admin: addr1.String(), + Admin: s.addrsStr[0], Members: members, }) s.Require().NoError(err) @@ -2089,7 +2052,7 @@ func (s *TestSuite) TestVote() { 0, ) policyReq := &group.MsgCreateGroupPolicy{ - Admin: addr1.String(), + Admin: s.addrsStr[0], GroupId: myGroupID, } err = policyReq.SetDecisionPolicy(policy) @@ -2109,12 +2072,12 @@ func (s *TestSuite) TestVote() { req := &group.MsgSubmitProposal{ GroupPolicyAddress: accountAddr, - Proposers: []string{addr4.String()}, + Proposers: []string{s.addrsStr[3]}, Messages: nil, } msg := &banktypes.MsgSend{ FromAddress: accountAddr, - ToAddress: addr5.String(), + ToAddress: s.addrsStr[4], Amount: sdk.Coins{sdk.NewInt64Coin("test", 100)}, } err = req.SetMsgs([]sdk.Msg{msg}) @@ -2126,7 +2089,7 @@ func (s *TestSuite) TestVote() { // no group policy proposalsRes, err := s.groupKeeper.ProposalsByGroupPolicy(s.ctx, &group.QueryProposalsByGroupPolicyRequest{ - Address: addrs[2].String(), + Address: s.addrsStr[2], }) s.Require().NoError(err) proposals := proposalsRes.Proposals @@ -2174,7 +2137,7 @@ func (s *TestSuite) TestVote() { "vote yes": { req: &group.MsgVote{ ProposalId: myProposalID, - Voter: addr4.String(), + Voter: s.addrsStr[3], Option: group.VOTE_OPTION_YES, }, expTallyResult: group.TallyResult{ @@ -2190,7 +2153,7 @@ func (s *TestSuite) TestVote() { "with try exec": { req: &group.MsgVote{ ProposalId: myProposalID, - Voter: addr3.String(), + Voter: s.addrsStr[2], Option: group.VOTE_OPTION_YES, Exec: group.Exec_EXEC_TRY, }, @@ -2219,7 +2182,7 @@ func (s *TestSuite) TestVote() { "with try exec, not enough yes votes for proposal to pass": { req: &group.MsgVote{ ProposalId: myProposalID, - Voter: addr4.String(), + Voter: s.addrsStr[3], Option: group.VOTE_OPTION_YES, Exec: group.Exec_EXEC_TRY, }, @@ -2236,7 +2199,7 @@ func (s *TestSuite) TestVote() { "vote no": { req: &group.MsgVote{ ProposalId: myProposalID, - Voter: addr4.String(), + Voter: s.addrsStr[3], Option: group.VOTE_OPTION_NO, }, expTallyResult: group.TallyResult{ @@ -2252,7 +2215,7 @@ func (s *TestSuite) TestVote() { "vote abstain": { req: &group.MsgVote{ ProposalId: myProposalID, - Voter: addr4.String(), + Voter: s.addrsStr[3], Option: group.VOTE_OPTION_ABSTAIN, }, expTallyResult: group.TallyResult{ @@ -2268,7 +2231,7 @@ func (s *TestSuite) TestVote() { "vote veto": { req: &group.MsgVote{ ProposalId: myProposalID, - Voter: addr4.String(), + Voter: s.addrsStr[3], Option: group.VOTE_OPTION_NO_WITH_VETO, }, expTallyResult: group.TallyResult{ @@ -2284,7 +2247,7 @@ func (s *TestSuite) TestVote() { "apply decision policy early": { req: &group.MsgVote{ ProposalId: myProposalID, - Voter: addr3.String(), + Voter: s.addrsStr[2], Option: group.VOTE_OPTION_YES, }, expTallyResult: group.TallyResult{ @@ -2300,13 +2263,13 @@ func (s *TestSuite) TestVote() { "reject new votes when final decision is made already": { req: &group.MsgVote{ ProposalId: myProposalID, - Voter: addr4.String(), + Voter: s.addrsStr[3], Option: group.VOTE_OPTION_YES, }, doBefore: func(ctx context.Context) { _, err := s.groupKeeper.Vote(ctx, &group.MsgVote{ ProposalId: myProposalID, - Voter: addr3.String(), + Voter: s.addrsStr[2], Option: group.VOTE_OPTION_NO_WITH_VETO, Exec: 1, // Execute the proposal so that its status is final }) @@ -2319,7 +2282,7 @@ func (s *TestSuite) TestVote() { "metadata too long": { req: &group.MsgVote{ ProposalId: myProposalID, - Voter: addr4.String(), + Voter: s.addrsStr[3], Option: group.VOTE_OPTION_NO, Metadata: strings.Repeat("a", 256), }, @@ -2330,7 +2293,7 @@ func (s *TestSuite) TestVote() { "existing proposal required": { req: &group.MsgVote{ ProposalId: 999, - Voter: addr4.String(), + Voter: s.addrsStr[3], Option: group.VOTE_OPTION_NO, }, expErr: true, @@ -2340,7 +2303,7 @@ func (s *TestSuite) TestVote() { "empty vote option": { req: &group.MsgVote{ ProposalId: myProposalID, - Voter: addr4.String(), + Voter: s.addrsStr[3], }, expErr: true, expErrMsg: "vote option: value is empty", @@ -2349,7 +2312,7 @@ func (s *TestSuite) TestVote() { "invalid vote option": { req: &group.MsgVote{ ProposalId: myProposalID, - Voter: addr4.String(), + Voter: s.addrsStr[3], Option: 5, }, expErr: true, @@ -2359,7 +2322,7 @@ func (s *TestSuite) TestVote() { "voter must be in group": { req: &group.MsgVote{ ProposalId: myProposalID, - Voter: addr2.String(), + Voter: s.addrsStr[1], Option: group.VOTE_OPTION_NO, }, expErr: true, @@ -2369,7 +2332,7 @@ func (s *TestSuite) TestVote() { "admin that is not a group member can not vote": { req: &group.MsgVote{ ProposalId: myProposalID, - Voter: addr1.String(), + Voter: s.addrsStr[0], Option: group.VOTE_OPTION_NO, }, expErr: true, @@ -2379,7 +2342,7 @@ func (s *TestSuite) TestVote() { "on voting period end": { req: &group.MsgVote{ ProposalId: myProposalID, - Voter: addr4.String(), + Voter: s.addrsStr[3], Option: group.VOTE_OPTION_NO, }, srcCtx: s.sdkCtx.WithHeaderInfo(header.Info{Time: s.sdkCtx.HeaderInfo().Time.Add(time.Second)}), @@ -2390,7 +2353,7 @@ func (s *TestSuite) TestVote() { "vote closed already": { req: &group.MsgVote{ ProposalId: myProposalID, - Voter: addr4.String(), + Voter: s.addrsStr[3], Option: group.VOTE_OPTION_NO, }, doBefore: func(ctx context.Context) { @@ -2398,7 +2361,7 @@ func (s *TestSuite) TestVote() { _, err := s.groupKeeper.Vote(ctx, &group.MsgVote{ ProposalId: myProposalID, - Voter: addr3.String(), + Voter: s.addrsStr[2], Option: group.VOTE_OPTION_YES, Exec: 1, // Execute to close the proposal. }) @@ -2411,13 +2374,13 @@ func (s *TestSuite) TestVote() { "voted already": { req: &group.MsgVote{ ProposalId: myProposalID, - Voter: addr4.String(), + Voter: s.addrsStr[3], Option: group.VOTE_OPTION_NO, }, doBefore: func(ctx context.Context) { _, err := s.groupKeeper.Vote(ctx, &group.MsgVote{ ProposalId: myProposalID, - Voter: addr4.String(), + Voter: s.addrsStr[3], Option: group.VOTE_OPTION_YES, }) s.Require().NoError(err) @@ -2515,12 +2478,12 @@ func (s *TestSuite) TestVote() { s.T().Log("test tally result should not take into account the member who left the group") members = []group.MemberRequest{ - {Address: addr2.String(), Weight: "3"}, - {Address: addr3.String(), Weight: "2"}, - {Address: addr4.String(), Weight: "1"}, + {Address: s.addrsStr[1], Weight: "3"}, + {Address: s.addrsStr[2], Weight: "2"}, + {Address: s.addrsStr[3], Weight: "1"}, } reqCreate := &group.MsgCreateGroupWithPolicy{ - Admin: addr1.String(), + Admin: s.addrsStr[0], Members: members, GroupMetadata: "metadata", } @@ -2541,11 +2504,11 @@ func (s *TestSuite) TestVote() { groupID := result.GroupId reqProposal := &group.MsgSubmitProposal{ GroupPolicyAddress: policyAddr, - Proposers: []string{addr4.String()}, + Proposers: []string{s.addrsStr[3]}, } s.Require().NoError(reqProposal.SetMsgs([]sdk.Msg{&banktypes.MsgSend{ FromAddress: policyAddr, - ToAddress: addr5.String(), + ToAddress: s.addrsStr[4], Amount: sdk.Coins{sdk.NewInt64Coin("test", 100)}, }})) @@ -2554,7 +2517,7 @@ func (s *TestSuite) TestVote() { s.Require().NotNil(resSubmitProposal) proposalID := resSubmitProposal.ProposalId - for _, voter := range []string{addr4.String(), addr3.String(), addr2.String()} { + for _, voter := range []string{s.addrsStr[3], s.addrsStr[2], s.addrsStr[1]} { _, err := s.groupKeeper.Vote(s.ctx, &group.MsgVote{ProposalId: proposalID, Voter: voter, Option: group.VOTE_OPTION_YES}, ) @@ -2569,7 +2532,7 @@ func (s *TestSuite) TestVote() { tallyResult, err := s.groupKeeper.Tally(s.sdkCtx, *qProposals.Proposal, groupID) s.Require().NoError(err) - _, err = s.groupKeeper.LeaveGroup(s.ctx, &group.MsgLeaveGroup{Address: addr4.String(), GroupId: groupID}) + _, err = s.groupKeeper.LeaveGroup(s.ctx, &group.MsgLeaveGroup{Address: s.addrsStr[3], GroupId: groupID}) s.Require().NoError(err) tallyResult1, err := s.groupKeeper.Tally(s.sdkCtx, *qProposals.Proposal, groupID) @@ -2579,20 +2542,19 @@ func (s *TestSuite) TestVote() { func (s *TestSuite) TestExecProposal() { addrs := s.addrs - addr1 := addrs[0] addr2 := addrs[1] msgSend1 := &banktypes.MsgSend{ - FromAddress: s.groupPolicyAddr.String(), - ToAddress: addr2.String(), + FromAddress: s.groupPolicyStrAddr, + ToAddress: s.addrsStr[1], Amount: sdk.Coins{sdk.NewInt64Coin("test", 100)}, } msgSend2 := &banktypes.MsgSend{ - FromAddress: s.groupPolicyAddr.String(), - ToAddress: addr2.String(), + FromAddress: s.groupPolicyStrAddr, + ToAddress: s.addrsStr[1], Amount: sdk.Coins{sdk.NewInt64Coin("test", 10001)}, } - proposers := []string{addr2.String()} + proposers := []string{s.addrsStr[1]} specs := map[string]struct { srcBlockTime time.Time @@ -2731,7 +2693,7 @@ func (s *TestSuite) TestExecProposal() { // Wait after min execution period end before Exec sdkCtx := sdk.UnwrapSDKContext(ctx) sdkCtx = sdkCtx.WithHeaderInfo(header.Info{Time: sdkCtx.HeaderInfo().Time.Add(minExecutionPeriod)}) // MinExecutionPeriod is 5s - _, err := s.groupKeeper.Exec(sdkCtx, &group.MsgExec{Executor: addr1.String(), ProposalId: myProposalID}) + _, err := s.groupKeeper.Exec(sdkCtx, &group.MsgExec{Executor: s.addrsStr[0], ProposalId: myProposalID}) s.Require().NoError(err) return myProposalID }, @@ -2767,7 +2729,7 @@ func (s *TestSuite) TestExecProposal() { sdkCtx := sdk.UnwrapSDKContext(ctx) sdkCtx = sdkCtx.WithHeaderInfo(header.Info{Time: sdkCtx.HeaderInfo().Time.Add(minExecutionPeriod)}) // MinExecutionPeriod is 5s s.bankKeeper.EXPECT().Send(gomock.Any(), msgSend2).Return(nil, fmt.Errorf("error")) - _, err := s.groupKeeper.Exec(sdkCtx, &group.MsgExec{Executor: addr1.String(), ProposalId: myProposalID}) + _, err := s.groupKeeper.Exec(sdkCtx, &group.MsgExec{Executor: s.addrsStr[0], ProposalId: myProposalID}) s.bankKeeper.EXPECT().Send(gomock.Any(), msgSend2).Return(nil, nil) s.Require().NoError(err) @@ -2791,7 +2753,7 @@ func (s *TestSuite) TestExecProposal() { sdkCtx = sdkCtx.WithHeaderInfo(header.Info{Time: spec.srcBlockTime}) } - _, err := s.groupKeeper.Exec(sdkCtx, &group.MsgExec{Executor: addr1.String(), ProposalId: proposalID}) + _, err := s.groupKeeper.Exec(sdkCtx, &group.MsgExec{Executor: s.addrsStr[0], ProposalId: proposalID}) if spec.expErr { s.Require().Error(err) s.Require().Contains(err.Error(), spec.expErrMsg) @@ -2831,11 +2793,7 @@ func (s *TestSuite) TestExecProposal() { } func (s *TestSuite) TestExecPrunedProposalsAndVotes() { - addrs := s.addrs - addr1 := addrs[0] - addr2 := addrs[1] - - proposers := []string{addr2.String()} + proposers := []string{s.addrsStr[1]} specs := map[string]struct { srcBlockTime time.Time setupProposal func(ctx context.Context) uint64 @@ -2846,8 +2804,8 @@ func (s *TestSuite) TestExecPrunedProposalsAndVotes() { "proposal pruned after executor result success": { setupProposal: func(ctx context.Context) uint64 { msgSend1 := &banktypes.MsgSend{ - FromAddress: s.groupPolicyAddr.String(), - ToAddress: addr2.String(), + FromAddress: s.groupPolicyStrAddr, + ToAddress: s.addrsStr[1], Amount: sdk.Coins{sdk.NewInt64Coin("test", 101)}, } msgs := []sdk.Msg{msgSend1} @@ -2860,8 +2818,8 @@ func (s *TestSuite) TestExecPrunedProposalsAndVotes() { "proposal with multiple messages pruned when executed with result success": { setupProposal: func(ctx context.Context) uint64 { msgSend1 := &banktypes.MsgSend{ - FromAddress: s.groupPolicyAddr.String(), - ToAddress: addr2.String(), + FromAddress: s.groupPolicyStrAddr, + ToAddress: s.addrsStr[1], Amount: sdk.Coins{sdk.NewInt64Coin("test", 102)}, } s.bankKeeper.EXPECT().Send(gomock.Any(), msgSend1).Return(nil, nil).MaxTimes(2) @@ -2875,8 +2833,8 @@ func (s *TestSuite) TestExecPrunedProposalsAndVotes() { "proposal not pruned when not executed and rejected": { setupProposal: func(ctx context.Context) uint64 { msgSend1 := &banktypes.MsgSend{ - FromAddress: s.groupPolicyAddr.String(), - ToAddress: addr2.String(), + FromAddress: s.groupPolicyStrAddr, + ToAddress: s.addrsStr[1], Amount: sdk.Coins{sdk.NewInt64Coin("test", 103)}, } msgs := []sdk.Msg{msgSend1} @@ -2887,8 +2845,8 @@ func (s *TestSuite) TestExecPrunedProposalsAndVotes() { "open proposal is not pruned which must not fail ": { setupProposal: func(ctx context.Context) uint64 { msgSend1 := &banktypes.MsgSend{ - FromAddress: s.groupPolicyAddr.String(), - ToAddress: addr2.String(), + FromAddress: s.groupPolicyStrAddr, + ToAddress: s.addrsStr[1], Amount: sdk.Coins{sdk.NewInt64Coin("test", 104)}, } return submitProposal(ctx, s, []sdk.Msg{msgSend1}, proposers) @@ -2898,15 +2856,15 @@ func (s *TestSuite) TestExecPrunedProposalsAndVotes() { "proposal not pruned with group modified before tally": { setupProposal: func(ctx context.Context) uint64 { msgSend1 := &banktypes.MsgSend{ - FromAddress: s.groupPolicyAddr.String(), - ToAddress: addr2.String(), + FromAddress: s.groupPolicyStrAddr, + ToAddress: s.addrsStr[1], Amount: sdk.Coins{sdk.NewInt64Coin("test", 105)}, } myProposalID := submitProposal(ctx, s, []sdk.Msg{msgSend1}, proposers) // then modify group _, err := s.groupKeeper.UpdateGroupMetadata(ctx, &group.MsgUpdateGroupMetadata{ - Admin: addr1.String(), + Admin: s.addrsStr[0], GroupId: s.groupID, }) s.Require().NoError(err) @@ -2917,15 +2875,15 @@ func (s *TestSuite) TestExecPrunedProposalsAndVotes() { "proposal not pruned with group policy modified before tally": { setupProposal: func(ctx context.Context) uint64 { msgSend1 := &banktypes.MsgSend{ - FromAddress: s.groupPolicyAddr.String(), - ToAddress: addr2.String(), + FromAddress: s.groupPolicyStrAddr, + ToAddress: s.addrsStr[1], Amount: sdk.Coins{sdk.NewInt64Coin("test", 106)}, } myProposalID := submitProposal(ctx, s, []sdk.Msg{msgSend1}, proposers) _, err := s.groupKeeper.UpdateGroupPolicyMetadata(ctx, &group.MsgUpdateGroupPolicyMetadata{ - Admin: addr1.String(), - GroupPolicyAddress: s.groupPolicyAddr.String(), + Admin: s.addrsStr[0], + GroupPolicyAddress: s.groupPolicyStrAddr, }) s.Require().NoError(err) return myProposalID @@ -2937,14 +2895,14 @@ func (s *TestSuite) TestExecPrunedProposalsAndVotes() { "proposal exists when rollback all msg updates on failure": { setupProposal: func(ctx context.Context) uint64 { msgSend1 := &banktypes.MsgSend{ - FromAddress: s.groupPolicyAddr.String(), - ToAddress: addr2.String(), + FromAddress: s.groupPolicyStrAddr, + ToAddress: s.addrsStr[1], Amount: sdk.Coins{sdk.NewInt64Coin("test", 107)}, } msgSend2 := &banktypes.MsgSend{ - FromAddress: s.groupPolicyAddr.String(), - ToAddress: addr2.String(), + FromAddress: s.groupPolicyStrAddr, + ToAddress: s.addrsStr[1], Amount: sdk.Coins{sdk.NewInt64Coin("test", 10002)}, } @@ -2958,8 +2916,8 @@ func (s *TestSuite) TestExecPrunedProposalsAndVotes() { "pruned when proposal is executable when failed before": { setupProposal: func(ctx context.Context) uint64 { msgSend2 := &banktypes.MsgSend{ - FromAddress: s.groupPolicyAddr.String(), - ToAddress: addr2.String(), + FromAddress: s.groupPolicyStrAddr, + ToAddress: s.addrsStr[1], Amount: sdk.Coins{sdk.NewInt64Coin("test", 10003)}, } @@ -2972,7 +2930,7 @@ func (s *TestSuite) TestExecPrunedProposalsAndVotes() { // Wait for min execution period end sdkCtx := sdk.UnwrapSDKContext(ctx) sdkCtx = sdkCtx.WithHeaderInfo(header.Info{Time: sdkCtx.HeaderInfo().Time.Add(minExecutionPeriod)}) - _, err := s.groupKeeper.Exec(sdkCtx, &group.MsgExec{Executor: addr1.String(), ProposalId: myProposalID}) + _, err := s.groupKeeper.Exec(sdkCtx, &group.MsgExec{Executor: s.addrsStr[0], ProposalId: myProposalID}) s.bankKeeper.EXPECT().Send(gomock.Any(), msgSend2).Return(nil, nil) s.Require().NoError(err) @@ -2994,7 +2952,7 @@ func (s *TestSuite) TestExecPrunedProposalsAndVotes() { // Wait for min execution period end sdkCtx = sdkCtx.WithHeaderInfo(header.Info{Time: sdkCtx.HeaderInfo().Time.Add(minExecutionPeriod)}) - _, err := s.groupKeeper.Exec(sdkCtx, &group.MsgExec{Executor: addr1.String(), ProposalId: proposalID}) + _, err := s.groupKeeper.Exec(sdkCtx, &group.MsgExec{Executor: s.addrsStr[0], ProposalId: proposalID}) if spec.expErr { s.Require().Error(err) s.Require().Contains(err.Error(), spec.expErrMsg) @@ -3032,26 +2990,30 @@ func (s *TestSuite) TestLeaveGroup() { addrs := simtestutil.CreateIncrementalAccounts(7) admin1 := addrs[0] - member1 := addrs[1] - member2 := addrs[2] - member3 := addrs[3] - member4 := addrs[4] + member1, err := s.accountKeeper.AddressCodec().BytesToString(addrs[1]) + s.Require().NoError(err) + member2, err := s.accountKeeper.AddressCodec().BytesToString(addrs[2]) + s.Require().NoError(err) + member3, err := s.accountKeeper.AddressCodec().BytesToString(addrs[3]) + s.Require().NoError(err) + member4, err := s.accountKeeper.AddressCodec().BytesToString(addrs[4]) + s.Require().NoError(err) admin2 := addrs[5] admin3 := addrs[6] members := []group.MemberRequest{ { - Address: member1.String(), + Address: member1, Weight: "1", Metadata: "metadata", }, { - Address: member2.String(), + Address: member2, Weight: "2", Metadata: "metadata", }, { - Address: member3.String(), + Address: member3, Weight: "3", Metadata: "metadata", }, @@ -3066,7 +3028,7 @@ func (s *TestSuite) TestLeaveGroup() { members = []group.MemberRequest{ { - Address: member1.String(), + Address: member1, Weight: "1", Metadata: "metadata", }, @@ -3077,12 +3039,12 @@ func (s *TestSuite) TestLeaveGroup() { members = []group.MemberRequest{ { - Address: member1.String(), + Address: member1, Weight: "1", Metadata: "metadata", }, { - Address: member2.String(), + Address: member2, Weight: "2", Metadata: "metadata", }, @@ -3107,7 +3069,7 @@ func (s *TestSuite) TestLeaveGroup() { "group not found", &group.MsgLeaveGroup{ GroupId: 100000, - Address: member1.String(), + Address: member1, }, true, "group: not found", @@ -3129,7 +3091,7 @@ func (s *TestSuite) TestLeaveGroup() { "member not part of group", &group.MsgLeaveGroup{ GroupId: groupID1, - Address: member4.String(), + Address: member4, }, true, "not part of group", @@ -3140,7 +3102,7 @@ func (s *TestSuite) TestLeaveGroup() { "valid testcase: decision policy is not present (and group total weight can be 0)", &group.MsgLeaveGroup{ GroupId: groupID2, - Address: member1.String(), + Address: member1, }, false, "", @@ -3151,7 +3113,7 @@ func (s *TestSuite) TestLeaveGroup() { "valid testcase: threshold decision policy", &group.MsgLeaveGroup{ GroupId: groupID1, - Address: member3.String(), + Address: member3, }, false, "", @@ -3162,7 +3124,7 @@ func (s *TestSuite) TestLeaveGroup() { "valid request: can leave group policy threshold more than group weight", &group.MsgLeaveGroup{ GroupId: groupID1, - Address: member2.String(), + Address: member2, }, false, "", @@ -3173,7 +3135,7 @@ func (s *TestSuite) TestLeaveGroup() { "valid request: can leave group (percentage decision policy)", &group.MsgLeaveGroup{ GroupId: groupID3, - Address: member2.String(), + Address: member2, }, false, "", @@ -3219,7 +3181,7 @@ func (s *TestSuite) TestLeaveGroup() { } func (s *TestSuite) TestExecProposalsWhenMemberLeavesOrIsUpdated() { - proposers := []string{s.addrs[1].String()} + proposers := []string{s.addrsStr[1]} specs := map[string]struct { votes []group.VoteOption @@ -3230,11 +3192,11 @@ func (s *TestSuite) TestExecProposalsWhenMemberLeavesOrIsUpdated() { }{ "member leaves while all others vote yes: proposal accepted": { members: []group.MemberRequest{ - {Address: s.addrs[4].String(), Weight: "1"}, - {Address: s.addrs[1].String(), Weight: "2"}, - {Address: s.addrs[3].String(), Weight: "1"}, - {Address: s.addrs[5].String(), Weight: "2"}, - {Address: s.addrs[2].String(), Weight: "2"}, + {Address: s.addrsStr[4], Weight: "1"}, + {Address: s.addrsStr[1], Weight: "2"}, + {Address: s.addrsStr[3], Weight: "1"}, + {Address: s.addrsStr[5], Weight: "2"}, + {Address: s.addrsStr[2], Weight: "2"}, }, votes: []group.VoteOption{ group.VOTE_OPTION_YES, group.VOTE_OPTION_YES, @@ -3244,7 +3206,7 @@ func (s *TestSuite) TestExecProposalsWhenMemberLeavesOrIsUpdated() { setupProposal: func(ctx context.Context, groupPolicyAddr string) uint64 { msgSend1 := &banktypes.MsgSend{ FromAddress: groupPolicyAddr, - ToAddress: s.addrs[1].String(), + ToAddress: s.addrsStr[1], Amount: sdk.Coins{sdk.NewInt64Coin("test", 100)}, } @@ -3265,16 +3227,16 @@ func (s *TestSuite) TestExecProposalsWhenMemberLeavesOrIsUpdated() { return proposalRes.ProposalId }, malleate: func(ctx context.Context, k keeper.Keeper, _ string, groupID uint64) error { - _, err := k.LeaveGroup(ctx, &group.MsgLeaveGroup{GroupId: groupID, Address: s.addrs[5].String()}) + _, err := k.LeaveGroup(ctx, &group.MsgLeaveGroup{GroupId: groupID, Address: s.addrsStr[5]}) return err }, }, "member leaves while all others vote yes and no: proposal rejected": { members: []group.MemberRequest{ - {Address: s.addrs[4].String(), Weight: "2"}, - {Address: s.addrs[1].String(), Weight: "2"}, - {Address: s.addrs[3].String(), Weight: "2"}, - {Address: s.addrs[2].String(), Weight: "2"}, + {Address: s.addrsStr[4], Weight: "2"}, + {Address: s.addrsStr[1], Weight: "2"}, + {Address: s.addrsStr[3], Weight: "2"}, + {Address: s.addrsStr[2], Weight: "2"}, }, votes: []group.VoteOption{ group.VOTE_OPTION_NO, group.VOTE_OPTION_NO, @@ -3283,7 +3245,7 @@ func (s *TestSuite) TestExecProposalsWhenMemberLeavesOrIsUpdated() { setupProposal: func(ctx context.Context, groupPolicyAddr string) uint64 { msgSend1 := &banktypes.MsgSend{ FromAddress: groupPolicyAddr, - ToAddress: s.addrs[1].String(), + ToAddress: s.addrsStr[1], Amount: sdk.Coins{sdk.NewInt64Coin("test", 100)}, } msgs := []sdk.Msg{msgSend1, msgSend1} @@ -3301,16 +3263,16 @@ func (s *TestSuite) TestExecProposalsWhenMemberLeavesOrIsUpdated() { return proposalRes.ProposalId }, malleate: func(ctx context.Context, k keeper.Keeper, _ string, groupID uint64) error { - _, err := k.LeaveGroup(ctx, &group.MsgLeaveGroup{GroupId: groupID, Address: s.addrs[3].String()}) + _, err := k.LeaveGroup(ctx, &group.MsgLeaveGroup{GroupId: groupID, Address: s.addrsStr[3]}) return err }, }, "member that leaves does affect the threshold policy outcome": { members: []group.MemberRequest{ - {Address: s.addrs[3].String(), Weight: "6"}, - {Address: s.addrs[1].String(), Weight: "1"}, - {Address: s.addrs[5].String(), Weight: "1"}, - {Address: s.addrs[2].String(), Weight: "1"}, + {Address: s.addrsStr[3], Weight: "6"}, + {Address: s.addrsStr[1], Weight: "1"}, + {Address: s.addrsStr[5], Weight: "1"}, + {Address: s.addrsStr[2], Weight: "1"}, }, votes: []group.VoteOption{ group.VOTE_OPTION_YES, group.VOTE_OPTION_NO, @@ -3319,7 +3281,7 @@ func (s *TestSuite) TestExecProposalsWhenMemberLeavesOrIsUpdated() { setupProposal: func(ctx context.Context, addr string) uint64 { msgSend1 := &banktypes.MsgSend{ FromAddress: addr, - ToAddress: s.addrs[1].String(), + ToAddress: s.addrsStr[1], Amount: sdk.Coins{sdk.NewInt64Coin("test", 100)}, } msgs := []sdk.Msg{msgSend1, msgSend1} @@ -3337,16 +3299,16 @@ func (s *TestSuite) TestExecProposalsWhenMemberLeavesOrIsUpdated() { return proposalRes.ProposalId }, malleate: func(ctx context.Context, k keeper.Keeper, _ string, groupID uint64) error { - _, err := k.LeaveGroup(ctx, &group.MsgLeaveGroup{GroupId: groupID, Address: s.addrs[3].String()}) + _, err := k.LeaveGroup(ctx, &group.MsgLeaveGroup{GroupId: groupID, Address: s.addrsStr[3]}) return err }, }, "update group policy voids the proposal": { members: []group.MemberRequest{ - {Address: s.addrs[3].String(), Weight: "2"}, - {Address: s.addrs[2].String(), Weight: "2"}, - {Address: s.addrs[1].String(), Weight: "2"}, - {Address: s.addrs[4].String(), Weight: "2"}, + {Address: s.addrsStr[3], Weight: "2"}, + {Address: s.addrsStr[2], Weight: "2"}, + {Address: s.addrsStr[1], Weight: "2"}, + {Address: s.addrsStr[4], Weight: "2"}, }, votes: []group.VoteOption{ group.VOTE_OPTION_YES, group.VOTE_OPTION_NO, @@ -3355,7 +3317,7 @@ func (s *TestSuite) TestExecProposalsWhenMemberLeavesOrIsUpdated() { setupProposal: func(ctx context.Context, groupPolicyAddr string) uint64 { msgSend1 := &banktypes.MsgSend{ FromAddress: groupPolicyAddr, - ToAddress: s.addrs[1].String(), + ToAddress: s.addrsStr[1], Amount: sdk.Coins{sdk.NewInt64Coin("test", 100)}, } msgs := []sdk.Msg{msgSend1, msgSend1} @@ -3373,7 +3335,7 @@ func (s *TestSuite) TestExecProposalsWhenMemberLeavesOrIsUpdated() { }, malleate: func(ctx context.Context, k keeper.Keeper, groupPolicyAddr string, groupID uint64) error { newGroupPolicy := &group.MsgUpdateGroupPolicyDecisionPolicy{ - Admin: s.addrs[0].String(), + Admin: s.addrsStr[0], GroupPolicyAddress: groupPolicyAddr, } err := newGroupPolicy.SetDecisionPolicy(group.NewThresholdDecisionPolicy("10", time.Second, minExecutionPeriod)) @@ -3393,7 +3355,7 @@ func (s *TestSuite) TestExecProposalsWhenMemberLeavesOrIsUpdated() { s.setNextAccount() groupRes, err := s.groupKeeper.CreateGroup(s.ctx, &group.MsgCreateGroup{ - Admin: s.addrs[0].String(), + Admin: s.addrsStr[0], Members: spec.members, }) s.Require().NoError(err) @@ -3401,7 +3363,7 @@ func (s *TestSuite) TestExecProposalsWhenMemberLeavesOrIsUpdated() { policy := group.NewThresholdDecisionPolicy("4", time.Second, minExecutionPeriod) policyReq := &group.MsgCreateGroupPolicy{ - Admin: s.addrs[0].String(), + Admin: s.addrsStr[0], GroupId: groupID, } err = policyReq.SetDecisionPolicy(policy) @@ -3431,7 +3393,7 @@ func (s *TestSuite) TestExecProposalsWhenMemberLeavesOrIsUpdated() { // travel in time sdkCtx = sdkCtx.WithHeaderInfo(header.Info{Time: s.blockTime.Add(minExecutionPeriod + 1)}) - _, err = s.groupKeeper.Exec(sdkCtx, &group.MsgExec{Executor: s.addrs[1].String(), ProposalId: proposalID}) + _, err = s.groupKeeper.Exec(sdkCtx, &group.MsgExec{Executor: s.addrsStr[1], ProposalId: proposalID}) if spec.expErrMsg != "" { s.Require().Contains(err.Error(), spec.expErrMsg) return diff --git a/x/group/keeper/proposal_executor.go b/x/group/keeper/proposal_executor.go index 148de9c741eb..7a3a530e78d2 100644 --- a/x/group/keeper/proposal_executor.go +++ b/x/group/keeper/proposal_executor.go @@ -4,6 +4,7 @@ import ( "bytes" "context" + "cosmossdk.io/core/address" errorsmod "cosmossdk.io/errors" "cosmossdk.io/x/group" "cosmossdk.io/x/group/errors" @@ -39,7 +40,7 @@ func (k Keeper) doExecuteMsgs(ctx context.Context, proposal group.Proposal, grou return err } - if err := ensureMsgAuthZ(msgs, groupPolicyAcc, k.cdc); err != nil { + if err := ensureMsgAuthZ(msgs, groupPolicyAcc, k.cdc, k.accKeeper.AddressCodec()); err != nil { return err } @@ -53,7 +54,7 @@ func (k Keeper) doExecuteMsgs(ctx context.Context, proposal group.Proposal, grou // ensureMsgAuthZ checks that if a message requires signers that all of them // are equal to the given account address of group policy. -func ensureMsgAuthZ(msgs []sdk.Msg, groupPolicyAcc sdk.AccAddress, cdc codec.Codec) error { +func ensureMsgAuthZ(msgs []sdk.Msg, groupPolicyAcc sdk.AccAddress, cdc codec.Codec, addressCodec address.Codec) error { for i := range msgs { // In practice, GetMsgV1Signers should return a non-empty array without duplicates. signers, _, err := cdc.GetMsgV1Signers(msgs[i]) @@ -65,7 +66,11 @@ func ensureMsgAuthZ(msgs []sdk.Msg, groupPolicyAcc sdk.AccAddress, cdc codec.Cod // But here, we loop through all the signers just to be sure. for _, acct := range signers { if !bytes.Equal(groupPolicyAcc, acct) { - return errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "msg does not have group policy authorization; expected %s, got %s", groupPolicyAcc.String(), acct) + groupPolicyAddr, err := addressCodec.BytesToString(groupPolicyAcc) + 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) } } } diff --git a/x/group/keeper/tally_test.go b/x/group/keeper/tally_test.go index a74a6f903913..80528675144a 100644 --- a/x/group/keeper/tally_test.go +++ b/x/group/keeper/tally_test.go @@ -11,15 +11,12 @@ import ( ) func (s *TestSuite) TestTally() { - addrs := s.addrs - addr2 := addrs[1] - msgSend1 := &banktypes.MsgSend{ - FromAddress: s.groupPolicyAddr.String(), - ToAddress: addr2.String(), + FromAddress: s.groupPolicyStrAddr, + ToAddress: s.addrsStr[1], Amount: sdk.Coins{sdk.NewInt64Coin("test", 100)}, } - proposers := []string{addr2.String()} + proposers := []string{s.addrsStr[1]} specs := map[string]struct { srcBlockTime time.Time diff --git a/x/group/migrations/v2/gen_state.go b/x/group/migrations/v2/gen_state.go index 0728a3430de3..10918441a475 100644 --- a/x/group/migrations/v2/gen_state.go +++ b/x/group/migrations/v2/gen_state.go @@ -3,6 +3,7 @@ package v2 import ( "encoding/binary" + "cosmossdk.io/core/address" authtypes "cosmossdk.io/x/auth/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -11,7 +12,7 @@ import ( // MigrateGenState accepts exported v0.46 x/auth genesis state and migrates it to // v0.47 x/auth genesis state. The migration includes: // - If the group module is enabled, replace group policy accounts from module accounts to base accounts. -func MigrateGenState(oldState *authtypes.GenesisState) *authtypes.GenesisState { +func MigrateGenState(oldState *authtypes.GenesisState, addressCodec address.Codec) *authtypes.GenesisState { newState := *oldState accounts, err := authtypes.UnpackAccounts(newState.Accounts) @@ -26,7 +27,12 @@ func MigrateGenState(oldState *authtypes.GenesisState) *authtypes.GenesisState { continue } - if modAcc.GetName() != modAcc.GetAddress().String() { + modAddr, err := addressCodec.BytesToString(modAcc.GetAddress()) + if err != nil { + panic(err) + } + + if modAcc.GetName() != modAddr { continue } diff --git a/x/group/migrations/v2/gen_state_test.go b/x/group/migrations/v2/gen_state_test.go index 187515eb63a9..05b4d2393539 100644 --- a/x/group/migrations/v2/gen_state_test.go +++ b/x/group/migrations/v2/gen_state_test.go @@ -9,6 +9,8 @@ import ( authtypes "cosmossdk.io/x/auth/types" "cosmossdk.io/x/group" v2 "cosmossdk.io/x/group/migrations/v2" + + codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" ) func TestMigrateGenState(t *testing.T) { @@ -73,7 +75,7 @@ func TestMigrateGenState(t *testing.T) { for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { require.Error(t, authtypes.ValidateGenesis(*tc.oldState)) - actualState := v2.MigrateGenState(tc.oldState) + actualState := v2.MigrateGenState(tc.oldState, codectestutil.CodecOptions{}.GetAddressCodec()) require.Equal(t, tc.newState, actualState) require.NoError(t, authtypes.ValidateGenesis(*actualState)) }) diff --git a/x/group/migrations/v2/migrate.go b/x/group/migrations/v2/migrate.go index ace145967564..c2db30443269 100644 --- a/x/group/migrations/v2/migrate.go +++ b/x/group/migrations/v2/migrate.go @@ -39,7 +39,11 @@ func Migrate( derivationKey := make([]byte, 8) binary.BigEndian.PutUint64(derivationKey, i) groupPolicyAcc := sdk.AccAddress(address.Module(group.ModuleName, policyKey, derivationKey)) - groupPolicyAccountDerivationKey[groupPolicyAcc.String()] = derivationKey + groupPolicyAddr, err := accountKeeper.AddressCodec().BytesToString(groupPolicyAcc) + if err != nil { + return err + } + groupPolicyAccountDerivationKey[groupPolicyAddr] = derivationKey } // get all group policies diff --git a/x/group/migrations/v2/migrate_test.go b/x/group/migrations/v2/migrate_test.go index c06b975c826c..1530dfba75ec 100644 --- a/x/group/migrations/v2/migrate_test.go +++ b/x/group/migrations/v2/migrate_test.go @@ -3,13 +3,16 @@ package v2_test import ( "testing" + "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "cosmossdk.io/core/address" corestore "cosmossdk.io/core/store" "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" "cosmossdk.io/x/auth" authkeeper "cosmossdk.io/x/auth/keeper" + authtestutil "cosmossdk.io/x/auth/testutil" authtypes "cosmossdk.io/x/auth/types" "cosmossdk.io/x/group" "cosmossdk.io/x/group/internal/orm" @@ -41,8 +44,9 @@ func TestMigrate(t *testing.T) { tKey := storetypes.NewTransientStoreKey("transient_test") ctx := testutil.DefaultContext(storeKey, tKey) - oldAccs, accountKeeper := createOldPolicyAccount(ctx, storeKey, cdc, policies) - groupPolicyTable, groupPolicySeq, err := createGroupPolicies(ctx, storeService, cdc, policies) + oldAccs, accountKeeper, err := createOldPolicyAccount(ctx, storeKey, cdc, policies) + require.NoError(t, err) + groupPolicyTable, groupPolicySeq, err := createGroupPolicies(ctx, storeService, cdc, policies, codectestutil.CodecOptions{}.GetAddressCodec()) require.NoError(t, err) require.NoError(t, v2.Migrate(ctx, storeService, accountKeeper, groupPolicySeq, groupPolicyTable)) @@ -57,7 +61,7 @@ func TestMigrate(t *testing.T) { } } -func createGroupPolicies(ctx sdk.Context, storeService corestore.KVStoreService, cdc codec.Codec, policies []sdk.AccAddress) (orm.PrimaryKeyTable, orm.Sequence, error) { +func createGroupPolicies(ctx sdk.Context, storeService corestore.KVStoreService, cdc codec.Codec, policies []sdk.AccAddress, addressCodec address.Codec) (orm.PrimaryKeyTable, orm.Sequence, error) { groupPolicyTable, err := orm.NewPrimaryKeyTable([2]byte{groupkeeper.GroupPolicyTablePrefix}, &group.GroupPolicyInfo{}, cdc) if err != nil { panic(err.Error()) @@ -66,8 +70,18 @@ func createGroupPolicies(ctx sdk.Context, storeService corestore.KVStoreService, groupPolicySeq := orm.NewSequence(v2.GroupPolicyTableSeqPrefix) kvStore := storeService.OpenKVStore(ctx) + authorityStrAddr, err := addressCodec.BytesToString(authorityAddr) + if err != nil { + return orm.PrimaryKeyTable{}, orm.Sequence{}, err + } + for _, policyAddr := range policies { - groupPolicyInfo, err := group.NewGroupPolicyInfo(policyAddr, 1, authorityAddr, "", 1, group.NewPercentageDecisionPolicy("1", 1, 1), ctx.HeaderInfo().Time) + policyStrAddr, err := addressCodec.BytesToString(policyAddr) + if err != nil { + return orm.PrimaryKeyTable{}, orm.Sequence{}, err + } + + groupPolicyInfo, err := group.NewGroupPolicyInfo(policyStrAddr, 1, authorityStrAddr, "", 1, group.NewPercentageDecisionPolicy("1", 1, 1), ctx.HeaderInfo().Time) if err != nil { return orm.PrimaryKeyTable{}, orm.Sequence{}, err } @@ -83,20 +97,33 @@ func createGroupPolicies(ctx sdk.Context, storeService corestore.KVStoreService, } // createOldPolicyAccount re-creates the group policy account using a module account -func createOldPolicyAccount(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.Codec, policies []sdk.AccAddress) ([]*authtypes.ModuleAccount, group.AccountKeeper) { - accountKeeper := authkeeper.NewAccountKeeper(runtime.NewEnvironment(runtime.NewKVStoreService(storeKey.(*storetypes.KVStoreKey)), log.NewNopLogger()), cdc, authtypes.ProtoBaseAccount, nil, addresscodec.NewBech32Codec(sdk.Bech32MainPrefix), sdk.Bech32MainPrefix, authorityAddr.String()) +func createOldPolicyAccount(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.Codec, policies []sdk.AccAddress) ([]*authtypes.ModuleAccount, group.AccountKeeper, error) { + addressCodec := addresscodec.NewBech32Codec(sdk.Bech32MainPrefix) + authorityStrAddr, err := addressCodec.BytesToString(authorityAddr) + if err != nil { + return nil, nil, err + } + // gomock initializations + ctrl := gomock.NewController(&testing.T{}) + acctsModKeeper := authtestutil.NewMockAccountsModKeeper(ctrl) + + accountKeeper := authkeeper.NewAccountKeeper(runtime.NewEnvironment(runtime.NewKVStoreService(storeKey.(*storetypes.KVStoreKey)), log.NewNopLogger()), cdc, authtypes.ProtoBaseAccount, acctsModKeeper, nil, addressCodec, sdk.Bech32MainPrefix, authorityStrAddr) oldPolicyAccounts := make([]*authtypes.ModuleAccount, len(policies)) for i, policyAddr := range policies { + policyStrAddr, err := addressCodec.BytesToString(policyAddr) + if err != nil { + return nil, nil, err + } acc := accountKeeper.NewAccount(ctx, &authtypes.ModuleAccount{ BaseAccount: &authtypes.BaseAccount{ - Address: policyAddr.String(), + Address: policyStrAddr, }, - Name: policyAddr.String(), + Name: policyStrAddr, }) accountKeeper.SetAccount(ctx, acc) oldPolicyAccounts[i] = acc.(*authtypes.ModuleAccount) } - return oldPolicyAccounts, accountKeeper + return oldPolicyAccounts, accountKeeper, nil } diff --git a/x/group/msgs.go b/x/group/msgs.go index 59793d79adb3..d9aad25d63b3 100644 --- a/x/group/msgs.go +++ b/x/group/msgs.go @@ -89,10 +89,10 @@ func (m MsgCreateGroupWithPolicy) UnpackInterfaces(unpacker types.AnyUnpacker) e } // NewMsgUpdateGroupPolicyDecisionPolicy creates a new MsgUpdateGroupPolicyDecisionPolicy. -func NewMsgUpdateGroupPolicyDecisionPolicy(admin, address sdk.AccAddress, decisionPolicy DecisionPolicy) (*MsgUpdateGroupPolicyDecisionPolicy, error) { +func NewMsgUpdateGroupPolicyDecisionPolicy(admin, address string, decisionPolicy DecisionPolicy) (*MsgUpdateGroupPolicyDecisionPolicy, error) { m := &MsgUpdateGroupPolicyDecisionPolicy{ - Admin: admin.String(), - GroupPolicyAddress: address.String(), + Admin: admin, + GroupPolicyAddress: address, } err := m.SetDecisionPolicy(decisionPolicy) if err != nil { @@ -132,9 +132,9 @@ func (m MsgUpdateGroupPolicyDecisionPolicy) UnpackInterfaces(unpacker types.AnyU } // NewMsgCreateGroupPolicy creates a new MsgCreateGroupPolicy. -func NewMsgCreateGroupPolicy(admin sdk.AccAddress, group uint64, metadata string, decisionPolicy DecisionPolicy) (*MsgCreateGroupPolicy, error) { +func NewMsgCreateGroupPolicy(admin string, group uint64, metadata string, decisionPolicy DecisionPolicy) (*MsgCreateGroupPolicy, error) { m := &MsgCreateGroupPolicy{ - Admin: admin.String(), + Admin: admin, GroupId: group, Metadata: metadata, } diff --git a/x/group/proto/buf.gen.gogo.yaml b/x/group/proto/buf.gen.gogo.yaml index 9c8ba0a4b1fd..db36231d0c82 100644 --- a/x/group/proto/buf.gen.gogo.yaml +++ b/x/group/proto/buf.gen.gogo.yaml @@ -2,7 +2,7 @@ version: v1 plugins: - name: gocosmos out: .. - opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any - name: grpc-gateway out: .. opt: logtostderr=true,allow_colon_final_segments=true diff --git a/x/group/simulation/decoder_test.go b/x/group/simulation/decoder_test.go index 6eee5a2fbd63..109d2b739ac9 100644 --- a/x/group/simulation/decoder_test.go +++ b/x/group/simulation/decoder_test.go @@ -28,14 +28,18 @@ func TestDecodeStore(t *testing.T) { require.NoError(t, err) _, _, addr := testdata.KeyTestPubAddr() + addrStr, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(addr) + require.NoError(t, err) member := group.GroupMember{GroupId: 1, Member: &group.Member{ - Address: addr.String(), + Address: addrStr, }} memberBz, err := cdc.Marshal(&member) require.NoError(t, err) _, _, accAddr := testdata.KeyTestPubAddr() - acc := group.GroupPolicyInfo{Address: accAddr.String()} + accStrAddr, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(accAddr) + require.NoError(t, err) + acc := group.GroupPolicyInfo{Address: accStrAddr} accBz, err := cdc.Marshal(&acc) require.NoError(t, err) @@ -43,7 +47,7 @@ func TestDecodeStore(t *testing.T) { proposalBz, err := cdc.Marshal(&proposal) require.NoError(t, err) - vote := group.Vote{Voter: addr.String(), ProposalId: 1} + vote := group.Vote{Voter: addrStr, ProposalId: 1} voteBz, err := cdc.Marshal(&vote) require.NoError(t, err) diff --git a/x/group/simulation/genesis.go b/x/group/simulation/genesis.go index 00f58a3ef7e9..2049e8a4ac15 100644 --- a/x/group/simulation/genesis.go +++ b/x/group/simulation/genesis.go @@ -4,6 +4,7 @@ import ( "math/rand" "time" + "cosmossdk.io/core/address" banktypes "cosmossdk.io/x/bank/types" "cosmossdk.io/x/group" @@ -21,23 +22,26 @@ const ( GroupVote = "group-vote" ) -func checkAccExists(acc sdk.AccAddress, g []*group.GroupMember, lastIndex int) bool { - s := acc.String() +func checkAccExists(acc string, g []*group.GroupMember, lastIndex int) bool { for i := 0; i < lastIndex; i++ { - if g[i].Member.Address == s { + if g[i].Member.Address == acc { return true } } return false } -func getGroups(r *rand.Rand, accounts []simtypes.Account) []*group.GroupInfo { +func getGroups(r *rand.Rand, accounts []simtypes.Account, addressCodec address.Codec) []*group.GroupInfo { groups := make([]*group.GroupInfo, 3) for i := 0; i < 3; i++ { acc, _ := simtypes.RandomAcc(r, accounts) + accAddr, err := addressCodec.BytesToString(acc.Address) + if err != nil { + return nil + } groups[i] = &group.GroupInfo{ Id: uint64(i + 1), - Admin: acc.Address.String(), + Admin: accAddr, Metadata: simtypes.RandStringOfLength(r, 10), Version: 1, TotalWeight: "10", @@ -46,17 +50,25 @@ func getGroups(r *rand.Rand, accounts []simtypes.Account) []*group.GroupInfo { return groups } -func getGroupMembers(r *rand.Rand, accounts []simtypes.Account) []*group.GroupMember { +func getGroupMembers(r *rand.Rand, accounts []simtypes.Account, addressCodec address.Codec) []*group.GroupMember { groupMembers := make([]*group.GroupMember, 3) for i := 0; i < 3; i++ { acc, _ := simtypes.RandomAcc(r, accounts) - for checkAccExists(acc.Address, groupMembers, i) { + accAddr, err := addressCodec.BytesToString(acc.Address) + if err != nil { + return nil + } + for checkAccExists(accAddr, groupMembers, i) { acc, _ = simtypes.RandomAcc(r, accounts) + accAddr, err = addressCodec.BytesToString(acc.Address) + if err != nil { + return nil + } } groupMembers[i] = &group.GroupMember{ GroupId: uint64(i + 1), Member: &group.Member{ - Address: acc.Address.String(), + Address: accAddr, Weight: "10", Metadata: simtypes.RandStringOfLength(r, 10), }, @@ -71,8 +83,11 @@ func getGroupPolicies(r *rand.Rand, simState *module.SimulationState) []*group.G usedAccs := make(map[string]bool) for i := 0; i < 3; i++ { acc, _ := simtypes.RandomAcc(r, simState.Accounts) - - if usedAccs[acc.Address.String()] { + accAddr, err := simState.AddressCodec.BytesToString(acc.Address) + if err != nil { + return nil + } + if usedAccs[accAddr] { if len(usedAccs) != len(simState.Accounts) { // Go again if the account is used and there are more to take from i-- @@ -80,7 +95,7 @@ func getGroupPolicies(r *rand.Rand, simState *module.SimulationState) []*group.G continue } - usedAccs[acc.Address.String()] = true + usedAccs[accAddr] = true any, err := codectypes.NewAnyWithValue(group.NewThresholdDecisionPolicy("10", time.Second, 0)) if err != nil { @@ -88,8 +103,8 @@ func getGroupPolicies(r *rand.Rand, simState *module.SimulationState) []*group.G } groupPolicies = append(groupPolicies, &group.GroupPolicyInfo{ GroupId: uint64(i + 1), - Admin: acc.Address.String(), - Address: acc.Address.String(), + Admin: accAddr, + Address: accAddr, Version: 1, DecisionPolicy: any, Metadata: simtypes.RandStringOfLength(r, 10), @@ -100,7 +115,15 @@ func getGroupPolicies(r *rand.Rand, simState *module.SimulationState) []*group.G func getProposals(r *rand.Rand, simState *module.SimulationState, groupPolicies []*group.GroupPolicyInfo) []*group.Proposal { proposals := make([]*group.Proposal, 3) - proposers := []string{simState.Accounts[0].Address.String(), simState.Accounts[1].Address.String()} + addr0, err := simState.AddressCodec.BytesToString(simState.Accounts[0].Address) + if err != nil { + panic(err) + } + addr1, err := simState.AddressCodec.BytesToString(simState.Accounts[1].Address) + if err != nil { + panic(err) + } + proposers := []string{addr0, addr1} for i := 0; i < 3; i++ { idx := r.Intn(len(groupPolicies)) groupPolicyAddress := groupPolicies[idx].Address @@ -127,9 +150,15 @@ func getProposals(r *rand.Rand, simState *module.SimulationState, groupPolicies SubmitTime: submittedAt, VotingPeriodEnd: timeout, } - err := proposal.SetMsgs([]sdk.Msg{&banktypes.MsgSend{ + + toAddr, err := simState.AddressCodec.BytesToString(to.Address) + if err != nil { + panic(err) + } + + err = proposal.SetMsgs([]sdk.Msg{&banktypes.MsgSend{ FromAddress: groupPolicyAddress, - ToAddress: to.Address.String(), + ToAddress: toAddr, Amount: sdk.NewCoins(sdk.NewInt64Coin("test", 10)), }}) if err != nil { @@ -146,9 +175,13 @@ func getVotes(r *rand.Rand, simState *module.SimulationState) []*group.Vote { votes := make([]*group.Vote, 3) for i := 0; i < 3; i++ { + voterAddr, err := simState.AddressCodec.BytesToString(simState.Accounts[i].Address) + if err != nil { + return nil + } votes[i] = &group.Vote{ ProposalId: uint64(i + 1), - Voter: simState.Accounts[i].Address.String(), + Voter: voterAddr, Option: getVoteOption(i), Metadata: simtypes.RandStringOfLength(r, 50), SubmitTime: time.Unix(0, 0), @@ -180,11 +213,11 @@ func RandomizedGenState(simState *module.SimulationState) { // groups var groups []*group.GroupInfo - simState.AppParams.GetOrGenerate(GroupInfo, &groups, simState.Rand, func(r *rand.Rand) { groups = getGroups(r, simState.Accounts) }) + simState.AppParams.GetOrGenerate(GroupInfo, &groups, simState.Rand, func(r *rand.Rand) { groups = getGroups(r, simState.Accounts, simState.AddressCodec) }) // group members var members []*group.GroupMember - simState.AppParams.GetOrGenerate(GroupMembers, &members, simState.Rand, func(r *rand.Rand) { members = getGroupMembers(r, simState.Accounts) }) + simState.AppParams.GetOrGenerate(GroupMembers, &members, simState.Rand, func(r *rand.Rand) { members = getGroupMembers(r, simState.Accounts, simState.AddressCodec) }) // group policies var groupPolicies []*group.GroupPolicyInfo diff --git a/x/group/simulation/operations.go b/x/group/simulation/operations.go index 392ac9c27539..df64641858cd 100644 --- a/x/group/simulation/operations.go +++ b/x/group/simulation/operations.go @@ -7,6 +7,7 @@ import ( "strings" "time" + "cosmossdk.io/core/address" "cosmossdk.io/x/group" "cosmossdk.io/x/group/keeper" @@ -228,7 +229,10 @@ func SimulateMsgCreateGroup( ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { acc, _ := simtypes.RandomAcc(r, accounts) account := ak.GetAccount(ctx, acc.Address) - accAddr := acc.Address.String() + accAddr, err := ak.AddressCodec().BytesToString(acc.Address) + if err != nil { + return simtypes.NoOpMsg(group.ModuleName, TypeMsgCreateGroup, "error getting account address"), nil, err + } spendableCoins := bk.SpendableCoins(ctx, account.GetAddress()) fees, err := simtypes.RandomFees(r, spendableCoins) @@ -236,7 +240,10 @@ func SimulateMsgCreateGroup( return simtypes.NoOpMsg(group.ModuleName, TypeMsgCreateGroup, "fee error"), nil, err } - members := genGroupMembers(r, accounts) + members, err := genGroupMembers(r, accounts, ak.AddressCodec()) + if err != nil { + return simtypes.NoOpMsg(group.ModuleName, TypeMsgCreateGroup, "error generating group members"), nil, err + } msg := &group.MsgCreateGroup{Admin: accAddr, Members: members, Metadata: simtypes.RandStringOfLength(r, 10)} tx, err := simtestutil.GenSignedMockTx( @@ -275,7 +282,10 @@ func SimulateMsgCreateGroupWithPolicy( ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { acc, _ := simtypes.RandomAcc(r, accounts) account := ak.GetAccount(ctx, acc.Address) - accAddr := acc.Address.String() + accAddr, err := ak.AddressCodec().BytesToString(acc.Address) + if err != nil { + return simtypes.NoOpMsg(group.ModuleName, TypeMsgCreateGroup, "error getting account address"), nil, err + } spendableCoins := bk.SpendableCoins(ctx, account.GetAddress()) fees, err := simtypes.RandomFees(r, spendableCoins) @@ -283,7 +293,10 @@ func SimulateMsgCreateGroupWithPolicy( return simtypes.NoOpMsg(group.ModuleName, TypeMsgCreateGroup, "fee error"), nil, err } - members := genGroupMembers(r, accounts) + members, err := genGroupMembers(r, accounts, ak.AddressCodec()) + if err != nil { + return simtypes.NoOpMsg(group.ModuleName, TypeMsgCreateGroup, "error generating group members"), nil, err + } decisionPolicy := &group.ThresholdDecisionPolicy{ Threshold: fmt.Sprintf("%d", simtypes.RandIntBetween(r, 1, 10)), Windows: &group.DecisionPolicyWindows{ @@ -353,8 +366,13 @@ func SimulateMsgCreateGroupPolicy( return simtypes.NoOpMsg(group.ModuleName, TypeMsgCreateGroupPolicy, "fee error"), nil, err } + accAddr, err := ak.AddressCodec().BytesToString(acc.Address) + if err != nil { + return simtypes.NoOpMsg(group.ModuleName, TypeMsgCreateGroupPolicy, "error generating admin address"), nil, err + } + msg, err := group.NewMsgCreateGroupPolicy( - acc.Address, + accAddr, groupID, simtypes.RandStringOfLength(r, 10), &group.ThresholdDecisionPolicy{ @@ -442,9 +460,14 @@ func SimulateMsgSubmitProposal( return simtypes.NoOpMsg(group.ModuleName, TypeMsgSubmitProposal, "fee error"), nil, err } + accAddr, err := ak.AddressCodec().BytesToString(acc.Address) + if err != nil { + return simtypes.NoOpMsg(group.ModuleName, TypeMsgSubmitProposal, "error getting account address"), nil, err + } + msg := &group.MsgSubmitProposal{ GroupPolicyAddress: groupPolicyAddr, - Proposers: []string{acc.Address.String()}, + Proposers: []string{accAddr}, Metadata: simtypes.RandStringOfLength(r, 10), Title: "Test Proposal", Summary: "Summary of the proposal", @@ -509,10 +532,18 @@ func SimulateMsgUpdateGroupAdmin( newAdmin, _ = simtypes.RandomAcc(r, accounts) } + accAddr, err := ak.AddressCodec().BytesToString(account.GetAddress()) + if err != nil { + return simtypes.NoOpMsg(group.ModuleName, TypeMsgUpdateGroupAdmin, "error getting admin address"), nil, err + } + newAdminAddr, err := ak.AddressCodec().BytesToString(newAdmin.Address) + if err != nil { + return simtypes.NoOpMsg(group.ModuleName, TypeMsgUpdateGroupAdmin, "error getting new admin address"), nil, err + } msg := &group.MsgUpdateGroupAdmin{ GroupId: groupID, - Admin: account.GetAddress().String(), - NewAdmin: newAdmin.Address.String(), + Admin: accAddr, + NewAdmin: newAdminAddr, } tx, err := simtestutil.GenSignedMockTx( @@ -565,9 +596,13 @@ func SimulateMsgUpdateGroupMetadata( return simtypes.NoOpMsg(group.ModuleName, TypeMsgUpdateGroupMetadata, "fee error"), nil, err } + adminAddr, err := ak.AddressCodec().BytesToString(account.GetAddress()) + if err != nil { + return simtypes.NoOpMsg(group.ModuleName, TypeMsgUpdateGroupMetadata, "error getting admin address"), nil, err + } msg := &group.MsgUpdateGroupMetadata{ GroupId: groupID, - Admin: account.GetAddress().String(), + Admin: adminAddr, Metadata: simtypes.RandStringOfLength(r, 10), } @@ -621,7 +656,10 @@ func SimulateMsgUpdateGroupMembers( return simtypes.NoOpMsg(group.ModuleName, TypeMsgUpdateGroupMembers, "fee error"), nil, err } - members := genGroupMembers(r, accounts) + members, err := genGroupMembers(r, accounts, ak.AddressCodec()) + if err != nil { + return simtypes.NoOpMsg(group.ModuleName, TypeMsgCreateGroup, "error generating group members"), nil, err + } ctx := sdk.UnwrapSDKContext(sdkCtx) res, err := k.GroupMembers(ctx, &group.QueryGroupMembersRequest{GroupId: groupID}) if err != nil { @@ -648,9 +686,13 @@ func SimulateMsgUpdateGroupMembers( } } + adminAddr, err := ak.AddressCodec().BytesToString(acc.Address) + if err != nil { + return simtypes.NoOpMsg(group.ModuleName, TypeMsgUpdateGroupMembers, "error getting admin address"), nil, err + } msg := &group.MsgUpdateGroupMembers{ GroupId: groupID, - Admin: acc.Address.String(), + Admin: adminAddr, MemberUpdates: members, } @@ -713,10 +755,18 @@ func SimulateMsgUpdateGroupPolicyAdmin( newAdmin, _ = simtypes.RandomAcc(r, accounts) } + adminAddr, err := ak.AddressCodec().BytesToString(acc.Address) + if err != nil { + return simtypes.NoOpMsg(group.ModuleName, TypeMsgUpdateGroupPolicyAdmin, "error getting admin address"), nil, err + } + newAdminAddr, err := ak.AddressCodec().BytesToString(newAdmin.Address) + if err != nil { + return simtypes.NoOpMsg(group.ModuleName, TypeMsgUpdateGroupPolicyAdmin, "error getting new admin address"), nil, err + } msg := &group.MsgUpdateGroupPolicyAdmin{ - Admin: acc.Address.String(), + Admin: adminAddr, GroupPolicyAddress: groupPolicyAddr, - NewAdmin: newAdmin.Address.String(), + NewAdmin: newAdminAddr, } tx, err := simtestutil.GenSignedMockTx( @@ -774,7 +824,16 @@ func SimulateMsgUpdateGroupPolicyDecisionPolicy( return simtypes.NoOpMsg(group.ModuleName, TypeMsgUpdateGroupPolicyDecisionPolicy, fmt.Sprintf("fail to decide bech32 address: %s", err.Error())), nil, nil } - msg, err := group.NewMsgUpdateGroupPolicyDecisionPolicy(acc.Address, groupPolicyBech32, &group.ThresholdDecisionPolicy{ + accAddr, err := ak.AddressCodec().BytesToString(acc.Address) + if err != nil { + return simtypes.NoOpMsg(group.ModuleName, TypeMsgUpdateGroupPolicyDecisionPolicy, "error getting admin address"), nil, err + } + groupPolicyStrAddr, err := ak.AddressCodec().BytesToString(groupPolicyBech32) + if err != nil { + return simtypes.NoOpMsg(group.ModuleName, TypeMsgUpdateGroupPolicyDecisionPolicy, "error group policy admin address"), nil, err + } + + msg, err := group.NewMsgUpdateGroupPolicyDecisionPolicy(accAddr, groupPolicyStrAddr, &group.ThresholdDecisionPolicy{ Threshold: fmt.Sprintf("%d", simtypes.RandIntBetween(r, 1, 10)), Windows: &group.DecisionPolicyWindows{ VotingPeriod: time.Second * time.Duration(simtypes.RandIntBetween(r, 100, 1000)), @@ -833,8 +892,12 @@ func SimulateMsgUpdateGroupPolicyMetadata( return simtypes.NoOpMsg(group.ModuleName, TypeMsgUpdateGroupPolicyMetadata, "fee error"), nil, err } + adminAddr, err := ak.AddressCodec().BytesToString(acc.Address) + if err != nil { + return simtypes.NoOpMsg(group.ModuleName, TypeMsgUpdateGroupPolicyMetadata, "error getting admin address"), nil, err + } msg := &group.MsgUpdateGroupPolicyMetadata{ - Admin: acc.Address.String(), + Admin: adminAddr, GroupPolicyAddress: groupPolicyAddr, Metadata: simtypes.RandStringOfLength(r, 10), } @@ -928,7 +991,10 @@ func SimulateMsgWithdrawProposal( // select a random proposer proposers := proposal.Proposers n := randIntInRange(r, len(proposers)) - proposerIdx := findAccount(accounts, proposers[n]) + proposerIdx, err := findAccount(accounts, proposers[n], ak.AddressCodec()) + if err != nil { + return simtypes.NoOpMsg(group.ModuleName, TypeMsgWithdrawProposal, "could not find account"), nil, err + } proposer := accounts[proposerIdx] proposerAcc := ak.GetAccount(sdkCtx, proposer.Address) @@ -938,9 +1004,14 @@ func SimulateMsgWithdrawProposal( return simtypes.NoOpMsg(group.ModuleName, TypeMsgWithdrawProposal, "fee error"), nil, err } + proposerAddr, err := ak.AddressCodec().BytesToString(proposer.Address) + if err != nil { + return simtypes.NoOpMsg(group.ModuleName, TypeMsgWithdrawProposal, "error getting voter address"), nil, err + } + msg := &group.MsgWithdrawProposal{ ProposalId: uint64(proposalID), - Address: proposer.Address.String(), + Address: proposerAddr, } tx, err := simtestutil.GenSignedMockTx( @@ -1035,9 +1106,14 @@ func SimulateMsgVote( return simtypes.NoOpMsg(group.ModuleName, TypeMsgVote, "no proposals found"), nil, nil } + voterAddr, err := ak.AddressCodec().BytesToString(acc.Address) + if err != nil { + return simtypes.NoOpMsg(group.ModuleName, TypeMsgVote, "error getting voter address"), nil, err + } + // Ensure member hasn't already voted res, _ := k.VoteByProposalVoter(sdkCtx, &group.QueryVoteByProposalVoterRequest{ - Voter: acc.Address.String(), + Voter: voterAddr, ProposalId: uint64(proposalID), }) if res != nil { @@ -1046,7 +1122,7 @@ func SimulateMsgVote( msg := &group.MsgVote{ ProposalId: uint64(proposalID), - Voter: acc.Address.String(), + Voter: voterAddr, Option: group.VOTE_OPTION_YES, Metadata: simtypes.RandStringOfLength(r, 10), } @@ -1126,9 +1202,13 @@ func SimulateMsgExec( return simtypes.NoOpMsg(group.ModuleName, TypeMsgExec, "no proposals found"), nil, nil } + accAddr, err := ak.AddressCodec().BytesToString(acc.Address) + if err != nil { + return simtypes.NoOpMsg(group.ModuleName, TypeMsgExec, "error getting executor address"), nil, err + } msg := &group.MsgExec{ ProposalId: uint64(proposalID), - Executor: acc.Address.String(), + Executor: accAddr, } tx, err := simtestutil.GenSignedMockTx( r, @@ -1192,8 +1272,12 @@ func SimulateMsgLeaveGroup( return simtypes.NoOpMsg(group.ModuleName, TypeMsgLeaveGroup, "fee error"), nil, err } + accAddr, err := ak.AddressCodec().BytesToString(acc.Address) + if err != nil { + return simtypes.NoOpMsg(group.ModuleName, TypeMsgLeaveGroup, "error getting account address"), nil, err + } msg := &group.MsgLeaveGroup{ - Address: acc.Address.String(), + Address: accAddr, GroupId: groupInfo.Id, } @@ -1252,7 +1336,11 @@ func randomGroup(r *rand.Rand, k keeper.Keeper, ak group.AccountKeeper, groupAdmin := groupInfo.Admin found := -1 for i := range accounts { - if accounts[i].Address.String() == groupAdmin { + addr, err := ak.AddressCodec().BytesToString(accounts[i].Address) + if err != nil { + return nil, simtypes.Account{}, nil, err + } + if addr == groupAdmin { found = i break } @@ -1288,7 +1376,11 @@ func randomGroupPolicy(r *rand.Rand, k keeper.Keeper, ak group.AccountKeeper, } groupPolicyInfo = result.GroupPolicies[n] - idx := findAccount(accounts, groupPolicyInfo.Admin) + idx, err := findAccount(accounts, groupPolicyInfo.Admin, ak.AddressCodec()) + if err != nil { + return groupInfo, nil, simtypes.Account{}, nil, nil + } + if idx < 0 { return groupInfo, nil, simtypes.Account{}, nil, nil } @@ -1310,7 +1402,10 @@ func randomMember(ctx context.Context, r *rand.Rand, k keeper.Keeper, ak group.A if n < 0 { return simtypes.Account{}, nil, err } - idx := findAccount(accounts, res.Members[n].Member.Address) + idx, err := findAccount(accounts, res.Members[n].Member.Address, ak.AddressCodec()) + if err != nil { + return simtypes.Account{}, nil, err + } if idx < 0 { return simtypes.Account{}, nil, err } @@ -1329,26 +1424,34 @@ func randIntInRange(r *rand.Rand, l int) int { return simtypes.RandIntBetween(r, 0, l-1) } -func findAccount(accounts []simtypes.Account, addr string) (idx int) { +func findAccount(accounts []simtypes.Account, addr string, addressCodec address.Codec) (idx int, err error) { idx = -1 for i := range accounts { - if accounts[i].Address.String() == addr { + accAddr, err := addressCodec.BytesToString(accounts[i].Address) + if err != nil { + return idx, err + } + if accAddr == addr { idx = i break } } - return idx + return idx, err } -func genGroupMembers(r *rand.Rand, accounts []simtypes.Account) []group.MemberRequest { +func genGroupMembers(r *rand.Rand, accounts []simtypes.Account, addressCodec address.Codec) ([]group.MemberRequest, error) { if len(accounts) == 1 { + addr, err := addressCodec.BytesToString(accounts[0].Address) + if err != nil { + return nil, err + } return []group.MemberRequest{ { - Address: accounts[0].Address.String(), + Address: addr, Weight: fmt.Sprintf("%d", simtypes.RandIntBetween(r, 1, 10)), Metadata: simtypes.RandStringOfLength(r, 10), }, - } + }, nil } max := 5 @@ -1360,12 +1463,16 @@ func genGroupMembers(r *rand.Rand, accounts []simtypes.Account) []group.MemberRe members := make([]group.MemberRequest, membersLen) for i := 0; i < membersLen; i++ { + addr, err := addressCodec.BytesToString(accounts[i].Address) + if err != nil { + return nil, err + } members[i] = group.MemberRequest{ - Address: accounts[i].Address.String(), + Address: addr, Weight: fmt.Sprintf("%d", simtypes.RandIntBetween(r, 1, 10)), Metadata: simtypes.RandStringOfLength(r, 10), } } - return members + return members, nil } diff --git a/x/group/simulation/operations_test.go b/x/group/simulation/operations_test.go index 433764d3f5fd..19b8a1cb0f51 100644 --- a/x/group/simulation/operations_test.go +++ b/x/group/simulation/operations_test.go @@ -130,6 +130,8 @@ func (suite *SimTestSuite) TestSimulateCreateGroup() { accounts := suite.getTestingAccounts(r, 1) acc := accounts[0] + accAddr, err := suite.accountKeeper.AddressCodec().BytesToString(acc.Address) + suite.Require().NoError(err) // execute operation op := simulation.SimulateMsgCreateGroup(codec.NewProtoCodec(suite.interfaceRegistry), suite.txConfig, suite.accountKeeper, suite.bankKeeper) @@ -140,7 +142,7 @@ func (suite *SimTestSuite) TestSimulateCreateGroup() { err = proto.Unmarshal(operationMsg.Msg, &msg) suite.Require().NoError(err) suite.Require().True(operationMsg.OK) - suite.Require().Equal(acc.Address.String(), msg.Admin) + suite.Require().Equal(accAddr, msg.Admin) suite.Require().Len(futureOperations, 0) } @@ -151,6 +153,8 @@ func (suite *SimTestSuite) TestSimulateCreateGroupWithPolicy() { accounts := suite.getTestingAccounts(r, 1) acc := accounts[0] + accAddr, err := suite.accountKeeper.AddressCodec().BytesToString(acc.Address) + suite.Require().NoError(err) // execute operation op := simulation.SimulateMsgCreateGroupWithPolicy(codec.NewProtoCodec(suite.interfaceRegistry), suite.txConfig, suite.accountKeeper, suite.bankKeeper) @@ -161,7 +165,7 @@ func (suite *SimTestSuite) TestSimulateCreateGroupWithPolicy() { err = proto.Unmarshal(operationMsg.Msg, &msg) suite.Require().NoError(err) suite.Require().True(operationMsg.OK) - suite.Require().Equal(acc.Address.String(), msg.Admin) + suite.Require().Equal(accAddr, msg.Admin) suite.Require().Len(futureOperations, 0) } @@ -171,14 +175,16 @@ func (suite *SimTestSuite) TestSimulateCreateGroupPolicy() { r := rand.New(s) accounts := suite.getTestingAccounts(r, 1) acc := accounts[0] + accAddr, err := suite.accountKeeper.AddressCodec().BytesToString(acc.Address) + suite.Require().NoError(err) // setup a group - _, err := suite.groupKeeper.CreateGroup(suite.ctx, + _, err = suite.groupKeeper.CreateGroup(suite.ctx, &group.MsgCreateGroup{ - Admin: acc.Address.String(), + Admin: accAddr, Members: []group.MemberRequest{ { - Address: acc.Address.String(), + Address: accAddr, Weight: "1", }, }, @@ -195,7 +201,7 @@ func (suite *SimTestSuite) TestSimulateCreateGroupPolicy() { err = proto.Unmarshal(operationMsg.Msg, &msg) suite.Require().NoError(err) suite.Require().True(operationMsg.OK) - suite.Require().Equal(acc.Address.String(), msg.Admin) + suite.Require().Equal(accAddr, msg.Admin) suite.Require().Len(futureOperations, 0) } @@ -205,15 +211,17 @@ func (suite *SimTestSuite) TestSimulateSubmitProposal() { r := rand.New(s) accounts := suite.getTestingAccounts(r, 1) acc := accounts[0] + accAddr, err := suite.accountKeeper.AddressCodec().BytesToString(acc.Address) + suite.Require().NoError(err) // setup a group ctx := suite.ctx groupRes, err := suite.groupKeeper.CreateGroup(ctx, &group.MsgCreateGroup{ - Admin: acc.Address.String(), + Admin: accAddr, Members: []group.MemberRequest{ { - Address: acc.Address.String(), + Address: accAddr, Weight: "1", }, }, @@ -223,7 +231,7 @@ func (suite *SimTestSuite) TestSimulateSubmitProposal() { // setup a group account accountReq := &group.MsgCreateGroupPolicy{ - Admin: acc.Address.String(), + Admin: accAddr, GroupId: groupRes.GroupId, } err = accountReq.SetDecisionPolicy(group.NewThresholdDecisionPolicy("1", time.Hour, 0)) @@ -250,10 +258,12 @@ func (suite *SimTestSuite) TestWithdrawProposal() { r := rand.New(s) accounts := suite.getTestingAccounts(r, 3) acc := accounts[0] + accAddr, err := suite.accountKeeper.AddressCodec().BytesToString(acc.Address) + suite.Require().NoError(err) // setup a group ctx := suite.ctx - addr := acc.Address.String() + addr := accAddr groupRes, err := suite.groupKeeper.CreateGroup(ctx, &group.MsgCreateGroup{ Admin: addr, @@ -308,10 +318,12 @@ func (suite *SimTestSuite) TestSimulateVote() { r := rand.New(s) accounts := suite.getTestingAccounts(r, 1) acc := accounts[0] + accAddr, err := suite.accountKeeper.AddressCodec().BytesToString(acc.Address) + suite.Require().NoError(err) // setup a group ctx := suite.ctx - addr := acc.Address.String() + addr := accAddr groupRes, err := suite.groupKeeper.CreateGroup(ctx, &group.MsgCreateGroup{ Admin: addr, @@ -367,10 +379,12 @@ func (suite *SimTestSuite) TestSimulateExec() { r := rand.New(s) accounts := suite.getTestingAccounts(r, 1) acc := accounts[0] + accAddr, err := suite.accountKeeper.AddressCodec().BytesToString(acc.Address) + suite.Require().NoError(err) // setup a group ctx := suite.ctx - addr := acc.Address.String() + addr := accAddr groupRes, err := suite.groupKeeper.CreateGroup(ctx, &group.MsgCreateGroup{ Admin: addr, @@ -434,14 +448,16 @@ func (suite *SimTestSuite) TestSimulateUpdateGroupAdmin() { r := rand.New(s) accounts := suite.getTestingAccounts(r, 2) acc := accounts[0] + accAddr, err := suite.accountKeeper.AddressCodec().BytesToString(acc.Address) + suite.Require().NoError(err) // setup a group - _, err := suite.groupKeeper.CreateGroup(suite.ctx, + _, err = suite.groupKeeper.CreateGroup(suite.ctx, &group.MsgCreateGroup{ - Admin: acc.Address.String(), + Admin: accAddr, Members: []group.MemberRequest{ { - Address: acc.Address.String(), + Address: accAddr, Weight: "1", }, }, @@ -458,7 +474,7 @@ func (suite *SimTestSuite) TestSimulateUpdateGroupAdmin() { err = proto.Unmarshal(operationMsg.Msg, &msg) suite.Require().NoError(err) suite.Require().True(operationMsg.OK) - suite.Require().Equal(acc.Address.String(), msg.Admin) + suite.Require().Equal(accAddr, msg.Admin) suite.Require().Len(futureOperations, 0) } @@ -468,14 +484,16 @@ func (suite *SimTestSuite) TestSimulateUpdateGroupMetadata() { r := rand.New(s) accounts := suite.getTestingAccounts(r, 2) acc := accounts[0] + accAddr, err := suite.accountKeeper.AddressCodec().BytesToString(acc.Address) + suite.Require().NoError(err) // setup a group - _, err := suite.groupKeeper.CreateGroup(suite.ctx, + _, err = suite.groupKeeper.CreateGroup(suite.ctx, &group.MsgCreateGroup{ - Admin: acc.Address.String(), + Admin: accAddr, Members: []group.MemberRequest{ { - Address: acc.Address.String(), + Address: accAddr, Weight: "1", }, }, @@ -492,7 +510,7 @@ func (suite *SimTestSuite) TestSimulateUpdateGroupMetadata() { err = proto.Unmarshal(operationMsg.Msg, &msg) suite.Require().NoError(err) suite.Require().True(operationMsg.OK) - suite.Require().Equal(acc.Address.String(), msg.Admin) + suite.Require().Equal(accAddr, msg.Admin) suite.Require().Len(futureOperations, 0) } @@ -502,14 +520,16 @@ func (suite *SimTestSuite) TestSimulateUpdateGroupMembers() { r := rand.New(s) accounts := suite.getTestingAccounts(r, 2) acc := accounts[0] + accAddr, err := suite.accountKeeper.AddressCodec().BytesToString(acc.Address) + suite.Require().NoError(err) // setup a group - _, err := suite.groupKeeper.CreateGroup(suite.ctx, + _, err = suite.groupKeeper.CreateGroup(suite.ctx, &group.MsgCreateGroup{ - Admin: acc.Address.String(), + Admin: accAddr, Members: []group.MemberRequest{ { - Address: acc.Address.String(), + Address: accAddr, Weight: "1", }, }, @@ -526,7 +546,7 @@ func (suite *SimTestSuite) TestSimulateUpdateGroupMembers() { err = proto.Unmarshal(operationMsg.Msg, &msg) suite.Require().NoError(err) suite.Require().True(operationMsg.OK) - suite.Require().Equal(acc.Address.String(), msg.Admin) + suite.Require().Equal(accAddr, msg.Admin) suite.Require().Len(futureOperations, 0) } @@ -536,15 +556,17 @@ func (suite *SimTestSuite) TestSimulateUpdateGroupPolicyAdmin() { r := rand.New(s) accounts := suite.getTestingAccounts(r, 2) acc := accounts[0] + accAddr, err := suite.accountKeeper.AddressCodec().BytesToString(acc.Address) + suite.Require().NoError(err) // setup a group ctx := suite.ctx groupRes, err := suite.groupKeeper.CreateGroup(ctx, &group.MsgCreateGroup{ - Admin: acc.Address.String(), + Admin: accAddr, Members: []group.MemberRequest{ { - Address: acc.Address.String(), + Address: accAddr, Weight: "1", }, }, @@ -554,7 +576,7 @@ func (suite *SimTestSuite) TestSimulateUpdateGroupPolicyAdmin() { // setup a group account accountReq := &group.MsgCreateGroupPolicy{ - Admin: acc.Address.String(), + Admin: accAddr, GroupId: groupRes.GroupId, } err = accountReq.SetDecisionPolicy(group.NewThresholdDecisionPolicy("1", time.Hour, 0)) @@ -581,15 +603,17 @@ func (suite *SimTestSuite) TestSimulateUpdateGroupPolicyDecisionPolicy() { r := rand.New(s) accounts := suite.getTestingAccounts(r, 2) acc := accounts[0] + accAddr, err := suite.accountKeeper.AddressCodec().BytesToString(acc.Address) + suite.Require().NoError(err) // setup a group ctx := suite.ctx groupRes, err := suite.groupKeeper.CreateGroup(ctx, &group.MsgCreateGroup{ - Admin: acc.Address.String(), + Admin: accAddr, Members: []group.MemberRequest{ { - Address: acc.Address.String(), + Address: accAddr, Weight: "1", }, }, @@ -599,7 +623,7 @@ func (suite *SimTestSuite) TestSimulateUpdateGroupPolicyDecisionPolicy() { // setup a group account accountReq := &group.MsgCreateGroupPolicy{ - Admin: acc.Address.String(), + Admin: accAddr, GroupId: groupRes.GroupId, } err = accountReq.SetDecisionPolicy(group.NewThresholdDecisionPolicy("1", time.Hour, 0)) @@ -626,15 +650,17 @@ func (suite *SimTestSuite) TestSimulateUpdateGroupPolicyMetadata() { r := rand.New(s) accounts := suite.getTestingAccounts(r, 2) acc := accounts[0] + accAddr, err := suite.accountKeeper.AddressCodec().BytesToString(acc.Address) + suite.Require().NoError(err) // setup a group ctx := suite.ctx groupRes, err := suite.groupKeeper.CreateGroup(ctx, &group.MsgCreateGroup{ - Admin: acc.Address.String(), + Admin: accAddr, Members: []group.MemberRequest{ { - Address: acc.Address.String(), + Address: accAddr, Weight: "1", }, }, @@ -644,7 +670,7 @@ func (suite *SimTestSuite) TestSimulateUpdateGroupPolicyMetadata() { // setup a group account accountReq := &group.MsgCreateGroupPolicy{ - Admin: acc.Address.String(), + Admin: accAddr, GroupId: groupRes.GroupId, } err = accountReq.SetDecisionPolicy(group.NewThresholdDecisionPolicy("1", time.Hour, 0)) @@ -673,26 +699,31 @@ func (suite *SimTestSuite) TestSimulateLeaveGroup() { // setup 4 account accounts := suite.getTestingAccounts(r, 4) admin := accounts[0] - member1 := accounts[1] - member2 := accounts[2] - member3 := accounts[3] + adminAddr, err := suite.accountKeeper.AddressCodec().BytesToString(admin.Address) + suite.Require().NoError(err) + member1, err := suite.accountKeeper.AddressCodec().BytesToString(accounts[1].Address) + suite.Require().NoError(err) + member2, err := suite.accountKeeper.AddressCodec().BytesToString(accounts[2].Address) + suite.Require().NoError(err) + member3, err := suite.accountKeeper.AddressCodec().BytesToString(accounts[3].Address) + suite.Require().NoError(err) // setup a group ctx := suite.ctx groupRes, err := suite.groupKeeper.CreateGroup(ctx, &group.MsgCreateGroup{ - Admin: admin.Address.String(), + Admin: adminAddr, Members: []group.MemberRequest{ { - Address: member1.Address.String(), + Address: member1, Weight: "1", }, { - Address: member2.Address.String(), + Address: member2, Weight: "2", }, { - Address: member3.Address.String(), + Address: member3, Weight: "1", }, }, @@ -702,7 +733,7 @@ func (suite *SimTestSuite) TestSimulateLeaveGroup() { // setup a group account accountReq := &group.MsgCreateGroupPolicy{ - Admin: admin.Address.String(), + Admin: adminAddr, GroupId: groupRes.GroupId, Metadata: "", } diff --git a/x/group/testutil/app_config.go b/x/group/testutil/app_config.go index f760be271998..d23caa88ebf2 100644 --- a/x/group/testutil/app_config.go +++ b/x/group/testutil/app_config.go @@ -1,6 +1,7 @@ package testutil import ( + _ "cosmossdk.io/x/accounts" // import as blank for app wiring _ "cosmossdk.io/x/auth" // import as blank for app wiring _ "cosmossdk.io/x/auth/tx/config" // import as blank for app wiring _ "cosmossdk.io/x/authz" // import as blank for app wiring @@ -15,6 +16,7 @@ import ( ) var AppConfig = configurator.NewAppConfig( + configurator.AccountsModule(), configurator.AuthModule(), configurator.BankModule(), configurator.StakingModule(), diff --git a/x/group/tx.pb.go b/x/group/tx.pb.go index 9dc7196a837c..27c588cf672d 100644 --- a/x/group/tx.pb.go +++ b/x/group/tx.pb.go @@ -7,12 +7,12 @@ import ( context "context" fmt "fmt" _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" + any "github.com/cosmos/gogoproto/types/any" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -487,7 +487,7 @@ type MsgCreateGroupPolicy struct { // metadata is any arbitrary metadata attached to the group policy. Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` // decision_policy specifies the group policy's decision policy. - DecisionPolicy *types.Any `protobuf:"bytes,4,opt,name=decision_policy,json=decisionPolicy,proto3" json:"decision_policy,omitempty"` + DecisionPolicy *any.Any `protobuf:"bytes,4,opt,name=decision_policy,json=decisionPolicy,proto3" json:"decision_policy,omitempty"` } func (m *MsgCreateGroupPolicy) Reset() { *m = MsgCreateGroupPolicy{} } @@ -684,7 +684,7 @@ type MsgCreateGroupWithPolicy struct { // and group policy admin. GroupPolicyAsAdmin bool `protobuf:"varint,5,opt,name=group_policy_as_admin,json=groupPolicyAsAdmin,proto3" json:"group_policy_as_admin,omitempty"` // decision_policy specifies the group policy's decision policy. - DecisionPolicy *types.Any `protobuf:"bytes,6,opt,name=decision_policy,json=decisionPolicy,proto3" json:"decision_policy,omitempty"` + DecisionPolicy *any.Any `protobuf:"bytes,6,opt,name=decision_policy,json=decisionPolicy,proto3" json:"decision_policy,omitempty"` } func (m *MsgCreateGroupWithPolicy) Reset() { *m = MsgCreateGroupWithPolicy{} } @@ -782,7 +782,7 @@ type MsgUpdateGroupPolicyDecisionPolicy struct { // group_policy_address is the account address of group policy. GroupPolicyAddress string `protobuf:"bytes,2,opt,name=group_policy_address,json=groupPolicyAddress,proto3" json:"group_policy_address,omitempty"` // decision_policy is the updated group policy's decision policy. - DecisionPolicy *types.Any `protobuf:"bytes,3,opt,name=decision_policy,json=decisionPolicy,proto3" json:"decision_policy,omitempty"` + DecisionPolicy *any.Any `protobuf:"bytes,3,opt,name=decision_policy,json=decisionPolicy,proto3" json:"decision_policy,omitempty"` } func (m *MsgUpdateGroupPolicyDecisionPolicy) Reset() { *m = MsgUpdateGroupPolicyDecisionPolicy{} } @@ -970,7 +970,7 @@ type MsgSubmitProposal struct { // metadata is any arbitrary metadata attached to the proposal. Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` // messages is a list of `sdk.Msg`s that will be executed if the proposal passes. - Messages []*types.Any `protobuf:"bytes,4,rep,name=messages,proto3" json:"messages,omitempty"` + Messages []*any.Any `protobuf:"bytes,4,rep,name=messages,proto3" json:"messages,omitempty"` // exec defines the mode of execution of the proposal, // whether it should be executed immediately on creation or not. // If so, proposers signatures are considered as Yes votes. @@ -4613,7 +4613,7 @@ func (m *MsgCreateGroupPolicy) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.DecisionPolicy == nil { - m.DecisionPolicy = &types.Any{} + m.DecisionPolicy = &any.Any{} } if err := m.DecisionPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -5127,7 +5127,7 @@ func (m *MsgCreateGroupWithPolicy) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.DecisionPolicy == nil { - m.DecisionPolicy = &types.Any{} + m.DecisionPolicy = &any.Any{} } if err := m.DecisionPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -5378,7 +5378,7 @@ func (m *MsgUpdateGroupPolicyDecisionPolicy) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.DecisionPolicy == nil { - m.DecisionPolicy = &types.Any{} + m.DecisionPolicy = &any.Any{} } if err := m.DecisionPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -5805,7 +5805,7 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Messages = append(m.Messages, &types.Any{}) + m.Messages = append(m.Messages, &any.Any{}) if err := m.Messages[len(m.Messages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/x/group/types.go b/x/group/types.go index 16d155565bde..3649bd0eb4b5 100644 --- a/x/group/types.go +++ b/x/group/types.go @@ -244,13 +244,13 @@ func (p PercentageDecisionPolicy) Allow(tally TallyResult, totalPower string) (D var _ orm.Validateable = GroupPolicyInfo{} // NewGroupPolicyInfo creates a new GroupPolicyInfo instance -func NewGroupPolicyInfo(address sdk.AccAddress, group uint64, admin sdk.AccAddress, metadata string, +func NewGroupPolicyInfo(address string, group uint64, admin, metadata string, version uint64, decisionPolicy DecisionPolicy, createdAt time.Time, ) (GroupPolicyInfo, error) { p := GroupPolicyInfo{ - Address: address.String(), + Address: address, GroupId: group, - Admin: admin.String(), + Admin: admin, Metadata: metadata, Version: version, CreatedAt: createdAt, diff --git a/x/group/types.pb.go b/x/group/types.pb.go index 868d4c5ba5a5..72070d5c0a9e 100644 --- a/x/group/types.pb.go +++ b/x/group/types.pb.go @@ -6,11 +6,11 @@ package group import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + any "github.com/cosmos/gogoproto/types/any" _ "google.golang.org/protobuf/types/known/durationpb" _ "google.golang.org/protobuf/types/known/timestamppb" io "io" @@ -650,7 +650,7 @@ type GroupPolicyInfo struct { // would create a different result on a running proposal. Version uint64 `protobuf:"varint,5,opt,name=version,proto3" json:"version,omitempty"` // decision_policy specifies the group policy's decision policy. - DecisionPolicy *types.Any `protobuf:"bytes,6,opt,name=decision_policy,json=decisionPolicy,proto3" json:"decision_policy,omitempty"` + DecisionPolicy *any.Any `protobuf:"bytes,6,opt,name=decision_policy,json=decisionPolicy,proto3" json:"decision_policy,omitempty"` // created_at is a timestamp specifying when a group policy was created. CreatedAt time.Time `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at"` } @@ -729,7 +729,7 @@ type Proposal struct { // executor_result is the final result of the proposal execution. Initial value is NotRun. ExecutorResult ProposalExecutorResult `protobuf:"varint,11,opt,name=executor_result,json=executorResult,proto3,enum=cosmos.group.v1.ProposalExecutorResult" json:"executor_result,omitempty"` // messages is a list of `sdk.Msg`s that will be executed if the proposal passes. - Messages []*types.Any `protobuf:"bytes,12,rep,name=messages,proto3" json:"messages,omitempty"` + Messages []*any.Any `protobuf:"bytes,12,rep,name=messages,proto3" json:"messages,omitempty"` // title is the title of the proposal // // Since: cosmos-sdk 0.47 @@ -3163,7 +3163,7 @@ func (m *GroupPolicyInfo) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.DecisionPolicy == nil { - m.DecisionPolicy = &types.Any{} + m.DecisionPolicy = &any.Any{} } if err := m.DecisionPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -3571,7 +3571,7 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Messages = append(m.Messages, &types.Any{}) + m.Messages = append(m.Messages, &any.Any{}) if err := m.Messages[len(m.Messages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/x/mint/README.md b/x/mint/README.md index 900615bbabb3..80198010dcb0 100644 --- a/x/mint/README.md +++ b/x/mint/README.md @@ -39,11 +39,11 @@ which should help provide some liquidity. It can be broken down in the following way: -* If the inflation rate is below the goal %-bonded the inflation rate will +* If the actual percentage of bonded tokens is below the goal %-bonded the inflation rate will increase until a maximum value is reached * If the goal % bonded (67% in Cosmos-Hub) is maintained, then the inflation rate will stay constant -* If the inflation rate is above the goal %-bonded the inflation rate will +* If the actual percentage of bonded tokens is above the goal %-bonded the inflation rate will decrease until a minimum value is reached @@ -61,7 +61,7 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/mint/v1beta1/ ### Params -The mint module stores it's params in state with the prefix of `0x01`, +The mint module stores its params in state with the prefix of `0x01`, it can be updated with governance or the address with authority. * Params: `mint/params -> legacy_amino(params)` @@ -91,7 +91,7 @@ type InflationCalculationFn func(ctx sdk.Context, minter Minter, params Params, The target annual inflation rate is recalculated each block. The inflation is also subject to a rate change (positive or negative) depending on the distance from the desired ratio (67%). The maximum rate change -possible is defined to be 13% per year, however the annual inflation is capped +possible is defined to be 13% per year, however, the annual inflation is capped as between 7% and 20%. ```go @@ -169,7 +169,7 @@ A user can query and interact with the `mint` module using the CLI. #### Query -The `query` commands allow users to query `mint` state. +The `query` commands allows users to query `mint` state. ```shell simd query mint --help @@ -177,7 +177,7 @@ simd query mint --help ##### annual-provisions -The `annual-provisions` command allow users to query the current minting annual provisions value +The `annual-provisions` command allows users to query the current minting annual provisions value ```shell simd query mint annual-provisions [flags] @@ -197,7 +197,7 @@ Example Output: ##### inflation -The `inflation` command allow users to query the current minting inflation value +The `inflation` command allows users to query the current minting inflation value ```shell simd query mint inflation [flags] @@ -217,7 +217,7 @@ Example Output: ##### params -The `params` command allow users to query the current minting parameters +The `params` command allows users to query the current minting parameters ```shell simd query mint params [flags] @@ -240,7 +240,7 @@ A user can query the `mint` module using gRPC endpoints. #### AnnualProvisions -The `AnnualProvisions` endpoint allow users to query the current minting annual provisions value +The `AnnualProvisions` endpoint allows users to query the current minting annual provisions value ```shell /cosmos.mint.v1beta1.Query/AnnualProvisions @@ -262,7 +262,7 @@ Example Output: #### Inflation -The `Inflation` endpoint allow users to query the current minting inflation value +The `Inflation` endpoint allows users to query the current minting inflation value ```shell /cosmos.mint.v1beta1.Query/Inflation @@ -284,7 +284,7 @@ Example Output: #### Params -The `Params` endpoint allow users to query the current minting parameters +The `Params` endpoint allows users to query the current minting parameters ```shell /cosmos.mint.v1beta1.Query/Params diff --git a/x/mint/go.mod b/x/mint/go.mod index 0a27a9f890d3..380446cc7213 100644 --- a/x/mint/go.mod +++ b/x/mint/go.mod @@ -15,13 +15,13 @@ require ( github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.4 github.com/cosmos/cosmos-sdk v0.51.0 - github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/gogoproto v1.4.12 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/stretchr/testify v1.9.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 - google.golang.org/grpc v1.62.1 + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de + google.golang.org/grpc v1.63.2 gotest.tools/v3 v3.5.1 ) @@ -48,7 +48,7 @@ require ( github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect - github.com/cometbft/cometbft v0.38.6 // indirect + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 // indirect github.com/cometbft/cometbft-db v0.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect @@ -59,7 +59,7 @@ require ( github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect @@ -105,7 +105,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -115,13 +115,13 @@ require ( github.com/mtibben/percent v0.2.1 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.0 // indirect github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.50.0 // indirect + github.com/prometheus/common v0.52.2 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect @@ -146,17 +146,17 @@ require ( gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 // indirect go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.21.0 // indirect + golang.org/x/crypto v0.22.0 // indirect golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.22.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.18.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/x/mint/go.sum b/x/mint/go.sum index 046ebfecd550..507f3ab80bd9 100644 --- a/x/mint/go.sum +++ b/x/mint/go.sum @@ -118,8 +118,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -141,8 +141,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/cosmos/iavl v1.0.0 h1:bw6t0Mv/mVCJvlMTOPHWLs5uUE3BRBfVWCRelOzl+so= github.com/cosmos/iavl v1.0.0/go.mod h1:CmTGqMnRnucjxbjduneZXT+0vPgNElYvdefjX2q9tYc= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= @@ -162,8 +162,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= @@ -449,8 +449,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -553,8 +553,8 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= @@ -595,8 +595,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= -github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -749,8 +749,8 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= @@ -799,8 +799,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -812,8 +812,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -868,12 +868,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -927,12 +927,12 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -950,8 +950,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/x/mint/keeper/abci.go b/x/mint/keeper/abci.go index 8c3c1b3a4b01..04677ad2f317 100644 --- a/x/mint/keeper/abci.go +++ b/x/mint/keeper/abci.go @@ -2,7 +2,6 @@ package keeper import ( "context" - "time" "cosmossdk.io/core/event" "cosmossdk.io/x/mint/types" @@ -13,7 +12,7 @@ import ( // BeginBlocker mints new tokens for the previous block. func (k Keeper) BeginBlocker(ctx context.Context, ic types.InflationCalculationFn) error { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) + defer telemetry.ModuleMeasureSince(types.ModuleName, telemetry.Now(), telemetry.MetricKeyBeginBlocker) // fetch stored minter & params minter, err := k.Minter.Get(ctx) diff --git a/x/mint/proto/buf.gen.gogo.yaml b/x/mint/proto/buf.gen.gogo.yaml index 9c8ba0a4b1fd..db36231d0c82 100644 --- a/x/mint/proto/buf.gen.gogo.yaml +++ b/x/mint/proto/buf.gen.gogo.yaml @@ -2,7 +2,7 @@ version: v1 plugins: - name: gocosmos out: .. - opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any - name: grpc-gateway out: .. opt: logtostderr=true,allow_colon_final_segments=true diff --git a/x/mint/simulation/proposals.go b/x/mint/simulation/proposals.go index 9ba75b4a6615..e1d5471bf970 100644 --- a/x/mint/simulation/proposals.go +++ b/x/mint/simulation/proposals.go @@ -32,7 +32,7 @@ func ProposalMsgs() []simtypes.WeightedProposalMsg { } // SimulateMsgUpdateParams returns a random MsgUpdateParams -func SimulateMsgUpdateParams(r *rand.Rand, _ sdk.Context, _ []simtypes.Account, _ coreaddress.Codec) (sdk.Msg, error) { +func SimulateMsgUpdateParams(r *rand.Rand, _ []simtypes.Account, _ coreaddress.Codec) (sdk.Msg, error) { // use the default gov module account address as authority var authority sdk.AccAddress = address.Module("gov") diff --git a/x/mint/simulation/proposals_test.go b/x/mint/simulation/proposals_test.go index 42d604b3e005..2f7ee4f85439 100644 --- a/x/mint/simulation/proposals_test.go +++ b/x/mint/simulation/proposals_test.go @@ -21,7 +21,6 @@ func TestProposalMsgs(t *testing.T) { s := rand.NewSource(1) r := rand.New(s) - ctx := sdk.NewContext(nil, true, nil) accounts := simtypes.RandomAccounts(r, 3) // execute ProposalMsgs function @@ -34,7 +33,7 @@ func TestProposalMsgs(t *testing.T) { assert.Equal(t, simulation.OpWeightMsgUpdateParams, w0.AppParamsKey()) assert.Equal(t, simulation.DefaultWeightMsgUpdateParams, w0.DefaultWeight()) - msg, err := w0.MsgSimulatorFn()(r, ctx, accounts, codectestutil.CodecOptions{}.GetAddressCodec()) + msg, err := w0.MsgSimulatorFn()(r, accounts, codectestutil.CodecOptions{}.GetAddressCodec()) assert.NilError(t, err) msgUpdateParams, ok := msg.(*types.MsgUpdateParams) assert.Assert(t, ok) diff --git a/x/nft/go.mod b/x/nft/go.mod index 1a4dbdcc36ef..478155bf7dd9 100644 --- a/x/nft/go.mod +++ b/x/nft/go.mod @@ -12,13 +12,13 @@ require ( cosmossdk.io/store v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.4 github.com/cosmos/cosmos-sdk v0.51.0 - github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/gogoproto v1.4.12 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/stretchr/testify v1.9.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 - google.golang.org/grpc v1.62.1 + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de + google.golang.org/grpc v1.63.2 ) require ( @@ -47,7 +47,7 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.6 // indirect + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 // indirect github.com/cometbft/cometbft-db v0.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect @@ -58,7 +58,7 @@ require ( github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect @@ -104,7 +104,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -114,13 +114,13 @@ require ( github.com/mtibben/percent v0.2.1 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.0 // indirect github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.50.0 // indirect + github.com/prometheus/common v0.52.2 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect @@ -145,17 +145,17 @@ require ( gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 // indirect go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.21.0 // indirect + golang.org/x/crypto v0.22.0 // indirect golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.22.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.18.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/x/nft/go.sum b/x/nft/go.sum index 046ebfecd550..507f3ab80bd9 100644 --- a/x/nft/go.sum +++ b/x/nft/go.sum @@ -118,8 +118,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -141,8 +141,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/cosmos/iavl v1.0.0 h1:bw6t0Mv/mVCJvlMTOPHWLs5uUE3BRBfVWCRelOzl+so= github.com/cosmos/iavl v1.0.0/go.mod h1:CmTGqMnRnucjxbjduneZXT+0vPgNElYvdefjX2q9tYc= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= @@ -162,8 +162,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= @@ -449,8 +449,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -553,8 +553,8 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= @@ -595,8 +595,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= -github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -749,8 +749,8 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= @@ -799,8 +799,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -812,8 +812,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -868,12 +868,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -927,12 +927,12 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -950,8 +950,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/x/nft/nft.pb.go b/x/nft/nft.pb.go index ff696d7aca55..3c51d2dcf6b0 100644 --- a/x/nft/nft.pb.go +++ b/x/nft/nft.pb.go @@ -5,8 +5,8 @@ package nft import ( fmt "fmt" - types "github.com/cosmos/cosmos-sdk/codec/types" proto "github.com/cosmos/gogoproto/proto" + any "github.com/cosmos/gogoproto/types/any" io "io" math "math" math_bits "math/bits" @@ -38,7 +38,7 @@ type Class struct { // uri_hash is a hash of the document pointed by uri. Optional UriHash string `protobuf:"bytes,6,opt,name=uri_hash,json=uriHash,proto3" json:"uri_hash,omitempty"` // data is the app specific metadata of the NFT class. Optional - Data *types.Any `protobuf:"bytes,7,opt,name=data,proto3" json:"data,omitempty"` + Data *any.Any `protobuf:"bytes,7,opt,name=data,proto3" json:"data,omitempty"` } func (m *Class) Reset() { *m = Class{} } @@ -116,7 +116,7 @@ func (m *Class) GetUriHash() string { return "" } -func (m *Class) GetData() *types.Any { +func (m *Class) GetData() *any.Any { if m != nil { return m.Data } @@ -134,7 +134,7 @@ type NFT struct { // uri_hash is a hash of the document pointed by uri UriHash string `protobuf:"bytes,4,opt,name=uri_hash,json=uriHash,proto3" json:"uri_hash,omitempty"` // data is an app specific data of the NFT. Optional - Data *types.Any `protobuf:"bytes,10,opt,name=data,proto3" json:"data,omitempty"` + Data *any.Any `protobuf:"bytes,10,opt,name=data,proto3" json:"data,omitempty"` } func (m *NFT) Reset() { *m = NFT{} } @@ -198,7 +198,7 @@ func (m *NFT) GetUriHash() string { return "" } -func (m *NFT) GetData() *types.Any { +func (m *NFT) GetData() *any.Any { if m != nil { return m.Data } @@ -710,7 +710,7 @@ func (m *Class) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Data == nil { - m.Data = &types.Any{} + m.Data = &any.Any{} } if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -924,7 +924,7 @@ func (m *NFT) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Data == nil { - m.Data = &types.Any{} + m.Data = &any.Any{} } if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/x/nft/proto/buf.gen.gogo.yaml b/x/nft/proto/buf.gen.gogo.yaml index 9c8ba0a4b1fd..db36231d0c82 100644 --- a/x/nft/proto/buf.gen.gogo.yaml +++ b/x/nft/proto/buf.gen.gogo.yaml @@ -2,7 +2,7 @@ version: v1 plugins: - name: gocosmos out: .. - opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any - name: grpc-gateway out: .. opt: logtostderr=true,allow_colon_final_segments=true diff --git a/x/params/client/cli/tx.go b/x/params/client/cli/tx.go index 3e3937a77b12..c768b298d12c 100644 --- a/x/params/client/cli/tx.go +++ b/x/params/client/cli/tx.go @@ -67,7 +67,11 @@ Where proposal.json contains: return err } - from := clientCtx.GetFromAddress() + from, err := clientCtx.AddressCodec.BytesToString(clientCtx.GetFromAddress()) + if err != nil { + return err + } + content := paramproposal.NewParameterChangeProposal( proposal.Title, proposal.Description, proposal.Changes.ToParamChanges(), ) diff --git a/x/params/go.mod b/x/params/go.mod index 4864fc565e1c..ed87d988da53 100644 --- a/x/params/go.mod +++ b/x/params/go.mod @@ -11,18 +11,18 @@ require ( cosmossdk.io/math v1.3.0 cosmossdk.io/store v1.0.2 cosmossdk.io/x/gov v0.0.0-20230925135524-a1bc045b3190 - github.com/cometbft/cometbft v0.38.6 + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.4 github.com/cosmos/cosmos-sdk v0.51.0 - github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/gogoproto v1.4.12 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.9.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 - google.golang.org/grpc v1.62.1 + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de + google.golang.org/grpc v1.63.2 ) require ( @@ -60,7 +60,7 @@ require ( github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect @@ -106,7 +106,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -116,13 +116,13 @@ require ( github.com/mtibben/percent v0.2.1 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.0 // indirect github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.50.0 // indirect + github.com/prometheus/common v0.52.2 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect @@ -146,17 +146,17 @@ require ( gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 // indirect go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.21.0 // indirect + golang.org/x/crypto v0.22.0 // indirect golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.22.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.18.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/x/params/go.sum b/x/params/go.sum index 046ebfecd550..507f3ab80bd9 100644 --- a/x/params/go.sum +++ b/x/params/go.sum @@ -118,8 +118,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -141,8 +141,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/cosmos/iavl v1.0.0 h1:bw6t0Mv/mVCJvlMTOPHWLs5uUE3BRBfVWCRelOzl+so= github.com/cosmos/iavl v1.0.0/go.mod h1:CmTGqMnRnucjxbjduneZXT+0vPgNElYvdefjX2q9tYc= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= @@ -162,8 +162,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= @@ -449,8 +449,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -553,8 +553,8 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= @@ -595,8 +595,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= -github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -749,8 +749,8 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= @@ -799,8 +799,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -812,8 +812,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -868,12 +868,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -927,12 +927,12 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -950,8 +950,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/x/params/proto/buf.gen.gogo.yaml b/x/params/proto/buf.gen.gogo.yaml index 9c8ba0a4b1fd..db36231d0c82 100644 --- a/x/params/proto/buf.gen.gogo.yaml +++ b/x/params/proto/buf.gen.gogo.yaml @@ -2,7 +2,7 @@ version: v1 plugins: - name: gocosmos out: .. - opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any - name: grpc-gateway out: .. opt: logtostderr=true,allow_colon_final_segments=true diff --git a/x/params/types/common_test.go b/x/params/types/common_test.go index 09cd49401fca..9fd9b1a535af 100644 --- a/x/params/types/common_test.go +++ b/x/params/types/common_test.go @@ -78,18 +78,18 @@ func validateMaxRedelegationEntries(i interface{}) error { func (p *params) ParamSetPairs() types.ParamSetPairs { return types.ParamSetPairs{ - {keyUnbondingTime, &p.UnbondingTime, validateUnbondingTime}, - {keyMaxValidators, &p.MaxValidators, validateMaxValidators}, - {keyBondDenom, &p.BondDenom, validateBondDenom}, + types.ParamSetPair{Key: keyUnbondingTime, Value: &p.UnbondingTime, ValidatorFn: validateUnbondingTime}, + types.ParamSetPair{Key: keyMaxValidators, Value: &p.MaxValidators, ValidatorFn: validateMaxValidators}, + types.ParamSetPair{Key: keyBondDenom, Value: &p.BondDenom, ValidatorFn: validateBondDenom}, } } func (p *paramsV2) ParamSetPairs() types.ParamSetPairs { return types.ParamSetPairs{ - {keyUnbondingTime, &p.UnbondingTime, validateUnbondingTime}, - {keyMaxValidators, &p.MaxValidators, validateMaxValidators}, - {keyBondDenom, &p.BondDenom, validateBondDenom}, - {keyMaxRedelegationEntries, &p.MaxRedelegationEntries, validateMaxRedelegationEntries}, + types.ParamSetPair{Key: keyUnbondingTime, Value: &p.UnbondingTime, ValidatorFn: validateUnbondingTime}, + types.ParamSetPair{Key: keyMaxValidators, Value: &p.MaxValidators, ValidatorFn: validateMaxValidators}, + types.ParamSetPair{Key: keyBondDenom, Value: &p.BondDenom, ValidatorFn: validateBondDenom}, + types.ParamSetPair{Key: keyMaxRedelegationEntries, Value: &p.MaxRedelegationEntries, ValidatorFn: validateMaxRedelegationEntries}, } } diff --git a/x/params/types/subspace.go b/x/params/types/subspace.go index baa95ff2a5eb..69691de8ae8a 100644 --- a/x/params/types/subspace.go +++ b/x/params/types/subspace.go @@ -2,6 +2,7 @@ package types import ( "fmt" + "maps" "reflect" "cosmossdk.io/store/prefix" @@ -57,9 +58,7 @@ func (s Subspace) WithKeyTable(table KeyTable) Subspace { panic("WithKeyTable() called on already initialized Subspace") } - for k, v := range table.m { - s.table.m[k] = v - } + maps.Copy(s.table.m, table.m) // Allocate additional capacity for Subspace.name // So we don't have to allocate extra space each time appending to the key diff --git a/x/protocolpool/depinject.go b/x/protocolpool/depinject.go index 97c588f7db99..bf141436b5bb 100644 --- a/x/protocolpool/depinject.go +++ b/x/protocolpool/depinject.go @@ -53,7 +53,12 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority) } - k := keeper.NewKeeper(in.Codec, in.Environment, in.AccountKeeper, in.BankKeeper, in.StakingKeeper, authority.String()) + authorityAddr, err := in.AccountKeeper.AddressCodec().BytesToString(authority) + if err != nil { + panic(err) + } + + k := keeper.NewKeeper(in.Codec, in.Environment, in.AccountKeeper, in.BankKeeper, in.StakingKeeper, authorityAddr) m := NewAppModule(in.Codec, k, in.AccountKeeper, in.BankKeeper) return ModuleOutputs{ diff --git a/x/protocolpool/go.mod b/x/protocolpool/go.mod index 7dd949f0bfd0..8897da2399a7 100644 --- a/x/protocolpool/go.mod +++ b/x/protocolpool/go.mod @@ -14,13 +14,13 @@ require ( cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 github.com/cosmos/cosmos-proto v1.0.0-beta.4 github.com/cosmos/cosmos-sdk v0.51.0 - github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/gogoproto v1.4.12 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/stretchr/testify v1.9.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 - google.golang.org/grpc v1.62.1 + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de + google.golang.org/grpc v1.63.2 google.golang.org/protobuf v1.33.0 gotest.tools/v3 v3.5.1 ) @@ -49,7 +49,7 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.6 // indirect + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 // indirect github.com/cometbft/cometbft-db v0.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect @@ -60,7 +60,7 @@ require ( github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect @@ -106,7 +106,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -116,13 +116,13 @@ require ( github.com/mtibben/percent v0.2.1 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.0 // indirect github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.50.0 // indirect + github.com/prometheus/common v0.52.2 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect @@ -147,17 +147,17 @@ require ( gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 // indirect go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.21.0 // indirect + golang.org/x/crypto v0.22.0 // indirect golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.22.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.18.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect diff --git a/x/protocolpool/go.sum b/x/protocolpool/go.sum index 046ebfecd550..507f3ab80bd9 100644 --- a/x/protocolpool/go.sum +++ b/x/protocolpool/go.sum @@ -118,8 +118,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -141,8 +141,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/cosmos/iavl v1.0.0 h1:bw6t0Mv/mVCJvlMTOPHWLs5uUE3BRBfVWCRelOzl+so= github.com/cosmos/iavl v1.0.0/go.mod h1:CmTGqMnRnucjxbjduneZXT+0vPgNElYvdefjX2q9tYc= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= @@ -162,8 +162,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= @@ -449,8 +449,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -553,8 +553,8 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= @@ -595,8 +595,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= -github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -749,8 +749,8 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= @@ -799,8 +799,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -812,8 +812,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -868,12 +868,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -927,12 +927,12 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -950,8 +950,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/x/protocolpool/keeper/genesis.go b/x/protocolpool/keeper/genesis.go index 51b193178f24..c5211513d99d 100644 --- a/x/protocolpool/keeper/genesis.go +++ b/x/protocolpool/keeper/genesis.go @@ -54,8 +54,12 @@ func (k Keeper) InitGenesis(ctx context.Context, data *types.GenesisState) error func (k Keeper) ExportGenesis(ctx context.Context) (*types.GenesisState, error) { var cf []*types.ContinuousFund err := k.ContinuousFund.Walk(ctx, nil, func(key sdk.AccAddress, value types.ContinuousFund) (stop bool, err error) { + recipient, err := k.authKeeper.AddressCodec().BytesToString(key) + if err != nil { + return true, err + } cf = append(cf, &types.ContinuousFund{ - Recipient: key.String(), + Recipient: recipient, Percentage: value.Percentage, Expiry: value.Expiry, }) @@ -67,8 +71,12 @@ func (k Keeper) ExportGenesis(ctx context.Context) (*types.GenesisState, error) var budget []*types.Budget err = k.BudgetProposal.Walk(ctx, nil, func(key sdk.AccAddress, value types.Budget) (stop bool, err error) { + recipient, err := k.authKeeper.AddressCodec().BytesToString(key) + if err != nil { + return true, err + } budget = append(budget, &types.Budget{ - RecipientAddress: key.String(), + RecipientAddress: recipient, TotalBudget: value.TotalBudget, ClaimedAmount: value.ClaimedAmount, StartTime: value.StartTime, diff --git a/x/protocolpool/keeper/grpc_query_test.go b/x/protocolpool/keeper/grpc_query_test.go index 14e0ff2a0a6d..2fc082b811e8 100644 --- a/x/protocolpool/keeper/grpc_query_test.go +++ b/x/protocolpool/keeper/grpc_query_test.go @@ -6,6 +6,7 @@ import ( "cosmossdk.io/math" "cosmossdk.io/x/protocolpool/types" + codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -14,6 +15,8 @@ func (suite *KeeperTestSuite) TestUnclaimedBudget() { period := time.Duration(60) * time.Second zeroCoin := sdk.NewCoin("foo", math.ZeroInt()) nextClaimFrom := startTime.Add(period) + recipientStrAddr, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(recipientAddr) + suite.Require().NoError(err) testCases := []struct { name string preRun func() @@ -34,7 +37,7 @@ func (suite *KeeperTestSuite) TestUnclaimedBudget() { { name: "no budget proposal found", req: &types.QueryUnclaimedBudgetRequest{ - Address: recipientAddr.String(), + Address: recipientStrAddr, }, expErr: true, expErrMsg: "no budget proposal found for address", @@ -44,7 +47,7 @@ func (suite *KeeperTestSuite) TestUnclaimedBudget() { preRun: func() { // Prepare a valid budget proposal budget := types.Budget{ - RecipientAddress: recipientAddr.String(), + RecipientAddress: recipientStrAddr, TotalBudget: &fooCoin, StartTime: &startTime, Tranches: 2, @@ -54,7 +57,7 @@ func (suite *KeeperTestSuite) TestUnclaimedBudget() { suite.Require().NoError(err) }, req: &types.QueryUnclaimedBudgetRequest{ - Address: recipientAddr.String(), + Address: recipientStrAddr, }, expErr: false, unclaimedFunds: &fooCoin, @@ -72,7 +75,7 @@ func (suite *KeeperTestSuite) TestUnclaimedBudget() { preRun: func() { // Prepare a valid budget proposal budget := types.Budget{ - RecipientAddress: recipientAddr.String(), + RecipientAddress: recipientStrAddr, TotalBudget: &fooCoin, StartTime: &startTime, Tranches: 2, @@ -83,7 +86,7 @@ func (suite *KeeperTestSuite) TestUnclaimedBudget() { // Claim the funds once msg := &types.MsgClaimBudget{ - RecipientAddress: recipientAddr.String(), + RecipientAddress: recipientStrAddr, } suite.mockSendCoinsFromModuleToAccount(recipientAddr) _, err = suite.msgServer.ClaimBudget(suite.ctx, msg) @@ -91,7 +94,7 @@ func (suite *KeeperTestSuite) TestUnclaimedBudget() { }, req: &types.QueryUnclaimedBudgetRequest{ - Address: recipientAddr.String(), + Address: recipientStrAddr, }, expErr: false, unclaimedFunds: &fooCoin2, diff --git a/x/protocolpool/keeper/keeper.go b/x/protocolpool/keeper/keeper.go index 1f91bcdb7ed7..cbfe25c1d23a 100644 --- a/x/protocolpool/keeper/keeper.go +++ b/x/protocolpool/keeper/keeper.go @@ -113,16 +113,21 @@ func (k Keeper) GetCommunityPool(ctx context.Context) (sdk.Coins, error) { return k.bankKeeper.GetAllBalances(ctx, moduleAccount.GetAddress()), nil } -func (k Keeper) withdrawContinuousFund(ctx context.Context, recipient sdk.AccAddress) (sdk.Coin, error) { +func (k Keeper) withdrawContinuousFund(ctx context.Context, recipientAddr string) (sdk.Coin, error) { + recipient, err := k.authKeeper.AddressCodec().StringToBytes(recipientAddr) + if err != nil { + return sdk.Coin{}, sdkerrors.ErrInvalidAddress.Wrapf("invalid recipient address: %s", err) + } + cf, err := k.ContinuousFund.Get(ctx, recipient) if err != nil { if errors.Is(err, collections.ErrNotFound) { - return sdk.Coin{}, fmt.Errorf("no continuous fund found for recipient: %s", recipient.String()) + return sdk.Coin{}, fmt.Errorf("no continuous fund found for recipient: %s", recipientAddr) } - return sdk.Coin{}, fmt.Errorf("get continuous fund failed for recipient: %s", recipient.String()) + return sdk.Coin{}, fmt.Errorf("get continuous fund failed for recipient: %s", recipientAddr) } if cf.Expiry != nil && cf.Expiry.Before(k.environment.HeaderService.GetHeaderInfo(ctx).Time) { - return sdk.Coin{}, fmt.Errorf("cannot withdraw continuous funds: continuous fund expired for recipient: %s", recipient.String()) + return sdk.Coin{}, fmt.Errorf("cannot withdraw continuous funds: continuous fund expired for recipient: %s", recipientAddr) } toDistributeAmount, err := k.ToDistribute.Get(ctx) @@ -138,15 +143,20 @@ func (k Keeper) withdrawContinuousFund(ctx context.Context, recipient sdk.AccAdd } // withdraw continuous fund - withdrawnAmount, err := k.withdrawRecipientFunds(ctx, recipient) + withdrawnAmount, err := k.withdrawRecipientFunds(ctx, recipientAddr) if err != nil { - return sdk.Coin{}, fmt.Errorf("error while withdrawing recipient funds for recipient: %s", recipient.String()) + return sdk.Coin{}, fmt.Errorf("error while withdrawing recipient funds for recipient: %s", recipientAddr) } return withdrawnAmount, nil } -func (k Keeper) withdrawRecipientFunds(ctx context.Context, recipient sdk.AccAddress) (sdk.Coin, error) { +func (k Keeper) withdrawRecipientFunds(ctx context.Context, recipientAddr string) (sdk.Coin, error) { + recipient, err := k.authKeeper.AddressCodec().StringToBytes(recipientAddr) + if err != nil { + return sdk.Coin{}, sdkerrors.ErrInvalidAddress.Wrapf("invalid recipient address: %s", err) + } + // get allocated continuous fund fundsAllocated, err := k.RecipientFundDistribution.Get(ctx, recipient) if err != nil { @@ -165,7 +175,7 @@ func (k Keeper) withdrawRecipientFunds(ctx context.Context, recipient sdk.AccAdd withdrawnAmount := sdk.NewCoin(denom, fundsAllocated) err = k.DistributeFromStreamFunds(ctx, sdk.NewCoins(withdrawnAmount), recipient) if err != nil { - return sdk.Coin{}, fmt.Errorf("error while distributing funds to the recipient %s: %v", recipient.String(), err) + return sdk.Coin{}, fmt.Errorf("error while distributing funds to the recipient %s: %v", recipientAddr, err) } // reset fund distribution @@ -257,8 +267,12 @@ func (k Keeper) iterateAndUpdateFundsDistribution(ctx context.Context, toDistrib // Calculate totalPercentageToBeDistributed and store values err := k.RecipientFundPercentage.Walk(ctx, nil, func(key sdk.AccAddress, value math.Int) (stop bool, err error) { + addr, err := k.authKeeper.AddressCodec().BytesToString(key) + if err != nil { + return true, err + } totalPercentageToBeDistributed = totalPercentageToBeDistributed.Add(value) - recipientFundMap[key.String()] = value + recipientFundMap[addr] = value return false, nil }) if err != nil { @@ -306,9 +320,14 @@ func (k Keeper) iterateAndUpdateFundsDistribution(ctx context.Context, toDistrib return k.ToDistribute.Set(ctx, math.ZeroInt()) } -func (k Keeper) claimFunds(ctx context.Context, recipient sdk.AccAddress) (amount sdk.Coin, err error) { +func (k Keeper) claimFunds(ctx context.Context, recipientAddr string) (amount sdk.Coin, err error) { + recipient, err := k.authKeeper.AddressCodec().StringToBytes(recipientAddr) + if err != nil { + return sdk.Coin{}, sdkerrors.ErrInvalidAddress.Wrapf("invalid recipient address: %s", err) + } + // get claimable funds from distribution info - amount, err = k.getClaimableFunds(ctx, recipient) + amount, err = k.getClaimableFunds(ctx, recipientAddr) if err != nil { return sdk.Coin{}, fmt.Errorf("error getting claimable funds: %w", err) } @@ -322,11 +341,16 @@ func (k Keeper) claimFunds(ctx context.Context, recipient sdk.AccAddress) (amoun return amount, nil } -func (k Keeper) getClaimableFunds(ctx context.Context, recipient sdk.AccAddress) (amount sdk.Coin, err error) { +func (k Keeper) getClaimableFunds(ctx context.Context, recipientAddr string) (amount sdk.Coin, err error) { + recipient, err := k.authKeeper.AddressCodec().StringToBytes(recipientAddr) + if err != nil { + return sdk.Coin{}, sdkerrors.ErrInvalidAddress.Wrapf("invalid recipient address: %s", err) + } + budget, err := k.BudgetProposal.Get(ctx, recipient) if err != nil { if errors.Is(err, collections.ErrNotFound) { - return sdk.Coin{}, fmt.Errorf("no budget found for recipient: %s", recipient.String()) + return sdk.Coin{}, fmt.Errorf("no budget found for recipient: %s", recipientAddr) } return sdk.Coin{}, err } @@ -340,7 +364,7 @@ func (k Keeper) getClaimableFunds(ctx context.Context, recipient sdk.AccAddress) return sdk.Coin{}, err } // Return the end of the budget - return sdk.Coin{}, fmt.Errorf("budget ended for recipient: %s", recipient.String()) + return sdk.Coin{}, fmt.Errorf("budget ended for recipient: %s", recipientAddr) } } diff --git a/x/protocolpool/keeper/keeper_test.go b/x/protocolpool/keeper/keeper_test.go index fec0abd80cbc..6df649c7b782 100644 --- a/x/protocolpool/keeper/keeper_test.go +++ b/x/protocolpool/keeper/keeper_test.go @@ -68,13 +68,16 @@ func (s *KeeperTestSuite) SetupTest() { stakingKeeper.EXPECT().BondDenom(ctx).Return("stake", nil).AnyTimes() s.stakingKeeper = stakingKeeper + authority, err := accountKeeper.AddressCodec().BytesToString(authtypes.NewModuleAddress(types.GovModuleName)) + s.Require().NoError(err) + poolKeeper := poolkeeper.NewKeeper( encCfg.Codec, environment, accountKeeper, bankKeeper, stakingKeeper, - authtypes.NewModuleAddress(types.GovModuleName).String(), + authority, ) s.ctx = ctx s.poolKeeper = poolKeeper diff --git a/x/protocolpool/keeper/msg_server.go b/x/protocolpool/keeper/msg_server.go index fd5015607d98..4c03c08e85cf 100644 --- a/x/protocolpool/keeper/msg_server.go +++ b/x/protocolpool/keeper/msg_server.go @@ -26,12 +26,7 @@ func NewMsgServerImpl(keeper Keeper) types.MsgServer { } func (k MsgServer) ClaimBudget(ctx context.Context, msg *types.MsgClaimBudget) (*types.MsgClaimBudgetResponse, error) { - recipient, err := k.Keeper.authKeeper.AddressCodec().StringToBytes(msg.RecipientAddress) - if err != nil { - return nil, sdkerrors.ErrInvalidAddress.Wrapf("invalid recipient address: %s", err) - } - - amount, err := k.claimFunds(ctx, recipient) + amount, err := k.claimFunds(ctx, msg.RecipientAddress) if err != nil { return nil, err } @@ -164,12 +159,7 @@ func (k MsgServer) CreateContinuousFund(ctx context.Context, msg *types.MsgCreat } func (k MsgServer) WithdrawContinuousFund(ctx context.Context, msg *types.MsgWithdrawContinuousFund) (*types.MsgWithdrawContinuousFundResponse, error) { - recipient, err := k.Keeper.authKeeper.AddressCodec().StringToBytes(msg.RecipientAddress) - if err != nil { - return nil, sdkerrors.ErrInvalidAddress.Wrapf("invalid recipient address: %s", err) - } - - amount, err := k.withdrawContinuousFund(ctx, recipient) + amount, err := k.withdrawContinuousFund(ctx, msg.RecipientAddress) if err != nil { return nil, err } @@ -202,7 +192,7 @@ func (k MsgServer) CancelContinuousFund(ctx context.Context, msg *types.MsgCance } // withdraw funds if any are allocated - withdrawnFunds, err := k.withdrawRecipientFunds(ctx, recipient) + withdrawnFunds, err := k.withdrawRecipientFunds(ctx, msg.RecipientAddress) if err != nil && !errorspkg.Is(err, types.ErrNoRecipientFund) { return nil, fmt.Errorf("error while withdrawing already allocated funds for recipient %s: %v", msg.RecipientAddress, err) } diff --git a/x/protocolpool/keeper/msg_server_test.go b/x/protocolpool/keeper/msg_server_test.go index e5f6638ee3b5..ed0343403153 100644 --- a/x/protocolpool/keeper/msg_server_test.go +++ b/x/protocolpool/keeper/msg_server_test.go @@ -8,6 +8,7 @@ import ( "cosmossdk.io/math" "cosmossdk.io/x/protocolpool/types" + codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -24,6 +25,8 @@ func (suite *KeeperTestSuite) TestMsgSubmitBudgetProposal() { invalidStartTime := suite.environment.HeaderService.GetHeaderInfo(suite.ctx).Time.Add(-15 * time.Second) period := time.Duration(60) * time.Second zeroPeriod := time.Duration(0) * time.Second + recipientStrAddr, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(recipientAddr) + suite.Require().NoError(err) testCases := map[string]struct { input *types.MsgSubmitBudgetProposal expErr bool @@ -44,7 +47,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitBudgetProposal() { "empty authority": { input: &types.MsgSubmitBudgetProposal{ Authority: "", - RecipientAddress: recipientAddr.String(), + RecipientAddress: recipientStrAddr, TotalBudget: &fooCoin, StartTime: &startTime, Tranches: 2, @@ -56,7 +59,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitBudgetProposal() { "invalid authority": { input: &types.MsgSubmitBudgetProposal{ Authority: "invalid_authority", - RecipientAddress: recipientAddr.String(), + RecipientAddress: recipientStrAddr, TotalBudget: &fooCoin, StartTime: &startTime, Tranches: 2, @@ -68,7 +71,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitBudgetProposal() { "invalid budget": { input: &types.MsgSubmitBudgetProposal{ Authority: suite.poolKeeper.GetAuthority(), - RecipientAddress: recipientAddr.String(), + RecipientAddress: recipientStrAddr, TotalBudget: &invalidCoin, StartTime: &startTime, Tranches: 2, @@ -80,7 +83,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitBudgetProposal() { "invalid start time": { input: &types.MsgSubmitBudgetProposal{ Authority: suite.poolKeeper.GetAuthority(), - RecipientAddress: recipientAddr.String(), + RecipientAddress: recipientStrAddr, TotalBudget: &fooCoin, StartTime: &invalidStartTime, Tranches: 2, @@ -92,7 +95,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitBudgetProposal() { "invalid tranches": { input: &types.MsgSubmitBudgetProposal{ Authority: suite.poolKeeper.GetAuthority(), - RecipientAddress: recipientAddr.String(), + RecipientAddress: recipientStrAddr, TotalBudget: &fooCoin, StartTime: &startTime, Tranches: 0, @@ -104,7 +107,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitBudgetProposal() { "invalid period": { input: &types.MsgSubmitBudgetProposal{ Authority: suite.poolKeeper.GetAuthority(), - RecipientAddress: recipientAddr.String(), + RecipientAddress: recipientStrAddr, TotalBudget: &fooCoin, StartTime: &startTime, Tranches: 2, @@ -116,7 +119,7 @@ func (suite *KeeperTestSuite) TestMsgSubmitBudgetProposal() { "all good": { input: &types.MsgSubmitBudgetProposal{ Authority: suite.poolKeeper.GetAuthority(), - RecipientAddress: recipientAddr.String(), + RecipientAddress: recipientStrAddr, TotalBudget: &fooCoin, StartTime: &startTime, Tranches: 2, @@ -144,6 +147,8 @@ func (suite *KeeperTestSuite) TestMsgSubmitBudgetProposal() { func (suite *KeeperTestSuite) TestMsgClaimBudget() { startTime := suite.environment.HeaderService.GetHeaderInfo(suite.ctx).Time.Add(-70 * time.Second) period := time.Duration(60) * time.Second + recipientStrAddr, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(recipientAddr) + suite.Require().NoError(err) testCases := map[string]struct { preRun func() @@ -167,7 +172,7 @@ func (suite *KeeperTestSuite) TestMsgClaimBudget() { startTime := suite.environment.HeaderService.GetHeaderInfo(suite.ctx).Time.Add(3600 * time.Second) // Prepare the budget proposal with a future start time budget := types.Budget{ - RecipientAddress: recipientAddr.String(), + RecipientAddress: recipientStrAddr, TotalBudget: &fooCoin, StartTime: &startTime, Tranches: 2, @@ -185,7 +190,7 @@ func (suite *KeeperTestSuite) TestMsgClaimBudget() { startTime := suite.environment.HeaderService.GetHeaderInfo(suite.ctx).Time.Add(-50 * time.Second) // Prepare the budget proposal with start time and a short period budget := types.Budget{ - RecipientAddress: recipientAddr.String(), + RecipientAddress: recipientStrAddr, TotalBudget: &fooCoin, StartTime: &startTime, Tranches: 1, @@ -202,7 +207,7 @@ func (suite *KeeperTestSuite) TestMsgClaimBudget() { preRun: func() { // Prepare the budget proposal with valid start time and period budget := types.Budget{ - RecipientAddress: recipientAddr.String(), + RecipientAddress: recipientStrAddr, TotalBudget: &fooCoin, StartTime: &startTime, Tranches: 2, @@ -219,7 +224,7 @@ func (suite *KeeperTestSuite) TestMsgClaimBudget() { preRun: func() { // Prepare the budget proposal with valid start time and period budget := types.Budget{ - RecipientAddress: recipientAddr.String(), + RecipientAddress: recipientStrAddr, TotalBudget: &fooCoin, StartTime: &startTime, Tranches: 2, @@ -230,7 +235,7 @@ func (suite *KeeperTestSuite) TestMsgClaimBudget() { // Claim the funds once msg := &types.MsgClaimBudget{ - RecipientAddress: recipientAddr.String(), + RecipientAddress: recipientStrAddr, } suite.mockSendCoinsFromModuleToAccount(recipientAddr) _, err = suite.msgServer.ClaimBudget(suite.ctx, msg) @@ -247,7 +252,7 @@ func (suite *KeeperTestSuite) TestMsgClaimBudget() { oneMonthPeriod := time.Duration(oneMonthInSeconds) * time.Second // Prepare the budget proposal with valid start time and period of 1 month (in seconds) budget := types.Budget{ - RecipientAddress: recipientAddr.String(), + RecipientAddress: recipientStrAddr, TotalBudget: &fooCoin, StartTime: &startTimeBeforeMonth, Tranches: 2, @@ -258,7 +263,7 @@ func (suite *KeeperTestSuite) TestMsgClaimBudget() { // Claim the funds once msg := &types.MsgClaimBudget{ - RecipientAddress: recipientAddr.String(), + RecipientAddress: recipientStrAddr, } suite.mockSendCoinsFromModuleToAccount(recipientAddr) _, err = suite.msgServer.ClaimBudget(suite.ctx, msg) @@ -278,7 +283,7 @@ func (suite *KeeperTestSuite) TestMsgClaimBudget() { preRun: func() { // Prepare the budget proposal with valid start time and period budget := types.Budget{ - RecipientAddress: recipientAddr.String(), + RecipientAddress: recipientStrAddr, TotalBudget: &fooCoin, StartTime: &startTime, Tranches: 2, @@ -289,7 +294,7 @@ func (suite *KeeperTestSuite) TestMsgClaimBudget() { // Claim the funds once msg := &types.MsgClaimBudget{ - RecipientAddress: recipientAddr.String(), + RecipientAddress: recipientStrAddr, } suite.mockSendCoinsFromModuleToAccount(recipientAddr) _, err = suite.msgServer.ClaimBudget(suite.ctx, msg) @@ -303,7 +308,7 @@ func (suite *KeeperTestSuite) TestMsgClaimBudget() { // Claim the funds twice msg = &types.MsgClaimBudget{ - RecipientAddress: recipientAddr.String(), + RecipientAddress: recipientStrAddr, } suite.mockSendCoinsFromModuleToAccount(recipientAddr) _, err = suite.msgServer.ClaimBudget(suite.ctx, msg) @@ -321,8 +326,10 @@ func (suite *KeeperTestSuite) TestMsgClaimBudget() { if tc.preRun != nil { tc.preRun() } + addr, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(tc.recipientAddress) + suite.Require().NoError(err) msg := &types.MsgClaimBudget{ - RecipientAddress: tc.recipientAddress.String(), + RecipientAddress: addr, } suite.mockSendCoinsFromModuleToAccount(tc.recipientAddress) resp, err := suite.msgServer.ClaimBudget(suite.ctx, msg) @@ -338,9 +345,16 @@ func (suite *KeeperTestSuite) TestMsgClaimBudget() { } func (suite *KeeperTestSuite) TestWithdrawContinuousFund() { + addressCodec := codectestutil.CodecOptions{}.GetAddressCodec() recipient := sdk.AccAddress([]byte("recipientAddr1__________________")) + recipientStrAddr, err := addressCodec.BytesToString(recipient) + suite.Require().NoError(err) recipient2 := sdk.AccAddress([]byte("recipientAddr2___________________")) + recipient2StrAddr, err := addressCodec.BytesToString(recipient2) + suite.Require().NoError(err) recipient3 := sdk.AccAddress([]byte("recipientAddr3___________________")) + recipient3StrAddr, err := addressCodec.BytesToString(recipient3) + suite.Require().NoError(err) testCases := map[string]struct { preRun func() recipientAddress []sdk.AccAddress @@ -366,7 +380,7 @@ func (suite *KeeperTestSuite) TestWithdrawContinuousFund() { oneMonthInSeconds := int64(30 * 24 * 60 * 60) // Approximate number of seconds in 1 month expiry := suite.environment.HeaderService.GetHeaderInfo(suite.ctx).Time.Add(time.Duration(oneMonthInSeconds) * time.Second) cf := types.ContinuousFund{ - Recipient: recipient.String(), + Recipient: recipientStrAddr, Percentage: percentage, Expiry: &expiry, } @@ -384,7 +398,7 @@ func (suite *KeeperTestSuite) TestWithdrawContinuousFund() { percentage, err = math.LegacyNewDecFromStr("0.9") suite.Require().NoError(err) cf = types.ContinuousFund{ - Recipient: recipient2.String(), + Recipient: recipient2StrAddr, Percentage: percentage, Expiry: &expiry, } @@ -412,7 +426,7 @@ func (suite *KeeperTestSuite) TestWithdrawContinuousFund() { suite.Require().NoError(err) expiry := suite.environment.HeaderService.GetHeaderInfo(suite.ctx).Time.Add(time.Duration(-1) * time.Second) cf := types.ContinuousFund{ - Recipient: recipient.String(), + Recipient: recipientStrAddr, Percentage: percentage, Expiry: &expiry, } @@ -431,7 +445,7 @@ func (suite *KeeperTestSuite) TestWithdrawContinuousFund() { oneMonthInSeconds := int64(30 * 24 * 60 * 60) // Approximate number of seconds in 1 month expiry := suite.environment.HeaderService.GetHeaderInfo(suite.ctx).Time.Add(time.Duration(oneMonthInSeconds) * time.Second) cf := types.ContinuousFund{ - Recipient: recipient.String(), + Recipient: recipientStrAddr, Percentage: percentage, Expiry: &expiry, } @@ -456,7 +470,7 @@ func (suite *KeeperTestSuite) TestWithdrawContinuousFund() { percentage, err := math.LegacyNewDecFromStr("0.2") suite.Require().NoError(err) cf := types.ContinuousFund{ - Recipient: recipient.String(), + Recipient: recipientStrAddr, Percentage: percentage, } // Set continuous fund @@ -484,7 +498,7 @@ func (suite *KeeperTestSuite) TestWithdrawContinuousFund() { oneMonthInSeconds := int64(30 * 24 * 60 * 60) // Approximate number of seconds in 1 month expiry := suite.environment.HeaderService.GetHeaderInfo(suite.ctx).Time.Add(time.Duration(oneMonthInSeconds) * time.Second) cf := types.ContinuousFund{ - Recipient: recipient.String(), + Recipient: recipientStrAddr, Percentage: percentage, Expiry: &expiry, } @@ -514,7 +528,7 @@ func (suite *KeeperTestSuite) TestWithdrawContinuousFund() { oneMonthInSeconds := int64(30 * 24 * 60 * 60) // Approximate number of seconds in 1 month expiry := suite.environment.HeaderService.GetHeaderInfo(suite.ctx).Time.Add(time.Duration(oneMonthInSeconds) * time.Second) cf := types.ContinuousFund{ - Recipient: recipient.String(), + Recipient: recipientStrAddr, Percentage: percentage, Expiry: &expiry, } @@ -532,7 +546,7 @@ func (suite *KeeperTestSuite) TestWithdrawContinuousFund() { percentage2, err := math.LegacyNewDecFromStr("0.2") suite.Require().NoError(err) cf = types.ContinuousFund{ - Recipient: recipient2.String(), + Recipient: recipient2StrAddr, Percentage: percentage, Expiry: &expiry, } @@ -550,7 +564,7 @@ func (suite *KeeperTestSuite) TestWithdrawContinuousFund() { percentage3, err := math.LegacyNewDecFromStr("0.3") suite.Require().NoError(err) cf = types.ContinuousFund{ - Recipient: recipient3.String(), + Recipient: recipient3StrAddr, Percentage: percentage2, Expiry: &expiry, } @@ -581,8 +595,10 @@ func (suite *KeeperTestSuite) TestWithdrawContinuousFund() { if tc.preRun != nil { tc.preRun() } + addr, err := addressCodec.BytesToString(tc.recipientAddress[0]) + suite.Require().NoError(err) msg := &types.MsgWithdrawContinuousFund{ - RecipientAddress: tc.recipientAddress[0].String(), + RecipientAddress: addr, } suite.mockWithdrawContinuousFund() @@ -617,6 +633,8 @@ func (suite *KeeperTestSuite) TestCreateContinuousFund() { invalidExpirty := suite.environment.HeaderService.GetHeaderInfo(suite.ctx).Time.Add(-15 * time.Second) oneMonthInSeconds := int64(30 * 24 * 60 * 60) // Approximate number of seconds in 1 month expiry := suite.environment.HeaderService.GetHeaderInfo(suite.ctx).Time.Add(time.Duration(oneMonthInSeconds) * time.Second) + recipientStrAddr, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(recipientAddr) + suite.Require().NoError(err) testCases := map[string]struct { preRun func() input *types.MsgCreateContinuousFund @@ -636,7 +654,7 @@ func (suite *KeeperTestSuite) TestCreateContinuousFund() { "empty authority": { input: &types.MsgCreateContinuousFund{ Authority: "", - Recipient: recipientAddr.String(), + Recipient: recipientStrAddr, Percentage: percentage, Expiry: &expiry, }, @@ -646,7 +664,7 @@ func (suite *KeeperTestSuite) TestCreateContinuousFund() { "invalid authority": { input: &types.MsgCreateContinuousFund{ Authority: "invalid_authority", - Recipient: recipientAddr.String(), + Recipient: recipientStrAddr, Percentage: percentage, Expiry: &expiry, }, @@ -656,7 +674,7 @@ func (suite *KeeperTestSuite) TestCreateContinuousFund() { "zero percentage": { input: &types.MsgCreateContinuousFund{ Authority: suite.poolKeeper.GetAuthority(), - Recipient: recipientAddr.String(), + Recipient: recipientStrAddr, Percentage: math.LegacyNewDec(0), Expiry: &expiry, }, @@ -666,7 +684,7 @@ func (suite *KeeperTestSuite) TestCreateContinuousFund() { "negative percentage": { input: &types.MsgCreateContinuousFund{ Authority: suite.poolKeeper.GetAuthority(), - Recipient: recipientAddr.String(), + Recipient: recipientStrAddr, Percentage: negativePercentage, Expiry: &expiry, }, @@ -676,7 +694,7 @@ func (suite *KeeperTestSuite) TestCreateContinuousFund() { "invalid percentage": { input: &types.MsgCreateContinuousFund{ Authority: suite.poolKeeper.GetAuthority(), - Recipient: recipientAddr.String(), + Recipient: recipientStrAddr, Percentage: math.LegacyNewDec(1), Expiry: &expiry, }, @@ -686,7 +704,7 @@ func (suite *KeeperTestSuite) TestCreateContinuousFund() { "invalid expiry": { input: &types.MsgCreateContinuousFund{ Authority: suite.poolKeeper.GetAuthority(), - Recipient: recipientAddr.String(), + Recipient: recipientStrAddr, Percentage: percentage, Expiry: &invalidExpirty, }, @@ -696,7 +714,7 @@ func (suite *KeeperTestSuite) TestCreateContinuousFund() { "all good": { input: &types.MsgCreateContinuousFund{ Authority: suite.poolKeeper.GetAuthority(), - Recipient: recipientAddr.String(), + Recipient: recipientStrAddr, Percentage: percentage, Expiry: &expiry, }, @@ -705,10 +723,12 @@ func (suite *KeeperTestSuite) TestCreateContinuousFund() { "total funds percentage > 100": { preRun: func() { percentage, err := math.LegacyNewDecFromStr("0.9") + suite.Require().NoError(err) recipient2 := sdk.AccAddress([]byte("recipientAddr2___________________")) + recipient2StrAddr, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(recipient2) suite.Require().NoError(err) cf := types.ContinuousFund{ - Recipient: recipient2.String(), + Recipient: recipient2StrAddr, Percentage: percentage, Expiry: &time.Time{}, } @@ -720,7 +740,7 @@ func (suite *KeeperTestSuite) TestCreateContinuousFund() { }, input: &types.MsgCreateContinuousFund{ Authority: suite.poolKeeper.GetAuthority(), - Recipient: recipientAddr.String(), + Recipient: recipientStrAddr, Percentage: percentage, Expiry: &expiry, }, @@ -752,8 +772,11 @@ func (suite *KeeperTestSuite) TestCreateContinuousFund() { // canceling a fund with no recipient found, canceling a fund with unclaimed funds for the recipient, // and canceling a fund with no errors. func (suite *KeeperTestSuite) TestCancelContinuousFund() { + recipientStrAddr, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(recipientAddr) + suite.Require().NoError(err) recipient2 := sdk.AccAddress([]byte("recipientAddr2___________________")) - + recipient2StrAddr, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(recipient2) + suite.Require().NoError(err) testCases := map[string]struct { preRun func() recipientAddr sdk.AccAddress @@ -792,7 +815,7 @@ func (suite *KeeperTestSuite) TestCancelContinuousFund() { oneMonthInSeconds := int64(30 * 24 * 60 * 60) // Approximate number of seconds in 1 month expiry := suite.environment.HeaderService.GetHeaderInfo(suite.ctx).Time.Add(time.Duration(oneMonthInSeconds) * time.Second) cf := types.ContinuousFund{ - Recipient: recipientAddr.String(), + Recipient: recipientStrAddr, Percentage: percentage, Expiry: &expiry, } @@ -810,7 +833,7 @@ func (suite *KeeperTestSuite) TestCancelContinuousFund() { percentage, err = math.LegacyNewDecFromStr("0.3") suite.Require().NoError(err) cf = types.ContinuousFund{ - Recipient: recipient2.String(), + Recipient: recipient2StrAddr, Percentage: percentage, Expiry: &expiry, } @@ -832,7 +855,7 @@ func (suite *KeeperTestSuite) TestCancelContinuousFund() { // withdraw funds for fund request 2 suite.mockWithdrawContinuousFund() - msg := &types.MsgWithdrawContinuousFund{RecipientAddress: recipient2.String()} + msg := &types.MsgWithdrawContinuousFund{RecipientAddress: recipient2StrAddr} _, err = suite.msgServer.WithdrawContinuousFund(suite.ctx, msg) suite.Require().NoError(err) }, @@ -852,7 +875,7 @@ func (suite *KeeperTestSuite) TestCancelContinuousFund() { oneMonthInSeconds := int64(30 * 24 * 60 * 60) // Approximate number of seconds in 1 month expiry := suite.environment.HeaderService.GetHeaderInfo(suite.ctx).Time.Add(time.Duration(oneMonthInSeconds) * time.Second) cf := types.ContinuousFund{ - Recipient: recipientAddr.String(), + Recipient: recipientStrAddr, Percentage: percentage, Expiry: &expiry, } @@ -875,9 +898,11 @@ func (suite *KeeperTestSuite) TestCancelContinuousFund() { if tc.preRun != nil { tc.preRun() } + addr, err := codectestutil.CodecOptions{}.GetAddressCodec().BytesToString(tc.recipientAddr) + suite.Require().NoError(err) msg := &types.MsgCancelContinuousFund{ Authority: suite.poolKeeper.GetAuthority(), - RecipientAddress: tc.recipientAddr.String(), + RecipientAddress: addr, } resp, err := suite.msgServer.CancelContinuousFund(suite.ctx, msg) if tc.expErr { diff --git a/x/protocolpool/proto/buf.gen.gogo.yaml b/x/protocolpool/proto/buf.gen.gogo.yaml index 9c8ba0a4b1fd..db36231d0c82 100644 --- a/x/protocolpool/proto/buf.gen.gogo.yaml +++ b/x/protocolpool/proto/buf.gen.gogo.yaml @@ -2,7 +2,7 @@ version: v1 plugins: - name: gocosmos out: .. - opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any - name: grpc-gateway out: .. opt: logtostderr=true,allow_colon_final_segments=true diff --git a/x/protocolpool/simulation/operations.go b/x/protocolpool/simulation/operations.go index 9774dbd01209..004b850d52be 100644 --- a/x/protocolpool/simulation/operations.go +++ b/x/protocolpool/simulation/operations.go @@ -72,7 +72,11 @@ func SimulateMsgFundCommunityPool(txConfig client.TxConfig, ak types.AccountKeep } } - msg := types.NewMsgFundCommunityPool(fundAmount, funder.Address.String()) + funderAddr, err := ak.AddressCodec().BytesToString(funder.Address) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, sdk.MsgTypeURL(&types.MsgFundCommunityPool{}), "unable to get funder address"), nil, err + } + msg := types.NewMsgFundCommunityPool(fundAmount, funderAddr) txCtx := simulation.OperationInput{ R: r, diff --git a/x/protocolpool/simulation/proposals.go b/x/protocolpool/simulation/proposals.go index 224a9f8fb535..9a1af074a53b 100644 --- a/x/protocolpool/simulation/proposals.go +++ b/x/protocolpool/simulation/proposals.go @@ -28,7 +28,7 @@ func ProposalMsgs() []simtypes.WeightedProposalMsg { } } -func SimulateMsgCommunityPoolSpend(r *rand.Rand, _ sdk.Context, _ []simtypes.Account, _ coreaddress.Codec) (sdk.Msg, error) { +func SimulateMsgCommunityPoolSpend(r *rand.Rand, _ []simtypes.Account, cdc coreaddress.Codec) (sdk.Msg, error) { // use the default gov module account address as authority var authority sdk.AccAddress = address.Module("gov") @@ -37,12 +37,20 @@ func SimulateMsgCommunityPoolSpend(r *rand.Rand, _ sdk.Context, _ []simtypes.Acc coins, err := sdk.ParseCoinsNormalized("100stake,2testtoken") if err != nil { - panic(err) + return nil, err } + authorityAddr, err := cdc.BytesToString(authority) + if err != nil { + return nil, err + } + recipentAddr, err := cdc.BytesToString(acc.Address) + if err != nil { + return nil, err + } return &pooltypes.MsgCommunityPoolSpend{ - Authority: authority.String(), - Recipient: acc.Address.String(), + Authority: authorityAddr, + Recipient: recipentAddr, Amount: coins, }, nil } diff --git a/x/protocolpool/simulation/proposals_test.go b/x/protocolpool/simulation/proposals_test.go index 4cef1da31bdc..96046c2589f9 100644 --- a/x/protocolpool/simulation/proposals_test.go +++ b/x/protocolpool/simulation/proposals_test.go @@ -19,8 +19,7 @@ func TestProposalMsgs(t *testing.T) { // initialize parameters s := rand.NewSource(1) r := rand.New(s) - - ctx := sdk.NewContext(nil, true, nil) + addressCodec := codectestutil.CodecOptions{}.GetAddressCodec() accounts := simtypes.RandomAccounts(r, 3) // execute ProposalMsgs function @@ -33,7 +32,7 @@ func TestProposalMsgs(t *testing.T) { assert.Equal(t, simulation.OpWeightMsgCommunityPoolSpend, w0.AppParamsKey()) assert.Equal(t, simulation.DefaultWeightMsgCommunityPoolSpend, w0.DefaultWeight()) - msg, err := w0.MsgSimulatorFn()(r, ctx, accounts, codectestutil.CodecOptions{}.GetAddressCodec()) + msg, err := w0.MsgSimulatorFn()(r, accounts, addressCodec) assert.NilError(t, err) msgCommunityPoolSpend, ok := msg.(*pooltypes.MsgCommunityPoolSpend) assert.Assert(t, ok) @@ -41,6 +40,8 @@ func TestProposalMsgs(t *testing.T) { coins, err := sdk.ParseCoinsNormalized("100stake,2testtoken") assert.NilError(t, err) - assert.Equal(t, sdk.AccAddress(address.Module("gov")).String(), msgCommunityPoolSpend.Authority) + authAddr, err := addressCodec.BytesToString(address.Module("gov")) + assert.NilError(t, err) + assert.Equal(t, authAddr, msgCommunityPoolSpend.Authority) assert.Assert(t, msgCommunityPoolSpend.Amount.Equal(coins)) } diff --git a/x/slashing/CHANGELOG.md b/x/slashing/CHANGELOG.md index 81a7018057d4..121c64c1b0a5 100644 --- a/x/slashing/CHANGELOG.md +++ b/x/slashing/CHANGELOG.md @@ -35,6 +35,9 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### API Breaking Changes +* [#20026](https://github.com/cosmos/cosmos-sdk/pull/20026) Removal of the Address.String() method and related changes: + * `Migrate` now takes a `ValidatorAddressCodec` as argument. + * `Migrator` has a new field of `ValidatorAddressCodec` type. * [#16441](https://github.com/cosmos/cosmos-sdk/pull/16441) Params state is migrated to collections. `GetParams` has been removed. * [#17023](https://github.com/cosmos/cosmos-sdk/pull/17023) Use collections for `ValidatorSigningInfo`: * remove `Keeper`: `SetValidatorSigningInfo`, `GetValidatorSigningInfo`, `IterateValidatorSigningInfos` diff --git a/x/slashing/abci.go b/x/slashing/abci.go index 20613b40cfd6..72645213d82b 100644 --- a/x/slashing/abci.go +++ b/x/slashing/abci.go @@ -2,7 +2,6 @@ package slashing import ( "context" - "time" "cosmossdk.io/x/slashing/keeper" "cosmossdk.io/x/slashing/types" @@ -14,7 +13,7 @@ import ( // BeginBlocker check for infraction evidence or downtime of validators // on every begin block func BeginBlocker(ctx context.Context, k keeper.Keeper) error { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) + defer telemetry.ModuleMeasureSince(types.ModuleName, telemetry.Now(), telemetry.MetricKeyBeginBlocker) // Iterate over all the validators which *should* have signed this block // store whether or not they have actually signed it and slash/unbond any diff --git a/x/slashing/go.mod b/x/slashing/go.mod index b77840696322..3c304465dbf3 100644 --- a/x/slashing/go.mod +++ b/x/slashing/go.mod @@ -15,16 +15,16 @@ require ( cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 github.com/bits-and-blooms/bitset v1.10.0 github.com/cockroachdb/errors v1.11.1 - github.com/cometbft/cometbft v0.38.6 + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 github.com/cosmos/cosmos-proto v1.0.0-beta.4 github.com/cosmos/cosmos-sdk v0.51.0 - github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/gogoproto v1.4.12 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/stretchr/testify v1.9.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 - google.golang.org/grpc v1.62.1 + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de + google.golang.org/grpc v1.63.2 google.golang.org/protobuf v1.33.0 gotest.tools/v3 v3.5.1 ) @@ -61,7 +61,7 @@ require ( github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect @@ -107,7 +107,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -117,13 +117,13 @@ require ( github.com/mtibben/percent v0.2.1 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.0 // indirect github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.50.0 // indirect + github.com/prometheus/common v0.52.2 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect @@ -148,17 +148,17 @@ require ( gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 // indirect go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.21.0 // indirect + golang.org/x/crypto v0.22.0 // indirect golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.22.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.18.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect diff --git a/x/slashing/go.sum b/x/slashing/go.sum index f3e1b4f47150..b69eb2bf0bbb 100644 --- a/x/slashing/go.sum +++ b/x/slashing/go.sum @@ -120,8 +120,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -143,8 +143,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/cosmos/iavl v1.0.0 h1:bw6t0Mv/mVCJvlMTOPHWLs5uUE3BRBfVWCRelOzl+so= github.com/cosmos/iavl v1.0.0/go.mod h1:CmTGqMnRnucjxbjduneZXT+0vPgNElYvdefjX2q9tYc= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= @@ -164,8 +164,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= @@ -451,8 +451,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -555,8 +555,8 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= @@ -597,8 +597,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= -github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -751,8 +751,8 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= @@ -801,8 +801,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -814,8 +814,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -870,12 +870,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -929,12 +929,12 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -952,8 +952,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/x/slashing/keeper/migrations.go b/x/slashing/keeper/migrations.go index 8dde29ff7707..9f00003d315b 100644 --- a/x/slashing/keeper/migrations.go +++ b/x/slashing/keeper/migrations.go @@ -3,6 +3,7 @@ package keeper import ( "context" + "cosmossdk.io/core/address" v4 "cosmossdk.io/x/slashing/migrations/v4" "github.com/cosmos/cosmos-sdk/runtime" @@ -10,12 +11,16 @@ import ( // Migrator is a struct for handling in-place store migrations. type Migrator struct { - keeper Keeper + keeper Keeper + valCodec address.ValidatorAddressCodec } // NewMigrator returns a new Migrator. -func NewMigrator(keeper Keeper) Migrator { - return Migrator{keeper: keeper} +func NewMigrator(keeper Keeper, valCodec address.ValidatorAddressCodec) Migrator { + return Migrator{ + keeper: keeper, + valCodec: valCodec, + } } // Migrate1to2 migrates from version 1 to 2. @@ -40,5 +45,5 @@ func (m Migrator) Migrate3to4(ctx context.Context) error { if err != nil { return err } - return v4.Migrate(ctx, m.keeper.cdc, store, params) + return v4.Migrate(ctx, m.keeper.cdc, store, params, m.valCodec) } diff --git a/x/slashing/keeper/signing_info.go b/x/slashing/keeper/signing_info.go index 5eac3651a367..35fca38e2661 100644 --- a/x/slashing/keeper/signing_info.go +++ b/x/slashing/keeper/signing_info.go @@ -182,13 +182,7 @@ func (k Keeper) DeleteMissedBlockBitmap(ctx context.Context, addr sdk.ConsAddres } rng := collections.NewPrefixedPairRange[[]byte, uint64](addr.Bytes()) - return k.ValidatorMissedBlockBitmap.Walk(ctx, rng, func(key collections.Pair[[]byte, uint64], value []byte) (bool, error) { - err := k.ValidatorMissedBlockBitmap.Remove(ctx, key) - if err != nil { - return true, err - } - return false, nil - }) + return k.ValidatorMissedBlockBitmap.Clear(ctx, rng) } // IterateMissedBlockBitmap iterates over a validator's signed blocks window diff --git a/x/slashing/migrations/v4/migrate.go b/x/slashing/migrations/v4/migrate.go index f81566996e68..331068c32824 100644 --- a/x/slashing/migrations/v4/migrate.go +++ b/x/slashing/migrations/v4/migrate.go @@ -6,6 +6,7 @@ import ( "github.com/bits-and-blooms/bitset" gogotypes "github.com/cosmos/gogoproto/types" + "cosmossdk.io/core/address" "cosmossdk.io/errors" storetypes "cosmossdk.io/store/types" "cosmossdk.io/x/slashing/types" @@ -17,12 +18,15 @@ import ( // Migrate migrates state to consensus version 4. Specifically, the migration // deletes all existing validator bitmap entries and replaces them with a real // "chunked" bitmap. -func Migrate(ctx context.Context, cdc codec.BinaryCodec, store storetypes.KVStore, params types.Params) error { +func Migrate(ctx context.Context, cdc codec.BinaryCodec, store storetypes.KVStore, params types.Params, addressCodec address.ValidatorAddressCodec) error { // Get all the missed blocks for each validator, based on the existing signing // info. var missedBlocks []types.ValidatorMissedBlocks iterateValidatorSigningInfos(ctx, cdc, store, func(addr sdk.ConsAddress, info types.ValidatorSigningInfo) (stop bool) { - bechAddr := addr.String() + bechAddr, err := addressCodec.BytesToString(addr) + if err != nil { + return true + } localMissedBlocks := GetValidatorMissedBlocks(ctx, cdc, store, addr, params) missedBlocks = append(missedBlocks, types.ValidatorMissedBlocks{ diff --git a/x/slashing/migrations/v4/migrate_test.go b/x/slashing/migrations/v4/migrate_test.go index 41d8995af6e4..84fe79544624 100644 --- a/x/slashing/migrations/v4/migrate_test.go +++ b/x/slashing/migrations/v4/migrate_test.go @@ -12,6 +12,7 @@ import ( v4 "cosmossdk.io/x/slashing/migrations/v4" slashingtypes "cosmossdk.io/x/slashing/types" + "github.com/cosmos/cosmos-sdk/codec/address" codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" @@ -27,9 +28,12 @@ func TestMigrate(t *testing.T) { ctx := testutil.DefaultContext(storeKey, tKey) store := ctx.KVStore(storeKey) params := slashingtypes.Params{SignedBlocksWindow: 100} + valCodec := address.NewBech32Codec("cosmosvalcons") + consStrAddr, err := valCodec.BytesToString(consAddr) + require.NoError(t, err) // store old signing info and bitmap entries - bz := cdc.MustMarshal(&slashingtypes.ValidatorSigningInfo{Address: consAddr.String()}) + bz := cdc.MustMarshal(&slashingtypes.ValidatorSigningInfo{Address: consStrAddr}) store.Set(v4.ValidatorSigningInfoKey(consAddr), bz) for i := int64(0); i < params.SignedBlocksWindow; i++ { @@ -39,7 +43,7 @@ func TestMigrate(t *testing.T) { store.Set(v4.ValidatorMissedBlockBitArrayKey(consAddr, i), bz) } - err := v4.Migrate(ctx, cdc, store, params) + err = v4.Migrate(ctx, cdc, store, params, valCodec) require.NoError(t, err) for i := int64(0); i < params.SignedBlocksWindow; i++ { diff --git a/x/slashing/module.go b/x/slashing/module.go index dab442d3860d..c5ae4fef1919 100644 --- a/x/slashing/module.go +++ b/x/slashing/module.go @@ -103,7 +103,7 @@ func (am AppModule) RegisterServices(registrar grpc.ServiceRegistrar) error { // RegisterMigrations registers module migrations. func (am AppModule) RegisterMigrations(mr appmodule.MigrationRegistrar) error { - m := keeper.NewMigrator(am.keeper) + m := keeper.NewMigrator(am.keeper, am.stakingKeeper.ValidatorAddressCodec()) if err := mr.Register(types.ModuleName, 1, m.Migrate1to2); err != nil { return fmt.Errorf("failed to migrate x/%s from version 1 to 2: %w", types.ModuleName, err) diff --git a/x/slashing/proto/buf.gen.gogo.yaml b/x/slashing/proto/buf.gen.gogo.yaml index 9c8ba0a4b1fd..db36231d0c82 100644 --- a/x/slashing/proto/buf.gen.gogo.yaml +++ b/x/slashing/proto/buf.gen.gogo.yaml @@ -2,7 +2,7 @@ version: v1 plugins: - name: gocosmos out: .. - opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any - name: grpc-gateway out: .. opt: logtostderr=true,allow_colon_final_segments=true diff --git a/x/slashing/simulation/proposals.go b/x/slashing/simulation/proposals.go index 1a6e60f012ea..1ea39d97f19a 100644 --- a/x/slashing/simulation/proposals.go +++ b/x/slashing/simulation/proposals.go @@ -33,10 +33,15 @@ func ProposalMsgs() []simtypes.WeightedProposalMsg { } // SimulateMsgUpdateParams returns a random MsgUpdateParams -func SimulateMsgUpdateParams(r *rand.Rand, _ sdk.Context, _ []simtypes.Account, _ coreaddress.Codec) (sdk.Msg, error) { +func SimulateMsgUpdateParams(r *rand.Rand, _ []simtypes.Account, ac coreaddress.Codec) (sdk.Msg, error) { // use the default gov module account address as authority var authority sdk.AccAddress = address.Module("gov") + authorityAddr, err := ac.BytesToString(authority) + if err != nil { + return nil, err + } + params := types.DefaultParams() params.DowntimeJailDuration = time.Duration(simtypes.RandTimestamp(r).UnixNano()) params.SignedBlocksWindow = int64(simtypes.RandIntBetween(r, 1, 1000)) @@ -45,7 +50,7 @@ func SimulateMsgUpdateParams(r *rand.Rand, _ sdk.Context, _ []simtypes.Account, params.SlashFractionDowntime = sdkmath.LegacyNewDecWithPrec(int64(simtypes.RandIntBetween(r, 1, 100)), 2) return &types.MsgUpdateParams{ - Authority: authority.String(), + Authority: authorityAddr, Params: params, }, nil } diff --git a/x/slashing/simulation/proposals_test.go b/x/slashing/simulation/proposals_test.go index eb63a817ac6d..d2b553964a00 100644 --- a/x/slashing/simulation/proposals_test.go +++ b/x/slashing/simulation/proposals_test.go @@ -12,7 +12,6 @@ import ( "cosmossdk.io/x/slashing/types" codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" ) @@ -21,8 +20,8 @@ func TestProposalMsgs(t *testing.T) { // initialize parameters s := rand.NewSource(1) r := rand.New(s) + ac := codectestutil.CodecOptions{}.GetAddressCodec() - ctx := sdk.NewContext(nil, true, nil) accounts := simtypes.RandomAccounts(r, 3) // execute ProposalMsgs function @@ -35,12 +34,15 @@ func TestProposalMsgs(t *testing.T) { assert.Equal(t, simulation.OpWeightMsgUpdateParams, w0.AppParamsKey()) assert.Equal(t, simulation.DefaultWeightMsgUpdateParams, w0.DefaultWeight()) - msg, err := w0.MsgSimulatorFn()(r, ctx, accounts, codectestutil.CodecOptions{}.GetAddressCodec()) + msg, err := w0.MsgSimulatorFn()(r, accounts, ac) assert.NilError(t, err) msgUpdateParams, ok := msg.(*types.MsgUpdateParams) assert.Assert(t, ok) - assert.Equal(t, sdk.AccAddress(address.Module("gov")).String(), msgUpdateParams.Authority) + moduleAddr, err := ac.BytesToString(address.Module("gov")) + assert.NilError(t, err) + + assert.Equal(t, moduleAddr, msgUpdateParams.Authority) assert.Equal(t, int64(905), msgUpdateParams.Params.SignedBlocksWindow) assert.DeepEqual(t, sdkmath.LegacyNewDecWithPrec(7, 2), msgUpdateParams.Params.MinSignedPerWindow) assert.DeepEqual(t, sdkmath.LegacyNewDecWithPrec(60, 2), msgUpdateParams.Params.SlashFractionDoubleSign) diff --git a/x/staking/CHANGELOG.md b/x/staking/CHANGELOG.md index 0f09872a7d4f..a096783a6054 100644 --- a/x/staking/CHANGELOG.md +++ b/x/staking/CHANGELOG.md @@ -43,6 +43,9 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### API Breaking Changes +* [#19788](https://github.com/cosmos/cosmos-sdk/pull/19788) Remove `ABCIValidatorUpdate` and `ABCIValidatorUpdateZero`, use `ModuleValidatorUpdate` and `ModuleValidatorUpdateIsZero` instead. +* [#19754](https://github.com/cosmos/cosmos-sdk/pull/19754) Update to use `[]appmodule.ValidatorUpdate` as return for `ApplyAndReturnValidatorSetUpdates`. +* [#19414](https://github.com/cosmos/cosmos-sdk/pull/19414) `NewStakingKeeper` takes an environment variable instead of individual services. * [#19742](https://github.com/cosmos/cosmos-sdk/pull/19742) `NewStakeAuthorization` now takes `address.Codec` as argument. * [#19735](https://github.com/cosmos/cosmos-sdk/pull/19735) Update genesis api to match new `appmodule.HasGenesis` interface. * [#18198](https://github.com/cosmos/cosmos-sdk/pull/18198) `Validator` and `Delegator` interfaces were moved to `github.com/cosmos/cosmos-sdk/types` to avoid interface dependency on staking in other modules. @@ -85,18 +88,15 @@ Ref: https://keepachangelog.com/en/1.0.0/ * remove from `types`: `GetUnbondingTypeKey`. * [#17063](https://github.com/cosmos/cosmos-sdk/pull/17063) Use collections for `HistoricalInfo`: * remove `Keeper`: `GetHistoricalInfo`, `SetHistoricalInfo` -* [#17062](https://github.com/cosmos/cosmos-sdk/pull/17062) Use collections for `ValidatorUpdates`: - * remove `Keeper`: `SetValidatorUpdates`, `GetValidatorUpdates` +* [#17062](https://github.com/cosmos/cosmos-sdk/pull/17062), [#19788](https://github.com/cosmos/cosmos-sdk/pull/19788) Remove `GetValidatorUpdates` and `ValidatorUpdates` storage. * [#17026](https://github.com/cosmos/cosmos-sdk/pull/17026) Use collections for `LastTotalPower`: * remove `Keeper`: `SetLastTotalPower`, `GetLastTotalPower` * [#17335](https://github.com/cosmos/cosmos-sdk/pull/17335) Remove usage of `"cosmossdk.io/x/staking/types".Infraction_*` in favour of `"cosmossdk.io/api/cosmos/staking/v1beta1".Infraction_` in order to remove dependency between modules on staking * [#17655](https://github.com/cosmos/cosmos-sdk/pull/17655) `QueryHistoricalInfo` was adjusted to return `HistoricalRecord` and marked `Hist` as deprecated. -* [#19414](https://github.com/cosmos/cosmos-sdk/pull/19414) Staking module takes an environment variable in `NewStakingKeeper` instead of individual services. -* [#19754](https://github.com/cosmos/cosmos-sdk/pull/19754) update to use `[]module.ValidatorUpdate` as return for `ApplyAndReturnValidatorSetUpdates`. ### State Breaking changes * [#18841](https://github.com/cosmos/cosmos-sdk/pull/18841) In a undelegation or redelegation if the shares being left delegated correspond to less than 1 token (in base denom) the entire delegation gets removed. * [#18142](https://github.com/cosmos/cosmos-sdk/pull/18142) Introduce `key_rotation_fee` param to calculate fees while rotating the keys * [#17655](https://github.com/cosmos/cosmos-sdk/pull/17655) `HistoricalInfo` was replaced with `HistoricalRecord`, it removes the validator set and comet header and only keep what is needed for IBC. -* [#19740](https://github.com/cosmos/cosmos-sdk/pull/19740) Verify `InitGenesis` and `ExportGenesis` module code and keeper code do not panic. \ No newline at end of file +* [#19740](https://github.com/cosmos/cosmos-sdk/pull/19740) Verify `InitGenesis` and `ExportGenesis` module code and keeper code do not panic. diff --git a/x/staking/README.md b/x/staking/README.md index 713accb96c9f..84c3ab22781e 100644 --- a/x/staking/README.md +++ b/x/staking/README.md @@ -23,7 +23,6 @@ network. * [State](#state) * [Pool](#pool) * [LastTotalPower](#lasttotalpower) - * [ValidatorUpdates](#validatorupdates) * [UnbondingID](#unbondingid) * [Params](#params) * [Validator](#validator) @@ -75,13 +74,6 @@ Store entries prefixed with "Last" must remain unchanged until EndBlock. * LastTotalPower: `0x12 -> ProtocolBuffer(math.Int)` -### ValidatorUpdates - -ValidatorUpdates contains the validator updates returned to ABCI at the end of every block. -The values are overwritten in every block. - -* ValidatorUpdates `0x61 -> []abci.ValidatorUpdate` - ### UnbondingID UnbondingID stores the ID of the latest unbonding operation. It enables creating unique IDs for unbonding operations, i.e., UnbondingID is incremented every time a new unbonding operation (validator unbonding, unbonding delegation, redelegation) is initiated. diff --git a/x/staking/go.mod b/x/staking/go.mod index d2e52c3fbca4..064d871bbc31 100644 --- a/x/staking/go.mod +++ b/x/staking/go.mod @@ -12,10 +12,10 @@ require ( cosmossdk.io/math v1.3.0 cosmossdk.io/store v1.0.2 cosmossdk.io/x/accounts v0.0.0-00010101000000-000000000000 // indirect - github.com/cometbft/cometbft v0.38.6 + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 github.com/cosmos/cosmos-proto v1.0.0-beta.4 github.com/cosmos/cosmos-sdk v0.51.0 - github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/gogoproto v1.4.12 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 @@ -24,8 +24,8 @@ require ( github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.9.0 golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 - google.golang.org/grpc v1.62.1 + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de + google.golang.org/grpc v1.63.2 google.golang.org/protobuf v1.33.0 gotest.tools/v3 v3.5.1 ) @@ -63,7 +63,7 @@ require ( github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect @@ -108,7 +108,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -118,13 +118,13 @@ require ( github.com/mtibben/percent v0.2.1 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.0 // indirect github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.50.0 // indirect + github.com/prometheus/common v0.52.2 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect @@ -147,16 +147,16 @@ require ( gitlab.com/yawning/tuplehash v0.0.0-20230713102510-df83abbf9a02 // indirect go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.21.0 // indirect + golang.org/x/crypto v0.22.0 // indirect golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.22.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.18.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect diff --git a/x/staking/go.sum b/x/staking/go.sum index 046ebfecd550..507f3ab80bd9 100644 --- a/x/staking/go.sum +++ b/x/staking/go.sum @@ -118,8 +118,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -141,8 +141,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/cosmos/iavl v1.0.0 h1:bw6t0Mv/mVCJvlMTOPHWLs5uUE3BRBfVWCRelOzl+so= github.com/cosmos/iavl v1.0.0/go.mod h1:CmTGqMnRnucjxbjduneZXT+0vPgNElYvdefjX2q9tYc= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= @@ -162,8 +162,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= @@ -449,8 +449,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -553,8 +553,8 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= @@ -595,8 +595,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= -github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -749,8 +749,8 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= @@ -799,8 +799,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -812,8 +812,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -868,12 +868,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -927,12 +927,12 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -950,8 +950,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/x/staking/keeper/abci.go b/x/staking/keeper/abci.go index 174fd5c21af7..59db9be890cb 100644 --- a/x/staking/keeper/abci.go +++ b/x/staking/keeper/abci.go @@ -2,23 +2,23 @@ package keeper import ( "context" - "time" + "cosmossdk.io/core/appmodule" "cosmossdk.io/x/staking/types" "github.com/cosmos/cosmos-sdk/telemetry" - "github.com/cosmos/cosmos-sdk/types/module" ) // BeginBlocker will persist the current header and validator set as a historical entry // and prune the oldest entry based on the HistoricalEntries parameter func (k *Keeper) BeginBlocker(ctx context.Context) error { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) + defer telemetry.ModuleMeasureSince(types.ModuleName, telemetry.Now(), telemetry.MetricKeyBeginBlocker) return k.TrackHistoricalInfo(ctx) } // EndBlocker called at every block, update validator set -func (k *Keeper) EndBlocker(ctx context.Context) ([]module.ValidatorUpdate, error) { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyEndBlocker) +func (k *Keeper) EndBlocker(ctx context.Context) ([]appmodule.ValidatorUpdate, error) { + start := telemetry.Now() + defer telemetry.ModuleMeasureSince(types.ModuleName, start, telemetry.MetricKeyEndBlocker) return k.BlockValidatorUpdates(ctx) } diff --git a/x/staking/keeper/cons_pubkey.go b/x/staking/keeper/cons_pubkey.go index f666ae21e542..7c327b5b61e6 100644 --- a/x/staking/keeper/cons_pubkey.go +++ b/x/staking/keeper/cons_pubkey.go @@ -202,9 +202,7 @@ func (k Keeper) deleteConsKeyIndexKey(ctx context.Context, valAddr sdk.ValAddres StartInclusive(collections.Join(valAddr.Bytes(), time.Time{})). EndInclusive(collections.Join(valAddr.Bytes(), ts)) - return k.ValidatorConsensusKeyRotationRecordIndexKey.Walk(ctx, rng, func(key collections.Pair[[]byte, time.Time]) (stop bool, err error) { - return false, k.ValidatorConsensusKeyRotationRecordIndexKey.Remove(ctx, key) - }) + return k.ValidatorConsensusKeyRotationRecordIndexKey.Clear(ctx, rng) } // getAndRemoveAllMaturedRotatedKeys returns all matured valaddresses. @@ -213,14 +211,23 @@ func (k Keeper) getAndRemoveAllMaturedRotatedKeys(ctx context.Context, matureTim // get an iterator for all timeslices from time 0 until the current HeaderInfo time rng := new(collections.Range[time.Time]).EndInclusive(matureTime) + keysToRemove := []time.Time{} err := k.ValidatorConsensusKeyRotationRecordQueue.Walk(ctx, rng, func(key time.Time, value types.ValAddrsOfRotatedConsKeys) (stop bool, err error) { valAddrs = append(valAddrs, value.Addresses...) - return false, k.ValidatorConsensusKeyRotationRecordQueue.Remove(ctx, key) + keysToRemove = append(keysToRemove, key) + return false, nil }) if err != nil { return nil, err } + // remove all the keys from the list + for _, key := range keysToRemove { + if err := k.ValidatorConsensusKeyRotationRecordQueue.Remove(ctx, key); err != nil { + return nil, err + } + } + return valAddrs, nil } diff --git a/x/staking/keeper/genesis.go b/x/staking/keeper/genesis.go index 1db8b9f0adf1..b59bda1ad598 100644 --- a/x/staking/keeper/genesis.go +++ b/x/staking/keeper/genesis.go @@ -5,11 +5,11 @@ import ( "fmt" "cosmossdk.io/collections" + "cosmossdk.io/core/appmodule" "cosmossdk.io/math" "cosmossdk.io/x/staking/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" ) // InitGenesis sets the pool and parameters for the provided keeper. For each @@ -17,7 +17,7 @@ import ( // setting the indexes. In addition, it also sets any delegations found in // data. Finally, it updates the bonded validators. // Returns final validator set after applying all declaration and delegations -func (k Keeper) InitGenesis(ctx context.Context, data *types.GenesisState) ([]module.ValidatorUpdate, error) { +func (k Keeper) InitGenesis(ctx context.Context, data *types.GenesisState) ([]appmodule.ValidatorUpdate, error) { bondedTokens := math.ZeroInt() notBondedTokens := math.ZeroInt() @@ -175,7 +175,7 @@ func (k Keeper) InitGenesis(ctx context.Context, data *types.GenesisState) ([]mo } // don't need to run CometBFT updates if we exported - var moduleValidatorUpdates []module.ValidatorUpdate + var moduleValidatorUpdates []appmodule.ValidatorUpdate if data.Exported { for _, lv := range data.LastValidatorPowers { valAddr, err := k.validatorAddressCodec.StringToBytes(lv.Address) diff --git a/x/staking/keeper/keeper.go b/x/staking/keeper/keeper.go index 6cb5dab27826..ca25c8093c2d 100644 --- a/x/staking/keeper/keeper.go +++ b/x/staking/keeper/keeper.go @@ -83,8 +83,6 @@ type Keeper struct { HistoricalInfo collections.Map[uint64, types.HistoricalRecord] // LastTotalPower value: LastTotalPower LastTotalPower collections.Item[math.Int] - // ValidatorUpdates value: ValidatorUpdates - ValidatorUpdates collections.Item[types.ValidatorUpdates] // DelegationsByValidator key: valAddr+delAddr | value: none used (index key for delegations by validator index) DelegationsByValidator collections.Map[collections.Pair[sdk.ValAddress, sdk.AccAddress], []byte] UnbondingID collections.Sequence @@ -171,7 +169,6 @@ func NewKeeper( consensusAddressCodec: consensusAddressCodec, LastTotalPower: collections.NewItem(sb, types.LastTotalPowerKey, "last_total_power", sdk.IntValue), HistoricalInfo: collections.NewMap(sb, types.HistoricalInfoKey, "historical_info", collections.Uint64Key, HistoricalInfoCodec(cdc)), - ValidatorUpdates: collections.NewItem(sb, types.ValidatorUpdatesKey, "validator_updates", codec.CollValue[types.ValidatorUpdates](cdc)), Delegations: collections.NewMap( sb, types.DelegationKey, "delegations", collections.PairKeyCodec( diff --git a/x/staking/keeper/migrations.go b/x/staking/keeper/migrations.go index 63a674470595..8c9b555a4bb7 100644 --- a/x/staking/keeper/migrations.go +++ b/x/staking/keeper/migrations.go @@ -4,6 +4,7 @@ import ( "context" v5 "cosmossdk.io/x/staking/migrations/v5" + v6 "cosmossdk.io/x/staking/migrations/v6" "github.com/cosmos/cosmos-sdk/runtime" ) @@ -40,3 +41,9 @@ func (m Migrator) Migrate4to5(ctx context.Context) error { store := runtime.KVStoreAdapter(m.keeper.environment.KVStoreService.OpenKVStore(ctx)) return v5.MigrateStore(ctx, store, m.keeper.cdc, m.keeper.Logger()) } + +// Migrate4to5 migrates x/staking state from consensus version 5 to 6. +func (m Migrator) Migrate5to6(ctx context.Context) error { + store := runtime.KVStoreAdapter(m.keeper.environment.KVStoreService.OpenKVStore(ctx)) + return v6.MigrateStore(ctx, store, m.keeper.cdc) +} diff --git a/x/staking/keeper/val_state_change.go b/x/staking/keeper/val_state_change.go index e2bfe780a44b..3279faa001f3 100644 --- a/x/staking/keeper/val_state_change.go +++ b/x/staking/keeper/val_state_change.go @@ -6,25 +6,23 @@ import ( "fmt" "sort" - abci "github.com/cometbft/cometbft/abci/types" gogotypes "github.com/cosmos/gogoproto/types" "cosmossdk.io/core/address" + "cosmossdk.io/core/appmodule" "cosmossdk.io/core/event" errorsmod "cosmossdk.io/errors" "cosmossdk.io/math" "cosmossdk.io/x/staking/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/types/module" ) // BlockValidatorUpdates calculates the ValidatorUpdates for the current block // Called in each EndBlock -func (k Keeper) BlockValidatorUpdates(ctx context.Context) ([]module.ValidatorUpdate, error) { +func (k Keeper) BlockValidatorUpdates(ctx context.Context) ([]appmodule.ValidatorUpdate, error) { // Calculate validator set changes. // // NOTE: ApplyAndReturnValidatorSetUpdates has to come before @@ -138,7 +136,7 @@ func (k Keeper) BlockValidatorUpdates(ctx context.Context) ([]module.ValidatorUp // CONTRACT: Only validators with non-zero power or zero-power that were bonded // at the previous block height or were removed from the validator set entirely // are returned to CometBFT. -func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx context.Context) ([]module.ValidatorUpdate, error) { +func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx context.Context) ([]appmodule.ValidatorUpdate, error) { params, err := k.Params.Get(ctx) if err != nil { return nil, err @@ -163,8 +161,7 @@ func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx context.Context) ([]module } defer iterator.Close() - var updates []abci.ValidatorUpdate - var moduleValidatorUpdates []module.ValidatorUpdate + var updates []appmodule.ValidatorUpdate for count := 0; iterator.Valid() && count < int(maxValidators); iterator.Next() { // everything that is iterated in this loop is becoming or already a // part of the bonded validator set @@ -215,8 +212,7 @@ func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx context.Context) ([]module // update the validator set if power has changed if !found || !bytes.Equal(oldPowerBytes, newPowerBytes) { - updates = append(updates, validator.ABCIValidatorUpdate(powerReduction)) - moduleValidatorUpdates = append(moduleValidatorUpdates, validator.ModuleValidatorUpdate(powerReduction)) + updates = append(updates, validator.ModuleValidatorUpdate(powerReduction)) if err = k.SetLastValidatorPower(ctx, valAddr, newPower); err != nil { return nil, err } @@ -251,8 +247,7 @@ func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx context.Context) ([]module return nil, err } - updates = append(updates, validator.ABCIValidatorUpdateZero()) - moduleValidatorUpdates = append(moduleValidatorUpdates, validator.ModuleValidatorUpdateZero()) + updates = append(updates, validator.ModuleValidatorUpdateZero()) } // ApplyAndReturnValidatorSetUpdates checks if there is ConsPubKeyRotationHistory @@ -265,10 +260,6 @@ func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx context.Context) ([]module for _, history := range historyObjects { valAddr := history.OperatorAddress - if err != nil { - return nil, err - } - validator, err := k.GetValidator(ctx, valAddr) if err != nil { return nil, err @@ -278,41 +269,23 @@ func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx context.Context) ([]module if !ok { return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidType, "Expecting cryptotypes.PubKey, got %T", oldPk) } - oldCmtPk, err := cryptocodec.ToCmtProtoPublicKey(oldPk) - if err != nil { - return nil, err - } newPk, ok := history.NewConsPubkey.GetCachedValue().(cryptotypes.PubKey) if !ok { return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidType, "Expecting cryptotypes.PubKey, got %T", newPk) } - newCmtPk, err := cryptocodec.ToCmtProtoPublicKey(newPk) - if err != nil { - return nil, err - } // a validator cannot rotate keys if it's not bonded or if it's jailed // - a validator can be unbonding state but jailed status false // - a validator can be jailed and status can be unbonding if !(validator.Jailed || validator.Status != types.Bonded) { - updates = append(updates, abci.ValidatorUpdate{ - PubKey: oldCmtPk, - Power: 0, - }) - - moduleValidatorUpdates = append(moduleValidatorUpdates, module.ValidatorUpdate{ + updates = append(updates, appmodule.ValidatorUpdate{ PubKey: oldPk.Bytes(), PubKeyType: oldPk.Type(), Power: 0, }) - updates = append(updates, abci.ValidatorUpdate{ - PubKey: newCmtPk, - Power: validator.ConsensusPower(powerReduction), - }) - - moduleValidatorUpdates = append(moduleValidatorUpdates, module.ValidatorUpdate{ + updates = append(updates, appmodule.ValidatorUpdate{ PubKey: newPk.Bytes(), PubKeyType: newPk.Type(), Power: validator.ConsensusPower(powerReduction), @@ -350,13 +323,7 @@ func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx context.Context) ([]module } } - valUpdates := types.ValidatorUpdates{Updates: updates} - // set the list of validator updates - if err = k.ValidatorUpdates.Set(ctx, valUpdates); err != nil { - return nil, err - } - - return moduleValidatorUpdates, err + return updates, err } // Validator state transitions diff --git a/x/staking/keeper/validator.go b/x/staking/keeper/validator.go index b8c4472cccb4..6e496f756762 100644 --- a/x/staking/keeper/validator.go +++ b/x/staking/keeper/validator.go @@ -494,9 +494,24 @@ func (k Keeper) UnbondAllMatureValidators(ctx context.Context) error { rng := new(collections.Range[collections.Triple[uint64, time.Time, uint64]]). EndInclusive(collections.Join3(uint64(29), blockTime, blockHeight)) - return k.ValidatorQueue.Walk(ctx, rng, func(key collections.Triple[uint64, time.Time, uint64], value types.ValAddresses) (stop bool, err error) { - return false, k.unbondMatureValidators(ctx, blockHeight, blockTime, key, value) - }) + // get all the values before performing any delete operations + iter, err := k.ValidatorQueue.Iterate(ctx, rng) + if err != nil { + return err + } + + kvs, err := iter.KeyValues() + if err != nil { + return err + } + + for _, kv := range kvs { + if err := k.unbondMatureValidators(ctx, blockHeight, blockTime, kv.Key, kv.Value); err != nil { + return err + } + } + + return nil } func (k Keeper) unbondMatureValidators( diff --git a/x/staking/keeper/validator_test.go b/x/staking/keeper/validator_test.go index 2c7a90f98cc1..d6f0655e981b 100644 --- a/x/staking/keeper/validator_test.go +++ b/x/staking/keeper/validator_test.go @@ -6,6 +6,7 @@ import ( "github.com/golang/mock/gomock" "cosmossdk.io/collections" + "cosmossdk.io/core/appmodule" "cosmossdk.io/core/header" "cosmossdk.io/math" authtypes "cosmossdk.io/x/auth/types" @@ -14,10 +15,9 @@ import ( stakingtypes "cosmossdk.io/x/staking/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" ) -func (s *KeeperTestSuite) applyValidatorSetUpdates(ctx sdk.Context, keeper *stakingkeeper.Keeper, expectedUpdatesLen int) []module.ValidatorUpdate { +func (s *KeeperTestSuite) applyValidatorSetUpdates(ctx sdk.Context, keeper *stakingkeeper.Keeper, expectedUpdatesLen int) []appmodule.ValidatorUpdate { updates, err := keeper.ApplyAndReturnValidatorSetUpdates(ctx) s.Require().NoError(err) if expectedUpdatesLen >= 0 { diff --git a/x/staking/migrations/v5/store.go b/x/staking/migrations/v5/store.go index 38ff590b3271..37117c5901a0 100644 --- a/x/staking/migrations/v5/store.go +++ b/x/staking/migrations/v5/store.go @@ -13,7 +13,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -func migrateDelegationsByValidatorIndex(ctx context.Context, store storetypes.KVStore, cdc codec.BinaryCodec) error { +func migrateDelegationsByValidatorIndex(store storetypes.KVStore) error { iterator := storetypes.KVStorePrefixIterator(store, DelegationKey) for ; iterator.Valid(); iterator.Next() { @@ -31,7 +31,7 @@ func migrateDelegationsByValidatorIndex(ctx context.Context, store storetypes.KV // MigrateStore performs in-place store migrations from v4 to v5. func MigrateStore(ctx context.Context, store storetypes.KVStore, cdc codec.BinaryCodec, logger log.Logger) error { - if err := migrateDelegationsByValidatorIndex(ctx, store, cdc); err != nil { + if err := migrateDelegationsByValidatorIndex(store); err != nil { return err } return migrateHistoricalInfoKeys(store, logger) diff --git a/x/staking/migrations/v6/keys.go b/x/staking/migrations/v6/keys.go new file mode 100644 index 000000000000..ed44b1c56faf --- /dev/null +++ b/x/staking/migrations/v6/keys.go @@ -0,0 +1,5 @@ +package v6 + +import "cosmossdk.io/collections" + +var ValidatorUpdatesKey = collections.NewPrefix(97) diff --git a/x/staking/migrations/v6/store.go b/x/staking/migrations/v6/store.go new file mode 100644 index 000000000000..235e7fbf6ce4 --- /dev/null +++ b/x/staking/migrations/v6/store.go @@ -0,0 +1,16 @@ +package v6 + +import ( + "context" + + storetypes "cosmossdk.io/store/types" + + "github.com/cosmos/cosmos-sdk/codec" +) + +// MigrateStore performs in-place store migrations from v5 to v6. +// It deletes the ValidatorUpdatesKey from the store. +func MigrateStore(ctx context.Context, store storetypes.KVStore, cdc codec.BinaryCodec) error { + store.Delete(ValidatorUpdatesKey) + return nil +} diff --git a/x/staking/module.go b/x/staking/module.go index 1978689d6efc..ec28b212aad2 100644 --- a/x/staking/module.go +++ b/x/staking/module.go @@ -23,7 +23,7 @@ import ( ) const ( - consensusVersion uint64 = 5 + consensusVersion uint64 = 6 ) var ( @@ -125,6 +125,9 @@ func (am AppModule) RegisterMigrations(mr appmodule.MigrationRegistrar) error { if err := mr.Register(types.ModuleName, 4, m.Migrate4to5); err != nil { return fmt.Errorf("failed to migrate x/%s from version 4 to 5: %v", types.ModuleName, err) } + if err := mr.Register(types.ModuleName, 5, m.Migrate5to6); err != nil { + return fmt.Errorf("failed to migrate x/%s from version 5 to 6: %v", types.ModuleName, err) + } return nil } @@ -145,7 +148,7 @@ func (am AppModule) ValidateGenesis(bz json.RawMessage) error { } // InitGenesis performs genesis initialization for the staking module. -func (am AppModule) InitGenesis(ctx context.Context, data json.RawMessage) ([]module.ValidatorUpdate, error) { +func (am AppModule) InitGenesis(ctx context.Context, data json.RawMessage) ([]appmodule.ValidatorUpdate, error) { var genesisState types.GenesisState am.cdc.MustUnmarshalJSON(data, &genesisState) return am.keeper.InitGenesis(ctx, &genesisState) @@ -173,6 +176,6 @@ func (am AppModule) BeginBlock(ctx context.Context) error { } // EndBlock returns the end blocker for the staking module. -func (am AppModule) EndBlock(ctx context.Context) ([]module.ValidatorUpdate, error) { +func (am AppModule) EndBlock(ctx context.Context) ([]appmodule.ValidatorUpdate, error) { return am.keeper.EndBlocker(ctx) } diff --git a/x/staking/proto/buf.gen.gogo.yaml b/x/staking/proto/buf.gen.gogo.yaml index 9c8ba0a4b1fd..db36231d0c82 100644 --- a/x/staking/proto/buf.gen.gogo.yaml +++ b/x/staking/proto/buf.gen.gogo.yaml @@ -2,7 +2,7 @@ version: v1 plugins: - name: gocosmos out: .. - opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any - name: grpc-gateway out: .. opt: logtostderr=true,allow_colon_final_segments=true diff --git a/x/staking/proto/cosmos/staking/v1beta1/staking.proto b/x/staking/proto/cosmos/staking/v1beta1/staking.proto index dc76b743f6ad..9a617b69ea6a 100644 --- a/x/staking/proto/cosmos/staking/v1beta1/staking.proto +++ b/x/staking/proto/cosmos/staking/v1beta1/staking.proto @@ -406,6 +406,8 @@ enum Infraction { // ValidatorUpdates defines an array of abci.ValidatorUpdate objects. // TODO: explore moving this to proto/cosmos/base to separate modules from tendermint dependence message ValidatorUpdates { + option deprecated = true; + repeated tendermint.abci.ValidatorUpdate updates = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } diff --git a/x/staking/simulation/proposals.go b/x/staking/simulation/proposals.go index 9a74e2509bd3..000984b46cdd 100644 --- a/x/staking/simulation/proposals.go +++ b/x/staking/simulation/proposals.go @@ -33,7 +33,7 @@ func ProposalMsgs() []simtypes.WeightedProposalMsg { } // SimulateMsgUpdateParams returns a random MsgUpdateParams -func SimulateMsgUpdateParams(r *rand.Rand, _ sdk.Context, _ []simtypes.Account, addressCodec coreaddress.Codec) (sdk.Msg, error) { +func SimulateMsgUpdateParams(r *rand.Rand, _ []simtypes.Account, addressCodec coreaddress.Codec) (sdk.Msg, error) { // use the default gov module account address as authority var authority sdk.AccAddress = address.Module("gov") diff --git a/x/staking/simulation/proposals_test.go b/x/staking/simulation/proposals_test.go index 359a218b484e..64eb447a8559 100644 --- a/x/staking/simulation/proposals_test.go +++ b/x/staking/simulation/proposals_test.go @@ -12,7 +12,6 @@ import ( "cosmossdk.io/x/staking/types" codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" ) @@ -22,7 +21,6 @@ func TestProposalMsgs(t *testing.T) { s := rand.NewSource(1) r := rand.New(s) - ctx := sdk.NewContext(nil, true, nil) accounts := simtypes.RandomAccounts(r, 3) addressCodec := codectestutil.CodecOptions{}.GetAddressCodec() // execute ProposalMsgs function @@ -35,7 +33,7 @@ func TestProposalMsgs(t *testing.T) { assert.Equal(t, simulation.OpWeightMsgUpdateParams, w0.AppParamsKey()) assert.Equal(t, simulation.DefaultWeightMsgUpdateParams, w0.DefaultWeight()) - msg, err := w0.MsgSimulatorFn()(r, ctx, accounts, addressCodec) + msg, err := w0.MsgSimulatorFn()(r, accounts, addressCodec) assert.NilError(t, err) msgUpdateParams, ok := msg.(*types.MsgUpdateParams) assert.Assert(t, ok) diff --git a/x/staking/types/keys.go b/x/staking/types/keys.go index c519ce181ab7..2b4213e277f4 100644 --- a/x/staking/types/keys.go +++ b/x/staking/types/keys.go @@ -57,10 +57,8 @@ var ( RedelegationQueueKey = collections.NewPrefix(66) // prefix for the timestamps in redelegations queue ValidatorQueueKey = collections.NewPrefix(67) // prefix for the timestamps in validator queue - HistoricalInfoKey = collections.NewPrefix(80) // prefix for the historical info - ValidatorUpdatesKey = collections.NewPrefix(97) // prefix for the end block validator updates key - - ParamsKey = collections.NewPrefix(81) // prefix for parameters for module x/staking + HistoricalInfoKey = collections.NewPrefix(80) // prefix for the historical info + ParamsKey = collections.NewPrefix(81) // prefix for parameters for module x/staking DelegationByValIndexKey = collections.NewPrefix(113) // key for delegations by a validator @@ -72,6 +70,11 @@ var ( OldToNewConsKeyMap = collections.NewPrefix(106) // prefix for rotated cons address to new cons address ) +// Reserved kvstore keys +var ( + _ = collections.NewPrefix(97) +) + // UnbondingType defines the type of unbonding operation type UnbondingType int diff --git a/x/staking/types/staking.pb.go b/x/staking/types/staking.pb.go index 0494f43106ad..fc5531046214 100644 --- a/x/staking/types/staking.pb.go +++ b/x/staking/types/staking.pb.go @@ -8,17 +8,17 @@ import ( compress_gzip "compress/gzip" cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" - types3 "github.com/cometbft/cometbft/abci/types" + types2 "github.com/cometbft/cometbft/abci/types" types "github.com/cometbft/cometbft/proto/tendermint/types" _ "github.com/cosmos/cosmos-proto" - types1 "github.com/cosmos/cosmos-sdk/codec/types" - types2 "github.com/cosmos/cosmos-sdk/types" + types1 "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" github_com_cosmos_gogoproto_proto "github.com/cosmos/gogoproto/proto" proto "github.com/cosmos/gogoproto/proto" github_com_cosmos_gogoproto_protoc_gen_gogo_descriptor "github.com/cosmos/gogoproto/protoc-gen-gogo/descriptor" github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + any "github.com/cosmos/gogoproto/types/any" _ "google.golang.org/protobuf/types/known/durationpb" _ "google.golang.org/protobuf/types/known/timestamppb" io "io" @@ -416,7 +416,7 @@ type Validator struct { // operator_address defines the address of the validator's operator; bech encoded in JSON. OperatorAddress string `protobuf:"bytes,1,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` // consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. - ConsensusPubkey *types1.Any `protobuf:"bytes,2,opt,name=consensus_pubkey,json=consensusPubkey,proto3" json:"consensus_pubkey,omitempty"` + ConsensusPubkey *any.Any `protobuf:"bytes,2,opt,name=consensus_pubkey,json=consensusPubkey,proto3" json:"consensus_pubkey,omitempty"` // jailed defined whether the validator has been jailed from bonded status or not. Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed,omitempty"` // status is the validator status (bonded/unbonding/unbonded). @@ -1000,7 +1000,7 @@ type Params struct { MinCommissionRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=min_commission_rate,json=minCommissionRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"min_commission_rate" yaml:"min_commission_rate"` // key_rotation_fee is fee to be spent when rotating validator's key // (either consensus pubkey or operator key) - KeyRotationFee types2.Coin `protobuf:"bytes,7,opt,name=key_rotation_fee,json=keyRotationFee,proto3" json:"key_rotation_fee"` + KeyRotationFee types1.Coin `protobuf:"bytes,7,opt,name=key_rotation_fee,json=keyRotationFee,proto3" json:"key_rotation_fee"` } func (m *Params) Reset() { *m = Params{} } @@ -1071,18 +1071,18 @@ func (m *Params) GetBondDenom() string { return "" } -func (m *Params) GetKeyRotationFee() types2.Coin { +func (m *Params) GetKeyRotationFee() types1.Coin { if m != nil { return m.KeyRotationFee } - return types2.Coin{} + return types1.Coin{} } // DelegationResponse is equivalent to Delegation except that it contains a // balance in addition to shares which is more suitable for client responses. type DelegationResponse struct { Delegation Delegation `protobuf:"bytes,1,opt,name=delegation,proto3" json:"delegation"` - Balance types2.Coin `protobuf:"bytes,2,opt,name=balance,proto3" json:"balance"` + Balance types1.Coin `protobuf:"bytes,2,opt,name=balance,proto3" json:"balance"` } func (m *DelegationResponse) Reset() { *m = DelegationResponse{} } @@ -1125,11 +1125,11 @@ func (m *DelegationResponse) GetDelegation() Delegation { return Delegation{} } -func (m *DelegationResponse) GetBalance() types2.Coin { +func (m *DelegationResponse) GetBalance() types1.Coin { if m != nil { return m.Balance } - return types2.Coin{} + return types1.Coin{} } // RedelegationEntryResponse is equivalent to a RedelegationEntry except that it @@ -1277,8 +1277,10 @@ var xxx_messageInfo_Pool proto.InternalMessageInfo // ValidatorUpdates defines an array of abci.ValidatorUpdate objects. // TODO: explore moving this to proto/cosmos/base to separate modules from tendermint dependence +// +// Deprecated: Do not use. type ValidatorUpdates struct { - Updates []types3.ValidatorUpdate `protobuf:"bytes,1,rep,name=updates,proto3" json:"updates"` + Updates []types2.ValidatorUpdate `protobuf:"bytes,1,rep,name=updates,proto3" json:"updates"` } func (m *ValidatorUpdates) Reset() { *m = ValidatorUpdates{} } @@ -1314,7 +1316,7 @@ func (m *ValidatorUpdates) XXX_DiscardUnknown() { var xxx_messageInfo_ValidatorUpdates proto.InternalMessageInfo -func (m *ValidatorUpdates) GetUpdates() []types3.ValidatorUpdate { +func (m *ValidatorUpdates) GetUpdates() []types2.ValidatorUpdate { if m != nil { return m.Updates } @@ -1326,13 +1328,13 @@ type ConsPubKeyRotationHistory struct { // operator_address defines the address of the validator's operator; bech encoded in JSON. OperatorAddress []byte `protobuf:"bytes,1,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` // old_cons_pubkey is the old consensus public key of the validator, as a Protobuf Any. - OldConsPubkey *types1.Any `protobuf:"bytes,2,opt,name=old_cons_pubkey,json=oldConsPubkey,proto3" json:"old_cons_pubkey,omitempty"` + OldConsPubkey *any.Any `protobuf:"bytes,2,opt,name=old_cons_pubkey,json=oldConsPubkey,proto3" json:"old_cons_pubkey,omitempty"` // new_cons_pubkey is the new consensus public key of the validator, as a Protobuf Any. - NewConsPubkey *types1.Any `protobuf:"bytes,3,opt,name=new_cons_pubkey,json=newConsPubkey,proto3" json:"new_cons_pubkey,omitempty"` + NewConsPubkey *any.Any `protobuf:"bytes,3,opt,name=new_cons_pubkey,json=newConsPubkey,proto3" json:"new_cons_pubkey,omitempty"` // height defines the block height at which the rotation event occurred. Height uint64 `protobuf:"varint,4,opt,name=height,proto3" json:"height,omitempty"` // fee holds the amount of fee deduced for the rotation. - Fee types2.Coin `protobuf:"bytes,5,opt,name=fee,proto3" json:"fee"` + Fee types1.Coin `protobuf:"bytes,5,opt,name=fee,proto3" json:"fee"` } func (m *ConsPubKeyRotationHistory) Reset() { *m = ConsPubKeyRotationHistory{} } @@ -1448,138 +1450,138 @@ func init() { } var fileDescriptor_64c30c6cf92913c9 = []byte{ - // 2083 bytes of a gzipped FileDescriptorProto + // 2084 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x59, 0x4d, 0x6c, 0x5b, 0x49, 0x1d, 0xcf, 0xb3, 0x5d, 0x27, 0xf9, 0xdb, 0x89, 0x9d, 0xe9, 0x97, 0xe3, 0xee, 0xc6, 0xae, 0xb7, 0xb0, 0x6d, 0xa1, 0x0e, 0x2d, 0xa8, 0x87, 0x80, 0x40, 0x75, 0xec, 0x6e, 0xbd, 0x1f, 0x49, 0x78, - 0x4e, 0x02, 0xcb, 0xd7, 0xd3, 0xf8, 0xbd, 0xb1, 0xfd, 0x88, 0x3d, 0xcf, 0xbc, 0x19, 0xb7, 0xf5, - 0x9d, 0xc3, 0x2a, 0x2b, 0xa4, 0x3d, 0x01, 0x12, 0xaa, 0xa8, 0xc4, 0x65, 0xb9, 0xed, 0xa1, 0xe2, - 0xce, 0x6d, 0x41, 0x42, 0xaa, 0x7a, 0x42, 0x48, 0x04, 0xd4, 0x1e, 0xba, 0x82, 0x0b, 0xe2, 0xc4, - 0x11, 0xcd, 0xbc, 0x79, 0x1f, 0x8e, 0xe3, 0xe6, 0xa3, 0x2b, 0xb4, 0x62, 0x2f, 0x91, 0x67, 0xe6, - 0xff, 0xff, 0xbd, 0xff, 0xf7, 0xcc, 0xff, 0x1f, 0xb8, 0x64, 0x3a, 0xac, 0xe7, 0xb0, 0x65, 0xc6, - 0xf1, 0x8e, 0x4d, 0xdb, 0xcb, 0x77, 0xaf, 0x37, 0x09, 0xc7, 0xd7, 0xfd, 0x75, 0xb9, 0xef, 0x3a, - 0xdc, 0x41, 0xe7, 0x3c, 0xaa, 0xb2, 0xbf, 0xab, 0xa8, 0xf2, 0x67, 0xda, 0x4e, 0xdb, 0x91, 0x24, - 0xcb, 0xe2, 0x97, 0x47, 0x9d, 0x5f, 0x6c, 0x3b, 0x4e, 0xbb, 0x4b, 0x96, 0xe5, 0xaa, 0x39, 0x68, - 0x2d, 0x63, 0x3a, 0x54, 0x47, 0x4b, 0xfb, 0x8f, 0xac, 0x81, 0x8b, 0xb9, 0xed, 0x50, 0x75, 0x5e, - 0xd8, 0x7f, 0xce, 0xed, 0x1e, 0x61, 0x1c, 0xf7, 0xfa, 0x3e, 0xb6, 0x27, 0x89, 0xe1, 0x7d, 0x54, - 0x89, 0xa5, 0xb0, 0x95, 0x2a, 0x4d, 0xcc, 0x48, 0xa0, 0x87, 0xe9, 0xd8, 0x3e, 0xf6, 0x02, 0xee, - 0xd9, 0xd4, 0x59, 0x96, 0x7f, 0xd5, 0xd6, 0x2b, 0x9c, 0x50, 0x8b, 0xb8, 0x3d, 0x9b, 0xf2, 0x65, - 0x3e, 0xec, 0x13, 0xe6, 0xfd, 0x55, 0xa7, 0x17, 0x22, 0xa7, 0xb8, 0x69, 0xda, 0xd1, 0xc3, 0xd2, - 0x2f, 0x34, 0x98, 0xbf, 0x63, 0x33, 0xee, 0xb8, 0xb6, 0x89, 0xbb, 0x75, 0xda, 0x72, 0xd0, 0xd7, - 0x21, 0xd9, 0x21, 0xd8, 0x22, 0x6e, 0x4e, 0x2b, 0x6a, 0x97, 0x53, 0x37, 0x72, 0xe5, 0x10, 0xa0, - 0xec, 0xf1, 0xde, 0x91, 0xe7, 0x95, 0xd9, 0x8f, 0xf7, 0x0a, 0x53, 0x1f, 0x3e, 0xff, 0xe8, 0xaa, - 0xa6, 0x2b, 0x16, 0x54, 0x85, 0xe4, 0x5d, 0xdc, 0x65, 0x84, 0xe7, 0x62, 0xc5, 0xf8, 0xe5, 0xd4, - 0x8d, 0x8b, 0xe5, 0x83, 0x6d, 0x5e, 0xde, 0xc6, 0x5d, 0xdb, 0xc2, 0xdc, 0x19, 0x45, 0xf1, 0x78, - 0x57, 0x62, 0x39, 0xad, 0xf4, 0xbe, 0x06, 0xd9, 0x50, 0x32, 0x9d, 0x98, 0x8e, 0x6b, 0xa1, 0x1c, - 0x4c, 0xe3, 0x7e, 0xbf, 0x83, 0x59, 0x47, 0x0a, 0x97, 0xd6, 0xfd, 0x25, 0xfa, 0x1a, 0x24, 0x84, - 0x91, 0x73, 0x31, 0x29, 0x73, 0xbe, 0xec, 0x79, 0xa0, 0xec, 0x7b, 0xa0, 0xbc, 0xe9, 0x7b, 0xa0, - 0x92, 0xf8, 0xe0, 0x6f, 0x05, 0x4d, 0x97, 0xd4, 0xe8, 0x75, 0xc8, 0xdc, 0xf5, 0x05, 0x61, 0x86, - 0xc4, 0x8d, 0x4b, 0xdc, 0xf9, 0x70, 0xfb, 0x0e, 0x66, 0x9d, 0xd2, 0xcf, 0x63, 0x90, 0x59, 0x75, - 0x7a, 0x3d, 0x9b, 0x31, 0xdb, 0xa1, 0x3a, 0xe6, 0x84, 0xa1, 0x37, 0x21, 0xe1, 0x62, 0x4e, 0xa4, - 0x24, 0xb3, 0x95, 0x9b, 0x42, 0x8d, 0xbf, 0xec, 0x15, 0x2e, 0x78, 0x0a, 0x33, 0x6b, 0xa7, 0x6c, - 0x3b, 0xcb, 0x3d, 0xcc, 0x3b, 0xe5, 0xb7, 0x49, 0x1b, 0x9b, 0xc3, 0x2a, 0x31, 0x9f, 0x3c, 0xba, - 0x06, 0xca, 0x1e, 0x55, 0x62, 0x7a, 0x3a, 0x4b, 0x0c, 0xf4, 0x6d, 0x98, 0xe9, 0xe1, 0xfb, 0x86, - 0xc4, 0x8b, 0xbd, 0x14, 0xde, 0x74, 0x0f, 0xdf, 0x17, 0xf2, 0xa1, 0x1f, 0x41, 0x46, 0x40, 0x9a, - 0x1d, 0x4c, 0xdb, 0xc4, 0x43, 0x8e, 0xbf, 0x14, 0xf2, 0x5c, 0x0f, 0xdf, 0x5f, 0x95, 0x68, 0x02, - 0x7f, 0x25, 0xf1, 0xc9, 0xc3, 0x82, 0x56, 0xfa, 0xbd, 0x06, 0x10, 0x1a, 0x06, 0x61, 0xc8, 0x9a, - 0xc1, 0x4a, 0x7e, 0x94, 0xa9, 0x30, 0x7a, 0x7d, 0x52, 0x24, 0xec, 0x33, 0x6b, 0x65, 0x4e, 0x88, - 0xf7, 0x78, 0xaf, 0xa0, 0x79, 0x5f, 0xcd, 0x98, 0x63, 0x66, 0x4f, 0x0d, 0xfa, 0x16, 0xe6, 0xc4, - 0x38, 0xa2, 0xc3, 0x25, 0xa0, 0x70, 0xba, 0x07, 0x08, 0x1e, 0xb7, 0x38, 0x57, 0x3a, 0x7c, 0xa8, - 0x41, 0xaa, 0x4a, 0x98, 0xe9, 0xda, 0x7d, 0x91, 0xc4, 0x22, 0xca, 0x7a, 0x0e, 0xb5, 0x77, 0x54, - 0x0a, 0xcc, 0xea, 0xfe, 0x12, 0xe5, 0x61, 0xc6, 0xb6, 0x08, 0xe5, 0x36, 0x1f, 0x7a, 0x6e, 0xd2, - 0x83, 0xb5, 0xe0, 0xba, 0x47, 0x9a, 0xcc, 0xf6, 0xed, 0xac, 0xfb, 0x4b, 0x74, 0x05, 0xb2, 0x8c, - 0x98, 0x03, 0xd7, 0xe6, 0x43, 0xc3, 0x74, 0x28, 0xc7, 0x26, 0xcf, 0x25, 0x24, 0x49, 0xc6, 0xdf, - 0x5f, 0xf5, 0xb6, 0x05, 0x88, 0x45, 0x38, 0xb6, 0xbb, 0x2c, 0x77, 0xca, 0x03, 0x51, 0x4b, 0x25, - 0xea, 0xee, 0x34, 0xcc, 0x06, 0xa9, 0x83, 0x56, 0x21, 0xeb, 0xf4, 0x89, 0x2b, 0x7e, 0x1b, 0xd8, - 0xb2, 0x5c, 0xc2, 0x98, 0x8a, 0xc6, 0xdc, 0x93, 0x47, 0xd7, 0xce, 0x28, 0x83, 0xdf, 0xf2, 0x4e, - 0x1a, 0xdc, 0xb5, 0x69, 0x5b, 0xcf, 0xf8, 0x1c, 0x6a, 0x1b, 0xbd, 0x2b, 0x5c, 0x46, 0x19, 0xa1, - 0x6c, 0xc0, 0x8c, 0xfe, 0xa0, 0xb9, 0x43, 0x86, 0xca, 0xa8, 0x67, 0xc6, 0x8c, 0x7a, 0x8b, 0x0e, - 0x2b, 0xb9, 0x3f, 0x86, 0xd0, 0xa6, 0x3b, 0xec, 0x73, 0xa7, 0xbc, 0x31, 0x68, 0xbe, 0x45, 0x86, - 0xc2, 0x55, 0x0a, 0x67, 0x43, 0xc2, 0xa0, 0x73, 0x90, 0xfc, 0x31, 0xb6, 0xbb, 0xc4, 0x92, 0x16, - 0x99, 0xd1, 0xd5, 0x0a, 0xad, 0x40, 0x92, 0x71, 0xcc, 0x07, 0x4c, 0x9a, 0x61, 0xfe, 0x46, 0x69, - 0x52, 0x6c, 0x54, 0x1c, 0x6a, 0x35, 0x24, 0xa5, 0xae, 0x38, 0xd0, 0x2a, 0x24, 0xb9, 0xb3, 0x43, - 0xa8, 0x32, 0x50, 0xe5, 0x4b, 0x2a, 0x9a, 0xcf, 0x8e, 0x47, 0x73, 0x9d, 0xf2, 0x48, 0x1c, 0xd7, - 0x29, 0xd7, 0x15, 0x2b, 0xfa, 0x01, 0x64, 0x2d, 0xd2, 0x25, 0x6d, 0x69, 0x39, 0xd6, 0xc1, 0x2e, - 0x61, 0xb9, 0xa4, 0x84, 0xbb, 0x7e, 0xec, 0xe4, 0xd0, 0x33, 0x01, 0x54, 0x43, 0x22, 0xa1, 0x0d, - 0x48, 0x59, 0x61, 0x38, 0xe5, 0xa6, 0xa5, 0x31, 0x5f, 0x9b, 0xa4, 0x63, 0x24, 0xf2, 0xa2, 0xb5, - 0x30, 0x0a, 0x21, 0x22, 0x68, 0x40, 0x9b, 0x0e, 0xb5, 0x6c, 0xda, 0x36, 0x3a, 0xc4, 0x6e, 0x77, - 0x78, 0x6e, 0xa6, 0xa8, 0x5d, 0x8e, 0xeb, 0x99, 0x60, 0xff, 0x8e, 0xdc, 0x46, 0x1b, 0x30, 0x1f, - 0x92, 0xca, 0x0c, 0x99, 0x3d, 0x6e, 0x86, 0xcc, 0x05, 0x00, 0x82, 0x04, 0xbd, 0x03, 0x10, 0xe6, - 0x60, 0x0e, 0x24, 0x5a, 0xe9, 0xf0, 0x6c, 0x8e, 0x2a, 0x13, 0x01, 0x40, 0xdf, 0x87, 0xd3, 0x3d, - 0x9b, 0x1a, 0x8c, 0x74, 0x5b, 0x86, 0xb2, 0x9c, 0xc0, 0x4d, 0x1d, 0xdf, 0x9b, 0x0b, 0x3d, 0x9b, - 0x36, 0x48, 0xb7, 0x55, 0x0d, 0x50, 0xd0, 0x37, 0xe0, 0x42, 0xa8, 0xbd, 0x43, 0x8d, 0x8e, 0xd3, - 0xb5, 0x0c, 0x97, 0xb4, 0x0c, 0xd3, 0x19, 0x50, 0x9e, 0x4b, 0x4b, 0x9b, 0x9d, 0x0f, 0x48, 0xd6, - 0xe9, 0x1d, 0xa7, 0x6b, 0xe9, 0xa4, 0xb5, 0x2a, 0x8e, 0xd1, 0x6b, 0x10, 0xaa, 0x6e, 0xd8, 0x16, - 0xcb, 0xcd, 0x15, 0xe3, 0x97, 0x13, 0x7a, 0x3a, 0xd8, 0xac, 0x5b, 0x6c, 0x65, 0xe6, 0xbd, 0x87, - 0x85, 0xa9, 0x4f, 0x1e, 0x16, 0xa6, 0x4a, 0xb7, 0x21, 0xbd, 0x8d, 0xbb, 0x2a, 0x8f, 0x08, 0x43, - 0x37, 0x61, 0x16, 0xfb, 0x8b, 0x9c, 0x56, 0x8c, 0xbf, 0x30, 0x0f, 0x43, 0xd2, 0xd2, 0x6f, 0x35, - 0x48, 0x56, 0xb7, 0x37, 0xb0, 0xed, 0xa2, 0x1a, 0x2c, 0x84, 0x81, 0x79, 0xd4, 0x94, 0x0e, 0x63, - 0xd9, 0xcf, 0xe9, 0x35, 0x58, 0x08, 0x2e, 0xb0, 0x00, 0xc6, 0xbb, 0x57, 0x2e, 0x3e, 0x79, 0x74, - 0xed, 0x55, 0x05, 0x13, 0x54, 0x92, 0x7d, 0x78, 0x77, 0xf7, 0xed, 0x47, 0x74, 0x7e, 0x13, 0xa6, - 0x3d, 0x51, 0x19, 0xfa, 0x16, 0x9c, 0xea, 0x8b, 0x1f, 0x52, 0xd5, 0xd4, 0x8d, 0xa5, 0x89, 0x01, - 0x2e, 0xe9, 0xa3, 0xe1, 0xe0, 0xf1, 0x95, 0xde, 0x8f, 0x01, 0x54, 0xb7, 0xb7, 0x37, 0x5d, 0xbb, - 0xdf, 0x25, 0xfc, 0xd3, 0xd2, 0x7d, 0x0b, 0xce, 0x86, 0xba, 0x33, 0xd7, 0x3c, 0xbe, 0xfe, 0xa7, - 0x03, 0xfe, 0x86, 0x6b, 0x1e, 0x08, 0x6b, 0x31, 0x1e, 0xc0, 0xc6, 0x8f, 0x0f, 0x5b, 0x65, 0x7c, - 0xdc, 0xb2, 0xdf, 0x85, 0x54, 0x68, 0x0c, 0x86, 0xea, 0x30, 0xc3, 0xd5, 0x6f, 0x65, 0xe0, 0xd2, - 0x64, 0x03, 0xfb, 0x6c, 0x51, 0x23, 0x07, 0xec, 0xa5, 0xff, 0x68, 0x00, 0x91, 0x1c, 0xf9, 0x6c, - 0xc6, 0x18, 0xaa, 0x43, 0x52, 0x55, 0xe2, 0xf8, 0x49, 0x2b, 0xb1, 0x02, 0x88, 0x18, 0xf5, 0x67, - 0x31, 0x38, 0xbd, 0xe5, 0x67, 0xef, 0x67, 0xdf, 0x06, 0x5b, 0x30, 0x4d, 0x28, 0x77, 0x6d, 0x69, - 0x04, 0xe1, 0xf3, 0xaf, 0x4c, 0xf2, 0xf9, 0x01, 0x4a, 0xd5, 0x28, 0x77, 0x87, 0xd1, 0x08, 0xf0, - 0xb1, 0x22, 0xf6, 0xf8, 0x55, 0x1c, 0x72, 0x93, 0x58, 0xc5, 0x6b, 0xd8, 0x74, 0x89, 0xdc, 0xf0, - 0x2f, 0x19, 0x4d, 0x16, 0xcc, 0x79, 0x7f, 0x5b, 0xdd, 0x31, 0x3a, 0x88, 0x57, 0x99, 0x08, 0x2e, - 0x41, 0x7a, 0xb2, 0x67, 0xd8, 0x7c, 0x88, 0x20, 0x6f, 0x99, 0x4d, 0xc8, 0xd8, 0xd4, 0xe6, 0x36, - 0xee, 0x1a, 0x4d, 0xdc, 0xc5, 0xd4, 0xf4, 0x9f, 0xab, 0xc7, 0xba, 0x12, 0xe6, 0x15, 0x46, 0xc5, - 0x83, 0x40, 0x35, 0x98, 0xf6, 0xd1, 0x12, 0xc7, 0x47, 0xf3, 0x79, 0xd1, 0x45, 0x48, 0x47, 0x2f, - 0x06, 0xf9, 0xf4, 0x48, 0xe8, 0xa9, 0xc8, 0xbd, 0x70, 0xd8, 0xcd, 0x93, 0x7c, 0xe1, 0xcd, 0xa3, - 0x5e, 0x77, 0xbf, 0x8e, 0xc3, 0x82, 0x4e, 0xac, 0xff, 0x7f, 0xb7, 0x6c, 0x00, 0x78, 0xa9, 0x2a, - 0x2a, 0xa9, 0xf2, 0xcc, 0x09, 0xf2, 0x7d, 0xd6, 0x03, 0xa9, 0x32, 0xfe, 0xbf, 0xf2, 0xd0, 0x5f, - 0x63, 0x90, 0x8e, 0x7a, 0xe8, 0x73, 0x79, 0x69, 0xa1, 0xb5, 0xb0, 0x4c, 0x25, 0x64, 0x99, 0xba, - 0x32, 0xa9, 0x4c, 0x8d, 0x45, 0xf3, 0x21, 0xf5, 0xe9, 0x79, 0x1c, 0x92, 0x1b, 0xd8, 0xc5, 0x3d, - 0x86, 0xd6, 0xc7, 0x1e, 0xb2, 0x5e, 0x23, 0xb9, 0x38, 0x16, 0xcc, 0x55, 0x35, 0x7d, 0xf1, 0x62, - 0xf9, 0x97, 0x93, 0xde, 0xb1, 0x5f, 0x80, 0x79, 0xd1, 0x10, 0x87, 0x9d, 0xbd, 0x34, 0xee, 0x9c, - 0xec, 0x6b, 0x03, 0xed, 0x19, 0x2a, 0x40, 0x4a, 0x90, 0x85, 0x75, 0x58, 0xd0, 0x40, 0x0f, 0xdf, - 0xaf, 0x79, 0x3b, 0xe8, 0x1a, 0xa0, 0x4e, 0x30, 0x98, 0x30, 0x42, 0x43, 0x08, 0xba, 0x85, 0xf0, - 0xc4, 0x27, 0x7f, 0x15, 0x40, 0x48, 0x61, 0x58, 0x84, 0x3a, 0x3d, 0xd5, 0xd5, 0xcd, 0x8a, 0x9d, - 0xaa, 0xd8, 0x40, 0x3f, 0xd5, 0xbc, 0xf7, 0xf0, 0xbe, 0xb6, 0x59, 0xb5, 0x23, 0x9b, 0x47, 0x48, - 0x8a, 0x7f, 0xef, 0x15, 0xf2, 0x43, 0xdc, 0xeb, 0xae, 0x94, 0x0e, 0xc0, 0x29, 0x1d, 0xd4, 0xc9, - 0x8b, 0x87, 0xf3, 0x68, 0xdb, 0x8d, 0xea, 0x90, 0xdd, 0x21, 0x43, 0xc3, 0x75, 0xb8, 0x57, 0x68, - 0x5a, 0x84, 0xa8, 0xc6, 0x65, 0xd1, 0xf7, 0x6d, 0x13, 0x33, 0x12, 0x79, 0xe7, 0xdb, 0xb4, 0x92, - 0x10, 0xd2, 0xe9, 0xf3, 0x3b, 0x64, 0xa8, 0x2b, 0xbe, 0xdb, 0x84, 0xac, 0x5c, 0x12, 0x99, 0xb2, - 0xfb, 0xfc, 0xa3, 0xab, 0x4a, 0xe8, 0x6b, 0xcc, 0xda, 0x59, 0xbe, 0x1f, 0xcc, 0xe6, 0x3c, 0xf7, - 0x8a, 0x47, 0x2f, 0x0a, 0x2f, 0x20, 0x9d, 0xb0, 0xbe, 0x68, 0x1e, 0x45, 0xb3, 0x11, 0x69, 0x0a, - 0xb4, 0x17, 0x37, 0x1b, 0x21, 0xff, 0x48, 0xb3, 0x11, 0x49, 0xcf, 0x6f, 0x86, 0xf5, 0x3f, 0x76, - 0x98, 0x36, 0xd1, 0xc8, 0x54, 0x4c, 0x32, 0xeb, 0xa7, 0x4a, 0x7f, 0xd2, 0x60, 0x71, 0x2c, 0x92, - 0x03, 0x91, 0x4d, 0x40, 0x6e, 0xe4, 0x50, 0x46, 0xc4, 0x50, 0x89, 0x7e, 0xb2, 0xc4, 0x58, 0x70, - 0xc7, 0x2e, 0x81, 0x4f, 0xe7, 0x22, 0x53, 0x55, 0xec, 0x0f, 0x1a, 0x9c, 0x89, 0x0a, 0x10, 0xa8, - 0xd2, 0x80, 0x74, 0xf4, 0xd3, 0x4a, 0x89, 0x4b, 0x47, 0x51, 0x22, 0x2a, 0xff, 0x08, 0x08, 0xda, - 0x0e, 0xab, 0x85, 0x37, 0x14, 0xbc, 0x7e, 0x64, 0xa3, 0xf8, 0x82, 0x1d, 0x58, 0x35, 0x3c, 0xdf, - 0xfc, 0x53, 0x83, 0xc4, 0x86, 0xe3, 0x74, 0xd1, 0x4f, 0x60, 0x81, 0x3a, 0xdc, 0x10, 0x99, 0x45, - 0x2c, 0x43, 0xcd, 0x08, 0xbc, 0x4a, 0x5c, 0x7b, 0xa1, 0xad, 0xfe, 0xb1, 0x57, 0x18, 0xe7, 0x1c, - 0x35, 0xa0, 0x1a, 0x45, 0x51, 0x87, 0x57, 0x24, 0xd1, 0xa6, 0x37, 0x46, 0x68, 0xc1, 0xdc, 0xe8, - 0xe7, 0xbc, 0x6a, 0x7d, 0xeb, 0xb0, 0xcf, 0xcd, 0x1d, 0xfa, 0xa9, 0x74, 0x33, 0xf2, 0x9d, 0x95, - 0x19, 0xe1, 0xb5, 0x7f, 0x09, 0xcf, 0xbd, 0x0b, 0xd9, 0xa0, 0x54, 0x6d, 0xc9, 0x39, 0x16, 0x13, - 0xa1, 0xe1, 0x8d, 0xb4, 0xfc, 0x46, 0xa1, 0x18, 0x9d, 0xd8, 0xe2, 0xa6, 0x69, 0x97, 0xf7, 0xf1, - 0x8c, 0x98, 0x53, 0xf1, 0x96, 0x1e, 0xc7, 0x60, 0x71, 0xd5, 0xa1, 0x4c, 0x0d, 0x73, 0x54, 0x42, - 0x7b, 0x23, 0xd8, 0x21, 0xba, 0x32, 0x61, 0xd4, 0x94, 0x1e, 0x1f, 0x28, 0x6d, 0x43, 0x46, 0xdc, - 0xac, 0xa6, 0x43, 0x5f, 0x72, 0x9e, 0x34, 0xe7, 0x74, 0x2d, 0x25, 0xd1, 0x0e, 0x19, 0x0a, 0x5c, - 0x4a, 0xee, 0x8d, 0xe0, 0xc6, 0x4f, 0x86, 0x4b, 0xc9, 0xbd, 0x08, 0xee, 0x39, 0x48, 0xaa, 0x67, - 0x55, 0x42, 0x3e, 0x1a, 0xd4, 0x0a, 0xdd, 0x84, 0xb8, 0xa8, 0x82, 0xa7, 0x8e, 0x51, 0x37, 0x04, - 0x43, 0xe4, 0x36, 0x6b, 0xc0, 0xa2, 0x1a, 0x10, 0xb0, 0xf5, 0x96, 0xb4, 0x28, 0x91, 0x0a, 0xbd, - 0x45, 0x86, 0x07, 0x4c, 0x0b, 0xd2, 0x47, 0x9a, 0x16, 0x5c, 0xfd, 0x9d, 0x06, 0x10, 0xce, 0xc5, - 0xd0, 0x97, 0xe1, 0x7c, 0x65, 0x7d, 0xad, 0x6a, 0x34, 0x36, 0x6f, 0x6d, 0x6e, 0x35, 0x8c, 0xad, - 0xb5, 0xc6, 0x46, 0x6d, 0xb5, 0x7e, 0xbb, 0x5e, 0xab, 0x66, 0xa7, 0xf2, 0x99, 0xdd, 0x07, 0xc5, - 0xd4, 0x16, 0x65, 0x7d, 0x62, 0xda, 0x2d, 0x9b, 0x58, 0xe8, 0x8b, 0x70, 0x66, 0x94, 0x5a, 0xac, - 0x6a, 0xd5, 0xac, 0x96, 0x4f, 0xef, 0x3e, 0x28, 0xce, 0x78, 0xad, 0x01, 0xb1, 0xd0, 0x65, 0x38, - 0x3b, 0x4e, 0x57, 0x5f, 0x7b, 0x23, 0x1b, 0xcb, 0xcf, 0xed, 0x3e, 0x28, 0xce, 0x06, 0x3d, 0x04, - 0x2a, 0x01, 0x8a, 0x52, 0x2a, 0xbc, 0x78, 0x1e, 0x76, 0x1f, 0x14, 0x93, 0x5e, 0xb6, 0xe4, 0x13, - 0xef, 0xfd, 0x66, 0x69, 0xea, 0xea, 0x0f, 0x01, 0xea, 0xb4, 0xe5, 0x62, 0x53, 0x56, 0x85, 0x3c, - 0x9c, 0xab, 0xaf, 0xdd, 0xd6, 0x6f, 0xad, 0x6e, 0xd6, 0xd7, 0xd7, 0x46, 0xc5, 0xde, 0x77, 0x56, - 0x5d, 0xdf, 0xaa, 0xbc, 0x5d, 0x33, 0x1a, 0xf5, 0x37, 0xd6, 0xb2, 0x1a, 0x3a, 0x0f, 0xa7, 0x47, - 0xce, 0xbe, 0xb3, 0xb6, 0x59, 0x7f, 0xa7, 0x96, 0x8d, 0x55, 0x6e, 0x7e, 0xfc, 0x74, 0x49, 0x7b, - 0xfc, 0x74, 0x49, 0xfb, 0xfb, 0xd3, 0x25, 0xed, 0x83, 0x67, 0x4b, 0x53, 0x8f, 0x9f, 0x2d, 0x4d, - 0xfd, 0xf9, 0xd9, 0xd2, 0xd4, 0xf7, 0x5e, 0x19, 0xc9, 0xc3, 0xf0, 0x26, 0x92, 0xff, 0xcc, 0x68, - 0x26, 0x65, 0xd4, 0x7c, 0xf5, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x51, 0xe0, 0x99, 0x08, 0x44, - 0x1a, 0x00, 0x00, + 0x4e, 0xc2, 0xe7, 0xf2, 0x34, 0x7e, 0x6f, 0x6c, 0x3f, 0x62, 0xcf, 0x33, 0x6f, 0xc6, 0x6d, 0x7d, + 0xe7, 0xb0, 0xca, 0x0a, 0x69, 0x4f, 0x80, 0x84, 0x2a, 0x2a, 0x71, 0x59, 0x6e, 0x7b, 0xa8, 0xb8, + 0x73, 0x5b, 0x90, 0x90, 0xaa, 0x9e, 0x10, 0x12, 0x01, 0xb5, 0x87, 0xae, 0xe0, 0x82, 0x38, 0x71, + 0x44, 0x33, 0x6f, 0xde, 0x87, 0xe3, 0xb8, 0xf9, 0xe8, 0x0a, 0xad, 0xd8, 0x4b, 0xe4, 0x99, 0xf9, + 0xff, 0x7f, 0xef, 0xff, 0x3d, 0xf3, 0xff, 0x07, 0x2e, 0x99, 0x0e, 0xeb, 0x39, 0x6c, 0x99, 0x71, + 0xbc, 0x63, 0xd3, 0xf6, 0xf2, 0xdd, 0xeb, 0x4d, 0xc2, 0xf1, 0x75, 0x7f, 0x5d, 0xee, 0xbb, 0x0e, + 0x77, 0xd0, 0x39, 0x8f, 0xaa, 0xec, 0xef, 0x2a, 0xaa, 0xfc, 0x99, 0xb6, 0xd3, 0x76, 0x24, 0xc9, + 0xb2, 0xf8, 0xe5, 0x51, 0xe7, 0x17, 0xdb, 0x8e, 0xd3, 0xee, 0x92, 0x65, 0xb9, 0x6a, 0x0e, 0x5a, + 0xcb, 0x98, 0x0e, 0xd5, 0xd1, 0xd2, 0xfe, 0x23, 0x6b, 0xe0, 0x62, 0x6e, 0x3b, 0x54, 0x9d, 0x17, + 0xf6, 0x9f, 0x73, 0xbb, 0x47, 0x18, 0xc7, 0xbd, 0xbe, 0x8f, 0xed, 0x49, 0x62, 0x78, 0x1f, 0x55, + 0x62, 0x29, 0x6c, 0xa5, 0x4a, 0x13, 0x33, 0x12, 0xe8, 0x61, 0x3a, 0xb6, 0x8f, 0xbd, 0x80, 0x7b, + 0x36, 0x75, 0x96, 0xe5, 0x5f, 0xb5, 0xf5, 0x0a, 0x27, 0xd4, 0x22, 0x6e, 0xcf, 0xa6, 0x7c, 0x99, + 0x0f, 0xfb, 0x84, 0x79, 0x7f, 0xd5, 0xe9, 0x85, 0xc8, 0x29, 0x6e, 0x9a, 0x76, 0xf4, 0xb0, 0xf4, + 0x0b, 0x0d, 0xe6, 0xef, 0xd8, 0x8c, 0x3b, 0xae, 0x6d, 0xe2, 0x6e, 0x9d, 0xb6, 0x1c, 0xf4, 0x75, + 0x48, 0x76, 0x08, 0xb6, 0x88, 0x9b, 0xd3, 0x8a, 0xda, 0xe5, 0xd4, 0x8d, 0x5c, 0x39, 0x04, 0x28, + 0x7b, 0xbc, 0x77, 0xe4, 0x79, 0x65, 0xf6, 0xe3, 0xbd, 0xc2, 0xd4, 0x87, 0xcf, 0x3f, 0xba, 0xaa, + 0xe9, 0x8a, 0x05, 0x55, 0x21, 0x79, 0x17, 0x77, 0x19, 0xe1, 0xb9, 0x58, 0x31, 0x7e, 0x39, 0x75, + 0xe3, 0x62, 0xf9, 0x60, 0x9b, 0x97, 0xb7, 0x71, 0xd7, 0xb6, 0x30, 0x77, 0x46, 0x51, 0x3c, 0xde, + 0x95, 0x58, 0x4e, 0x2b, 0xbd, 0xaf, 0x41, 0x36, 0x94, 0x4c, 0x27, 0xa6, 0xe3, 0x5a, 0x28, 0x07, + 0xd3, 0xb8, 0xdf, 0xef, 0x60, 0xd6, 0x91, 0xc2, 0xa5, 0x75, 0x7f, 0x89, 0xbe, 0x06, 0x09, 0x61, + 0xe4, 0x5c, 0x4c, 0xca, 0x9c, 0x2f, 0x7b, 0x1e, 0x28, 0xfb, 0x1e, 0x28, 0x6f, 0xfa, 0x1e, 0xa8, + 0x24, 0x3e, 0xf8, 0x5b, 0x41, 0xd3, 0x25, 0x35, 0x7a, 0x1d, 0x32, 0x77, 0x7d, 0x41, 0x98, 0x21, + 0x71, 0xe3, 0x12, 0x77, 0x3e, 0xdc, 0xbe, 0x83, 0x59, 0xa7, 0xf4, 0xf3, 0x18, 0x64, 0x56, 0x9d, + 0x5e, 0xcf, 0x66, 0xcc, 0x76, 0xa8, 0x8e, 0x39, 0x61, 0xe8, 0x4d, 0x48, 0xb8, 0x98, 0x13, 0x29, + 0xc9, 0x6c, 0xe5, 0xa6, 0x50, 0xe3, 0x2f, 0x7b, 0x85, 0x0b, 0x9e, 0xc2, 0xcc, 0xda, 0x29, 0xdb, + 0xce, 0x72, 0x0f, 0xf3, 0x4e, 0xf9, 0x6d, 0xd2, 0xc6, 0xe6, 0xb0, 0x4a, 0xcc, 0x27, 0x8f, 0xae, + 0x81, 0xb2, 0x47, 0x95, 0x98, 0x9e, 0xce, 0x12, 0x03, 0x7d, 0x1b, 0x66, 0x7a, 0xf8, 0xbe, 0x21, + 0xf1, 0x62, 0x2f, 0x85, 0x37, 0xdd, 0xc3, 0xf7, 0x85, 0x7c, 0xe8, 0x47, 0x90, 0x11, 0x90, 0x66, + 0x07, 0xd3, 0x36, 0xf1, 0x90, 0xe3, 0x2f, 0x85, 0x3c, 0xd7, 0xc3, 0xf7, 0x57, 0x25, 0x9a, 0xc0, + 0x5f, 0x49, 0x7c, 0xf2, 0xb0, 0xa0, 0x95, 0x7e, 0xaf, 0x01, 0x84, 0x86, 0x41, 0x18, 0xb2, 0x66, + 0xb0, 0x92, 0x1f, 0x65, 0x2a, 0x8c, 0x5e, 0x9f, 0x14, 0x09, 0xfb, 0xcc, 0x5a, 0x99, 0x13, 0xe2, + 0x3d, 0xde, 0x2b, 0x68, 0xde, 0x57, 0x33, 0xe6, 0x98, 0xd9, 0x53, 0x83, 0xbe, 0x85, 0x39, 0x31, + 0x8e, 0xe8, 0x70, 0x09, 0x28, 0x9c, 0xee, 0x01, 0x82, 0xc7, 0x2d, 0xce, 0x95, 0x0e, 0x1f, 0x6a, + 0x90, 0xaa, 0x12, 0x66, 0xba, 0x76, 0x5f, 0x24, 0xb1, 0x88, 0xb2, 0x9e, 0x43, 0xed, 0x1d, 0x95, + 0x02, 0xb3, 0xba, 0xbf, 0x44, 0x79, 0x98, 0xb1, 0x2d, 0x42, 0xb9, 0xcd, 0x87, 0x9e, 0x9b, 0xf4, + 0x60, 0x2d, 0xb8, 0xee, 0x91, 0x26, 0xb3, 0x7d, 0x3b, 0xeb, 0xfe, 0x12, 0x5d, 0x81, 0x2c, 0x23, + 0xe6, 0xc0, 0xb5, 0xf9, 0xd0, 0x30, 0x1d, 0xca, 0xb1, 0xc9, 0x73, 0x09, 0x49, 0x92, 0xf1, 0xf7, + 0x57, 0xbd, 0x6d, 0x01, 0x62, 0x11, 0x8e, 0xed, 0x2e, 0xcb, 0x9d, 0xf2, 0x40, 0xd4, 0x52, 0x89, + 0xba, 0x3b, 0x0d, 0xb3, 0x41, 0xea, 0xa0, 0x55, 0xc8, 0x3a, 0x7d, 0xe2, 0x8a, 0xdf, 0x06, 0xb6, + 0x2c, 0x97, 0x30, 0xa6, 0xa2, 0x31, 0xf7, 0xe4, 0xd1, 0xb5, 0x33, 0xca, 0xe0, 0xb7, 0xbc, 0x93, + 0x06, 0x77, 0x6d, 0xda, 0xd6, 0x33, 0x3e, 0x87, 0xda, 0x46, 0xdf, 0x13, 0x2e, 0xa3, 0x8c, 0x50, + 0x36, 0x60, 0x46, 0x7f, 0xd0, 0xdc, 0x21, 0x43, 0x65, 0xd4, 0x33, 0x63, 0x46, 0xbd, 0x45, 0x87, + 0x95, 0xdc, 0x1f, 0x43, 0x68, 0xd3, 0x1d, 0xf6, 0xb9, 0x53, 0xde, 0x18, 0x34, 0xdf, 0x22, 0x43, + 0xe1, 0x2a, 0x85, 0xb3, 0x21, 0x61, 0xd0, 0x39, 0x48, 0xfe, 0x18, 0xdb, 0x5d, 0x62, 0x49, 0x8b, + 0xcc, 0xe8, 0x6a, 0x85, 0x56, 0x20, 0xc9, 0x38, 0xe6, 0x03, 0x26, 0xcd, 0x30, 0x7f, 0xa3, 0x34, + 0x29, 0x36, 0x2a, 0x0e, 0xb5, 0x1a, 0x92, 0x52, 0x57, 0x1c, 0x68, 0x15, 0x92, 0xdc, 0xd9, 0x21, + 0x54, 0x19, 0xa8, 0xf2, 0x25, 0x15, 0xcd, 0x67, 0xc7, 0xa3, 0xb9, 0x4e, 0x79, 0x24, 0x8e, 0xeb, + 0x94, 0xeb, 0x8a, 0x15, 0xfd, 0x10, 0xb2, 0x16, 0xe9, 0x92, 0xb6, 0xb4, 0x1c, 0xeb, 0x60, 0x97, + 0xb0, 0x5c, 0x52, 0xc2, 0x5d, 0x3f, 0x76, 0x72, 0xe8, 0x99, 0x00, 0xaa, 0x21, 0x91, 0xd0, 0x06, + 0xa4, 0xac, 0x30, 0x9c, 0x72, 0xd3, 0xd2, 0x98, 0xaf, 0x4d, 0xd2, 0x31, 0x12, 0x79, 0xd1, 0x5a, + 0x18, 0x85, 0x10, 0x11, 0x34, 0xa0, 0x4d, 0x87, 0x5a, 0x36, 0x6d, 0x1b, 0x1d, 0x62, 0xb7, 0x3b, + 0x3c, 0x37, 0x53, 0xd4, 0x2e, 0xc7, 0xf5, 0x4c, 0xb0, 0x7f, 0x47, 0x6e, 0xa3, 0x0d, 0x98, 0x0f, + 0x49, 0x65, 0x86, 0xcc, 0x1e, 0x37, 0x43, 0xe6, 0x02, 0x00, 0x41, 0x82, 0xde, 0x01, 0x08, 0x73, + 0x30, 0x07, 0x12, 0xad, 0x74, 0x78, 0x36, 0x47, 0x95, 0x89, 0x00, 0xa0, 0x1f, 0xc0, 0xe9, 0x9e, + 0x4d, 0x0d, 0x46, 0xba, 0x2d, 0x43, 0x59, 0x4e, 0xe0, 0xa6, 0x8e, 0xef, 0xcd, 0x85, 0x9e, 0x4d, + 0x1b, 0xa4, 0xdb, 0xaa, 0x06, 0x28, 0xe8, 0x1b, 0x70, 0x21, 0xd4, 0xde, 0xa1, 0x46, 0xc7, 0xe9, + 0x5a, 0x86, 0x4b, 0x5a, 0x86, 0xe9, 0x0c, 0x28, 0xcf, 0xa5, 0xa5, 0xcd, 0xce, 0x07, 0x24, 0xeb, + 0xf4, 0x8e, 0xd3, 0xb5, 0x74, 0xd2, 0x5a, 0x15, 0xc7, 0xe8, 0x35, 0x08, 0x55, 0x37, 0x6c, 0x8b, + 0xe5, 0xe6, 0x8a, 0xf1, 0xcb, 0x09, 0x3d, 0x1d, 0x6c, 0xd6, 0x2d, 0xb6, 0x32, 0xf3, 0xde, 0xc3, + 0xc2, 0xd4, 0x27, 0x0f, 0x0b, 0x53, 0xa5, 0xdb, 0x90, 0xde, 0xc6, 0x5d, 0x95, 0x47, 0x84, 0xa1, + 0x9b, 0x30, 0x8b, 0xfd, 0x45, 0x4e, 0x2b, 0xc6, 0x5f, 0x98, 0x87, 0x21, 0x69, 0xe9, 0xb7, 0x1a, + 0x24, 0xab, 0xdb, 0x1b, 0xd8, 0x76, 0x51, 0x0d, 0x16, 0xc2, 0xc0, 0x3c, 0x6a, 0x4a, 0x87, 0xb1, + 0xec, 0xe7, 0xf4, 0x1a, 0x2c, 0x04, 0x17, 0x58, 0x00, 0xe3, 0xdd, 0x2b, 0x17, 0x9f, 0x3c, 0xba, + 0xf6, 0xaa, 0x82, 0x09, 0x2a, 0xc9, 0x3e, 0xbc, 0xbb, 0xfb, 0xf6, 0x23, 0x3a, 0xbf, 0x09, 0xd3, + 0x9e, 0xa8, 0x0c, 0x7d, 0x0b, 0x4e, 0xf5, 0xc5, 0x0f, 0xa9, 0x6a, 0xea, 0xc6, 0xd2, 0xc4, 0x00, + 0x97, 0xf4, 0xd1, 0x70, 0xf0, 0xf8, 0x4a, 0xef, 0xc7, 0x00, 0xaa, 0xdb, 0xdb, 0x9b, 0xae, 0xdd, + 0xef, 0x12, 0xfe, 0x69, 0xe9, 0xbe, 0x05, 0x67, 0x43, 0xdd, 0x99, 0x6b, 0x1e, 0x5f, 0xff, 0xd3, + 0x01, 0x7f, 0xc3, 0x35, 0x0f, 0x84, 0xb5, 0x18, 0x0f, 0x60, 0xe3, 0xc7, 0x87, 0xad, 0x32, 0x3e, + 0x6e, 0xd9, 0xef, 0x42, 0x2a, 0x34, 0x06, 0x43, 0x75, 0x98, 0xe1, 0xea, 0xb7, 0x32, 0x70, 0x69, + 0xb2, 0x81, 0x7d, 0xb6, 0xa8, 0x91, 0x03, 0xf6, 0xd2, 0x7f, 0x34, 0x80, 0x48, 0x8e, 0x7c, 0x36, + 0x63, 0x0c, 0xd5, 0x21, 0xa9, 0x2a, 0x71, 0xfc, 0xa4, 0x95, 0x58, 0x01, 0x44, 0x8c, 0xfa, 0xb3, + 0x18, 0x9c, 0xde, 0xf2, 0xb3, 0xf7, 0xb3, 0x6f, 0x83, 0x2d, 0x98, 0x26, 0x94, 0xbb, 0xb6, 0x34, + 0x82, 0xf0, 0xf9, 0x57, 0x26, 0xf9, 0xfc, 0x00, 0xa5, 0x6a, 0x94, 0xbb, 0xc3, 0x68, 0x04, 0xf8, + 0x58, 0x11, 0x7b, 0xfc, 0x2a, 0x0e, 0xb9, 0x49, 0xac, 0xe2, 0x35, 0x6c, 0xba, 0x44, 0x6e, 0xf8, + 0x97, 0x8c, 0x26, 0x0b, 0xe6, 0xbc, 0xbf, 0xad, 0xee, 0x18, 0x1d, 0xc4, 0xab, 0x4c, 0x04, 0x97, + 0x20, 0x3d, 0xd9, 0x33, 0x6c, 0x3e, 0x44, 0x90, 0xb7, 0xcc, 0x26, 0x64, 0x6c, 0x6a, 0x73, 0x1b, + 0x77, 0x8d, 0x26, 0xee, 0x62, 0x6a, 0xfa, 0xcf, 0xd5, 0x63, 0x5d, 0x09, 0xf3, 0x0a, 0xa3, 0xe2, + 0x41, 0xa0, 0x1a, 0x4c, 0xfb, 0x68, 0x89, 0xe3, 0xa3, 0xf9, 0xbc, 0xe8, 0x22, 0xa4, 0xa3, 0x17, + 0x83, 0x7c, 0x7a, 0x24, 0xf4, 0x54, 0xe4, 0x5e, 0x38, 0xec, 0xe6, 0x49, 0xbe, 0xf0, 0xe6, 0x51, + 0xaf, 0xbb, 0x5f, 0xc7, 0x61, 0x41, 0x27, 0xd6, 0xff, 0xbf, 0x5b, 0x36, 0x00, 0xbc, 0x54, 0x15, + 0x95, 0x54, 0x79, 0xe6, 0x04, 0xf9, 0x3e, 0xeb, 0x81, 0x54, 0x19, 0xff, 0x5f, 0x79, 0xe8, 0xaf, + 0x31, 0x48, 0x47, 0x3d, 0xf4, 0xb9, 0xbc, 0xb4, 0xd0, 0x5a, 0x58, 0xa6, 0x12, 0xb2, 0x4c, 0x5d, + 0x99, 0x54, 0xa6, 0xc6, 0xa2, 0xf9, 0x90, 0xfa, 0xf4, 0x3c, 0x0e, 0xc9, 0x0d, 0xec, 0xe2, 0x1e, + 0x43, 0xeb, 0x63, 0x0f, 0x59, 0xaf, 0x91, 0x5c, 0x1c, 0x0b, 0xe6, 0xaa, 0x9a, 0xbe, 0x78, 0xb1, + 0xfc, 0xcb, 0x49, 0xef, 0xd8, 0x2f, 0xc0, 0xbc, 0x68, 0x88, 0xc3, 0xce, 0x5e, 0x1a, 0x77, 0x4e, + 0xf6, 0xb5, 0x81, 0xf6, 0x0c, 0x15, 0x20, 0x25, 0xc8, 0xc2, 0x3a, 0x2c, 0x68, 0xa0, 0x87, 0xef, + 0xd7, 0xbc, 0x1d, 0x74, 0x0d, 0x50, 0x27, 0x18, 0x4c, 0x18, 0xa1, 0x21, 0x04, 0xdd, 0x42, 0x78, + 0xe2, 0x93, 0xbf, 0x0a, 0x20, 0xa4, 0x30, 0x2c, 0x42, 0x9d, 0x9e, 0xea, 0xea, 0x66, 0xc5, 0x4e, + 0x55, 0x6c, 0xa0, 0x9f, 0x6a, 0xde, 0x7b, 0x78, 0x5f, 0xdb, 0xac, 0xda, 0x91, 0xcd, 0x23, 0x24, + 0xc5, 0xbf, 0xf7, 0x0a, 0xf9, 0x21, 0xee, 0x75, 0x57, 0x4a, 0x07, 0xe0, 0x94, 0x0e, 0xea, 0xe4, + 0xc5, 0xc3, 0x79, 0xb4, 0xed, 0x46, 0x75, 0xc8, 0xee, 0x90, 0xa1, 0xe1, 0x3a, 0xdc, 0x2b, 0x34, + 0x2d, 0x42, 0x54, 0xe3, 0xb2, 0xe8, 0xfb, 0xb6, 0x89, 0x19, 0x89, 0xbc, 0xf3, 0x6d, 0x5a, 0x49, + 0x08, 0xe9, 0xf4, 0xf9, 0x1d, 0x32, 0xd4, 0x15, 0xdf, 0x6d, 0x42, 0x56, 0x2e, 0x89, 0x4c, 0xd9, + 0x7d, 0xfe, 0xd1, 0x55, 0x25, 0xf4, 0x35, 0x66, 0xed, 0x2c, 0xdf, 0x0f, 0x66, 0x73, 0x9e, 0x7b, + 0xc5, 0xa3, 0x17, 0x85, 0x17, 0x90, 0x4e, 0x58, 0x5f, 0x34, 0x8f, 0xa2, 0xd9, 0x88, 0x34, 0x05, + 0xda, 0x8b, 0x9b, 0x8d, 0x90, 0x7f, 0xa4, 0xd9, 0x88, 0xa4, 0xe7, 0x37, 0xc3, 0xfa, 0x1f, 0x3b, + 0x4c, 0x9b, 0x68, 0x64, 0x2a, 0x26, 0x99, 0xf5, 0x53, 0xa5, 0x3f, 0x69, 0xb0, 0x38, 0x16, 0xc9, + 0x81, 0xc8, 0x26, 0x20, 0x37, 0x72, 0x28, 0x23, 0x62, 0xa8, 0x44, 0x3f, 0x59, 0x62, 0x2c, 0xb8, + 0x63, 0x97, 0xc0, 0xa7, 0x73, 0x91, 0xa9, 0x2a, 0xf6, 0x07, 0x0d, 0xce, 0x44, 0x05, 0x08, 0x54, + 0x69, 0x40, 0x3a, 0xfa, 0x69, 0xa5, 0xc4, 0xa5, 0xa3, 0x28, 0x11, 0x95, 0x7f, 0x04, 0x04, 0x6d, + 0x87, 0xd5, 0xc2, 0x1b, 0x0a, 0x5e, 0x3f, 0xb2, 0x51, 0x7c, 0xc1, 0x0e, 0xac, 0x1a, 0x9e, 0x6f, + 0xfe, 0xa9, 0x41, 0x62, 0xc3, 0x71, 0xba, 0xe8, 0x27, 0xb0, 0x40, 0x1d, 0x6e, 0x88, 0xcc, 0x22, + 0x96, 0xa1, 0x66, 0x04, 0x5e, 0x25, 0xae, 0xbd, 0xd0, 0x56, 0xff, 0xd8, 0x2b, 0x8c, 0x73, 0x8e, + 0x1a, 0x50, 0x8d, 0xa2, 0xa8, 0xc3, 0x2b, 0x92, 0x68, 0xd3, 0x1b, 0x23, 0xb4, 0x60, 0x6e, 0xf4, + 0x73, 0x5e, 0xb5, 0xbe, 0x75, 0xd8, 0xe7, 0xe6, 0x0e, 0xfd, 0x54, 0xba, 0x19, 0xf9, 0xce, 0xca, + 0x8c, 0xf0, 0xda, 0xbf, 0x84, 0xe7, 0xde, 0x85, 0x6c, 0x50, 0xaa, 0xb6, 0xe4, 0x1c, 0x8b, 0x89, + 0xd0, 0xf0, 0x46, 0x5a, 0x7e, 0xa3, 0x50, 0x8c, 0x4e, 0x6c, 0x71, 0xd3, 0xb4, 0xcb, 0xfb, 0x78, + 0x46, 0xcc, 0xa9, 0x78, 0xe5, 0xd0, 0xf5, 0x71, 0x0c, 0x16, 0x57, 0x1d, 0xca, 0xd4, 0x40, 0x47, + 0x25, 0xb5, 0x37, 0x86, 0x1d, 0xa2, 0x2b, 0x13, 0xc6, 0x4d, 0xe9, 0xf1, 0xa1, 0xd2, 0x36, 0x64, + 0xc4, 0xed, 0x6a, 0x3a, 0xf4, 0x25, 0x67, 0x4a, 0x73, 0x4e, 0xd7, 0x52, 0x12, 0xed, 0x90, 0xa1, + 0xc0, 0xa5, 0xe4, 0xde, 0x08, 0x6e, 0xfc, 0x64, 0xb8, 0x94, 0xdc, 0x8b, 0xe0, 0x9e, 0x83, 0xa4, + 0x7a, 0x5a, 0x25, 0xe4, 0xc3, 0x41, 0xad, 0xd0, 0x4d, 0x88, 0x8b, 0x4a, 0x78, 0xea, 0x18, 0xb5, + 0x43, 0x30, 0x44, 0x6e, 0xb4, 0x06, 0x2c, 0xaa, 0x21, 0x01, 0x5b, 0x6f, 0x49, 0x8b, 0x12, 0xa9, + 0xd0, 0x5b, 0x64, 0x78, 0xc0, 0xc4, 0x20, 0x7d, 0xa4, 0x89, 0xc1, 0xd5, 0xdf, 0x69, 0x00, 0xe1, + 0x6c, 0x0c, 0x7d, 0x19, 0xce, 0x57, 0xd6, 0xd7, 0xaa, 0x46, 0x63, 0xf3, 0xd6, 0xe6, 0x56, 0xc3, + 0xd8, 0x5a, 0x6b, 0x6c, 0xd4, 0x56, 0xeb, 0xb7, 0xeb, 0xb5, 0x6a, 0x76, 0x2a, 0x9f, 0xd9, 0x7d, + 0x50, 0x4c, 0x6d, 0x51, 0xd6, 0x27, 0xa6, 0xdd, 0xb2, 0x89, 0x85, 0xbe, 0x08, 0x67, 0x46, 0xa9, + 0xc5, 0xaa, 0x56, 0xcd, 0x6a, 0xf9, 0xf4, 0xee, 0x83, 0xe2, 0x8c, 0xd7, 0x1e, 0x10, 0x0b, 0x5d, + 0x86, 0xb3, 0xe3, 0x74, 0xf5, 0xb5, 0x37, 0xb2, 0xb1, 0xfc, 0xdc, 0xee, 0x83, 0xe2, 0x6c, 0xd0, + 0x47, 0xa0, 0x12, 0xa0, 0x28, 0xa5, 0xc2, 0x8b, 0xe7, 0x61, 0xf7, 0x41, 0x31, 0xe9, 0x65, 0x4c, + 0x3e, 0xf1, 0xde, 0x6f, 0x96, 0xa6, 0xae, 0xbe, 0x0b, 0x50, 0xa7, 0x2d, 0x17, 0x9b, 0xb2, 0x32, + 0xe4, 0xe1, 0x5c, 0x7d, 0xed, 0xb6, 0x7e, 0x6b, 0x75, 0xb3, 0xbe, 0xbe, 0x36, 0x2a, 0xf6, 0xbe, + 0xb3, 0xea, 0xfa, 0x56, 0xe5, 0xed, 0x9a, 0xd1, 0xa8, 0xbf, 0xb1, 0x96, 0xd5, 0xd0, 0x79, 0x38, + 0x3d, 0x72, 0xf6, 0x9d, 0xb5, 0xcd, 0xfa, 0x3b, 0xb5, 0x6c, 0xac, 0x72, 0xf3, 0xe3, 0xa7, 0x4b, + 0xda, 0xe3, 0xa7, 0x4b, 0xda, 0xdf, 0x9f, 0x2e, 0x69, 0x1f, 0x3c, 0x5b, 0x9a, 0x7a, 0xfc, 0x6c, + 0x69, 0xea, 0xcf, 0xcf, 0x96, 0xa6, 0xbe, 0xff, 0xca, 0x48, 0x2e, 0x86, 0xb7, 0x91, 0xfc, 0x87, + 0x46, 0x33, 0x29, 0xa3, 0xe6, 0xab, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x97, 0xca, 0xc1, 0x71, + 0x48, 0x1a, 0x00, 0x00, } func (this *Pool) Description() (desc *github_com_cosmos_gogoproto_protoc_gen_gogo_descriptor.FileDescriptorSet) { @@ -1589,715 +1591,715 @@ func StakingDescription() (desc *github_com_cosmos_gogoproto_protoc_gen_gogo_des d := &github_com_cosmos_gogoproto_protoc_gen_gogo_descriptor.FileDescriptorSet{} var gzipped = []byte{ // 11335 bytes of a gzipped FileDescriptorSet - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0xbd, 0x6b, 0x90, 0x1c, 0xd7, - 0x75, 0x18, 0xbc, 0xf3, 0x9e, 0x39, 0xf3, 0xea, 0xbd, 0xbb, 0x00, 0x16, 0x03, 0x12, 0xbb, 0x6c, - 0x8a, 0x24, 0x08, 0x92, 0x0b, 0x12, 0x24, 0x40, 0x71, 0x21, 0x89, 0xdf, 0xcc, 0xec, 0x00, 0x18, - 0x70, 0x5f, 0xec, 0x99, 0x85, 0x48, 0xda, 0x56, 0xbb, 0xb7, 0xe7, 0xee, 0x6e, 0x13, 0x33, 0xdd, - 0xad, 0xee, 0x1e, 0x60, 0x97, 0xf5, 0x55, 0x4a, 0x8e, 0xec, 0x44, 0x86, 0x1f, 0x91, 0x63, 0x97, - 0x2d, 0x5b, 0x82, 0x2d, 0xd9, 0xb1, 0x25, 0x3b, 0x2f, 0x3f, 0x14, 0x3f, 0xe2, 0x8a, 0x63, 0xa7, - 0x9c, 0xc4, 0x76, 0x25, 0x29, 0xc5, 0x3f, 0x12, 0x27, 0x55, 0x66, 0x6c, 0xc9, 0x15, 0x29, 0xb2, - 0x9c, 0xf8, 0x21, 0x27, 0x4e, 0xa9, 0x92, 0x4a, 0xdd, 0x57, 0x3f, 0xe6, 0xb1, 0x33, 0x0b, 0x91, - 0xb2, 0x63, 0xe7, 0x0f, 0x30, 0x7d, 0xee, 0x39, 0xe7, 0xde, 0x7b, 0xee, 0xb9, 0xe7, 0x9e, 0x73, - 0xee, 0x63, 0xe1, 0x77, 0x6b, 0xb0, 0xb4, 0x67, 0x59, 0x7b, 0x5d, 0x7c, 0xc1, 0x76, 0x2c, 0xcf, - 0xda, 0xe9, 0xef, 0x5e, 0xe8, 0x60, 0x57, 0x77, 0x0c, 0xdb, 0xb3, 0x9c, 0x65, 0x0a, 0x43, 0x65, - 0x86, 0xb1, 0x2c, 0x30, 0xe4, 0x75, 0x98, 0xbd, 0x6a, 0x74, 0xf1, 0xaa, 0x8f, 0xd8, 0xc2, 0x1e, - 0x7a, 0x27, 0x24, 0x77, 0x8d, 0x2e, 0x5e, 0x88, 0x2d, 0x25, 0xce, 0xe5, 0x2f, 0xbe, 0x63, 0x79, - 0x80, 0x68, 0x39, 0x4a, 0xb1, 0x45, 0xc0, 0x0a, 0xa5, 0x90, 0xff, 0x77, 0x12, 0xe6, 0x46, 0x94, - 0x22, 0x04, 0x49, 0x53, 0xeb, 0x11, 0x8e, 0xb1, 0x73, 0x39, 0x85, 0xfe, 0x46, 0x0b, 0x90, 0xb1, - 0x35, 0xfd, 0x96, 0xb6, 0x87, 0x17, 0xe2, 0x14, 0x2c, 0x3e, 0xd1, 0x59, 0x80, 0x0e, 0xb6, 0xb1, - 0xd9, 0xc1, 0xa6, 0x7e, 0xb8, 0x90, 0x58, 0x4a, 0x9c, 0xcb, 0x29, 0x21, 0x08, 0x7a, 0x02, 0x66, - 0xed, 0xfe, 0x4e, 0xd7, 0xd0, 0xd5, 0x10, 0x1a, 0x2c, 0x25, 0xce, 0xa5, 0x14, 0x89, 0x15, 0xac, - 0x06, 0xc8, 0x8f, 0x41, 0xf9, 0x0e, 0xd6, 0x6e, 0x85, 0x51, 0xf3, 0x14, 0xb5, 0x44, 0xc0, 0x21, - 0xc4, 0x3a, 0x14, 0x7a, 0xd8, 0x75, 0xb5, 0x3d, 0xac, 0x7a, 0x87, 0x36, 0x5e, 0x48, 0xd2, 0xde, - 0x2f, 0x0d, 0xf5, 0x7e, 0xb0, 0xe7, 0x79, 0x4e, 0xd5, 0x3e, 0xb4, 0x31, 0xaa, 0x42, 0x0e, 0x9b, - 0xfd, 0x1e, 0xe3, 0x90, 0x1a, 0x23, 0xbf, 0x86, 0xd9, 0xef, 0x0d, 0x72, 0xc9, 0x12, 0x32, 0xce, - 0x22, 0xe3, 0x62, 0xe7, 0xb6, 0xa1, 0xe3, 0x85, 0x34, 0x65, 0xf0, 0xd8, 0x10, 0x83, 0x16, 0x2b, - 0x1f, 0xe4, 0x21, 0xe8, 0x50, 0x1d, 0x72, 0xf8, 0xc0, 0xc3, 0xa6, 0x6b, 0x58, 0xe6, 0x42, 0x86, - 0x32, 0x79, 0x64, 0xc4, 0x28, 0xe2, 0x6e, 0x67, 0x90, 0x45, 0x40, 0x87, 0x2e, 0x43, 0xc6, 0xb2, - 0x3d, 0xc3, 0x32, 0xdd, 0x85, 0xec, 0x52, 0xec, 0x5c, 0xfe, 0xe2, 0x03, 0x23, 0x15, 0x61, 0x93, - 0xe1, 0x28, 0x02, 0x19, 0x35, 0x41, 0x72, 0xad, 0xbe, 0xa3, 0x63, 0x55, 0xb7, 0x3a, 0x58, 0x35, - 0xcc, 0x5d, 0x6b, 0x21, 0x47, 0x19, 0x2c, 0x0e, 0x77, 0x84, 0x22, 0xd6, 0xad, 0x0e, 0x6e, 0x9a, - 0xbb, 0x96, 0x52, 0x72, 0x23, 0xdf, 0xe8, 0x24, 0xa4, 0xdd, 0x43, 0xd3, 0xd3, 0x0e, 0x16, 0x0a, - 0x54, 0x43, 0xf8, 0x17, 0x51, 0x1d, 0xdc, 0x31, 0x48, 0x75, 0x0b, 0x45, 0xa6, 0x3a, 0xfc, 0x53, - 0xfe, 0x85, 0x34, 0x94, 0xa7, 0x51, 0xbe, 0x2b, 0x90, 0xda, 0x25, 0xfd, 0x5f, 0x88, 0x1f, 0x47, - 0x3a, 0x8c, 0x26, 0x2a, 0xde, 0xf4, 0x7d, 0x8a, 0xb7, 0x0a, 0x79, 0x13, 0xbb, 0x1e, 0xee, 0x30, - 0x5d, 0x49, 0x4c, 0xa9, 0x6d, 0xc0, 0x88, 0x86, 0x95, 0x2d, 0x79, 0x5f, 0xca, 0xf6, 0x0a, 0x94, - 0xfd, 0x26, 0xa9, 0x8e, 0x66, 0xee, 0x09, 0xad, 0xbd, 0x30, 0xa9, 0x25, 0xcb, 0x0d, 0x41, 0xa7, - 0x10, 0x32, 0xa5, 0x84, 0x23, 0xdf, 0x68, 0x15, 0xc0, 0x32, 0xb1, 0xb5, 0xab, 0x76, 0xb0, 0xde, - 0x5d, 0xc8, 0x8e, 0x91, 0xd2, 0x26, 0x41, 0x19, 0x92, 0x92, 0xc5, 0xa0, 0x7a, 0x17, 0xbd, 0x10, - 0x28, 0x61, 0x66, 0x8c, 0x0e, 0xad, 0xb3, 0xe9, 0x37, 0xa4, 0x87, 0xdb, 0x50, 0x72, 0x30, 0x99, - 0x11, 0xb8, 0xc3, 0x7b, 0x96, 0xa3, 0x8d, 0x58, 0x9e, 0xd8, 0x33, 0x85, 0x93, 0xb1, 0x8e, 0x15, - 0x9d, 0xf0, 0x27, 0x7a, 0x18, 0x7c, 0x80, 0x4a, 0xd5, 0x0a, 0xa8, 0x7d, 0x2a, 0x08, 0xe0, 0x86, - 0xd6, 0xc3, 0x95, 0x37, 0xa0, 0x14, 0x15, 0x0f, 0x9a, 0x87, 0x94, 0xeb, 0x69, 0x8e, 0x47, 0xb5, - 0x30, 0xa5, 0xb0, 0x0f, 0x24, 0x41, 0x02, 0x9b, 0x1d, 0x6a, 0xff, 0x52, 0x0a, 0xf9, 0x89, 0xfe, - 0xbf, 0xa0, 0xc3, 0x09, 0xda, 0xe1, 0x47, 0x87, 0x47, 0x34, 0xc2, 0x79, 0xb0, 0xdf, 0x95, 0xe7, - 0xa1, 0x18, 0xe9, 0xc0, 0xb4, 0x55, 0xcb, 0xff, 0x3f, 0x9c, 0x18, 0xc9, 0x1a, 0xbd, 0x02, 0xf3, - 0x7d, 0xd3, 0x30, 0x3d, 0xec, 0xd8, 0x0e, 0x26, 0x1a, 0xcb, 0xaa, 0x5a, 0xf8, 0x7c, 0x66, 0x8c, - 0xce, 0x6d, 0x87, 0xb1, 0x19, 0x17, 0x65, 0xae, 0x3f, 0x0c, 0x3c, 0x9f, 0xcb, 0x7e, 0x21, 0x23, - 0x7d, 0xe0, 0x03, 0x1f, 0xf8, 0x40, 0x5c, 0xfe, 0x95, 0x34, 0xcc, 0x8f, 0x9a, 0x33, 0x23, 0xa7, - 0xef, 0x49, 0x48, 0x9b, 0xfd, 0xde, 0x0e, 0x76, 0xa8, 0x90, 0x52, 0x0a, 0xff, 0x42, 0x55, 0x48, - 0x75, 0xb5, 0x1d, 0xdc, 0x5d, 0x48, 0x2e, 0xc5, 0xce, 0x95, 0x2e, 0x3e, 0x31, 0xd5, 0xac, 0x5c, - 0x5e, 0x23, 0x24, 0x0a, 0xa3, 0x44, 0xef, 0x81, 0x24, 0x37, 0xde, 0x84, 0xc3, 0xf9, 0xe9, 0x38, - 0x90, 0xb9, 0xa4, 0x50, 0x3a, 0x74, 0x06, 0x72, 0xe4, 0x7f, 0xa6, 0x1b, 0x69, 0xda, 0xe6, 0x2c, - 0x01, 0x10, 0xbd, 0x40, 0x15, 0xc8, 0xd2, 0x69, 0xd2, 0xc1, 0x62, 0xd1, 0xf3, 0xbf, 0x89, 0x62, - 0x75, 0xf0, 0xae, 0xd6, 0xef, 0x7a, 0xea, 0x6d, 0xad, 0xdb, 0xc7, 0x54, 0xe1, 0x73, 0x4a, 0x81, - 0x03, 0x6f, 0x12, 0x18, 0x5a, 0x84, 0x3c, 0x9b, 0x55, 0x86, 0xd9, 0xc1, 0x07, 0xd4, 0xae, 0xa6, - 0x14, 0x36, 0xd1, 0x9a, 0x04, 0x42, 0xaa, 0x7f, 0xdd, 0xb5, 0x4c, 0xa1, 0x9a, 0xb4, 0x0a, 0x02, - 0xa0, 0xd5, 0x3f, 0x3f, 0x68, 0xd2, 0x1f, 0x1c, 0xdd, 0xbd, 0xa1, 0xb9, 0xf4, 0x18, 0x94, 0x29, - 0xc6, 0xb3, 0x7c, 0xe8, 0xb5, 0xee, 0xc2, 0xec, 0x52, 0xec, 0x5c, 0x56, 0x29, 0x31, 0xf0, 0x26, - 0x87, 0xca, 0x3f, 0x1b, 0x87, 0x24, 0x35, 0x2c, 0x65, 0xc8, 0xb7, 0x5f, 0xdd, 0x6a, 0xa8, 0xab, - 0x9b, 0xdb, 0xb5, 0xb5, 0x86, 0x14, 0x43, 0x25, 0x00, 0x0a, 0xb8, 0xba, 0xb6, 0x59, 0x6d, 0x4b, - 0x71, 0xff, 0xbb, 0xb9, 0xd1, 0xbe, 0xfc, 0x9c, 0x94, 0xf0, 0x09, 0xb6, 0x19, 0x20, 0x19, 0x46, - 0x78, 0xf6, 0xa2, 0x94, 0x42, 0x12, 0x14, 0x18, 0x83, 0xe6, 0x2b, 0x8d, 0xd5, 0xcb, 0xcf, 0x49, - 0xe9, 0x28, 0xe4, 0xd9, 0x8b, 0x52, 0x06, 0x15, 0x21, 0x47, 0x21, 0xb5, 0xcd, 0xcd, 0x35, 0x29, - 0xeb, 0xf3, 0x6c, 0xb5, 0x95, 0xe6, 0xc6, 0x35, 0x29, 0xe7, 0xf3, 0xbc, 0xa6, 0x6c, 0x6e, 0x6f, - 0x49, 0xe0, 0x73, 0x58, 0x6f, 0xb4, 0x5a, 0xd5, 0x6b, 0x0d, 0x29, 0xef, 0x63, 0xd4, 0x5e, 0x6d, - 0x37, 0x5a, 0x52, 0x21, 0xd2, 0xac, 0x67, 0x2f, 0x4a, 0x45, 0xbf, 0x8a, 0xc6, 0xc6, 0xf6, 0xba, - 0x54, 0x42, 0xb3, 0x50, 0x64, 0x55, 0x88, 0x46, 0x94, 0x07, 0x40, 0x97, 0x9f, 0x93, 0xa4, 0xa0, - 0x21, 0x8c, 0xcb, 0x6c, 0x04, 0x70, 0xf9, 0x39, 0x09, 0xc9, 0x75, 0x48, 0x51, 0x35, 0x44, 0x08, - 0x4a, 0x6b, 0xd5, 0x5a, 0x63, 0x4d, 0xdd, 0xdc, 0x6a, 0x37, 0x37, 0x37, 0xaa, 0x6b, 0x52, 0x2c, - 0x80, 0x29, 0x8d, 0x97, 0xb7, 0x9b, 0x4a, 0x63, 0x55, 0x8a, 0x87, 0x61, 0x5b, 0x8d, 0x6a, 0xbb, - 0xb1, 0x2a, 0x25, 0x64, 0x1d, 0xe6, 0x47, 0x19, 0xd4, 0x91, 0x53, 0x28, 0xa4, 0x0b, 0xf1, 0x31, - 0xba, 0x40, 0x79, 0x0d, 0xea, 0x82, 0xfc, 0xb9, 0x38, 0xcc, 0x8d, 0x58, 0x54, 0x46, 0x56, 0xf2, - 0x22, 0xa4, 0x98, 0x2e, 0xb3, 0x65, 0xf6, 0xf1, 0x91, 0xab, 0x13, 0xd5, 0xec, 0xa1, 0xa5, 0x96, - 0xd2, 0x85, 0x9d, 0x90, 0xc4, 0x18, 0x27, 0x84, 0xb0, 0x18, 0x52, 0xd8, 0x6f, 0x18, 0x32, 0xfe, - 0x6c, 0x7d, 0xbc, 0x3c, 0xcd, 0xfa, 0x48, 0x61, 0xc7, 0x5b, 0x04, 0x52, 0x23, 0x16, 0x81, 0x2b, - 0x30, 0x3b, 0xc4, 0x68, 0x6a, 0x63, 0xfc, 0xc1, 0x18, 0x2c, 0x8c, 0x13, 0xce, 0x04, 0x93, 0x18, - 0x8f, 0x98, 0xc4, 0x2b, 0x83, 0x12, 0x7c, 0x68, 0xfc, 0x20, 0x0c, 0x8d, 0xf5, 0x27, 0x63, 0x70, - 0x72, 0xb4, 0xb3, 0x39, 0xb2, 0x0d, 0xef, 0x81, 0x74, 0x0f, 0x7b, 0xfb, 0x96, 0x70, 0xab, 0x1e, - 0x1d, 0xb1, 0x58, 0x93, 0xe2, 0xc1, 0xc1, 0xe6, 0x54, 0xe1, 0xd5, 0x3e, 0x31, 0xce, 0x63, 0x64, - 0xad, 0x19, 0x6a, 0xe9, 0xb7, 0xc6, 0xe1, 0xc4, 0x48, 0xe6, 0x23, 0x1b, 0xfa, 0x20, 0x80, 0x61, - 0xda, 0x7d, 0x8f, 0xb9, 0x4e, 0xcc, 0x12, 0xe7, 0x28, 0x84, 0x1a, 0x2f, 0x62, 0x65, 0xfb, 0x9e, - 0x5f, 0x9e, 0xa0, 0xe5, 0xc0, 0x40, 0x14, 0xe1, 0x9d, 0x41, 0x43, 0x93, 0xb4, 0xa1, 0x67, 0xc7, - 0xf4, 0x74, 0x48, 0x31, 0x9f, 0x06, 0x49, 0xef, 0x1a, 0xd8, 0xf4, 0x54, 0xd7, 0x73, 0xb0, 0xd6, - 0x33, 0xcc, 0x3d, 0xba, 0xd4, 0x64, 0x57, 0x52, 0xbb, 0x5a, 0xd7, 0xc5, 0x4a, 0x99, 0x15, 0xb7, - 0x44, 0x29, 0xa1, 0xa0, 0x0a, 0xe4, 0x84, 0x28, 0xd2, 0x11, 0x0a, 0x56, 0xec, 0x53, 0xc8, 0xdf, - 0x95, 0x83, 0x7c, 0xc8, 0x35, 0x47, 0x0f, 0x41, 0xe1, 0x75, 0xed, 0xb6, 0xa6, 0x8a, 0x70, 0x8b, - 0x49, 0x22, 0x4f, 0x60, 0x5b, 0x3c, 0xe4, 0x7a, 0x1a, 0xe6, 0x29, 0x8a, 0xd5, 0xf7, 0xb0, 0xa3, - 0xea, 0x5d, 0xcd, 0x75, 0xa9, 0xd0, 0xb2, 0x14, 0x15, 0x91, 0xb2, 0x4d, 0x52, 0x54, 0x17, 0x25, - 0xe8, 0x12, 0xcc, 0x51, 0x8a, 0x5e, 0xbf, 0xeb, 0x19, 0x76, 0x17, 0xab, 0x24, 0x00, 0x74, 0xe9, - 0x92, 0xe3, 0xb7, 0x6c, 0x96, 0x60, 0xac, 0x73, 0x04, 0xd2, 0x22, 0x17, 0xad, 0xc2, 0x83, 0x94, - 0x6c, 0x0f, 0x9b, 0xd8, 0xd1, 0x3c, 0xac, 0xe2, 0xf7, 0xf7, 0xb5, 0xae, 0xab, 0x6a, 0x66, 0x47, - 0xdd, 0xd7, 0xdc, 0xfd, 0x85, 0x79, 0xc2, 0xa0, 0x16, 0x5f, 0x88, 0x29, 0xa7, 0x09, 0xe2, 0x35, - 0x8e, 0xd7, 0xa0, 0x68, 0x55, 0xb3, 0x73, 0x5d, 0x73, 0xf7, 0xd1, 0x0a, 0x9c, 0xa4, 0x5c, 0x5c, - 0xcf, 0x31, 0xcc, 0x3d, 0x55, 0xdf, 0xc7, 0xfa, 0x2d, 0xb5, 0xef, 0xed, 0xbe, 0x73, 0xe1, 0x4c, - 0xb8, 0x7e, 0xda, 0xc2, 0x16, 0xc5, 0xa9, 0x13, 0x94, 0x6d, 0x6f, 0xf7, 0x9d, 0xa8, 0x05, 0x05, - 0x32, 0x18, 0x3d, 0xe3, 0x0d, 0xac, 0xee, 0x5a, 0x0e, 0x5d, 0x43, 0x4b, 0x23, 0x4c, 0x53, 0x48, - 0x82, 0xcb, 0x9b, 0x9c, 0x60, 0xdd, 0xea, 0xe0, 0x95, 0x54, 0x6b, 0xab, 0xd1, 0x58, 0x55, 0xf2, - 0x82, 0xcb, 0x55, 0xcb, 0x21, 0x0a, 0xb5, 0x67, 0xf9, 0x02, 0xce, 0x33, 0x85, 0xda, 0xb3, 0x84, - 0x78, 0x2f, 0xc1, 0x9c, 0xae, 0xb3, 0x3e, 0x1b, 0xba, 0xca, 0xc3, 0x34, 0x77, 0x41, 0x8a, 0x08, - 0x4b, 0xd7, 0xaf, 0x31, 0x04, 0xae, 0xe3, 0x2e, 0x7a, 0x01, 0x4e, 0x04, 0xc2, 0x0a, 0x13, 0xce, - 0x0e, 0xf5, 0x72, 0x90, 0xf4, 0x12, 0xcc, 0xd9, 0x87, 0xc3, 0x84, 0x28, 0x52, 0xa3, 0x7d, 0x38, - 0x48, 0xf6, 0x3c, 0xcc, 0xdb, 0xfb, 0xf6, 0x30, 0xdd, 0xf9, 0x30, 0x1d, 0xb2, 0xf7, 0xed, 0x41, - 0xc2, 0x47, 0x68, 0xcc, 0xee, 0x60, 0x5d, 0xf3, 0x70, 0x67, 0xe1, 0x54, 0x18, 0x3d, 0x54, 0x80, - 0x96, 0x41, 0xd2, 0x75, 0x15, 0x9b, 0xda, 0x4e, 0x17, 0xab, 0x9a, 0x83, 0x4d, 0xcd, 0x5d, 0x58, - 0xa4, 0xc8, 0x49, 0xcf, 0xe9, 0x63, 0xa5, 0xa4, 0xeb, 0x0d, 0x5a, 0x58, 0xa5, 0x65, 0xe8, 0x3c, - 0xcc, 0x5a, 0x3b, 0xaf, 0xeb, 0x4c, 0x23, 0x55, 0xdb, 0xc1, 0xbb, 0xc6, 0xc1, 0xc2, 0x3b, 0xa8, - 0x78, 0xcb, 0xa4, 0x80, 0xea, 0xe3, 0x16, 0x05, 0xa3, 0xc7, 0x41, 0xd2, 0xdd, 0x7d, 0xcd, 0xb1, - 0xa9, 0x49, 0x76, 0x6d, 0x4d, 0xc7, 0x0b, 0x8f, 0x30, 0x54, 0x06, 0xdf, 0x10, 0x60, 0x32, 0x23, - 0xdc, 0x3b, 0xc6, 0xae, 0x27, 0x38, 0x3e, 0xc6, 0x66, 0x04, 0x85, 0x71, 0x6e, 0xe7, 0x40, 0x22, - 0x92, 0x88, 0x54, 0x7c, 0x8e, 0xa2, 0x95, 0xec, 0x7d, 0x3b, 0x5c, 0xef, 0xc3, 0x50, 0x24, 0x98, - 0x41, 0xa5, 0x8f, 0x33, 0xc7, 0xcd, 0xde, 0x0f, 0xd5, 0xf8, 0x1c, 0x9c, 0x24, 0x48, 0x3d, 0xec, - 0x69, 0x1d, 0xcd, 0xd3, 0x42, 0xd8, 0x4f, 0x52, 0x6c, 0x22, 0xf6, 0x75, 0x5e, 0x18, 0x69, 0xa7, - 0xd3, 0xdf, 0x39, 0xf4, 0x15, 0xeb, 0x29, 0xd6, 0x4e, 0x02, 0x13, 0xaa, 0xf5, 0xb6, 0x39, 0xe7, - 0xf2, 0x0a, 0x14, 0xc2, 0x7a, 0x8f, 0x72, 0xc0, 0x34, 0x5f, 0x8a, 0x11, 0x27, 0xa8, 0xbe, 0xb9, - 0x4a, 0xdc, 0x97, 0xd7, 0x1a, 0x52, 0x9c, 0xb8, 0x51, 0x6b, 0xcd, 0x76, 0x43, 0x55, 0xb6, 0x37, - 0xda, 0xcd, 0xf5, 0x86, 0x94, 0x08, 0x39, 0xf6, 0x37, 0x92, 0xd9, 0x47, 0xa5, 0xc7, 0xe4, 0x5f, - 0x4c, 0x40, 0x29, 0x1a, 0xa9, 0xa1, 0x77, 0xc1, 0x29, 0x91, 0x70, 0x71, 0xb1, 0xa7, 0xde, 0x31, - 0x1c, 0x3a, 0x21, 0x7b, 0x1a, 0x5b, 0x1c, 0x7d, 0xfd, 0x99, 0xe7, 0x58, 0x2d, 0xec, 0xbd, 0xd7, - 0x70, 0xc8, 0x74, 0xeb, 0x69, 0x1e, 0x5a, 0x83, 0x45, 0xd3, 0x52, 0x5d, 0x4f, 0x33, 0x3b, 0x9a, - 0xd3, 0x51, 0x83, 0x54, 0x97, 0xaa, 0xe9, 0x3a, 0x76, 0x5d, 0x8b, 0x2d, 0x84, 0x3e, 0x97, 0x07, - 0x4c, 0xab, 0xc5, 0x91, 0x83, 0x15, 0xa2, 0xca, 0x51, 0x07, 0xd4, 0x37, 0x31, 0x4e, 0x7d, 0xcf, - 0x40, 0xae, 0xa7, 0xd9, 0x2a, 0x36, 0x3d, 0xe7, 0x90, 0xfa, 0xe7, 0x59, 0x25, 0xdb, 0xd3, 0xec, - 0x06, 0xf9, 0x46, 0x37, 0xe1, 0xd1, 0x00, 0x55, 0xed, 0xe2, 0x3d, 0x4d, 0x3f, 0x54, 0xa9, 0x33, - 0x4e, 0xd3, 0x06, 0xaa, 0x6e, 0x99, 0xbb, 0x5d, 0x43, 0xf7, 0x5c, 0x6a, 0x1f, 0x98, 0x8d, 0x93, - 0x03, 0x8a, 0x35, 0x4a, 0x70, 0xc3, 0xb5, 0x4c, 0xea, 0x83, 0xd7, 0x05, 0xf6, 0xd7, 0x24, 0xfc, - 0xba, 0x91, 0xcc, 0x26, 0xa5, 0xd4, 0x8d, 0x64, 0x36, 0x25, 0xa5, 0x6f, 0x24, 0xb3, 0x69, 0x29, - 0x73, 0x23, 0x99, 0xcd, 0x4a, 0xb9, 0x1b, 0xc9, 0x6c, 0x4e, 0x02, 0xf9, 0xe7, 0xb2, 0x50, 0x08, - 0x47, 0x06, 0x24, 0xd0, 0xd2, 0xe9, 0xda, 0x18, 0xa3, 0xd6, 0xf3, 0xe1, 0x23, 0xe3, 0x88, 0xe5, - 0x3a, 0x59, 0x34, 0x57, 0xd2, 0xcc, 0x0d, 0x57, 0x18, 0x25, 0x71, 0x58, 0x88, 0x5a, 0x63, 0xe6, - 0xf6, 0x64, 0x15, 0xfe, 0x85, 0xae, 0x41, 0xfa, 0x75, 0x97, 0xf2, 0x4e, 0x53, 0xde, 0xef, 0x38, - 0x9a, 0xf7, 0x8d, 0x16, 0x65, 0x9e, 0xbb, 0xd1, 0x52, 0x37, 0x36, 0x95, 0xf5, 0xea, 0x9a, 0xc2, - 0xc9, 0xd1, 0x69, 0x48, 0x76, 0xb5, 0x37, 0x0e, 0xa3, 0xcb, 0x2b, 0x05, 0xa1, 0x65, 0x28, 0xf7, - 0xcd, 0xdb, 0xd8, 0x31, 0x76, 0x0d, 0x32, 0x54, 0x04, 0xab, 0x1c, 0xc6, 0x2a, 0x05, 0xa5, 0x6b, - 0x04, 0x7f, 0x4a, 0xf5, 0x38, 0x0d, 0xc9, 0x3b, 0x58, 0xbb, 0x15, 0x5d, 0x04, 0x29, 0x08, 0x9d, - 0x83, 0x42, 0x07, 0xef, 0xf4, 0xf7, 0x54, 0x07, 0x77, 0x34, 0xdd, 0x8b, 0x9a, 0xfe, 0x3c, 0x2d, - 0x52, 0x68, 0x09, 0x7a, 0x09, 0x72, 0x64, 0x8c, 0x4c, 0x3a, 0xc6, 0xb3, 0x54, 0x04, 0x4f, 0x1d, - 0x2d, 0x02, 0x3e, 0xc4, 0x82, 0x48, 0x09, 0xe8, 0xd1, 0x55, 0x48, 0x7b, 0x9a, 0xb3, 0x87, 0x3d, - 0x6a, 0xf9, 0x4b, 0x23, 0x92, 0x1f, 0x23, 0x38, 0xb5, 0x29, 0x05, 0x8d, 0x69, 0x39, 0xf5, 0xdb, - 0x68, 0x65, 0x2e, 0x40, 0x8a, 0xaa, 0x07, 0x02, 0xe0, 0x0a, 0x22, 0xcd, 0xa0, 0x2c, 0x24, 0xeb, - 0x9b, 0x0a, 0xb1, 0x34, 0x12, 0x14, 0x18, 0x54, 0xdd, 0x6a, 0x36, 0xea, 0x0d, 0x29, 0x2e, 0x5f, - 0x82, 0x34, 0x1b, 0x73, 0x62, 0x85, 0xfc, 0x51, 0x97, 0x66, 0xf8, 0x27, 0xe7, 0x11, 0x13, 0xa5, - 0xdb, 0xeb, 0xb5, 0x86, 0x22, 0xc5, 0xe5, 0x6d, 0x28, 0x0f, 0xc8, 0x09, 0x9d, 0x80, 0x59, 0xa5, - 0xd1, 0x6e, 0x6c, 0x90, 0x38, 0x4b, 0xdd, 0xde, 0x78, 0x69, 0x63, 0xf3, 0xbd, 0x1b, 0xd2, 0x4c, - 0x14, 0x2c, 0x4c, 0x5a, 0x0c, 0xcd, 0x83, 0x14, 0x80, 0x5b, 0x9b, 0xdb, 0x0a, 0x6d, 0xcd, 0xb7, - 0xc7, 0x41, 0x1a, 0x94, 0x1a, 0x3a, 0x05, 0x73, 0xed, 0xaa, 0x72, 0xad, 0xd1, 0x56, 0x59, 0xec, - 0xe8, 0xb3, 0x9e, 0x07, 0x29, 0x5c, 0x70, 0xb5, 0x49, 0x43, 0xe3, 0x45, 0x38, 0x13, 0x86, 0x36, - 0x5e, 0x69, 0x37, 0x36, 0x5a, 0xb4, 0xf2, 0xea, 0xc6, 0x35, 0x62, 0x5f, 0x07, 0xf8, 0x89, 0x68, - 0x35, 0x41, 0x9a, 0x1a, 0xe5, 0xd7, 0x58, 0x5b, 0x95, 0x92, 0x83, 0xe0, 0xcd, 0x8d, 0xc6, 0xe6, - 0x55, 0x29, 0x35, 0x58, 0x3b, 0x8d, 0x60, 0xd3, 0xa8, 0x02, 0x27, 0x07, 0xa1, 0x6a, 0x63, 0xa3, - 0xad, 0xbc, 0x2a, 0x65, 0x06, 0x2b, 0x6e, 0x35, 0x94, 0x9b, 0xcd, 0x7a, 0x43, 0xca, 0xa2, 0x93, - 0x80, 0xa2, 0x2d, 0x6a, 0x5f, 0xdf, 0x5c, 0x95, 0x72, 0x43, 0x16, 0x45, 0x76, 0xa1, 0x10, 0x0e, - 0x23, 0xbf, 0x36, 0xb9, 0xa4, 0x8f, 0xc4, 0x21, 0x1f, 0x0a, 0x0b, 0x89, 0x3f, 0xaf, 0x75, 0xbb, - 0xd6, 0x1d, 0x55, 0xeb, 0x1a, 0x9a, 0xcb, 0xed, 0x0d, 0x50, 0x50, 0x95, 0x40, 0xa6, 0x9d, 0xdf, - 0xd3, 0x5b, 0xf8, 0xf4, 0x5f, 0x44, 0x0b, 0x9f, 0x92, 0xd2, 0xf2, 0x0f, 0xc6, 0x40, 0x1a, 0x8c, - 0xf7, 0x06, 0xba, 0x1f, 0x1b, 0xd7, 0xfd, 0xaf, 0xc9, 0xd8, 0x7d, 0x2c, 0x06, 0xa5, 0x68, 0x90, - 0x37, 0xd0, 0xbc, 0x87, 0xfe, 0x5c, 0x9b, 0xf7, 0x3b, 0x71, 0x28, 0x46, 0x42, 0xbb, 0x69, 0x5b, - 0xf7, 0x7e, 0x98, 0x35, 0x3a, 0xb8, 0x67, 0x5b, 0x1e, 0x36, 0xf5, 0x43, 0xb5, 0x8b, 0x6f, 0xe3, - 0xee, 0x82, 0x4c, 0x8d, 0xf2, 0x85, 0xa3, 0x83, 0xc7, 0xe5, 0x66, 0x40, 0xb7, 0x46, 0xc8, 0x56, - 0xe6, 0x9a, 0xab, 0x8d, 0xf5, 0xad, 0xcd, 0x76, 0x63, 0xa3, 0xfe, 0xaa, 0xb0, 0x2e, 0x8a, 0x64, - 0x0c, 0xa0, 0xbd, 0x8d, 0x46, 0x7b, 0x0b, 0xa4, 0xc1, 0x46, 0x11, 0x5b, 0x31, 0xa2, 0x59, 0xd2, - 0x0c, 0x9a, 0x83, 0xf2, 0xc6, 0xa6, 0xda, 0x6a, 0xae, 0x36, 0xd4, 0xc6, 0xd5, 0xab, 0x8d, 0x7a, - 0xbb, 0xc5, 0xd2, 0x81, 0x3e, 0x76, 0x5b, 0x8a, 0x87, 0x45, 0xfc, 0x03, 0x09, 0x98, 0x1b, 0xd1, - 0x12, 0x54, 0xe5, 0x81, 0x3c, 0xcb, 0x2d, 0x3c, 0x35, 0x4d, 0xeb, 0x97, 0x89, 0x2b, 0xbd, 0xa5, - 0x39, 0x1e, 0x8f, 0xfb, 0x1f, 0x07, 0x22, 0x25, 0xd3, 0x23, 0x2b, 0xbb, 0xc3, 0xd3, 0xac, 0x2c, - 0xba, 0x2f, 0x07, 0x70, 0x96, 0x69, 0x7d, 0x12, 0x90, 0x6d, 0xb9, 0x86, 0x67, 0xdc, 0xc6, 0xaa, - 0x61, 0x8a, 0x9c, 0x2c, 0x89, 0xf6, 0x93, 0x8a, 0x24, 0x4a, 0x9a, 0xa6, 0xe7, 0x63, 0x9b, 0x78, - 0x4f, 0x1b, 0xc0, 0x26, 0x9e, 0x47, 0x42, 0x91, 0x44, 0x89, 0x8f, 0xfd, 0x10, 0x14, 0x3a, 0x56, - 0x9f, 0x84, 0x40, 0x0c, 0x8f, 0x58, 0x8b, 0x98, 0x92, 0x67, 0x30, 0x1f, 0x85, 0x07, 0xb7, 0x41, - 0x32, 0xb8, 0xa0, 0xe4, 0x19, 0x8c, 0xa1, 0x3c, 0x06, 0x65, 0x6d, 0x6f, 0xcf, 0x21, 0xcc, 0x05, - 0x23, 0x16, 0xae, 0x97, 0x7c, 0x30, 0x45, 0xac, 0xdc, 0x80, 0xac, 0x90, 0x03, 0xf1, 0x60, 0x89, - 0x24, 0x54, 0x9b, 0xe5, 0xa0, 0xe2, 0xe7, 0x72, 0x4a, 0xd6, 0x14, 0x85, 0x0f, 0x41, 0xc1, 0x70, - 0xd5, 0x60, 0x6f, 0x2b, 0xbe, 0x14, 0x3f, 0x97, 0x55, 0xf2, 0x86, 0xeb, 0xef, 0x0b, 0xc8, 0x9f, - 0x8c, 0x43, 0x29, 0xba, 0x6b, 0x87, 0x56, 0x21, 0xdb, 0xb5, 0x74, 0x8d, 0xaa, 0x16, 0xdb, 0x32, - 0x3e, 0x37, 0x61, 0xa3, 0x6f, 0x79, 0x8d, 0xe3, 0x2b, 0x3e, 0x65, 0xe5, 0xdf, 0xc4, 0x20, 0x2b, - 0xc0, 0xe8, 0x24, 0x24, 0x6d, 0xcd, 0xdb, 0xa7, 0xec, 0x52, 0xb5, 0xb8, 0x14, 0x53, 0xe8, 0x37, - 0x81, 0xbb, 0xb6, 0x66, 0x52, 0x15, 0xe0, 0x70, 0xf2, 0x4d, 0xc6, 0xb5, 0x8b, 0xb5, 0x0e, 0xcd, - 0x05, 0x58, 0xbd, 0x1e, 0x36, 0x3d, 0x57, 0x8c, 0x2b, 0x87, 0xd7, 0x39, 0x18, 0x3d, 0x01, 0xb3, - 0x9e, 0xa3, 0x19, 0xdd, 0x08, 0x6e, 0x92, 0xe2, 0x4a, 0xa2, 0xc0, 0x47, 0x5e, 0x81, 0xd3, 0x82, - 0x6f, 0x07, 0x7b, 0x9a, 0xbe, 0x8f, 0x3b, 0x01, 0x51, 0x9a, 0xe6, 0xfc, 0x4e, 0x71, 0x84, 0x55, - 0x5e, 0x2e, 0x68, 0xe5, 0xcf, 0xc4, 0x61, 0x56, 0x64, 0x2f, 0x3a, 0xbe, 0xb0, 0xd6, 0x01, 0x34, - 0xd3, 0xb4, 0xbc, 0xb0, 0xb8, 0x86, 0x55, 0x79, 0x88, 0x6e, 0xb9, 0xea, 0x13, 0x29, 0x21, 0x06, - 0x95, 0xdf, 0x8f, 0x01, 0x04, 0x45, 0x63, 0xe5, 0xb6, 0x08, 0x79, 0xbe, 0x27, 0x4b, 0x37, 0xf6, - 0x59, 0xc2, 0x0b, 0x18, 0xe8, 0xaa, 0xd1, 0xa5, 0x69, 0xc9, 0x1d, 0xbc, 0x67, 0x98, 0x7c, 0x3f, - 0x85, 0x7d, 0x88, 0xb4, 0x64, 0x32, 0xd8, 0x9e, 0x52, 0x20, 0xeb, 0xe2, 0x9e, 0x66, 0x7a, 0x86, - 0xce, 0x77, 0x48, 0x2e, 0x1f, 0xab, 0xf1, 0xcb, 0x2d, 0x4e, 0xad, 0xf8, 0x7c, 0xe4, 0x73, 0x90, - 0x15, 0x50, 0xe2, 0xf8, 0x6d, 0x6c, 0x6e, 0x34, 0xa4, 0x19, 0x94, 0x81, 0x44, 0xab, 0xd1, 0x96, - 0x62, 0x24, 0xec, 0xac, 0xae, 0x35, 0xab, 0x2d, 0x29, 0x5e, 0xfb, 0x6b, 0x30, 0xa7, 0x5b, 0xbd, - 0xc1, 0x0a, 0x6b, 0xd2, 0x40, 0xca, 0xcf, 0xbd, 0x1e, 0x7b, 0xed, 0x29, 0x8e, 0xb4, 0x67, 0x75, - 0x35, 0x73, 0x6f, 0xd9, 0x72, 0xf6, 0x82, 0x63, 0x11, 0x24, 0x3a, 0x70, 0x43, 0x87, 0x23, 0xec, - 0x9d, 0x3f, 0x8b, 0xc5, 0x7e, 0x38, 0x9e, 0xb8, 0xb6, 0x55, 0xfb, 0x89, 0x78, 0xe5, 0x1a, 0x23, - 0xdc, 0x12, 0xdd, 0x51, 0xf0, 0x6e, 0x17, 0xeb, 0xa4, 0xf1, 0xf0, 0x07, 0x4f, 0xc0, 0xfc, 0x9e, - 0xb5, 0x67, 0x51, 0x4e, 0x17, 0xc8, 0x2f, 0x7e, 0xae, 0x22, 0xe7, 0x43, 0x2b, 0x13, 0x0f, 0x61, - 0xac, 0x6c, 0xc0, 0x1c, 0x47, 0x56, 0xe9, 0xf6, 0x2d, 0x4b, 0x2e, 0xa0, 0x23, 0x33, 0xdb, 0x0b, - 0x3f, 0xf5, 0x7b, 0xd4, 0x2b, 0x51, 0x66, 0x39, 0x29, 0x29, 0x63, 0xf9, 0x87, 0x15, 0x05, 0x4e, - 0x44, 0xf8, 0x31, 0x1b, 0x81, 0x9d, 0x09, 0x1c, 0xff, 0x39, 0xe7, 0x38, 0x17, 0xe2, 0xd8, 0xe2, - 0xa4, 0x2b, 0x75, 0x28, 0x1e, 0x87, 0xd7, 0xbf, 0xe0, 0xbc, 0x0a, 0x38, 0xcc, 0xe4, 0x1a, 0x94, - 0x29, 0x13, 0xbd, 0xef, 0x7a, 0x56, 0x8f, 0x1a, 0xe0, 0xa3, 0xd9, 0xfc, 0xcb, 0xdf, 0x63, 0x93, - 0xb6, 0x44, 0xc8, 0xea, 0x3e, 0xd5, 0xca, 0x0a, 0xd0, 0x1d, 0xeb, 0x0e, 0xd6, 0xbb, 0x13, 0x38, - 0xfc, 0x1a, 0x6f, 0x88, 0x8f, 0xbf, 0x72, 0x13, 0xe6, 0xc9, 0x6f, 0x6a, 0x1f, 0xc3, 0x2d, 0x99, - 0x9c, 0x06, 0x5f, 0xf8, 0xb7, 0x1f, 0x64, 0x76, 0x61, 0xce, 0x67, 0x10, 0x6a, 0x53, 0x68, 0x14, - 0xf7, 0xb0, 0xe7, 0x61, 0xc7, 0x55, 0xb5, 0xee, 0xa8, 0xe6, 0x85, 0xf2, 0x88, 0x0b, 0xdf, 0xff, - 0xa5, 0xe8, 0x28, 0x5e, 0x63, 0x94, 0xd5, 0x6e, 0x77, 0x65, 0x1b, 0x4e, 0x8d, 0xd0, 0x8a, 0x29, - 0x78, 0xfe, 0x00, 0xe7, 0x39, 0x3f, 0xa4, 0x19, 0x84, 0xed, 0x16, 0x08, 0xb8, 0x3f, 0x96, 0x53, - 0xf0, 0xfc, 0x28, 0xe7, 0x89, 0x38, 0xad, 0x18, 0x52, 0xc2, 0xf1, 0x06, 0xcc, 0xde, 0xc6, 0xce, - 0x8e, 0xe5, 0xf2, 0xdc, 0xed, 0x14, 0xec, 0x3e, 0xc6, 0xd9, 0x95, 0x39, 0x21, 0x4d, 0xe6, 0x12, - 0x5e, 0x2f, 0x40, 0x76, 0x57, 0xd3, 0xf1, 0x14, 0x2c, 0xee, 0x71, 0x16, 0x19, 0x82, 0x4f, 0x48, - 0xab, 0x50, 0xd8, 0xb3, 0xf8, 0x12, 0x39, 0x99, 0xfc, 0x07, 0x39, 0x79, 0x5e, 0xd0, 0x70, 0x16, - 0xb6, 0x65, 0xf7, 0xbb, 0x64, 0xfd, 0x9c, 0xcc, 0xe2, 0x87, 0x04, 0x0b, 0x41, 0xc3, 0x59, 0x1c, - 0x43, 0xac, 0x1f, 0x17, 0x2c, 0xdc, 0x90, 0x3c, 0x5f, 0x84, 0xbc, 0x65, 0x76, 0x0f, 0x2d, 0x73, - 0x9a, 0x46, 0x7c, 0x82, 0x73, 0x00, 0x4e, 0x42, 0x18, 0x5c, 0x81, 0xdc, 0xb4, 0x03, 0xf1, 0xa3, - 0x5f, 0x12, 0xd3, 0x43, 0x8c, 0xc0, 0x35, 0x28, 0x0b, 0x03, 0x65, 0x58, 0xe6, 0x14, 0x2c, 0x7e, - 0x8c, 0xb3, 0x28, 0x85, 0xc8, 0x78, 0x37, 0x3c, 0xec, 0x7a, 0x7b, 0x78, 0x1a, 0x26, 0x9f, 0x14, - 0xdd, 0xe0, 0x24, 0x5c, 0x94, 0x3b, 0xd8, 0xd4, 0xf7, 0xa7, 0xe3, 0xf0, 0x29, 0x21, 0x4a, 0x41, - 0x43, 0x58, 0xd4, 0xa1, 0xd8, 0xd3, 0x1c, 0x77, 0x5f, 0xeb, 0x4e, 0x35, 0x1c, 0x3f, 0xce, 0x79, - 0x14, 0x7c, 0x22, 0x2e, 0x91, 0xbe, 0x79, 0x1c, 0x36, 0x3f, 0x21, 0x24, 0x12, 0x22, 0xe3, 0x53, - 0xcf, 0xf5, 0x68, 0xa2, 0xfb, 0x38, 0xdc, 0xfe, 0xae, 0x98, 0x7a, 0x8c, 0x76, 0x3d, 0xcc, 0xf1, - 0x0a, 0xe4, 0x5c, 0xe3, 0x8d, 0xa9, 0xd8, 0xfc, 0x3d, 0x31, 0xd2, 0x94, 0x80, 0x10, 0xbf, 0x0a, - 0xa7, 0x47, 0x2e, 0x13, 0x53, 0x30, 0xfb, 0xfb, 0x9c, 0xd9, 0xc9, 0x11, 0x4b, 0x05, 0x37, 0x09, - 0xc7, 0x65, 0xf9, 0x0f, 0x84, 0x49, 0xc0, 0x03, 0xbc, 0xb6, 0x48, 0xd0, 0xe2, 0x6a, 0xbb, 0xc7, - 0x93, 0xda, 0x3f, 0x14, 0x52, 0x63, 0xb4, 0x11, 0xa9, 0xb5, 0xe1, 0x24, 0xe7, 0x78, 0xbc, 0x71, - 0xfd, 0x49, 0x61, 0x58, 0x19, 0xf5, 0x76, 0x74, 0x74, 0xbf, 0x0e, 0x2a, 0xbe, 0x38, 0x85, 0x77, - 0xec, 0xaa, 0x3d, 0xcd, 0x9e, 0x82, 0xf3, 0x4f, 0x71, 0xce, 0xc2, 0xe2, 0xfb, 0xee, 0xb5, 0xbb, - 0xae, 0xd9, 0x84, 0xf9, 0x2b, 0xb0, 0x20, 0x98, 0xf7, 0x4d, 0x07, 0xeb, 0xd6, 0x9e, 0x69, 0xbc, - 0x81, 0x3b, 0x53, 0xb0, 0xfe, 0xe9, 0x81, 0xa1, 0xda, 0x0e, 0x91, 0x13, 0xce, 0x4d, 0x90, 0x7c, - 0x5f, 0x45, 0x35, 0x7a, 0xb6, 0xe5, 0x78, 0x13, 0x38, 0xfe, 0x8c, 0x18, 0x29, 0x9f, 0xae, 0x49, - 0xc9, 0x56, 0x1a, 0xc0, 0x4e, 0x7f, 0x4c, 0xab, 0x92, 0x9f, 0xe6, 0x8c, 0x8a, 0x01, 0x15, 0x37, - 0x1c, 0xba, 0xd5, 0xb3, 0x35, 0x67, 0x1a, 0xfb, 0xf7, 0x8f, 0x84, 0xe1, 0xe0, 0x24, 0xdc, 0x70, - 0x10, 0x8f, 0x8e, 0xac, 0xf6, 0x53, 0x70, 0xf8, 0x59, 0x61, 0x38, 0x04, 0x0d, 0x67, 0x21, 0x1c, - 0x86, 0x29, 0x58, 0xfc, 0x9c, 0x60, 0x21, 0x68, 0x08, 0x8b, 0x97, 0x83, 0x85, 0xd6, 0xc1, 0x7b, - 0x86, 0xeb, 0x39, 0xcc, 0x25, 0x3f, 0x9a, 0xd5, 0xcf, 0x7f, 0x29, 0xea, 0x84, 0x29, 0x21, 0x52, - 0x62, 0x89, 0xf8, 0xd6, 0x07, 0x0d, 0xd9, 0x26, 0x37, 0xec, 0x17, 0x84, 0x25, 0x0a, 0x91, 0x91, - 0xb6, 0x85, 0x3c, 0x44, 0x22, 0x76, 0x9d, 0x04, 0x2a, 0x53, 0xb0, 0xfb, 0xc7, 0x03, 0x8d, 0x6b, - 0x09, 0x5a, 0xc2, 0x33, 0xe4, 0xff, 0xf4, 0xcd, 0x5b, 0xf8, 0x70, 0x2a, 0xed, 0xfc, 0xc5, 0x01, - 0xff, 0x67, 0x9b, 0x51, 0x32, 0x1b, 0x52, 0x1e, 0xf0, 0xa7, 0xd0, 0xa4, 0xb3, 0x7e, 0x0b, 0xdf, - 0xf4, 0x65, 0xde, 0xdf, 0xa8, 0x3b, 0xb5, 0xb2, 0x46, 0x94, 0x3c, 0xea, 0xf4, 0x4c, 0x66, 0xf6, - 0xc1, 0x2f, 0xfb, 0x7a, 0x1e, 0xf1, 0x79, 0x56, 0xae, 0x42, 0x31, 0xe2, 0xf0, 0x4c, 0x66, 0xf5, - 0xcd, 0x9c, 0x55, 0x21, 0xec, 0xef, 0xac, 0x5c, 0x82, 0x24, 0x71, 0x5e, 0x26, 0x93, 0x7f, 0x0b, - 0x27, 0xa7, 0xe8, 0x2b, 0xef, 0x86, 0xac, 0x70, 0x5a, 0x26, 0x93, 0xfe, 0x0d, 0x4e, 0xea, 0x93, - 0x10, 0x72, 0xe1, 0xb0, 0x4c, 0x26, 0xff, 0x9b, 0x82, 0x5c, 0x90, 0x10, 0xf2, 0xe9, 0x45, 0xf8, - 0xcb, 0xdf, 0x96, 0xe4, 0x8b, 0x8e, 0x90, 0xdd, 0x15, 0xc8, 0x70, 0x4f, 0x65, 0x32, 0xf5, 0xb7, - 0xf2, 0xca, 0x05, 0xc5, 0xca, 0xf3, 0x90, 0x9a, 0x52, 0xe0, 0xdf, 0xc1, 0x49, 0x19, 0xfe, 0x4a, - 0x1d, 0xf2, 0x21, 0xef, 0x64, 0x32, 0xf9, 0x77, 0x72, 0xf2, 0x30, 0x15, 0x69, 0x3a, 0xf7, 0x4e, - 0x26, 0x33, 0xf8, 0x5b, 0xa2, 0xe9, 0x9c, 0x82, 0x88, 0x4d, 0x38, 0x26, 0x93, 0xa9, 0x3f, 0x2c, - 0xa4, 0x2e, 0x48, 0x56, 0x5e, 0x84, 0x9c, 0xbf, 0xd8, 0x4c, 0xa6, 0xff, 0x2e, 0x4e, 0x1f, 0xd0, - 0x10, 0x09, 0x84, 0x16, 0xbb, 0xc9, 0x2c, 0xfe, 0xb6, 0x90, 0x40, 0x88, 0x8a, 0x4c, 0xa3, 0x41, - 0x07, 0x66, 0x32, 0xa7, 0xef, 0x16, 0xd3, 0x68, 0xc0, 0x7f, 0x21, 0xa3, 0x49, 0x6d, 0xfe, 0x64, - 0x16, 0xdf, 0x23, 0x46, 0x93, 0xe2, 0x93, 0x66, 0x0c, 0x7a, 0x04, 0x93, 0x79, 0x7c, 0x9f, 0x68, - 0xc6, 0x80, 0x43, 0xb0, 0xb2, 0x05, 0x68, 0xd8, 0x1b, 0x98, 0xcc, 0xef, 0x23, 0x9c, 0xdf, 0xec, - 0x90, 0x33, 0xb0, 0xf2, 0x5e, 0x38, 0x39, 0xda, 0x13, 0x98, 0xcc, 0xf5, 0xfb, 0xbf, 0x3c, 0x10, - 0xbb, 0x85, 0x1d, 0x81, 0x95, 0x76, 0xb0, 0xa4, 0x84, 0xbd, 0x80, 0xc9, 0x6c, 0x7f, 0xe0, 0xcb, - 0x51, 0xc3, 0x1d, 0x76, 0x02, 0x56, 0xaa, 0x00, 0xc1, 0x02, 0x3c, 0x99, 0xd7, 0xc7, 0x38, 0xaf, - 0x10, 0x11, 0x99, 0x1a, 0x7c, 0xfd, 0x9d, 0x4c, 0x7f, 0x4f, 0x4c, 0x0d, 0x4e, 0x41, 0xa6, 0x86, - 0x58, 0x7a, 0x27, 0x53, 0xff, 0xa0, 0x98, 0x1a, 0x82, 0x84, 0x68, 0x76, 0x68, 0x75, 0x9b, 0xcc, - 0xe1, 0x13, 0x42, 0xb3, 0x43, 0x54, 0x2b, 0x1b, 0x30, 0x3b, 0xb4, 0x20, 0x4e, 0x66, 0xf5, 0xc3, - 0x9c, 0x95, 0x34, 0xb8, 0x1e, 0x86, 0x17, 0x2f, 0xbe, 0x18, 0x4e, 0xe6, 0xf6, 0x23, 0x03, 0x8b, - 0x17, 0x5f, 0x0b, 0x57, 0xae, 0x40, 0xd6, 0xec, 0x77, 0xbb, 0x64, 0xf2, 0xa0, 0xa3, 0xcf, 0xe7, - 0x2e, 0xfc, 0x97, 0xaf, 0x70, 0xe9, 0x08, 0x82, 0x95, 0x4b, 0x90, 0xc2, 0xbd, 0x1d, 0xdc, 0x99, - 0x44, 0xf9, 0xc5, 0xaf, 0x08, 0x83, 0x49, 0xb0, 0x57, 0x5e, 0x04, 0x60, 0xa9, 0x11, 0xba, 0x71, - 0x3e, 0x81, 0xf6, 0xf7, 0xbf, 0xc2, 0x0f, 0xc4, 0x05, 0x24, 0x01, 0x03, 0x76, 0xbc, 0xee, 0x68, - 0x06, 0x5f, 0x8a, 0x32, 0xa0, 0x23, 0xf2, 0x02, 0x64, 0x5e, 0x77, 0x2d, 0xd3, 0xd3, 0xf6, 0x26, - 0x51, 0xff, 0x01, 0xa7, 0x16, 0xf8, 0x44, 0x60, 0x3d, 0xcb, 0xc1, 0x9e, 0xb6, 0xe7, 0x4e, 0xa2, - 0xfd, 0xaf, 0x9c, 0xd6, 0x27, 0x20, 0xc4, 0xba, 0xe6, 0x7a, 0xd3, 0xf4, 0xfb, 0xbf, 0x09, 0x62, - 0x41, 0x40, 0x1a, 0x4d, 0x7e, 0xdf, 0xc2, 0x87, 0x93, 0x68, 0xff, 0x50, 0x34, 0x9a, 0xe3, 0xaf, - 0xbc, 0x1b, 0x72, 0xe4, 0x27, 0x3b, 0xe5, 0x3a, 0x81, 0xf8, 0x8f, 0x38, 0x71, 0x40, 0x41, 0x6a, - 0x76, 0xbd, 0x8e, 0x67, 0x4c, 0x16, 0xf6, 0x1f, 0xf3, 0x91, 0x16, 0xf8, 0x2b, 0x55, 0xc8, 0xbb, - 0x5e, 0xa7, 0xd3, 0xe7, 0xfe, 0xe9, 0x04, 0xf2, 0x3f, 0xf9, 0x8a, 0x9f, 0xb2, 0xf0, 0x69, 0xc8, - 0x68, 0xdf, 0xb9, 0xe5, 0xd9, 0x16, 0xdd, 0x6f, 0x99, 0xc4, 0xe1, 0xcb, 0x9c, 0x43, 0x88, 0x64, - 0xa5, 0x0e, 0x05, 0xd2, 0x17, 0x07, 0xdb, 0x98, 0x6e, 0x8e, 0x4d, 0x60, 0xf1, 0xa7, 0x5c, 0x00, - 0x11, 0xa2, 0xda, 0x37, 0xfe, 0xda, 0x67, 0xcf, 0xc6, 0x3e, 0xf3, 0xd9, 0xb3, 0xb1, 0xdf, 0xf9, - 0xec, 0xd9, 0xd8, 0x87, 0x3f, 0x77, 0x76, 0xe6, 0x33, 0x9f, 0x3b, 0x3b, 0xf3, 0x5b, 0x9f, 0x3b, - 0x3b, 0x33, 0x3a, 0x4b, 0x0c, 0xd7, 0xac, 0x6b, 0x16, 0xcb, 0x0f, 0xbf, 0xf6, 0xc8, 0x9e, 0xe1, - 0xed, 0xf7, 0x77, 0x96, 0x75, 0xab, 0x77, 0x41, 0xb7, 0xdc, 0x9e, 0xe5, 0x5e, 0x88, 0xe6, 0x75, - 0xe9, 0x2f, 0xf8, 0x5f, 0x31, 0x12, 0x33, 0x47, 0xd3, 0xb9, 0x9a, 0x79, 0x38, 0xee, 0x32, 0xdd, - 0x65, 0x48, 0x54, 0xcd, 0x43, 0x74, 0x9a, 0x19, 0x38, 0xb5, 0xef, 0x74, 0xf9, 0x51, 0xcb, 0x0c, - 0xf9, 0xde, 0x76, 0xba, 0x68, 0x3e, 0x38, 0x0f, 0x1d, 0x3b, 0x57, 0xe0, 0x87, 0x9c, 0x6b, 0xdf, - 0x19, 0x3b, 0x5e, 0x4f, 0xb2, 0x55, 0xf3, 0x90, 0x76, 0x64, 0x2b, 0xf6, 0xda, 0x93, 0x13, 0xf3, - 0xdc, 0xb7, 0x4c, 0xeb, 0x8e, 0x49, 0x9a, 0x6d, 0xef, 0x88, 0x1c, 0xf7, 0xd9, 0xc1, 0x1c, 0xf7, - 0x7b, 0x71, 0xb7, 0xfb, 0x12, 0xc1, 0x6b, 0x13, 0x92, 0x9d, 0x34, 0x3b, 0xd5, 0x0f, 0xdf, 0x1d, - 0x87, 0xb3, 0x43, 0xe9, 0x6c, 0xae, 0x04, 0xe3, 0x84, 0xb0, 0x02, 0xd9, 0x55, 0xa1, 0x5b, 0x0b, - 0x90, 0x71, 0xb1, 0x6e, 0x99, 0x1d, 0x97, 0x0a, 0x22, 0xa1, 0x88, 0x4f, 0x22, 0x08, 0x53, 0x33, - 0x2d, 0x97, 0x1f, 0x56, 0x66, 0x1f, 0xb5, 0x8f, 0x1e, 0x53, 0x10, 0x45, 0x51, 0x93, 0x90, 0xc6, - 0x33, 0x53, 0x4a, 0x43, 0x74, 0x22, 0x92, 0xf9, 0x9f, 0x56, 0x2a, 0xdf, 0x17, 0x87, 0xc5, 0x41, - 0xa9, 0x90, 0x99, 0xe5, 0x7a, 0x5a, 0xcf, 0x1e, 0x27, 0x96, 0x2b, 0x90, 0x6b, 0x0b, 0x9c, 0x63, - 0xcb, 0xe5, 0xde, 0x31, 0xe5, 0x52, 0xf2, 0xab, 0x12, 0x82, 0xb9, 0x38, 0xa5, 0x60, 0xfc, 0x7e, - 0xdc, 0x97, 0x64, 0xfe, 0x67, 0x1a, 0x4e, 0xb3, 0xe9, 0xa4, 0xb2, 0xa9, 0xc4, 0x3e, 0xb8, 0x4c, - 0x0a, 0xe1, 0xa2, 0xc9, 0xfb, 0x24, 0xf2, 0x4b, 0x30, 0xd7, 0x24, 0xd6, 0x82, 0x44, 0x41, 0xc1, - 0x0e, 0xcf, 0xc8, 0xf3, 0xdc, 0x4b, 0x11, 0x87, 0x9f, 0xef, 0x6f, 0x85, 0x41, 0xf2, 0x37, 0xc5, - 0x40, 0x6a, 0xe9, 0x5a, 0x57, 0x73, 0xbe, 0x5a, 0x56, 0xe8, 0x79, 0x00, 0x76, 0xdc, 0xc3, 0xbf, - 0xb8, 0x57, 0xba, 0xb8, 0xb0, 0x1c, 0xee, 0xdc, 0x32, 0xab, 0x89, 0x9e, 0xa0, 0xca, 0x51, 0x5c, - 0xf2, 0xf3, 0xfc, 0x2b, 0x00, 0x41, 0x01, 0x3a, 0x03, 0xa7, 0x5a, 0xf5, 0xea, 0x5a, 0x55, 0x11, - 0x87, 0x84, 0x5a, 0x5b, 0x8d, 0x7a, 0xf3, 0x6a, 0xb3, 0xb1, 0x2a, 0xcd, 0xa0, 0x93, 0x80, 0xc2, - 0x85, 0xfe, 0xa1, 0xa6, 0x13, 0x30, 0x1b, 0x86, 0xb3, 0x5b, 0x2a, 0x71, 0xe2, 0x29, 0x1a, 0x3d, - 0xbb, 0x8b, 0xe9, 0xce, 0xa3, 0x6a, 0x08, 0xa9, 0x4d, 0x76, 0x42, 0x7e, 0xfd, 0xdf, 0xb1, 0x9b, - 0x0b, 0x73, 0x01, 0xb9, 0x2f, 0xf3, 0x95, 0x35, 0x98, 0xd5, 0x74, 0x1d, 0xdb, 0x11, 0x96, 0x13, - 0x4c, 0x35, 0x61, 0x48, 0xf7, 0x52, 0x39, 0x65, 0xc0, 0xed, 0x79, 0x48, 0xbb, 0xb4, 0xf7, 0x93, - 0x58, 0xfc, 0x06, 0x67, 0xc1, 0xd1, 0x57, 0x4c, 0x98, 0x25, 0x9e, 0x9f, 0xe6, 0xe0, 0x50, 0x33, - 0x8e, 0xce, 0x33, 0xfc, 0x93, 0x9f, 0x79, 0x9a, 0xee, 0xac, 0x3e, 0x14, 0x1d, 0x96, 0x11, 0xea, - 0xa4, 0x48, 0x9c, 0x77, 0xd0, 0x50, 0x0c, 0x25, 0x51, 0x1f, 0x6f, 0xf0, 0xd1, 0x95, 0xfd, 0x12, - 0xaf, 0xec, 0xec, 0x28, 0x1d, 0x08, 0xd5, 0x54, 0xe4, 0x5c, 0x59, 0x41, 0xad, 0x31, 0x6e, 0x4e, - 0xbf, 0xf6, 0xc4, 0xf0, 0xea, 0xc4, 0xfe, 0x7b, 0x8a, 0x72, 0xbe, 0x12, 0xae, 0xc6, 0x9f, 0x7b, - 0x1f, 0x4d, 0xc2, 0xac, 0xd6, 0x33, 0x4c, 0xeb, 0x02, 0xfd, 0x97, 0xcf, 0xb9, 0x14, 0xfd, 0x98, - 0x62, 0x53, 0xf2, 0x32, 0x9b, 0x0a, 0x93, 0x35, 0xe6, 0x8f, 0xbe, 0xfd, 0xc7, 0x52, 0xc1, 0x74, - 0x59, 0x59, 0x07, 0x49, 0x1c, 0xe2, 0xc5, 0xa6, 0x6e, 0x75, 0xa6, 0xca, 0x52, 0xfc, 0xb1, 0xe0, - 0x21, 0xf2, 0x5b, 0x0d, 0x4e, 0xba, 0xf2, 0x2e, 0xc8, 0xfa, 0x6c, 0x26, 0x79, 0x26, 0x82, 0x89, - 0x4f, 0x41, 0xfc, 0x12, 0x36, 0x33, 0xa7, 0xf1, 0x42, 0xbf, 0x2c, 0xe8, 0xd9, 0x0c, 0xdd, 0x20, - 0xbd, 0xb9, 0x06, 0xa5, 0x8e, 0x65, 0x7a, 0xaa, 0xd5, 0x33, 0x3c, 0xdc, 0xb3, 0xbd, 0x89, 0x7e, - 0xdd, 0x9f, 0x32, 0x26, 0x59, 0xa5, 0x48, 0xe8, 0x36, 0x05, 0x19, 0x69, 0x09, 0xbb, 0xa7, 0x37, - 0x4d, 0x4b, 0xfe, 0xbb, 0xdf, 0x12, 0x4a, 0x43, 0x5a, 0x72, 0x5f, 0xda, 0xe1, 0x76, 0x6e, 0x71, - 0x63, 0xee, 0x1d, 0x30, 0x2d, 0xf0, 0xb5, 0xe3, 0x93, 0x09, 0x38, 0xcb, 0x91, 0x77, 0x34, 0x17, - 0x5f, 0xb8, 0xfd, 0xcc, 0x0e, 0xf6, 0xb4, 0x67, 0x2e, 0xe8, 0x96, 0x21, 0x56, 0xf2, 0x39, 0x6e, - 0xac, 0x49, 0xf9, 0x32, 0x2f, 0xaf, 0x8c, 0xdc, 0xee, 0xae, 0x8c, 0x37, 0xf2, 0x95, 0x61, 0x1d, - 0x94, 0xbb, 0x90, 0xac, 0x5b, 0x86, 0x49, 0xd6, 0xb6, 0x0e, 0x36, 0xad, 0x1e, 0x37, 0xb7, 0xec, - 0x03, 0x5d, 0x87, 0xb4, 0xd6, 0xb3, 0xfa, 0xa6, 0xc7, 0x4c, 0x6d, 0xed, 0xe9, 0x5f, 0x7b, 0x73, - 0x71, 0xe6, 0x3f, 0xbe, 0xb9, 0x78, 0x82, 0xb1, 0x75, 0x3b, 0xb7, 0x96, 0x0d, 0xeb, 0x42, 0x4f, - 0xf3, 0xf6, 0xc9, 0xf4, 0xfd, 0xcd, 0x4f, 0x3f, 0x05, 0xbc, 0xbe, 0xa6, 0xe9, 0x7d, 0xea, 0xf3, - 0x3f, 0x79, 0x3e, 0xa6, 0x70, 0xfa, 0x95, 0xe4, 0x17, 0x3e, 0xbe, 0x18, 0x93, 0x6d, 0xc8, 0xac, - 0x62, 0xfd, 0x88, 0x0a, 0x9b, 0x03, 0x15, 0x3e, 0xc3, 0x2b, 0x3c, 0x33, 0x5c, 0x21, 0x3b, 0xb0, - 0xb7, 0x8a, 0xf5, 0x50, 0xb5, 0xab, 0x58, 0x8f, 0xd6, 0x58, 0x5b, 0xfd, 0xad, 0xdf, 0x3d, 0x3b, - 0xf3, 0x81, 0xcf, 0x9e, 0x9d, 0x19, 0x3b, 0x64, 0xf2, 0xe4, 0x21, 0xf3, 0x47, 0xea, 0xc7, 0x92, - 0xf0, 0x20, 0xbd, 0x11, 0xea, 0xf4, 0x0c, 0xd3, 0xbb, 0xa0, 0x3b, 0x87, 0xb6, 0x67, 0x91, 0x89, - 0x6b, 0xed, 0xf2, 0x81, 0x9a, 0x0d, 0x8a, 0x97, 0x59, 0xf1, 0xe8, 0x61, 0x92, 0x77, 0x21, 0xb5, - 0x45, 0xe8, 0x88, 0x20, 0x3c, 0xcb, 0xd3, 0xba, 0xdc, 0xdb, 0x60, 0x1f, 0x04, 0xca, 0x6e, 0x91, - 0xc6, 0x19, 0xd4, 0x10, 0x17, 0x48, 0xbb, 0x58, 0xdb, 0x65, 0x97, 0x71, 0x12, 0xd4, 0x4d, 0xcd, - 0x12, 0x00, 0xbd, 0x77, 0x33, 0x0f, 0x29, 0xad, 0xcf, 0x0e, 0xcc, 0x24, 0x88, 0xff, 0x4a, 0x3f, - 0xe4, 0x97, 0x20, 0xc3, 0xf7, 0xcd, 0x91, 0x04, 0x89, 0x5b, 0xf8, 0x90, 0xd6, 0x53, 0x50, 0xc8, - 0x4f, 0xb4, 0x0c, 0x29, 0xda, 0x78, 0x7e, 0xcb, 0x70, 0x61, 0x79, 0xa8, 0xf5, 0xcb, 0xb4, 0x91, - 0x0a, 0x43, 0x93, 0x6f, 0x40, 0x76, 0xd5, 0x22, 0xda, 0x13, 0xe5, 0x96, 0x63, 0xdc, 0x68, 0x9b, - 0xed, 0x3e, 0x1f, 0x3b, 0x85, 0x7d, 0xa0, 0x93, 0x90, 0x66, 0x97, 0xb3, 0xf8, 0xa1, 0x1f, 0xfe, - 0x25, 0xd7, 0x21, 0x43, 0x79, 0x6f, 0xda, 0x64, 0xa9, 0xf7, 0xcf, 0xab, 0xe7, 0xf8, 0x55, 0x5d, - 0xce, 0x3e, 0x1e, 0x34, 0x16, 0x41, 0xb2, 0xa3, 0x79, 0x1a, 0xef, 0x37, 0xfd, 0x2d, 0xbf, 0x07, - 0xb2, 0x9c, 0x89, 0x8b, 0x2e, 0x42, 0xc2, 0xb2, 0x5d, 0x7e, 0x6c, 0xa7, 0x32, 0xae, 0x2b, 0x9b, - 0x76, 0x2d, 0x49, 0x94, 0x4a, 0x21, 0xc8, 0xb5, 0x8d, 0xb1, 0x6a, 0xf1, 0x5c, 0x44, 0x2d, 0x7a, - 0xd8, 0xdb, 0xd9, 0xf5, 0x82, 0x1f, 0x6c, 0x38, 0x87, 0x54, 0xc1, 0x57, 0x94, 0x7b, 0x71, 0x38, - 0x1b, 0x2a, 0xbd, 0x8d, 0x1d, 0xd7, 0xb0, 0x4c, 0xa6, 0x4d, 0x5c, 0x53, 0x50, 0xa8, 0x81, 0xbc, - 0x7c, 0x8c, 0xaa, 0xbc, 0x1b, 0x12, 0x55, 0xdb, 0x46, 0x15, 0xc8, 0xd2, 0x6f, 0xdd, 0x62, 0xba, - 0x92, 0x54, 0xfc, 0x6f, 0x52, 0xe6, 0x5a, 0xbb, 0xde, 0x1d, 0xcd, 0xf1, 0xef, 0x2e, 0x8b, 0x6f, - 0xf9, 0x05, 0xc8, 0xd5, 0x2d, 0xd3, 0xc5, 0xa6, 0xdb, 0xa7, 0x3e, 0xec, 0x4e, 0xd7, 0xd2, 0x6f, - 0x71, 0x0e, 0xec, 0x83, 0x08, 0x5b, 0xb3, 0x6d, 0x4a, 0x99, 0x54, 0xc8, 0x4f, 0x3e, 0x7b, 0x36, - 0xc7, 0x8a, 0xe7, 0xd2, 0xf1, 0xc4, 0xc3, 0x3b, 0x18, 0x38, 0xa3, 0x31, 0x78, 0x60, 0x78, 0x22, - 0xdd, 0xc2, 0x87, 0xee, 0x71, 0xe7, 0xd1, 0x2b, 0x90, 0xdb, 0xa2, 0xcf, 0x8a, 0xbc, 0x84, 0x0f, - 0x51, 0x05, 0x32, 0xb8, 0x73, 0xf1, 0xd2, 0xa5, 0x67, 0x5e, 0x60, 0x5a, 0x7e, 0x7d, 0x46, 0x11, - 0x00, 0x74, 0x16, 0x72, 0x2e, 0xd6, 0xed, 0x8b, 0x97, 0x2e, 0xdf, 0x7a, 0x86, 0xa9, 0xd5, 0xf5, - 0x19, 0x25, 0x00, 0xad, 0x64, 0x49, 0x8f, 0xbf, 0xf0, 0x89, 0xc5, 0x58, 0x2d, 0x05, 0x09, 0xb7, - 0xdf, 0x7b, 0xdb, 0x74, 0xe3, 0x0f, 0xd3, 0xb0, 0x14, 0x2a, 0x65, 0x8b, 0xc2, 0x6d, 0xad, 0x6b, - 0x74, 0xb4, 0xe0, 0x31, 0x18, 0x29, 0xd4, 0x7f, 0x8a, 0x31, 0xc6, 0xda, 0x1f, 0x29, 0x45, 0xf9, - 0xa7, 0x63, 0x50, 0xb8, 0x29, 0x38, 0xb7, 0xb0, 0x87, 0xae, 0x00, 0xf8, 0x35, 0x89, 0xa9, 0x72, - 0x66, 0x79, 0xb0, 0xae, 0x65, 0x9f, 0x46, 0x09, 0xa1, 0xa3, 0xe7, 0xa9, 0x02, 0xda, 0x96, 0xcb, - 0xef, 0xb1, 0x4e, 0x20, 0xf5, 0x91, 0xd1, 0x93, 0x80, 0xa8, 0x55, 0x53, 0x6f, 0x5b, 0x9e, 0x61, - 0xee, 0xa9, 0xb6, 0x75, 0x87, 0xbf, 0x0e, 0x90, 0x50, 0x24, 0x5a, 0x72, 0x93, 0x16, 0x6c, 0x11, - 0x38, 0x69, 0x74, 0xce, 0xe7, 0x42, 0xc2, 0x31, 0xad, 0xd3, 0x71, 0xb0, 0xeb, 0x72, 0xc3, 0x25, - 0x3e, 0xd1, 0x15, 0xc8, 0xd8, 0xfd, 0x1d, 0x55, 0x58, 0x89, 0xfc, 0xc5, 0x07, 0x46, 0xcd, 0x79, - 0xa1, 0x1b, 0x7c, 0xd6, 0xa7, 0xed, 0xfe, 0x0e, 0xd1, 0x94, 0x87, 0xa0, 0x30, 0xa2, 0x31, 0xf9, - 0xdb, 0x41, 0x3b, 0xe8, 0x4b, 0x36, 0xbc, 0x07, 0xaa, 0xed, 0x18, 0x96, 0x63, 0x78, 0x87, 0xf4, - 0xb8, 0x5d, 0x42, 0x91, 0x44, 0xc1, 0x16, 0x87, 0xcb, 0xb7, 0xa0, 0xdc, 0xa2, 0x6e, 0x7a, 0xd0, - 0xf2, 0x4b, 0x41, 0xfb, 0x62, 0x93, 0xdb, 0x37, 0xb6, 0x65, 0xf1, 0xa1, 0x96, 0x9d, 0xff, 0xf7, - 0x31, 0xc8, 0xd7, 0xc8, 0xc4, 0x6d, 0xae, 0x5e, 0xed, 0x6a, 0x7b, 0xe8, 0x19, 0x38, 0x51, 0x5b, - 0xdb, 0xac, 0xbf, 0xa4, 0x36, 0x57, 0xd5, 0xab, 0x6b, 0xd5, 0x6b, 0xc1, 0xf9, 0xde, 0xca, 0xc9, - 0xbb, 0xf7, 0x96, 0x50, 0x08, 0x77, 0xdb, 0xa4, 0xb1, 0x24, 0xba, 0x00, 0xf3, 0x51, 0x92, 0x6a, - 0xad, 0xd5, 0xd8, 0x68, 0x4b, 0xb1, 0xca, 0x89, 0xbb, 0xf7, 0x96, 0x66, 0x43, 0x14, 0xd5, 0x1d, - 0x17, 0x9b, 0xde, 0x30, 0x41, 0x7d, 0x73, 0x7d, 0xbd, 0xd9, 0x96, 0xe2, 0x43, 0x04, 0x75, 0xab, - 0xd7, 0x33, 0x3c, 0xf4, 0x38, 0xcc, 0x46, 0x09, 0x36, 0x9a, 0x6b, 0x52, 0xa2, 0x82, 0xee, 0xde, - 0x5b, 0x2a, 0x85, 0xb0, 0x37, 0x8c, 0x6e, 0x25, 0xfb, 0xa1, 0x1f, 0x39, 0x3b, 0xf3, 0xa9, 0xbf, - 0x73, 0x36, 0x56, 0x5b, 0x1f, 0x3b, 0xe7, 0x9e, 0x3d, 0xde, 0x9c, 0x8b, 0xae, 0xdb, 0x5f, 0x79, - 0x20, 0x62, 0x6e, 0xb8, 0x1f, 0x16, 0x32, 0xc6, 0xd3, 0x4e, 0xb7, 0x49, 0xb9, 0x85, 0xca, 0xd1, - 0xee, 0x41, 0x65, 0xc2, 0xa2, 0x50, 0x99, 0x68, 0x18, 0xe4, 0x17, 0xa0, 0xb8, 0xa5, 0x39, 0x5e, - 0x0b, 0x7b, 0xd7, 0xb1, 0xd6, 0xc1, 0x4e, 0xd4, 0x7f, 0x28, 0x0a, 0xff, 0x01, 0x41, 0x92, 0x3a, - 0x09, 0x6c, 0xfd, 0xa4, 0xbf, 0xe5, 0x7d, 0x48, 0xd2, 0x93, 0xc4, 0xbe, 0x6f, 0xc1, 0x29, 0x98, - 0x6f, 0x41, 0x56, 0x86, 0x43, 0x0f, 0xbb, 0x22, 0xfd, 0x45, 0x3f, 0xd0, 0x73, 0xc2, 0x43, 0x48, - 0x1c, 0xed, 0x21, 0xf0, 0xe9, 0xc5, 0xfd, 0x84, 0x2e, 0x64, 0xf8, 0x10, 0xfb, 0x0d, 0x89, 0x05, - 0x0d, 0x41, 0xeb, 0x50, 0xb6, 0x35, 0xc7, 0xa3, 0x37, 0x0b, 0xf7, 0x69, 0x2f, 0xf8, 0x0c, 0x5e, - 0x1c, 0xb6, 0x27, 0x91, 0xce, 0xf2, 0x5a, 0x8a, 0x76, 0x18, 0x28, 0xff, 0xe7, 0x24, 0xa4, 0xb9, - 0x30, 0xde, 0x0d, 0x19, 0x2e, 0x56, 0x3e, 0xe7, 0x1e, 0x5c, 0x1e, 0x5e, 0x66, 0x97, 0xfd, 0xe5, - 0x90, 0xf3, 0x13, 0x34, 0xe8, 0x51, 0xc8, 0xea, 0xfb, 0x9a, 0x61, 0xaa, 0x46, 0x87, 0x3b, 0xa0, - 0xf9, 0xcf, 0xbe, 0xb9, 0x98, 0xa9, 0x13, 0x58, 0x73, 0x55, 0xc9, 0xd0, 0xc2, 0x66, 0x87, 0xf8, - 0x34, 0xfb, 0xd8, 0xd8, 0xdb, 0xf7, 0xb8, 0xdd, 0xe0, 0x5f, 0xe8, 0x9d, 0x90, 0x24, 0x0a, 0xc1, - 0xef, 0x9d, 0x57, 0x86, 0x22, 0x0b, 0x3f, 0xf5, 0x53, 0xcb, 0x92, 0x8a, 0x3f, 0xfc, 0x9f, 0x16, - 0x63, 0x0a, 0xa5, 0x40, 0x75, 0x28, 0x76, 0x35, 0xd7, 0x53, 0xe9, 0x7a, 0x4c, 0xaa, 0x4f, 0x51, - 0x16, 0xa7, 0x87, 0x05, 0xc2, 0x05, 0xcb, 0x9b, 0x9e, 0x27, 0x54, 0x0c, 0xd4, 0x41, 0xe7, 0x40, - 0xa2, 0x4c, 0x74, 0x3a, 0x03, 0x99, 0x97, 0x98, 0xa6, 0x72, 0x2f, 0x11, 0x38, 0x9b, 0x98, 0xd4, - 0x57, 0x3c, 0x03, 0x39, 0x7a, 0xd3, 0x95, 0xa2, 0xb0, 0xe3, 0xeb, 0x59, 0x02, 0xa0, 0x85, 0x8f, - 0x41, 0x39, 0xb0, 0xfa, 0x0c, 0x25, 0xcb, 0xb8, 0x04, 0x60, 0x8a, 0xf8, 0x34, 0xcc, 0x9b, 0xf8, - 0x80, 0x1e, 0xa8, 0x8f, 0x60, 0xe7, 0x28, 0x36, 0x22, 0x65, 0x37, 0xa3, 0x14, 0x8f, 0x40, 0x49, - 0x17, 0xc2, 0x67, 0xb8, 0x40, 0x71, 0x8b, 0x3e, 0x94, 0xa2, 0x9d, 0x86, 0xac, 0x66, 0xdb, 0x0c, - 0x21, 0xcf, 0xad, 0xbe, 0x6d, 0xd3, 0xa2, 0xf3, 0x30, 0x4b, 0xfb, 0xe8, 0x60, 0xb7, 0xdf, 0xf5, - 0x38, 0x93, 0x02, 0xc5, 0x29, 0x93, 0x02, 0x85, 0xc1, 0x29, 0xee, 0xc3, 0x50, 0xc4, 0xb7, 0x8d, - 0x0e, 0x36, 0x75, 0xcc, 0xf0, 0x8a, 0x14, 0xaf, 0x20, 0x80, 0x14, 0xe9, 0x71, 0xf0, 0xad, 0xb9, - 0x2a, 0x56, 0x9a, 0x12, 0xe3, 0x27, 0xe0, 0x55, 0x06, 0x96, 0x17, 0x20, 0xb9, 0xaa, 0x79, 0x1a, - 0x71, 0x97, 0xbc, 0x03, 0xb6, 0x7c, 0x16, 0x14, 0xf2, 0x53, 0xfe, 0xb9, 0x04, 0x24, 0x6f, 0x5a, - 0x1e, 0x46, 0xcf, 0x86, 0x5c, 0xd9, 0xd2, 0x28, 0x7d, 0x6e, 0x19, 0x7b, 0x26, 0xee, 0xac, 0xbb, - 0x7b, 0xa1, 0x67, 0x69, 0x02, 0x75, 0x8a, 0x47, 0xd4, 0x69, 0x1e, 0x52, 0x8e, 0xd5, 0x37, 0x3b, - 0xe2, 0xe0, 0x37, 0xfd, 0x40, 0x0d, 0xc8, 0xfa, 0x5a, 0x92, 0x9c, 0xa4, 0x25, 0x65, 0xa2, 0x25, - 0x44, 0x87, 0x39, 0x40, 0xc9, 0xec, 0x70, 0x65, 0xa9, 0x41, 0xce, 0x37, 0x5e, 0x5c, 0xdb, 0xa6, - 0x53, 0xd8, 0x80, 0x8c, 0x2c, 0x91, 0xfe, 0xd8, 0xfb, 0xc2, 0x63, 0x1a, 0x27, 0xf9, 0x05, 0x5c, - 0x7a, 0x11, 0xb5, 0xe2, 0x4f, 0xe4, 0x64, 0x68, 0xbf, 0x02, 0xb5, 0x62, 0xcf, 0xe4, 0x3c, 0x00, - 0x39, 0xd7, 0xd8, 0x33, 0x35, 0xaf, 0xef, 0x60, 0xae, 0x79, 0x01, 0x80, 0x94, 0x06, 0x97, 0x20, - 0x98, 0xa6, 0x85, 0x5e, 0xee, 0xba, 0x00, 0x73, 0xc1, 0x9b, 0x59, 0x01, 0x17, 0xa6, 0x65, 0xc8, - 0x2f, 0x6a, 0x89, 0x12, 0xf9, 0x97, 0x63, 0x90, 0xe6, 0x2b, 0x56, 0x30, 0x0c, 0xb1, 0xd1, 0xc3, - 0x10, 0x1f, 0x37, 0x0c, 0x89, 0xfb, 0x1f, 0x86, 0x2a, 0x80, 0xdf, 0x4c, 0x97, 0x3f, 0x84, 0x32, - 0xc2, 0xad, 0x62, 0x4d, 0x6c, 0x19, 0x7b, 0x7c, 0xde, 0x87, 0x88, 0xe4, 0xdf, 0x8e, 0x11, 0x0f, - 0x9f, 0x97, 0xa3, 0x2a, 0x14, 0x45, 0xbb, 0xd4, 0xdd, 0xae, 0xb6, 0xc7, 0x55, 0xf1, 0xc1, 0xb1, - 0x8d, 0x23, 0xab, 0xb0, 0x92, 0xe7, 0xed, 0xa1, 0xfe, 0xc4, 0xc8, 0x61, 0x8d, 0x8f, 0x19, 0xd6, - 0x88, 0x1e, 0x25, 0xee, 0x4f, 0x8f, 0x22, 0x23, 0x9e, 0x1c, 0x18, 0x71, 0xf9, 0x77, 0x63, 0xfc, - 0xc5, 0xae, 0x0e, 0xbb, 0xc1, 0xf1, 0xe7, 0x35, 0x54, 0xaf, 0x71, 0xdd, 0xea, 0xe0, 0x8e, 0x3a, - 0x34, 0x66, 0x0f, 0x0f, 0x73, 0x8c, 0xb6, 0x39, 0x18, 0x3b, 0x24, 0xb8, 0xb4, 0x82, 0x31, 0xfc, - 0x74, 0x1c, 0x66, 0x87, 0xf0, 0xff, 0xf2, 0x8d, 0x65, 0x74, 0xf6, 0xa6, 0xa6, 0x9c, 0xbd, 0xe9, - 0xb1, 0xb3, 0xf7, 0x67, 0xe2, 0x34, 0x01, 0x60, 0x5b, 0xae, 0xd6, 0xfd, 0x5a, 0xd8, 0xde, 0x33, - 0x90, 0xb3, 0xad, 0xae, 0xca, 0x4a, 0xd8, 0xd5, 0x9b, 0xac, 0x6d, 0x75, 0x95, 0x21, 0x35, 0x4b, - 0xbd, 0x45, 0x86, 0x39, 0xfd, 0x16, 0x0c, 0x42, 0x66, 0x70, 0x42, 0x39, 0x50, 0x60, 0xa2, 0xe0, - 0x5e, 0xd3, 0xd3, 0x44, 0x06, 0xd4, 0x0d, 0x8b, 0x0d, 0x7b, 0x79, 0xac, 0xd9, 0x0c, 0x53, 0xe1, - 0x78, 0x84, 0x82, 0x39, 0x19, 0xa3, 0x32, 0x47, 0x61, 0x8b, 0xa5, 0x70, 0x3c, 0xf9, 0x7b, 0x63, - 0x00, 0x6b, 0x44, 0xb2, 0xb4, 0xbf, 0xc4, 0xdf, 0x71, 0x69, 0x13, 0xd4, 0x48, 0xcd, 0x67, 0xc7, - 0x0d, 0x1a, 0xaf, 0xbf, 0xe0, 0x86, 0xdb, 0x5d, 0x87, 0x62, 0xa0, 0xdb, 0x2e, 0x16, 0x8d, 0x39, - 0x7b, 0x44, 0x54, 0xda, 0xc2, 0x9e, 0x52, 0xb8, 0x1d, 0xfa, 0x92, 0xff, 0x59, 0x0c, 0x72, 0xb4, - 0x4d, 0xeb, 0xd8, 0xd3, 0x22, 0x63, 0x18, 0xbb, 0xff, 0x31, 0x7c, 0x10, 0x80, 0xb1, 0x71, 0x8d, - 0x37, 0x30, 0xd7, 0xac, 0x1c, 0x85, 0xb4, 0x8c, 0x37, 0x30, 0xba, 0xec, 0x0b, 0x3c, 0x71, 0xb4, - 0xc0, 0x45, 0xd4, 0xca, 0xc5, 0x7e, 0x0a, 0x32, 0xf4, 0x4d, 0xc9, 0x03, 0x97, 0x07, 0xa2, 0x69, - 0xb3, 0xdf, 0x6b, 0x1f, 0xb8, 0xf2, 0xeb, 0x90, 0x69, 0x1f, 0xb0, 0x7c, 0xe2, 0x19, 0xc8, 0x39, - 0x96, 0xc5, 0xbd, 0x3f, 0xe6, 0x75, 0x67, 0x09, 0x80, 0x3a, 0x3b, 0x22, 0x87, 0x16, 0x0f, 0x72, - 0x68, 0x41, 0x12, 0x30, 0x31, 0x55, 0x12, 0x90, 0x44, 0x9f, 0xc5, 0xc8, 0x4c, 0x42, 0x4f, 0xc2, - 0xa9, 0x56, 0xf3, 0xda, 0x46, 0x63, 0x55, 0x5d, 0x6f, 0x5d, 0x1b, 0xb8, 0x56, 0x5f, 0x29, 0xdf, - 0xbd, 0xb7, 0x94, 0xe7, 0x61, 0xe7, 0x38, 0xec, 0x2d, 0xa5, 0x71, 0x73, 0xb3, 0xdd, 0x90, 0x62, - 0x0c, 0x7b, 0xcb, 0xc1, 0xb7, 0x2d, 0x8f, 0x3d, 0xda, 0xfa, 0x34, 0x9c, 0x1e, 0x81, 0xed, 0x07, - 0x9f, 0xb3, 0x77, 0xef, 0x2d, 0x15, 0xb7, 0x1c, 0xcc, 0xb4, 0x8c, 0x52, 0x2c, 0xc3, 0xc2, 0x30, - 0xc5, 0xe6, 0xd6, 0x66, 0xab, 0xba, 0x26, 0x2d, 0x55, 0xa4, 0xbb, 0xf7, 0x96, 0x0a, 0xc2, 0x64, - 0x10, 0xfc, 0xb7, 0x3f, 0xfa, 0xfc, 0xd6, 0x6c, 0x24, 0x6b, 0xcc, 0xe2, 0x3a, 0x5b, 0x73, 0xb4, - 0xde, 0x71, 0xc3, 0xcf, 0x09, 0x1b, 0xfe, 0xf2, 0x4f, 0xc7, 0xa1, 0xec, 0x07, 0x37, 0x5b, 0xb4, - 0x06, 0xf4, 0x6c, 0x38, 0xe3, 0x97, 0x1f, 0xbb, 0x76, 0x30, 0x6c, 0x91, 0x10, 0x7c, 0x17, 0x64, - 0x85, 0x93, 0xcc, 0x27, 0xd5, 0xd2, 0x88, 0xf5, 0x8d, 0x63, 0x70, 0x52, 0x9f, 0x02, 0xbd, 0x08, - 0x39, 0x7f, 0x8a, 0xf9, 0x0f, 0x9b, 0x8d, 0x9f, 0x93, 0x9c, 0x3e, 0xa0, 0x41, 0x2f, 0x04, 0x61, - 0x5c, 0x72, 0x5c, 0x60, 0x78, 0x93, 0x21, 0x70, 0x62, 0x3f, 0x84, 0x7b, 0x1a, 0x92, 0xda, 0x8e, - 0x6e, 0x70, 0x03, 0xfc, 0xc0, 0x30, 0x5d, 0xb5, 0x56, 0x6f, 0x72, 0x22, 0x8a, 0x29, 0x37, 0x79, - 0x32, 0x85, 0xcb, 0x8b, 0x3e, 0x23, 0x73, 0xa0, 0xb2, 0x58, 0x98, 0x79, 0x17, 0xd9, 0x9e, 0x76, - 0x50, 0xa3, 0xe1, 0xf0, 0x29, 0xc8, 0x90, 0xc2, 0x3d, 0xfe, 0x50, 0x41, 0x42, 0x49, 0xf7, 0xb4, - 0x83, 0x6b, 0x9a, 0x7b, 0x23, 0x99, 0x4d, 0x48, 0x49, 0xf9, 0xc7, 0x89, 0xa7, 0x12, 0x91, 0x0a, - 0x7a, 0x02, 0x10, 0xa1, 0xd0, 0xf6, 0xb0, 0x4a, 0xa6, 0x2e, 0x15, 0xaf, 0xe0, 0x5b, 0xee, 0x69, - 0x07, 0xd5, 0x3d, 0xbc, 0xd1, 0xef, 0xd1, 0x06, 0xb8, 0x68, 0x1d, 0x24, 0x81, 0x2c, 0x46, 0x96, - 0x8b, 0xff, 0xf4, 0xf0, 0xc3, 0xa8, 0x1c, 0x81, 0x2d, 0x00, 0x1f, 0x21, 0x0b, 0x40, 0x89, 0xf1, - 0xf3, 0x8f, 0x78, 0x44, 0xba, 0x92, 0x88, 0x76, 0x45, 0x7e, 0x11, 0xca, 0x03, 0x23, 0x80, 0x64, - 0x28, 0xf2, 0x8c, 0x15, 0xdd, 0x3e, 0x67, 0x11, 0x4e, 0x4e, 0xc9, 0xb3, 0xcc, 0x14, 0x3d, 0x4e, - 0xb0, 0x92, 0xfd, 0xf9, 0x8f, 0x2f, 0xc6, 0xe8, 0x66, 0xce, 0x13, 0x50, 0x8c, 0x8c, 0x81, 0xc8, - 0x22, 0xc7, 0x82, 0x2c, 0x72, 0x80, 0xfc, 0x1a, 0x14, 0x88, 0x01, 0xc2, 0x1d, 0x8e, 0xfb, 0x28, - 0x94, 0x99, 0x81, 0x1c, 0x94, 0x35, 0x73, 0x78, 0xd6, 0x85, 0xc0, 0x65, 0xe1, 0x01, 0x45, 0xc5, - 0x9e, 0x17, 0x58, 0xd7, 0x34, 0x57, 0xde, 0x04, 0x08, 0x06, 0x15, 0x55, 0xe1, 0x41, 0x62, 0x3c, - 0xc2, 0xc7, 0x3d, 0xf9, 0x93, 0x56, 0x11, 0x8f, 0xb1, 0x42, 0x90, 0x82, 0x23, 0x9d, 0xec, 0x61, - 0xab, 0xeb, 0x14, 0xa3, 0xf6, 0xf2, 0xa7, 0x3e, 0x7b, 0x36, 0xf6, 0xf6, 0xd8, 0x82, 0xff, 0xf0, - 0x2a, 0x9c, 0x09, 0x15, 0x12, 0x05, 0x8c, 0x24, 0xa2, 0xca, 0x21, 0x7d, 0x25, 0x85, 0x93, 0x12, - 0x4a, 0x47, 0xe6, 0x7f, 0x2b, 0x47, 0x9b, 0x9d, 0xc9, 0xd9, 0xa6, 0xc9, 0xf9, 0xae, 0xd1, 0x49, - 0xf9, 0x7f, 0x9a, 0x83, 0x8c, 0x82, 0xdf, 0xdf, 0xc7, 0xae, 0x87, 0x2e, 0x42, 0x12, 0xeb, 0xfb, - 0xd6, 0xa8, 0x1c, 0x28, 0xe9, 0xe0, 0x32, 0xc7, 0x6b, 0xe8, 0xfb, 0xd6, 0xf5, 0x19, 0x85, 0xe2, - 0xa2, 0x4b, 0x90, 0xda, 0xed, 0xf6, 0x79, 0xfa, 0x6a, 0xc0, 0x66, 0x85, 0x89, 0xae, 0x12, 0xa4, - 0xeb, 0x33, 0x0a, 0xc3, 0x26, 0x55, 0xd1, 0x17, 0xad, 0x13, 0x47, 0x57, 0xd5, 0x34, 0x77, 0x69, - 0x55, 0x04, 0x17, 0xd5, 0x00, 0x0c, 0xd3, 0xf0, 0x54, 0x9a, 0xda, 0xe1, 0x56, 0xe3, 0xa1, 0xf1, - 0x94, 0x86, 0x47, 0x93, 0x41, 0xd7, 0x67, 0x94, 0x9c, 0x21, 0x3e, 0x48, 0x73, 0xdf, 0xdf, 0xc7, - 0xce, 0x21, 0xf7, 0xd6, 0xc6, 0x36, 0xf7, 0x65, 0x82, 0x44, 0x9a, 0x4b, 0xb1, 0x89, 0x91, 0x65, - 0x8f, 0xe3, 0x79, 0x07, 0xfc, 0xc9, 0xd7, 0xc5, 0x71, 0x94, 0xf4, 0x85, 0xbc, 0xf6, 0xc1, 0xf5, - 0x19, 0x25, 0xa3, 0xb3, 0x9f, 0xe8, 0x9d, 0xbe, 0x0b, 0x96, 0x1f, 0xf6, 0x7a, 0x22, 0xb4, 0x2c, - 0xed, 0x33, 0x23, 0x5c, 0x31, 0xb4, 0x01, 0xa5, 0xae, 0xe1, 0x7a, 0xaa, 0x6b, 0x6a, 0xb6, 0xbb, - 0x6f, 0x79, 0x2e, 0xcd, 0x9f, 0xe4, 0x2f, 0x3e, 0x32, 0x8e, 0xc3, 0x9a, 0xe1, 0x7a, 0x2d, 0x81, - 0x7c, 0x7d, 0x46, 0x29, 0x76, 0xc3, 0x00, 0xc2, 0xcf, 0xda, 0xdd, 0xc5, 0x8e, 0xcf, 0x90, 0xe6, - 0x59, 0x8e, 0xe0, 0xb7, 0x49, 0xb0, 0x05, 0x3d, 0xe1, 0x67, 0x85, 0x01, 0xe8, 0xeb, 0x60, 0xae, - 0x6b, 0x69, 0x1d, 0x9f, 0x9d, 0xaa, 0xef, 0xf7, 0xcd, 0x5b, 0x34, 0x29, 0x93, 0xbf, 0xf8, 0xf8, - 0xd8, 0x46, 0x5a, 0x5a, 0x47, 0xb0, 0xa8, 0x13, 0x82, 0xeb, 0x33, 0xca, 0x6c, 0x77, 0x10, 0x88, - 0xde, 0x07, 0xf3, 0x9a, 0x6d, 0x77, 0x0f, 0x07, 0xb9, 0x97, 0x29, 0xf7, 0xf3, 0xe3, 0xb8, 0x57, - 0x09, 0xcd, 0x20, 0x7b, 0xa4, 0x0d, 0x41, 0x51, 0x1b, 0x24, 0xdb, 0xc1, 0xf4, 0xc6, 0x94, 0xcd, - 0xbd, 0x0c, 0xfa, 0x9e, 0x54, 0xfe, 0xe2, 0x63, 0xe3, 0x78, 0x6f, 0x31, 0x7c, 0xe1, 0x94, 0x5c, - 0x9f, 0x51, 0xca, 0x76, 0x14, 0xc4, 0xb8, 0x5a, 0x3a, 0xa6, 0xcf, 0xdd, 0x71, 0xae, 0xb3, 0x93, - 0xb8, 0x52, 0xfc, 0x28, 0xd7, 0x08, 0x08, 0x35, 0x20, 0xcf, 0x42, 0x51, 0x95, 0x18, 0x43, 0xfa, - 0x0a, 0x55, 0xfe, 0xa2, 0x3c, 0x76, 0x86, 0x52, 0xd4, 0x9b, 0x96, 0x87, 0xaf, 0xcf, 0x28, 0x80, - 0xfd, 0x2f, 0xa4, 0xc1, 0x09, 0xfa, 0x20, 0xd7, 0xa1, 0x1a, 0x35, 0xbc, 0x0b, 0x73, 0x94, 0xe1, - 0x13, 0xe3, 0x18, 0xde, 0xa4, 0x44, 0x37, 0xc3, 0x76, 0xf8, 0xfa, 0x8c, 0x32, 0x77, 0x7b, 0x18, - 0x4c, 0x54, 0x6c, 0xd7, 0x30, 0xb5, 0xae, 0xf1, 0x06, 0x66, 0x4b, 0x28, 0x7d, 0x8a, 0xf2, 0x08, - 0x15, 0xbb, 0xca, 0xb1, 0xe9, 0xc2, 0x4a, 0x54, 0x6c, 0x37, 0x0c, 0xa8, 0x65, 0xf8, 0x59, 0x4f, - 0xff, 0x69, 0xb5, 0x8c, 0x94, 0x65, 0xcf, 0xa9, 0xdd, 0x48, 0x66, 0x41, 0xca, 0xcb, 0x8f, 0x41, - 0x3e, 0x64, 0x98, 0xd0, 0x02, 0x64, 0xf8, 0x69, 0x18, 0x71, 0x6a, 0x94, 0x7f, 0xca, 0x25, 0x28, - 0x84, 0x8d, 0x91, 0xfc, 0xe1, 0x98, 0x4f, 0x49, 0xdf, 0x94, 0x58, 0x88, 0x66, 0xa4, 0x73, 0x81, - 0xa7, 0xf2, 0xb0, 0x58, 0xda, 0x44, 0x39, 0xdb, 0x7e, 0x2d, 0x50, 0x20, 0x5f, 0x59, 0xd1, 0x22, - 0xe4, 0xed, 0x8b, 0xb6, 0x8f, 0x92, 0xa0, 0x28, 0x60, 0x5f, 0xb4, 0x05, 0xc2, 0x43, 0x50, 0x20, - 0xfd, 0x56, 0xc3, 0xfe, 0x52, 0x4e, 0xc9, 0x13, 0x18, 0x47, 0x91, 0xff, 0x55, 0x1c, 0xa4, 0x41, - 0x03, 0xe6, 0xa7, 0xaa, 0x63, 0xc7, 0x4e, 0x55, 0x9f, 0x1e, 0x4c, 0x92, 0x07, 0x79, 0xf1, 0x35, - 0x90, 0x82, 0xf4, 0x2e, 0x5b, 0x6a, 0xc6, 0xfb, 0x7f, 0x03, 0x8e, 0xaa, 0x52, 0xd6, 0x07, 0x3c, - 0xd7, 0xab, 0x91, 0xcd, 0x4a, 0xf1, 0x27, 0x1f, 0x06, 0x07, 0xdc, 0x77, 0x62, 0xb6, 0xed, 0x8e, - 0xe6, 0x61, 0x91, 0x1f, 0x0b, 0xed, 0x5b, 0x3e, 0x0a, 0x65, 0xcd, 0xb6, 0x55, 0xd7, 0xd3, 0x3c, - 0xcc, 0x7d, 0x0d, 0x96, 0x79, 0x28, 0x6a, 0xb6, 0xdd, 0x22, 0x50, 0xe6, 0x6b, 0x3c, 0x02, 0x25, - 0x62, 0xd3, 0x0d, 0xad, 0x2b, 0x5c, 0x85, 0x34, 0x73, 0x49, 0x38, 0x94, 0x79, 0x07, 0x72, 0xc7, - 0x1f, 0x71, 0x6a, 0xcf, 0xfd, 0x98, 0x2a, 0x16, 0x8a, 0xa9, 0x10, 0x7f, 0xeb, 0x83, 0xc9, 0x47, - 0xbc, 0x8f, 0x32, 0x7a, 0xd3, 0x60, 0x9e, 0xc6, 0x5f, 0xb7, 0x59, 0xb2, 0x24, 0xab, 0xb0, 0x0f, - 0x59, 0x81, 0x52, 0xd4, 0xf6, 0xa3, 0x12, 0xc4, 0xbd, 0x03, 0x5e, 0x4b, 0xdc, 0x3b, 0x20, 0x9e, - 0xae, 0xff, 0x42, 0x6e, 0x69, 0xc4, 0x6a, 0xc7, 0xe9, 0x82, 0x5c, 0x87, 0x5c, 0x86, 0x62, 0x64, - 0x4d, 0x90, 0x4f, 0xc2, 0xfc, 0x28, 0x13, 0x2f, 0xef, 0xfb, 0xf0, 0x88, 0xa9, 0x46, 0x97, 0x20, - 0xeb, 0xdb, 0xf8, 0x11, 0xd1, 0x31, 0xad, 0x56, 0x20, 0x2b, 0x3e, 0x6a, 0x24, 0x9d, 0x1f, 0x8f, - 0xa4, 0xf3, 0xe5, 0x6f, 0x84, 0x85, 0x71, 0xf6, 0x7b, 0x20, 0xc9, 0x97, 0xf4, 0x05, 0x76, 0x12, - 0xd2, 0xfc, 0x29, 0xca, 0x38, 0xdd, 0xc0, 0xe2, 0x5f, 0x44, 0x90, 0xcc, 0x96, 0x27, 0xd8, 0xbe, - 0x16, 0xfd, 0x90, 0x55, 0x38, 0x3d, 0xd6, 0x86, 0x8f, 0xdf, 0x0a, 0x63, 0x8c, 0xf8, 0x56, 0x98, - 0x2e, 0x9a, 0xe3, 0xd2, 0xbe, 0x8a, 0x83, 0x2c, 0xec, 0x4b, 0xfe, 0x48, 0x02, 0x4e, 0x8e, 0xb6, - 0xe4, 0x68, 0x09, 0x0a, 0xc4, 0x6f, 0xf5, 0xa2, 0x2e, 0x2e, 0xf4, 0xb4, 0x83, 0x36, 0xf7, 0x6f, - 0xf9, 0x56, 0x42, 0xdc, 0xdf, 0x4a, 0x40, 0xdb, 0x30, 0xdb, 0xb5, 0x74, 0xad, 0xab, 0x86, 0xb6, - 0x72, 0xf8, 0x24, 0x7a, 0x78, 0x48, 0xd8, 0xd1, 0x94, 0x21, 0x31, 0x38, 0x5c, 0xff, 0xcb, 0x94, - 0xc7, 0x9a, 0xbf, 0xeb, 0x83, 0x56, 0x21, 0xdf, 0x33, 0xdc, 0x1d, 0xbc, 0xaf, 0xdd, 0x36, 0x2c, - 0x87, 0xcf, 0xa6, 0x61, 0xa5, 0x59, 0x0f, 0x70, 0xc4, 0x0e, 0x53, 0x88, 0x2c, 0x34, 0x24, 0xa9, - 0x91, 0x1b, 0x5f, 0xe9, 0x63, 0x5b, 0x93, 0x71, 0x7b, 0x48, 0x99, 0xb1, 0x7b, 0x48, 0xa3, 0x36, - 0x6c, 0xb2, 0xa3, 0x37, 0x6c, 0x3e, 0x14, 0x1e, 0x9a, 0xe8, 0xda, 0x37, 0xb4, 0x87, 0x83, 0x5a, - 0x30, 0xcf, 0xe9, 0x3b, 0x11, 0xd9, 0x8f, 0x38, 0xea, 0xc0, 0xe6, 0xd7, 0xa0, 0xcc, 0x91, 0x20, - 0x1f, 0x2f, 0xf6, 0xc4, 0xfd, 0x89, 0x5d, 0x6c, 0xa2, 0x26, 0x43, 0x9b, 0xa8, 0xff, 0x97, 0x0d, - 0xc5, 0x07, 0x13, 0x30, 0x3b, 0xe4, 0x48, 0x8c, 0xdc, 0x1d, 0x1e, 0x97, 0x91, 0x15, 0x1d, 0x4b, - 0x1c, 0xbb, 0x63, 0x7c, 0xac, 0x93, 0x93, 0xc7, 0x3a, 0xf5, 0x16, 0x8e, 0x75, 0xfa, 0xfe, 0xc6, - 0xfa, 0x6d, 0x1d, 0x85, 0x8f, 0xc5, 0xa0, 0x32, 0xde, 0xfb, 0x1a, 0x39, 0x1c, 0xc7, 0xda, 0x40, - 0x18, 0xb7, 0xc6, 0x3d, 0x02, 0xa5, 0x01, 0xdf, 0x90, 0xa9, 0x72, 0x31, 0x12, 0x85, 0xcb, 0xdf, - 0x9c, 0xf0, 0x17, 0x9e, 0x88, 0x03, 0x37, 0x62, 0xb6, 0xbe, 0x0c, 0x73, 0x1d, 0xac, 0x1b, 0x9d, - 0xfb, 0x9d, 0xac, 0xb3, 0x9c, 0xfa, 0xff, 0xcd, 0xd5, 0x61, 0x2d, 0xf9, 0x1e, 0x80, 0xac, 0x82, - 0x5d, 0x9b, 0xf8, 0x63, 0xa8, 0x06, 0x39, 0x7c, 0xa0, 0x63, 0xdb, 0x0b, 0x0e, 0x55, 0x8c, 0x0a, - 0x11, 0x18, 0x76, 0x43, 0x60, 0x92, 0x00, 0xd9, 0x27, 0x43, 0xcf, 0xf2, 0x1c, 0xc0, 0xf8, 0x70, - 0x9e, 0x93, 0x87, 0x93, 0x00, 0x97, 0x45, 0x12, 0x20, 0x31, 0x36, 0xbe, 0x65, 0x54, 0x03, 0x59, - 0x80, 0x67, 0x79, 0x16, 0x20, 0x39, 0xa1, 0xb2, 0x48, 0x1a, 0xa0, 0x1e, 0x49, 0x03, 0xa4, 0x27, - 0x74, 0x73, 0x4c, 0x1e, 0xe0, 0xb2, 0xc8, 0x03, 0x64, 0x26, 0xb4, 0x78, 0x20, 0x11, 0xf0, 0xee, - 0x50, 0x22, 0x20, 0x37, 0x9c, 0x6d, 0x8d, 0x90, 0x8e, 0xc8, 0x04, 0xbc, 0xe0, 0x67, 0x02, 0x0a, - 0x63, 0xb3, 0x08, 0x9c, 0x78, 0x30, 0x15, 0xb0, 0x39, 0x94, 0x0a, 0x28, 0xf2, 0x3f, 0x6c, 0x34, - 0x8e, 0xc5, 0x84, 0x5c, 0xc0, 0xe6, 0x50, 0x2e, 0xa0, 0x34, 0x81, 0xe1, 0x84, 0x64, 0xc0, 0xd7, - 0x8f, 0x4e, 0x06, 0x8c, 0x0f, 0xd7, 0x79, 0x33, 0xa7, 0xcb, 0x06, 0xa8, 0x63, 0xb2, 0x01, 0xd2, - 0xd8, 0xc8, 0x95, 0xb1, 0x9f, 0x3a, 0x1d, 0xb0, 0x3d, 0x22, 0x1d, 0xc0, 0x02, 0xf7, 0x73, 0x63, - 0x99, 0x4f, 0x91, 0x0f, 0xd8, 0x1e, 0x91, 0x0f, 0x40, 0x13, 0xd9, 0x4e, 0x4c, 0x08, 0x5c, 0x8d, - 0x26, 0x04, 0xe6, 0xc6, 0x78, 0x9d, 0xc1, 0x6c, 0x1f, 0x93, 0x11, 0xd8, 0x19, 0x97, 0x11, 0x60, - 0x51, 0xfb, 0x93, 0x63, 0x39, 0x1e, 0x23, 0x25, 0xb0, 0x39, 0x94, 0x12, 0x38, 0x31, 0x41, 0xd3, - 0xa6, 0xcf, 0x09, 0xb0, 0x87, 0xd6, 0xd9, 0x13, 0xeb, 0x20, 0xe5, 0x6f, 0x24, 0xb3, 0x79, 0xa9, - 0x20, 0x3f, 0x4e, 0x3c, 0x98, 0x01, 0x3b, 0x47, 0x62, 0x05, 0xec, 0x38, 0x96, 0x23, 0xee, 0x31, - 0xd0, 0x0f, 0xf9, 0x1c, 0x89, 0x11, 0x03, 0x9b, 0x76, 0x44, 0xfe, 0x80, 0xc6, 0x64, 0x21, 0x3b, - 0x26, 0xff, 0x7c, 0x2c, 0xa0, 0xa5, 0x19, 0x84, 0x70, 0x7c, 0x99, 0xe3, 0xf1, 0x65, 0x28, 0xab, - 0x10, 0x8f, 0x66, 0x15, 0x16, 0x21, 0x4f, 0x62, 0xad, 0x81, 0x84, 0x81, 0x66, 0xfb, 0x09, 0x03, - 0x71, 0x80, 0x8a, 0xe5, 0x1e, 0xf8, 0xb2, 0xc4, 0x76, 0x13, 0xcb, 0xfe, 0x61, 0x32, 0x16, 0xea, - 0xa2, 0xa7, 0x60, 0x2e, 0x84, 0xeb, 0xc7, 0x70, 0x2c, 0x7a, 0x96, 0x7c, 0xec, 0x2a, 0x0f, 0xe6, - 0x7e, 0x35, 0x16, 0x48, 0x28, 0xc8, 0x34, 0x8c, 0x4a, 0x0a, 0xc4, 0xde, 0xa2, 0xa4, 0x40, 0xfc, - 0xbe, 0x93, 0x02, 0xe1, 0x98, 0x34, 0x11, 0x8d, 0x49, 0xff, 0x47, 0x2c, 0x18, 0x13, 0x3f, 0xc4, - 0xd7, 0xad, 0x0e, 0xe6, 0x51, 0x22, 0xfd, 0x4d, 0x5c, 0x92, 0xae, 0xb5, 0xc7, 0x63, 0x41, 0xf2, - 0x93, 0x60, 0xf9, 0x0b, 0x4f, 0x8e, 0xaf, 0x2b, 0x7e, 0x80, 0x99, 0x0a, 0xdf, 0xe3, 0xe0, 0x97, - 0x1b, 0xd2, 0xc1, 0xe5, 0x06, 0xff, 0xf2, 0x71, 0x26, 0x74, 0xf9, 0x18, 0xbd, 0x13, 0x72, 0x34, - 0xd9, 0xaf, 0x5a, 0xb6, 0xf8, 0xab, 0x60, 0x67, 0xc6, 0x5f, 0x6c, 0x70, 0xe9, 0x91, 0x6b, 0x76, - 0x19, 0x22, 0xf0, 0x38, 0x72, 0x11, 0x8f, 0xe3, 0x01, 0xc8, 0x91, 0xd6, 0xb3, 0xbf, 0x6e, 0x01, - 0xfc, 0xe6, 0xba, 0x00, 0xc8, 0x3f, 0x11, 0x87, 0xf2, 0xc0, 0x42, 0x33, 0xb2, 0xef, 0xa3, 0xb6, - 0x91, 0xa7, 0x93, 0xc7, 0x59, 0x80, 0x3d, 0xcd, 0x55, 0xef, 0x68, 0xa6, 0x87, 0x3b, 0x5c, 0x28, - 0x21, 0x08, 0xaa, 0x40, 0x96, 0x7c, 0xf5, 0x5d, 0xdc, 0xe1, 0xd9, 0x17, 0xff, 0x1b, 0x5d, 0x87, - 0x34, 0xbe, 0x4d, 0x5f, 0x77, 0x65, 0x6f, 0x24, 0x9f, 0x1c, 0x0e, 0x87, 0x49, 0x71, 0x6d, 0x81, - 0x0c, 0xf6, 0x17, 0xdf, 0x5c, 0x94, 0x18, 0xf6, 0x93, 0xfe, 0x85, 0x31, 0x85, 0xd3, 0x47, 0xa5, - 0x90, 0x1d, 0x90, 0x02, 0xcd, 0x03, 0x16, 0x44, 0x78, 0x4f, 0x64, 0xca, 0xce, 0x78, 0x2b, 0xc5, - 0x1e, 0xee, 0xd9, 0x96, 0xd5, 0x55, 0xd9, 0x1c, 0xaf, 0x42, 0x29, 0xba, 0xae, 0xb2, 0xbf, 0x3c, - 0xe5, 0x69, 0x86, 0xa9, 0x46, 0x9c, 0xe0, 0x02, 0x03, 0xb2, 0x39, 0x75, 0x23, 0x99, 0x8d, 0x49, - 0xf1, 0x1b, 0xc9, 0x6c, 0x5c, 0x4a, 0xc8, 0x5b, 0x70, 0x62, 0xe4, 0xba, 0x8a, 0x9e, 0x87, 0x5c, - 0xb0, 0x24, 0xb3, 0x63, 0xfa, 0x47, 0x64, 0x5a, 0x02, 0x5c, 0xf9, 0x97, 0x62, 0x01, 0xcb, 0x68, - 0xee, 0xa6, 0x01, 0x69, 0x76, 0x66, 0x92, 0x9f, 0x8f, 0x79, 0x6a, 0xba, 0x15, 0x79, 0x99, 0x1d, - 0xa8, 0x54, 0x38, 0xb1, 0xfc, 0x3e, 0x48, 0x33, 0x08, 0xca, 0x43, 0x26, 0x78, 0x47, 0x1a, 0x20, - 0x5d, 0xad, 0xd7, 0x1b, 0x5b, 0xe2, 0x51, 0xd8, 0xda, 0xa6, 0xd2, 0x96, 0xe2, 0x04, 0xac, 0x34, - 0x6e, 0x34, 0xea, 0x6d, 0x29, 0x81, 0x66, 0xa1, 0xc8, 0x7e, 0xab, 0x57, 0x37, 0x95, 0xf5, 0x6a, - 0x5b, 0x4a, 0x86, 0x40, 0xad, 0xc6, 0xc6, 0x6a, 0x43, 0x91, 0x52, 0xf2, 0x33, 0x70, 0x7a, 0xec, - 0x1a, 0x1e, 0x24, 0x66, 0x62, 0xa1, 0xc4, 0x8c, 0xfc, 0x91, 0x38, 0x09, 0x6a, 0xc6, 0x2d, 0xcc, - 0xe8, 0xc6, 0x40, 0xc7, 0x2f, 0x1e, 0x63, 0x55, 0x1f, 0xe8, 0x3d, 0x89, 0x63, 0x1c, 0xbc, 0x8b, - 0x3d, 0x7d, 0x9f, 0x39, 0x0a, 0xcc, 0x02, 0x15, 0x95, 0x22, 0x87, 0x52, 0x22, 0x97, 0xa1, 0xbd, - 0x8e, 0x75, 0x4f, 0x65, 0x4a, 0xe4, 0xf2, 0x3f, 0x94, 0x5b, 0x64, 0xd0, 0x16, 0x03, 0xca, 0xdf, - 0x78, 0x2c, 0x59, 0xe6, 0x20, 0xa5, 0x34, 0xda, 0xca, 0xab, 0x52, 0x02, 0x21, 0x28, 0xd1, 0x9f, - 0x6a, 0x6b, 0xa3, 0xba, 0xd5, 0xba, 0xbe, 0x49, 0x64, 0x39, 0x07, 0x65, 0x21, 0x4b, 0x01, 0x4c, - 0xc9, 0x4f, 0xc0, 0xa9, 0x31, 0x5e, 0xc5, 0x88, 0x43, 0xac, 0x9f, 0x88, 0x85, 0xb1, 0xa3, 0x9e, - 0xc1, 0x26, 0xa4, 0x5d, 0x4f, 0xf3, 0xfa, 0x2e, 0x17, 0xe2, 0xf3, 0xd3, 0xba, 0x19, 0xcb, 0xe2, - 0x47, 0x8b, 0x92, 0x2b, 0x9c, 0x8d, 0x7c, 0x09, 0x4a, 0xd1, 0x92, 0xf1, 0x32, 0x08, 0x94, 0x28, - 0x2e, 0x5f, 0x01, 0x34, 0xec, 0x7d, 0x8c, 0x08, 0x2f, 0x63, 0xa3, 0xc2, 0xcb, 0x1f, 0x8d, 0xc1, - 0x99, 0x23, 0x3c, 0x0d, 0xf4, 0xf2, 0x40, 0x27, 0x5f, 0x38, 0x8e, 0x9f, 0xb2, 0xcc, 0x60, 0x03, - 0xdd, 0x7c, 0x16, 0x0a, 0x61, 0xf8, 0x74, 0x9d, 0xfc, 0x62, 0x3c, 0x98, 0xc4, 0xd1, 0x38, 0x38, - 0x30, 0x81, 0xb1, 0xaf, 0xd2, 0x04, 0xbe, 0x0b, 0xc0, 0x3b, 0x10, 0xa7, 0xa8, 0xf9, 0x3a, 0xfa, - 0xe0, 0x88, 0xfc, 0x22, 0xd6, 0xdb, 0x07, 0x7c, 0x12, 0xe4, 0x3c, 0xfe, 0xcb, 0x45, 0xad, 0x70, - 0x52, 0xa0, 0x4f, 0xd7, 0x58, 0xd7, 0xff, 0x33, 0xb9, 0xd3, 0x2d, 0xc6, 0x41, 0xf2, 0x80, 0x81, - 0x5d, 0xf4, 0x2a, 0x9c, 0x1a, 0x70, 0x14, 0x7c, 0xd6, 0xc9, 0x69, 0xfd, 0x85, 0x13, 0x51, 0x7f, - 0x41, 0xb0, 0x0e, 0xaf, 0xf6, 0xa9, 0xe8, 0x6a, 0xff, 0x2a, 0x40, 0x90, 0x1c, 0x08, 0x8e, 0xfd, - 0xc5, 0xc2, 0xc7, 0xfe, 0x2e, 0x41, 0x8a, 0x68, 0x92, 0x90, 0xd3, 0xb0, 0x29, 0x26, 0x9a, 0x10, - 0x4a, 0x2e, 0x30, 0x6c, 0xd9, 0x00, 0x34, 0x9c, 0xa0, 0x1d, 0x53, 0xc5, 0xbb, 0xa3, 0x55, 0x3c, - 0x34, 0x36, 0xd5, 0x3b, 0xba, 0xaa, 0x37, 0x20, 0x45, 0x47, 0x7e, 0xe4, 0x5d, 0xca, 0x6f, 0x00, - 0xd0, 0x3c, 0xcf, 0x31, 0x76, 0xfa, 0x41, 0x05, 0x8b, 0xa3, 0x35, 0xa7, 0x2a, 0xf0, 0x6a, 0x0f, - 0x70, 0x15, 0x9a, 0x0f, 0x48, 0x43, 0x6a, 0x14, 0x62, 0x28, 0x6f, 0x40, 0x29, 0x4a, 0x3b, 0xfa, - 0x6e, 0x68, 0xf0, 0xb8, 0x4a, 0x4e, 0xf8, 0x37, 0xbe, 0x77, 0xc4, 0x1f, 0x3c, 0xa2, 0x1f, 0xf2, - 0x07, 0xe2, 0x50, 0x08, 0x2b, 0xde, 0x5f, 0x3d, 0x17, 0x44, 0xfe, 0x96, 0x18, 0x64, 0xfd, 0xee, - 0x1f, 0x71, 0xd8, 0x39, 0xb8, 0x23, 0xec, 0x6f, 0x5e, 0xb0, 0x6d, 0xa2, 0x84, 0xbf, 0x4d, 0x74, - 0xc5, 0x5f, 0xfe, 0xc6, 0x25, 0x44, 0xc2, 0xb2, 0x16, 0x07, 0x0e, 0xf9, 0x6a, 0x7f, 0x65, 0xba, - 0xab, 0x78, 0xf3, 0x90, 0x0a, 0x5f, 0xa3, 0x63, 0x1f, 0x72, 0x27, 0x74, 0xc2, 0x88, 0x4d, 0xc4, - 0xf0, 0x9d, 0xbd, 0xd8, 0xb1, 0xef, 0xec, 0xf9, 0xb5, 0xc4, 0xc3, 0xb5, 0x7c, 0x77, 0x0c, 0xb2, - 0x62, 0x4e, 0xa0, 0xf7, 0x84, 0x4f, 0x9e, 0x89, 0xad, 0xcd, 0xb1, 0xf6, 0x88, 0xf3, 0x0f, 0x1d, - 0x3c, 0x1b, 0x3a, 0x70, 0x9d, 0x38, 0xee, 0x81, 0x6b, 0xee, 0xd9, 0xfd, 0x49, 0x0c, 0xa4, 0xc1, - 0x19, 0xfb, 0x55, 0xb7, 0x6e, 0x78, 0x99, 0x4b, 0x8c, 0x58, 0xe6, 0xc6, 0x9d, 0xa2, 0x4e, 0x8e, - 0x3b, 0x45, 0x3d, 0xdc, 0xeb, 0xd4, 0x7d, 0xf6, 0xfa, 0x83, 0x71, 0xc8, 0x87, 0xd2, 0xa3, 0xe8, - 0xb9, 0xc8, 0x89, 0xec, 0xa5, 0xa3, 0x52, 0xa9, 0xa1, 0x23, 0xd9, 0x11, 0x31, 0xc5, 0x8f, 0x2f, - 0xa6, 0xb7, 0xfe, 0x76, 0xd6, 0xe8, 0x0b, 0xac, 0xa9, 0x31, 0x17, 0x58, 0xff, 0x7a, 0x0c, 0xb2, - 0xbe, 0xdb, 0x7d, 0xdc, 0x4d, 0xcc, 0x93, 0x90, 0xe6, 0x9e, 0x25, 0xdb, 0xc5, 0xe4, 0x5f, 0x23, - 0xd3, 0xca, 0x15, 0xc8, 0x8a, 0xbf, 0x59, 0xc8, 0x57, 0x35, 0xff, 0xfb, 0xfc, 0x0b, 0x90, 0x0f, - 0x6d, 0x00, 0x13, 0xd3, 0xb8, 0xd1, 0x78, 0xaf, 0x34, 0x53, 0xc9, 0xdc, 0xbd, 0xb7, 0x94, 0xd8, - 0xc0, 0x77, 0xc8, 0x6c, 0x56, 0x1a, 0xf5, 0xeb, 0x8d, 0xfa, 0x4b, 0x52, 0xac, 0x92, 0xbf, 0x7b, - 0x6f, 0x29, 0xa3, 0x60, 0x9a, 0x51, 0x3c, 0xff, 0x12, 0x94, 0x07, 0x06, 0x26, 0xea, 0xb6, 0x20, - 0x28, 0xad, 0x6e, 0x6f, 0xad, 0x35, 0xeb, 0xd5, 0x76, 0x43, 0x65, 0xe7, 0x76, 0xd1, 0x29, 0x98, - 0x5b, 0x6b, 0x5e, 0xbb, 0xde, 0x56, 0xeb, 0x6b, 0xcd, 0xc6, 0x46, 0x5b, 0xad, 0xb6, 0xdb, 0xd5, - 0xfa, 0x4b, 0x52, 0xfc, 0xe2, 0xbd, 0x3c, 0x24, 0xab, 0xb5, 0x7a, 0x13, 0xd5, 0x21, 0x49, 0x53, - 0x21, 0x47, 0x9e, 0x00, 0xab, 0x1c, 0x9d, 0x1b, 0x46, 0x57, 0x21, 0x45, 0xb3, 0x24, 0xe8, 0xe8, - 0x23, 0x61, 0x95, 0x09, 0xc9, 0x62, 0xd2, 0x18, 0x3a, 0x23, 0x8f, 0x3c, 0x23, 0x56, 0x39, 0x3a, - 0x77, 0x8c, 0xd6, 0x20, 0x23, 0x82, 0xe4, 0x49, 0x07, 0xb7, 0x2a, 0x13, 0x13, 0xba, 0xa4, 0x6b, - 0x2c, 0xd9, 0x70, 0xf4, 0xf1, 0xb1, 0xca, 0x84, 0xac, 0x32, 0x6a, 0xfa, 0xf7, 0x99, 0x26, 0x9c, - 0x08, 0xab, 0x4c, 0xca, 0x13, 0x23, 0x05, 0x72, 0x41, 0x1a, 0x67, 0xf2, 0xa1, 0xb8, 0xca, 0x14, - 0x09, 0x73, 0xf4, 0x3e, 0x28, 0x46, 0x43, 0xdd, 0xe9, 0x4e, 0x9d, 0x55, 0xa6, 0xcc, 0x48, 0x13, - 0xfe, 0xd1, 0xb8, 0x77, 0xba, 0x53, 0x68, 0x95, 0x29, 0x13, 0xd4, 0xe8, 0x75, 0x98, 0x1d, 0x8e, - 0x4b, 0xa7, 0x3f, 0x94, 0x56, 0x39, 0x46, 0xca, 0x1a, 0xf5, 0x00, 0x8d, 0x88, 0x67, 0x8f, 0x71, - 0x46, 0xad, 0x72, 0x9c, 0x0c, 0x36, 0xea, 0x40, 0x79, 0x30, 0x48, 0x9c, 0xf6, 0xcc, 0x5a, 0x65, - 0xea, 0x6c, 0x36, 0xab, 0x25, 0x1a, 0x5c, 0x4e, 0x7b, 0x86, 0xad, 0x32, 0x75, 0x72, 0x1b, 0x6d, - 0x03, 0x84, 0xe2, 0xc3, 0x29, 0xce, 0xb4, 0x55, 0xa6, 0x49, 0x73, 0x23, 0x1b, 0xe6, 0x46, 0x05, - 0x8e, 0xc7, 0x39, 0xe2, 0x56, 0x39, 0x56, 0xf6, 0x9b, 0xe8, 0x73, 0x34, 0x04, 0x9c, 0xee, 0xc8, - 0x5b, 0x65, 0xca, 0x34, 0x78, 0xad, 0x3a, 0xf6, 0x9c, 0xf3, 0x63, 0x47, 0x9e, 0x73, 0x0e, 0x4e, - 0x2e, 0xfb, 0x67, 0x9b, 0x7f, 0xf5, 0x39, 0x78, 0x07, 0x7f, 0x41, 0xc7, 0xf5, 0xb4, 0x5b, 0x86, - 0xb9, 0xe7, 0x3f, 0x65, 0xc4, 0xbf, 0xf9, 0x21, 0xe7, 0x93, 0xfc, 0xb9, 0x1e, 0x01, 0x9d, 0xf0, - 0xa0, 0xd1, 0xd8, 0x57, 0x1e, 0x27, 0xdd, 0x87, 0x98, 0x7c, 0x7c, 0xf9, 0x88, 0xc7, 0x92, 0x26, - 0x3c, 0xc9, 0x34, 0xe2, 0x31, 0xa5, 0xca, 0x91, 0x6f, 0x0c, 0x54, 0x8e, 0x3a, 0xf7, 0x2d, 0x7f, - 0x5f, 0x0c, 0x4a, 0xd7, 0x0d, 0xd7, 0xb3, 0x1c, 0x43, 0xd7, 0xba, 0x74, 0x79, 0xb9, 0x32, 0xed, - 0xad, 0xac, 0x5a, 0x8e, 0xb8, 0x2b, 0xfc, 0xbd, 0x25, 0x7e, 0x53, 0x68, 0x15, 0xd2, 0xb7, 0xb5, - 0x2e, 0xbb, 0x13, 0x15, 0x7e, 0x6c, 0x6d, 0x50, 0xe6, 0x21, 0x3f, 0x2a, 0xcc, 0x85, 0xd1, 0xae, - 0xc4, 0x17, 0x62, 0xf2, 0xb7, 0xc5, 0x40, 0x0a, 0x5a, 0xa6, 0x60, 0xdd, 0x72, 0x3a, 0x34, 0x14, - 0xb0, 0xed, 0xd0, 0x59, 0x01, 0xf1, 0x49, 0x5d, 0x3e, 0xa3, 0x87, 0x7d, 0xbf, 0x6d, 0xbc, 0x93, - 0x95, 0x0c, 0x39, 0x58, 0x23, 0xae, 0x9c, 0x27, 0x46, 0x5d, 0x39, 0x97, 0xbf, 0x97, 0xde, 0x70, - 0xe9, 0xf5, 0x0c, 0x97, 0xcc, 0x0e, 0x85, 0x06, 0xf7, 0x37, 0x20, 0xe9, 0x68, 0x1e, 0x0f, 0x79, - 0x6b, 0x97, 0x8f, 0xfd, 0x64, 0x14, 0xeb, 0x33, 0xe5, 0x81, 0x5e, 0x86, 0x6c, 0x4f, 0x3b, 0x50, - 0x29, 0xbf, 0xf8, 0x57, 0xc5, 0x2f, 0xd3, 0xd3, 0x0e, 0x48, 0xfb, 0xd0, 0xfb, 0xa0, 0x4c, 0x58, - 0xea, 0xfb, 0x9a, 0xb9, 0x87, 0x19, 0xe7, 0xc4, 0x57, 0xc5, 0xb9, 0xd8, 0xd3, 0x0e, 0xea, 0x94, - 0x1b, 0xe1, 0xcf, 0x9f, 0xd6, 0xfa, 0x95, 0x18, 0xcf, 0x63, 0x50, 0xc1, 0x20, 0x0d, 0x24, 0xdd, - 0xff, 0xa2, 0x95, 0x8a, 0x4d, 0x97, 0xc7, 0xc6, 0x69, 0xc2, 0x80, 0x58, 0x6b, 0x45, 0xd2, 0xbc, - 0xcf, 0xbc, 0xb9, 0x18, 0x63, 0xb5, 0x96, 0xf5, 0x21, 0xb1, 0xe7, 0x59, 0x7a, 0x46, 0x9d, 0x72, - 0xc0, 0x8b, 0xc2, 0xab, 0x66, 0x0c, 0x81, 0x51, 0x93, 0x72, 0xde, 0x87, 0x4f, 0xc5, 0x20, 0xbf, - 0x1a, 0x7a, 0xcc, 0x71, 0x01, 0x32, 0x3d, 0xcb, 0x34, 0x6e, 0x61, 0xc7, 0xdf, 0x35, 0x63, 0x9f, - 0xc4, 0xf3, 0x65, 0x7f, 0x13, 0xd0, 0x3b, 0x14, 0xef, 0x1d, 0x89, 0x6f, 0x42, 0x75, 0x07, 0xef, - 0xb8, 0x86, 0x90, 0xb3, 0x22, 0x3e, 0xd1, 0xe3, 0x20, 0xb9, 0x58, 0xef, 0x3b, 0x86, 0x77, 0xa8, - 0xea, 0x96, 0xe9, 0x69, 0xba, 0xc7, 0x33, 0x03, 0x65, 0x01, 0xaf, 0x33, 0x30, 0x61, 0xd2, 0xc1, - 0x9e, 0x66, 0x74, 0xd9, 0x59, 0xd1, 0x9c, 0x22, 0x3e, 0x79, 0x53, 0xef, 0x66, 0xc2, 0x91, 0x71, - 0x1d, 0x24, 0xcb, 0xc6, 0x4e, 0xe4, 0x88, 0x0c, 0xd3, 0xc6, 0x85, 0xdf, 0xfc, 0xf4, 0x53, 0xf3, - 0x5c, 0xe0, 0xfc, 0x78, 0x05, 0xfb, 0xdb, 0x05, 0x4a, 0x59, 0x50, 0x88, 0xb3, 0x33, 0xaf, 0x46, - 0xf6, 0xc9, 0xfa, 0x3b, 0xc1, 0xc3, 0x36, 0xf3, 0x43, 0x42, 0xad, 0x9a, 0x87, 0xb5, 0x85, 0xdf, - 0x08, 0x58, 0x07, 0x91, 0xf3, 0x4b, 0xf8, 0x30, 0xbc, 0x69, 0x46, 0xd9, 0x90, 0xa0, 0xe2, 0x75, - 0xcd, 0xe8, 0x8a, 0x3f, 0x9f, 0xaa, 0xf0, 0x2f, 0xb4, 0xe2, 0x27, 0x3c, 0x93, 0x34, 0x42, 0x93, - 0xc7, 0xe9, 0x46, 0xcd, 0x32, 0x3b, 0xd1, 0xcc, 0x26, 0xaa, 0x43, 0xda, 0xb3, 0x6e, 0x61, 0x93, - 0x0b, 0xa8, 0xf6, 0xc4, 0x31, 0xde, 0x86, 0x53, 0x38, 0x29, 0xfa, 0x7a, 0x90, 0x3a, 0xb8, 0x8b, - 0xf7, 0xd8, 0x0d, 0xce, 0x7d, 0xcd, 0xc1, 0xec, 0xfd, 0x80, 0xfb, 0x7a, 0xf9, 0xad, 0xec, 0xb3, - 0x6a, 0x51, 0x4e, 0x68, 0x2b, 0xfa, 0x5c, 0x68, 0x86, 0x6f, 0x67, 0x8f, 0xe9, 0x63, 0x48, 0xf3, - 0xc2, 0xb6, 0x30, 0xf2, 0xbc, 0xe8, 0xe3, 0x20, 0xf5, 0xcd, 0x1d, 0xcb, 0xa4, 0x7f, 0x75, 0x90, - 0xc7, 0x75, 0x59, 0xb6, 0x77, 0xea, 0xc3, 0xf9, 0xde, 0xe9, 0x16, 0x94, 0x02, 0x54, 0x3a, 0x43, - 0x72, 0xc7, 0x9d, 0x21, 0x45, 0x9f, 0x01, 0x41, 0x41, 0xeb, 0x00, 0xc1, 0x1c, 0xa4, 0x9b, 0x77, - 0xf9, 0xf1, 0x23, 0x16, 0xcc, 0xe6, 0x70, 0x67, 0x42, 0x0c, 0xd0, 0xd7, 0xc1, 0x5c, 0xcf, 0x30, - 0x55, 0x17, 0x77, 0x77, 0x55, 0x2e, 0x39, 0xc2, 0x37, 0x7f, 0xfc, 0xd1, 0x9c, 0xed, 0x19, 0x66, - 0x0b, 0x77, 0x77, 0x57, 0x7d, 0x2e, 0xe8, 0x5d, 0x70, 0x26, 0xe8, 0xbd, 0x65, 0xaa, 0xfb, 0x56, - 0xb7, 0xa3, 0x3a, 0x78, 0x57, 0xd5, 0xe9, 0xeb, 0x7e, 0x05, 0x2a, 0xb3, 0x53, 0x3e, 0xca, 0xa6, - 0x79, 0xdd, 0xea, 0x76, 0x14, 0xbc, 0x5b, 0x27, 0xc5, 0xe8, 0x61, 0x08, 0xba, 0xae, 0x1a, 0x1d, - 0x77, 0xa1, 0xb8, 0x94, 0x38, 0x97, 0x54, 0x0a, 0x3e, 0xb0, 0xd9, 0x71, 0x57, 0xb2, 0x1f, 0xfa, - 0xf8, 0xe2, 0xcc, 0x17, 0x3e, 0xbe, 0x38, 0x23, 0x5f, 0xa5, 0xaf, 0x5c, 0xf1, 0x79, 0x84, 0x5d, - 0x74, 0x19, 0x72, 0x9a, 0xf8, 0x60, 0x77, 0xd8, 0x8e, 0x98, 0x87, 0x01, 0xaa, 0xfc, 0xe3, 0x31, - 0x48, 0xaf, 0xde, 0xdc, 0xd2, 0x0c, 0x07, 0x35, 0x60, 0x36, 0x50, 0xcc, 0x69, 0xa7, 0x74, 0xa0, - 0xcb, 0x62, 0x4e, 0x6f, 0x8c, 0x3b, 0x3c, 0x97, 0xab, 0x3d, 0xf4, 0x9b, 0x9f, 0x7e, 0xea, 0x41, - 0xce, 0xe6, 0xe6, 0xc0, 0x39, 0x3a, 0xc1, 0x6f, 0xf0, 0x7c, 0x5d, 0xa8, 0xcf, 0x37, 0x20, 0xc3, - 0x9a, 0xea, 0xa2, 0x17, 0x21, 0x65, 0x93, 0x1f, 0x7c, 0x4f, 0xe0, 0xec, 0x58, 0x05, 0xa7, 0xf8, - 0x61, 0x75, 0x60, 0x74, 0xf2, 0xb7, 0xc5, 0x01, 0x56, 0x6f, 0xde, 0x6c, 0x3b, 0x86, 0xdd, 0xc5, - 0xde, 0x5b, 0xd5, 0xf7, 0x6d, 0x38, 0x11, 0xba, 0x9d, 0xed, 0xe8, 0xc7, 0xef, 0xff, 0x5c, 0x70, - 0x51, 0xdb, 0xd1, 0x47, 0xb2, 0xed, 0xb8, 0x9e, 0xcf, 0x36, 0x71, 0x7c, 0xb6, 0xab, 0xae, 0x37, - 0x2c, 0xd9, 0x57, 0x20, 0x1f, 0x08, 0xc3, 0x45, 0x4d, 0xc8, 0x7a, 0xfc, 0x37, 0x17, 0xb0, 0x3c, - 0x5e, 0xc0, 0x82, 0x2c, 0x2c, 0x64, 0x9f, 0x5c, 0xfe, 0xb3, 0x18, 0x40, 0x68, 0x8e, 0xfc, 0xc5, - 0xd4, 0x31, 0xd4, 0x84, 0x34, 0xb7, 0xc4, 0x89, 0xfb, 0x7e, 0x83, 0x93, 0x31, 0x08, 0x09, 0xf5, - 0x3b, 0xe2, 0x30, 0xb7, 0x2d, 0x66, 0xef, 0x5f, 0x7c, 0x19, 0x6c, 0x43, 0x06, 0x9b, 0x9e, 0x63, - 0xf8, 0xbb, 0x5a, 0x4f, 0x8f, 0x1b, 0xf3, 0x11, 0x9d, 0x6a, 0x98, 0x9e, 0x73, 0x18, 0xd6, 0x00, - 0xc1, 0x2b, 0x24, 0x8f, 0x8f, 0x26, 0x60, 0x61, 0x1c, 0x29, 0xf1, 0x86, 0x75, 0x07, 0x53, 0x40, - 0xf4, 0xd2, 0x6a, 0x49, 0x80, 0xf9, 0x1a, 0xa3, 0x00, 0xf1, 0xca, 0x88, 0x72, 0x11, 0xd4, 0xfb, - 0x73, 0xc3, 0x4a, 0x01, 0x07, 0xba, 0xca, 0xb4, 0xa1, 0x2c, 0x6e, 0xc1, 0xec, 0x68, 0x5d, 0xcd, - 0xd4, 0x85, 0xbb, 0x7a, 0xac, 0x25, 0x41, 0xdc, 0xa4, 0xa9, 0x31, 0x16, 0xa8, 0x01, 0x19, 0xc1, - 0x2d, 0x79, 0x7c, 0x6e, 0x82, 0x16, 0x3d, 0x04, 0x85, 0xf0, 0xc2, 0x40, 0x5d, 0x8f, 0xa4, 0x92, - 0x0f, 0xad, 0x0b, 0x93, 0x56, 0x9e, 0xf4, 0x91, 0x2b, 0x0f, 0xf7, 0xee, 0x7e, 0x88, 0x1e, 0x56, - 0xef, 0xfc, 0xe5, 0x1f, 0x96, 0x2d, 0x00, 0x36, 0x55, 0x89, 0x25, 0xe5, 0x23, 0x73, 0x1f, 0xf3, - 0x3d, 0xc7, 0x98, 0xac, 0xba, 0xde, 0xd7, 0x6a, 0x84, 0x7e, 0x3b, 0x0e, 0x85, 0xf0, 0x08, 0xfd, - 0x95, 0x5c, 0xb4, 0xd0, 0x46, 0x60, 0xa6, 0xd8, 0x85, 0x9e, 0xc7, 0xc7, 0x99, 0xa9, 0x21, 0x6d, - 0x9e, 0x60, 0x9f, 0x3e, 0x9f, 0x80, 0x34, 0x3f, 0x71, 0xb7, 0x39, 0xe4, 0xc8, 0xc6, 0x26, 0x3d, - 0x49, 0x50, 0x14, 0x4f, 0x12, 0x8c, 0xf4, 0x63, 0x1f, 0x81, 0x12, 0x09, 0x88, 0x23, 0xc7, 0xf8, - 0x62, 0xe7, 0x8a, 0x34, 0xae, 0x0d, 0x0e, 0xad, 0xa3, 0x45, 0xc8, 0x13, 0xb4, 0xc0, 0x0e, 0x13, - 0x1c, 0xe8, 0x69, 0x07, 0x0d, 0x06, 0x41, 0x4f, 0x01, 0xda, 0xf7, 0x13, 0x13, 0x6a, 0x20, 0x08, - 0x82, 0x37, 0x1b, 0x94, 0x08, 0xf4, 0x07, 0x01, 0x48, 0x2b, 0x54, 0xf6, 0xec, 0x34, 0x7f, 0xd4, - 0x9b, 0x40, 0x56, 0xe9, 0xd3, 0xd3, 0xdf, 0x1c, 0x63, 0xfe, 0xf0, 0x40, 0xd8, 0xcc, 0xc3, 0x91, - 0xf6, 0x14, 0x93, 0xe2, 0x8f, 0xdf, 0x5c, 0xac, 0x1c, 0x6a, 0xbd, 0xee, 0x8a, 0x3c, 0x82, 0x8f, - 0x3c, 0x2a, 0x92, 0x27, 0x8e, 0x73, 0x34, 0xec, 0x46, 0x4d, 0x90, 0x6e, 0xe1, 0x43, 0xd5, 0xe1, - 0x7f, 0x93, 0x5b, 0xdd, 0xc5, 0x98, 0x07, 0x2e, 0xa7, 0x97, 0x47, 0x3c, 0x02, 0xbe, 0x5c, 0xb7, - 0x0c, 0x93, 0x6f, 0x81, 0x95, 0x6e, 0xe1, 0x43, 0x85, 0xd3, 0x5d, 0xc5, 0x78, 0xe5, 0x1d, 0x64, - 0xa6, 0xdc, 0xfd, 0xfc, 0x4f, 0x9e, 0x3f, 0x13, 0x7a, 0xd0, 0xfa, 0xc0, 0xcf, 0xcd, 0xb1, 0xe1, - 0x25, 0x4e, 0x2f, 0x0a, 0x16, 0x20, 0xff, 0xd8, 0xff, 0x3a, 0x40, 0x28, 0x28, 0x88, 0x1d, 0x1d, - 0x6c, 0x04, 0xf4, 0x91, 0x60, 0x23, 0x34, 0x3d, 0xdf, 0x13, 0xd8, 0xff, 0xf8, 0xa4, 0xde, 0x84, - 0x35, 0x93, 0x13, 0xd1, 0x59, 0x3f, 0x23, 0xff, 0xeb, 0x18, 0x9c, 0x1e, 0xd2, 0x64, 0xbf, 0xc9, - 0x3a, 0x20, 0x27, 0x54, 0x48, 0x35, 0x42, 0xec, 0x33, 0xdf, 0xdf, 0xc4, 0x98, 0x75, 0x86, 0x16, - 0x81, 0xb7, 0x66, 0x21, 0xe3, 0x56, 0xec, 0xd7, 0x63, 0x30, 0x1f, 0x6e, 0x80, 0xdf, 0x95, 0x16, - 0x14, 0xc2, 0x55, 0xf3, 0x4e, 0xbc, 0x63, 0x9a, 0x4e, 0x84, 0xdb, 0x1f, 0x61, 0x82, 0x6e, 0x06, - 0xd6, 0x82, 0x25, 0x05, 0x9f, 0x99, 0x5a, 0x28, 0xa2, 0x61, 0x23, 0xad, 0x06, 0x1b, 0x9b, 0xdf, - 0x8f, 0x41, 0x72, 0xcb, 0xb2, 0xba, 0xe8, 0xfd, 0x30, 0x6b, 0x5a, 0x9e, 0x4a, 0x66, 0x16, 0xee, - 0xa8, 0x3c, 0x47, 0xc0, 0x2c, 0x71, 0xe3, 0x48, 0x59, 0x7d, 0xf1, 0xcd, 0xc5, 0x61, 0xca, 0x51, - 0x8f, 0xca, 0x97, 0x4d, 0xcb, 0xab, 0x51, 0xa4, 0x36, 0x4b, 0x23, 0xec, 0x42, 0x31, 0x5a, 0x1d, - 0xb3, 0xd6, 0xd5, 0x49, 0xd5, 0x15, 0x27, 0x56, 0x55, 0xd8, 0x09, 0xd5, 0xc3, 0xde, 0x88, 0xfe, - 0x43, 0x32, 0x72, 0xaf, 0x82, 0x74, 0x73, 0xf0, 0xfc, 0x52, 0x03, 0x32, 0xe2, 0xbc, 0x52, 0x6c, - 0xca, 0xa3, 0x50, 0x61, 0x71, 0x72, 0x5a, 0xf9, 0x33, 0x71, 0x38, 0x5d, 0xb7, 0x4c, 0x97, 0x27, - 0x73, 0xf8, 0x84, 0x66, 0x29, 0xd8, 0x43, 0xf4, 0xf8, 0x98, 0x54, 0x53, 0x61, 0x38, 0xa1, 0x74, - 0x13, 0xca, 0x64, 0x65, 0xd5, 0x2d, 0xf3, 0xab, 0xcc, 0x27, 0x15, 0xad, 0x6e, 0x87, 0xb7, 0xe8, - 0x16, 0x3e, 0x24, 0x7c, 0x4d, 0x7c, 0x27, 0xc2, 0x37, 0x71, 0x7f, 0x7c, 0x4d, 0x7c, 0x27, 0xc4, - 0x37, 0xd8, 0x2a, 0x4f, 0x46, 0xb6, 0xca, 0x2f, 0x43, 0x82, 0x58, 0xc1, 0xd4, 0x31, 0xec, 0x06, - 0x21, 0x08, 0xad, 0x66, 0x2d, 0x38, 0xcd, 0x13, 0x04, 0xee, 0xe6, 0x2e, 0x95, 0x28, 0xa6, 0x1d, - 0x7a, 0x09, 0x1f, 0x8e, 0xc8, 0x16, 0x14, 0xa6, 0xca, 0x16, 0x9c, 0xff, 0xd9, 0x18, 0x40, 0x90, - 0x17, 0x43, 0x4f, 0xc2, 0xa9, 0xda, 0xe6, 0xc6, 0xaa, 0xda, 0x6a, 0x57, 0xdb, 0xdb, 0xad, 0xe8, - 0x9f, 0x8c, 0x11, 0x8f, 0x60, 0xb9, 0x36, 0xd6, 0x8d, 0x5d, 0x03, 0x77, 0xd0, 0xa3, 0x30, 0x1f, - 0xc5, 0x26, 0x5f, 0x8d, 0x55, 0x29, 0x56, 0x29, 0xdc, 0xbd, 0xb7, 0x94, 0x65, 0xa1, 0x01, 0xee, - 0xa0, 0x73, 0x70, 0x62, 0x18, 0xaf, 0xb9, 0x71, 0x4d, 0x8a, 0x57, 0x8a, 0x77, 0xef, 0x2d, 0xe5, - 0xfc, 0x18, 0x02, 0xc9, 0x80, 0xc2, 0x98, 0x9c, 0x5f, 0xa2, 0x02, 0x77, 0xef, 0x2d, 0xa5, 0xd9, - 0x6c, 0xa9, 0x24, 0x3f, 0xf4, 0x23, 0x67, 0x67, 0xce, 0x7f, 0x03, 0x40, 0xd3, 0xdc, 0x75, 0x34, - 0x9d, 0x5a, 0x85, 0x0a, 0x9c, 0x6c, 0x6e, 0x5c, 0x55, 0xaa, 0xf5, 0x76, 0x73, 0x73, 0x63, 0xe0, - 0x2f, 0xdd, 0x44, 0xcb, 0x56, 0x37, 0xb7, 0x6b, 0x6b, 0x0d, 0xb5, 0xd5, 0xbc, 0xb6, 0xc1, 0x76, - 0xfc, 0x23, 0x65, 0xef, 0xdd, 0x68, 0x37, 0xd7, 0x1b, 0x52, 0xbc, 0x76, 0x79, 0xec, 0x8e, 0xd2, - 0x03, 0x91, 0x79, 0x18, 0xac, 0x44, 0x91, 0x6d, 0xa4, 0xff, 0x13, 0x00, 0x00, 0xff, 0xff, 0x18, - 0x00, 0x33, 0xab, 0x2d, 0xa3, 0x00, 0x00, + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x7d, 0x69, 0x90, 0x1c, 0xd7, + 0x79, 0xd8, 0xce, 0x3d, 0xf3, 0xcd, 0xd5, 0xfb, 0x76, 0x01, 0x2c, 0x06, 0x24, 0x76, 0xd9, 0x14, + 0x49, 0x10, 0x24, 0x17, 0x24, 0x48, 0x80, 0xe4, 0x42, 0x12, 0x33, 0x33, 0x3b, 0x00, 0x06, 0xdc, + 0x8b, 0x3d, 0xb3, 0x10, 0x49, 0x5b, 0x6a, 0xf7, 0xf6, 0xbc, 0xdd, 0x6d, 0x62, 0xa6, 0xbb, 0xd5, + 0xdd, 0x03, 0xec, 0xb2, 0x52, 0x29, 0x39, 0xb2, 0x13, 0x99, 0x3e, 0x22, 0xc7, 0x2e, 0x5b, 0xb6, + 0x04, 0x5b, 0xb2, 0x63, 0x4b, 0x76, 0x2e, 0x1f, 0x8a, 0x8f, 0xb8, 0xe2, 0xd8, 0xa9, 0x1c, 0xb2, + 0x2b, 0x49, 0x29, 0xfe, 0x91, 0x38, 0xa9, 0x32, 0x63, 0x4b, 0xae, 0x48, 0x91, 0xe5, 0xc4, 0x87, + 0x9c, 0x38, 0xa5, 0x4a, 0x2a, 0xf5, 0xae, 0x3e, 0xe6, 0xd8, 0x99, 0x85, 0x48, 0xd9, 0xb1, 0xf3, + 0x07, 0x98, 0xfe, 0xde, 0xf7, 0x7d, 0xef, 0xbd, 0xef, 0x7d, 0xef, 0x7b, 0xdf, 0xf7, 0xbd, 0x63, + 0xe1, 0x77, 0x6a, 0xb0, 0xb4, 0x67, 0x59, 0x7b, 0x5d, 0x7c, 0xc1, 0x76, 0x2c, 0xcf, 0xda, 0xe9, + 0xef, 0x5e, 0xe8, 0x60, 0x57, 0x77, 0x0c, 0xdb, 0xb3, 0x9c, 0x65, 0x0a, 0x43, 0x65, 0x86, 0xb1, + 0x2c, 0x30, 0xe4, 0x75, 0x98, 0xbd, 0x6a, 0x74, 0xf1, 0xaa, 0x8f, 0xd8, 0xc2, 0x1e, 0x7a, 0x0e, + 0x92, 0xbb, 0x46, 0x17, 0x2f, 0xc4, 0x96, 0x12, 0xe7, 0xf2, 0x17, 0xdf, 0xb1, 0x3c, 0x40, 0xb4, + 0x1c, 0xa5, 0xd8, 0x22, 0x60, 0x85, 0x52, 0xc8, 0xff, 0x27, 0x09, 0x73, 0x23, 0x4a, 0x11, 0x82, + 0xa4, 0xa9, 0xf5, 0x08, 0xc7, 0xd8, 0xb9, 0x9c, 0x42, 0x7f, 0xa3, 0x05, 0xc8, 0xd8, 0x9a, 0x7e, + 0x4b, 0xdb, 0xc3, 0x0b, 0x71, 0x0a, 0x16, 0x9f, 0xe8, 0x2c, 0x40, 0x07, 0xdb, 0xd8, 0xec, 0x60, + 0x53, 0x3f, 0x5c, 0x48, 0x2c, 0x25, 0xce, 0xe5, 0x94, 0x10, 0x04, 0x3d, 0x06, 0xb3, 0x76, 0x7f, + 0xa7, 0x6b, 0xe8, 0x6a, 0x08, 0x0d, 0x96, 0x12, 0xe7, 0x52, 0x8a, 0xc4, 0x0a, 0x56, 0x03, 0xe4, + 0x47, 0xa0, 0x7c, 0x07, 0x6b, 0xb7, 0xc2, 0xa8, 0x79, 0x8a, 0x5a, 0x22, 0xe0, 0x10, 0x62, 0x1d, + 0x0a, 0x3d, 0xec, 0xba, 0xda, 0x1e, 0x56, 0xbd, 0x43, 0x1b, 0x2f, 0x24, 0x69, 0xef, 0x97, 0x86, + 0x7a, 0x3f, 0xd8, 0xf3, 0x3c, 0xa7, 0x6a, 0x1f, 0xda, 0x18, 0x55, 0x21, 0x87, 0xcd, 0x7e, 0x8f, + 0x71, 0x48, 0x8d, 0x91, 0x5f, 0xc3, 0xec, 0xf7, 0x06, 0xb9, 0x64, 0x09, 0x19, 0x67, 0x91, 0x71, + 0xb1, 0x73, 0xdb, 0xd0, 0xf1, 0x42, 0x9a, 0x32, 0x78, 0x64, 0x88, 0x41, 0x8b, 0x95, 0x0f, 0xf2, + 0x10, 0x74, 0xa8, 0x0e, 0x39, 0x7c, 0xe0, 0x61, 0xd3, 0x35, 0x2c, 0x73, 0x21, 0x43, 0x99, 0x3c, + 0x34, 0x62, 0x14, 0x71, 0xb7, 0x33, 0xc8, 0x22, 0xa0, 0x43, 0x97, 0x21, 0x63, 0xd9, 0x9e, 0x61, + 0x99, 0xee, 0x42, 0x76, 0x29, 0x76, 0x2e, 0x7f, 0xf1, 0xbe, 0x91, 0x8a, 0xb0, 0xc9, 0x70, 0x14, + 0x81, 0x8c, 0x9a, 0x20, 0xb9, 0x56, 0xdf, 0xd1, 0xb1, 0xaa, 0x5b, 0x1d, 0xac, 0x1a, 0xe6, 0xae, + 0xb5, 0x90, 0xa3, 0x0c, 0x16, 0x87, 0x3b, 0x42, 0x11, 0xeb, 0x56, 0x07, 0x37, 0xcd, 0x5d, 0x4b, + 0x29, 0xb9, 0x91, 0x6f, 0x74, 0x12, 0xd2, 0xee, 0xa1, 0xe9, 0x69, 0x07, 0x0b, 0x05, 0xaa, 0x21, + 0xfc, 0x8b, 0xa8, 0x0e, 0xee, 0x18, 0xa4, 0xba, 0x85, 0x22, 0x53, 0x1d, 0xfe, 0x29, 0xff, 0x62, + 0x1a, 0xca, 0xd3, 0x28, 0xdf, 0x15, 0x48, 0xed, 0x92, 0xfe, 0x2f, 0xc4, 0x8f, 0x23, 0x1d, 0x46, + 0x13, 0x15, 0x6f, 0xfa, 0x1e, 0xc5, 0x5b, 0x85, 0xbc, 0x89, 0x5d, 0x0f, 0x77, 0x98, 0xae, 0x24, + 0xa6, 0xd4, 0x36, 0x60, 0x44, 0xc3, 0xca, 0x96, 0xbc, 0x27, 0x65, 0x7b, 0x19, 0xca, 0x7e, 0x93, + 0x54, 0x47, 0x33, 0xf7, 0x84, 0xd6, 0x5e, 0x98, 0xd4, 0x92, 0xe5, 0x86, 0xa0, 0x53, 0x08, 0x99, + 0x52, 0xc2, 0x91, 0x6f, 0xb4, 0x0a, 0x60, 0x99, 0xd8, 0xda, 0x55, 0x3b, 0x58, 0xef, 0x2e, 0x64, + 0xc7, 0x48, 0x69, 0x93, 0xa0, 0x0c, 0x49, 0xc9, 0x62, 0x50, 0xbd, 0x8b, 0x9e, 0x0f, 0x94, 0x30, + 0x33, 0x46, 0x87, 0xd6, 0xd9, 0xf4, 0x1b, 0xd2, 0xc3, 0x6d, 0x28, 0x39, 0x98, 0xcc, 0x08, 0xdc, + 0xe1, 0x3d, 0xcb, 0xd1, 0x46, 0x2c, 0x4f, 0xec, 0x99, 0xc2, 0xc9, 0x58, 0xc7, 0x8a, 0x4e, 0xf8, + 0x13, 0x3d, 0x08, 0x3e, 0x40, 0xa5, 0x6a, 0x05, 0xd4, 0x3e, 0x15, 0x04, 0x70, 0x43, 0xeb, 0xe1, + 0xca, 0xeb, 0x50, 0x8a, 0x8a, 0x07, 0xcd, 0x43, 0xca, 0xf5, 0x34, 0xc7, 0xa3, 0x5a, 0x98, 0x52, + 0xd8, 0x07, 0x92, 0x20, 0x81, 0xcd, 0x0e, 0xb5, 0x7f, 0x29, 0x85, 0xfc, 0x44, 0x7f, 0x25, 0xe8, + 0x70, 0x82, 0x76, 0xf8, 0xe1, 0xe1, 0x11, 0x8d, 0x70, 0x1e, 0xec, 0x77, 0xe5, 0x59, 0x28, 0x46, + 0x3a, 0x30, 0x6d, 0xd5, 0xf2, 0x5f, 0x85, 0x13, 0x23, 0x59, 0xa3, 0x97, 0x61, 0xbe, 0x6f, 0x1a, + 0xa6, 0x87, 0x1d, 0xdb, 0xc1, 0x44, 0x63, 0x59, 0x55, 0x0b, 0x5f, 0xc8, 0x8c, 0xd1, 0xb9, 0xed, + 0x30, 0x36, 0xe3, 0xa2, 0xcc, 0xf5, 0x87, 0x81, 0xe7, 0x73, 0xd9, 0x2f, 0x66, 0xa4, 0x0f, 0x7c, + 0xe0, 0x03, 0x1f, 0x88, 0xcb, 0xbf, 0x9a, 0x86, 0xf9, 0x51, 0x73, 0x66, 0xe4, 0xf4, 0x3d, 0x09, + 0x69, 0xb3, 0xdf, 0xdb, 0xc1, 0x0e, 0x15, 0x52, 0x4a, 0xe1, 0x5f, 0xa8, 0x0a, 0xa9, 0xae, 0xb6, + 0x83, 0xbb, 0x0b, 0xc9, 0xa5, 0xd8, 0xb9, 0xd2, 0xc5, 0xc7, 0xa6, 0x9a, 0x95, 0xcb, 0x6b, 0x84, + 0x44, 0x61, 0x94, 0xe8, 0xdd, 0x90, 0xe4, 0xc6, 0x9b, 0x70, 0x38, 0x3f, 0x1d, 0x07, 0x32, 0x97, + 0x14, 0x4a, 0x87, 0xce, 0x40, 0x8e, 0xfc, 0xcf, 0x74, 0x23, 0x4d, 0xdb, 0x9c, 0x25, 0x00, 0xa2, + 0x17, 0xa8, 0x02, 0x59, 0x3a, 0x4d, 0x3a, 0x58, 0x2c, 0x7a, 0xfe, 0x37, 0x51, 0xac, 0x0e, 0xde, + 0xd5, 0xfa, 0x5d, 0x4f, 0xbd, 0xad, 0x75, 0xfb, 0x98, 0x2a, 0x7c, 0x4e, 0x29, 0x70, 0xe0, 0x4d, + 0x02, 0x43, 0x8b, 0x90, 0x67, 0xb3, 0xca, 0x30, 0x3b, 0xf8, 0x80, 0xda, 0xd5, 0x94, 0xc2, 0x26, + 0x5a, 0x93, 0x40, 0x48, 0xf5, 0xaf, 0xb9, 0x96, 0x29, 0x54, 0x93, 0x56, 0x41, 0x00, 0xb4, 0xfa, + 0x67, 0x07, 0x4d, 0xfa, 0xfd, 0xa3, 0xbb, 0x37, 0x34, 0x97, 0x1e, 0x81, 0x32, 0xc5, 0x78, 0x9a, + 0x0f, 0xbd, 0xd6, 0x5d, 0x98, 0x5d, 0x8a, 0x9d, 0xcb, 0x2a, 0x25, 0x06, 0xde, 0xe4, 0x50, 0xf9, + 0xe7, 0xe2, 0x90, 0xa4, 0x86, 0xa5, 0x0c, 0xf9, 0xf6, 0x2b, 0x5b, 0x0d, 0x75, 0x75, 0x73, 0xbb, + 0xb6, 0xd6, 0x90, 0x62, 0xa8, 0x04, 0x40, 0x01, 0x57, 0xd7, 0x36, 0xab, 0x6d, 0x29, 0xee, 0x7f, + 0x37, 0x37, 0xda, 0x97, 0x9f, 0x91, 0x12, 0x3e, 0xc1, 0x36, 0x03, 0x24, 0xc3, 0x08, 0x4f, 0x5f, + 0x94, 0x52, 0x48, 0x82, 0x02, 0x63, 0xd0, 0x7c, 0xb9, 0xb1, 0x7a, 0xf9, 0x19, 0x29, 0x1d, 0x85, + 0x3c, 0x7d, 0x51, 0xca, 0xa0, 0x22, 0xe4, 0x28, 0xa4, 0xb6, 0xb9, 0xb9, 0x26, 0x65, 0x7d, 0x9e, + 0xad, 0xb6, 0xd2, 0xdc, 0xb8, 0x26, 0xe5, 0x7c, 0x9e, 0xd7, 0x94, 0xcd, 0xed, 0x2d, 0x09, 0x7c, + 0x0e, 0xeb, 0x8d, 0x56, 0xab, 0x7a, 0xad, 0x21, 0xe5, 0x7d, 0x8c, 0xda, 0x2b, 0xed, 0x46, 0x4b, + 0x2a, 0x44, 0x9a, 0xf5, 0xf4, 0x45, 0xa9, 0xe8, 0x57, 0xd1, 0xd8, 0xd8, 0x5e, 0x97, 0x4a, 0x68, + 0x16, 0x8a, 0xac, 0x0a, 0xd1, 0x88, 0xf2, 0x00, 0xe8, 0xf2, 0x33, 0x92, 0x14, 0x34, 0x84, 0x71, + 0x99, 0x8d, 0x00, 0x2e, 0x3f, 0x23, 0x21, 0xb9, 0x0e, 0x29, 0xaa, 0x86, 0x08, 0x41, 0x69, 0xad, + 0x5a, 0x6b, 0xac, 0xa9, 0x9b, 0x5b, 0xed, 0xe6, 0xe6, 0x46, 0x75, 0x4d, 0x8a, 0x05, 0x30, 0xa5, + 0xf1, 0xd2, 0x76, 0x53, 0x69, 0xac, 0x4a, 0xf1, 0x30, 0x6c, 0xab, 0x51, 0x6d, 0x37, 0x56, 0xa5, + 0x84, 0xac, 0xc3, 0xfc, 0x28, 0x83, 0x3a, 0x72, 0x0a, 0x85, 0x74, 0x21, 0x3e, 0x46, 0x17, 0x28, + 0xaf, 0x41, 0x5d, 0x90, 0x3f, 0x1f, 0x87, 0xb9, 0x11, 0x8b, 0xca, 0xc8, 0x4a, 0x5e, 0x80, 0x14, + 0xd3, 0x65, 0xb6, 0xcc, 0x3e, 0x3a, 0x72, 0x75, 0xa2, 0x9a, 0x3d, 0xb4, 0xd4, 0x52, 0xba, 0xb0, + 0x13, 0x92, 0x18, 0xe3, 0x84, 0x10, 0x16, 0x43, 0x0a, 0xfb, 0xde, 0x21, 0xe3, 0xcf, 0xd6, 0xc7, + 0xcb, 0xd3, 0xac, 0x8f, 0x14, 0x76, 0xbc, 0x45, 0x20, 0x35, 0x62, 0x11, 0xb8, 0x02, 0xb3, 0x43, + 0x8c, 0xa6, 0x36, 0xc6, 0x1f, 0x8c, 0xc1, 0xc2, 0x38, 0xe1, 0x4c, 0x30, 0x89, 0xf1, 0x88, 0x49, + 0xbc, 0x32, 0x28, 0xc1, 0x07, 0xc6, 0x0f, 0xc2, 0xd0, 0x58, 0x7f, 0x32, 0x06, 0x27, 0x47, 0x3b, + 0x9b, 0x23, 0xdb, 0xf0, 0x6e, 0x48, 0xf7, 0xb0, 0xb7, 0x6f, 0x09, 0xb7, 0xea, 0xe1, 0x11, 0x8b, + 0x35, 0x29, 0x1e, 0x1c, 0x6c, 0x4e, 0x15, 0x5e, 0xed, 0x13, 0xe3, 0x3c, 0x46, 0xd6, 0x9a, 0xa1, + 0x96, 0x7e, 0x5b, 0x1c, 0x4e, 0x8c, 0x64, 0x3e, 0xb2, 0xa1, 0xf7, 0x03, 0x18, 0xa6, 0xdd, 0xf7, + 0x98, 0xeb, 0xc4, 0x2c, 0x71, 0x8e, 0x42, 0xa8, 0xf1, 0x22, 0x56, 0xb6, 0xef, 0xf9, 0xe5, 0x09, + 0x5a, 0x0e, 0x0c, 0x44, 0x11, 0x9e, 0x0b, 0x1a, 0x9a, 0xa4, 0x0d, 0x3d, 0x3b, 0xa6, 0xa7, 0x43, + 0x8a, 0xf9, 0x24, 0x48, 0x7a, 0xd7, 0xc0, 0xa6, 0xa7, 0xba, 0x9e, 0x83, 0xb5, 0x9e, 0x61, 0xee, + 0xd1, 0xa5, 0x26, 0xbb, 0x92, 0xda, 0xd5, 0xba, 0x2e, 0x56, 0xca, 0xac, 0xb8, 0x25, 0x4a, 0x09, + 0x05, 0x55, 0x20, 0x27, 0x44, 0x91, 0x8e, 0x50, 0xb0, 0x62, 0x9f, 0x42, 0xfe, 0xee, 0x1c, 0xe4, + 0x43, 0xae, 0x39, 0x7a, 0x00, 0x0a, 0xaf, 0x69, 0xb7, 0x35, 0x55, 0x84, 0x5b, 0x4c, 0x12, 0x79, + 0x02, 0xdb, 0xe2, 0x21, 0xd7, 0x93, 0x30, 0x4f, 0x51, 0xac, 0xbe, 0x87, 0x1d, 0x55, 0xef, 0x6a, + 0xae, 0x4b, 0x85, 0x96, 0xa5, 0xa8, 0x88, 0x94, 0x6d, 0x92, 0xa2, 0xba, 0x28, 0x41, 0x97, 0x60, + 0x8e, 0x52, 0xf4, 0xfa, 0x5d, 0xcf, 0xb0, 0xbb, 0x58, 0x25, 0x01, 0xa0, 0x4b, 0x97, 0x1c, 0xbf, + 0x65, 0xb3, 0x04, 0x63, 0x9d, 0x23, 0x90, 0x16, 0xb9, 0x68, 0x15, 0xee, 0xa7, 0x64, 0x7b, 0xd8, + 0xc4, 0x8e, 0xe6, 0x61, 0x15, 0xbf, 0xbf, 0xaf, 0x75, 0x5d, 0x55, 0x33, 0x3b, 0xea, 0xbe, 0xe6, + 0xee, 0x2f, 0xcc, 0x13, 0x06, 0xb5, 0xf8, 0x42, 0x4c, 0x39, 0x4d, 0x10, 0xaf, 0x71, 0xbc, 0x06, + 0x45, 0xab, 0x9a, 0x9d, 0xeb, 0x9a, 0xbb, 0x8f, 0x56, 0xe0, 0x24, 0xe5, 0xe2, 0x7a, 0x8e, 0x61, + 0xee, 0xa9, 0xfa, 0x3e, 0xd6, 0x6f, 0xa9, 0x7d, 0x6f, 0xf7, 0xb9, 0x85, 0x33, 0xe1, 0xfa, 0x69, + 0x0b, 0x5b, 0x14, 0xa7, 0x4e, 0x50, 0xb6, 0xbd, 0xdd, 0xe7, 0x50, 0x0b, 0x0a, 0x64, 0x30, 0x7a, + 0xc6, 0xeb, 0x58, 0xdd, 0xb5, 0x1c, 0xba, 0x86, 0x96, 0x46, 0x98, 0xa6, 0x90, 0x04, 0x97, 0x37, + 0x39, 0xc1, 0xba, 0xd5, 0xc1, 0x2b, 0xa9, 0xd6, 0x56, 0xa3, 0xb1, 0xaa, 0xe4, 0x05, 0x97, 0xab, + 0x96, 0x43, 0x14, 0x6a, 0xcf, 0xf2, 0x05, 0x9c, 0x67, 0x0a, 0xb5, 0x67, 0x09, 0xf1, 0x5e, 0x82, + 0x39, 0x5d, 0x67, 0x7d, 0x36, 0x74, 0x95, 0x87, 0x69, 0xee, 0x82, 0x14, 0x11, 0x96, 0xae, 0x5f, + 0x63, 0x08, 0x5c, 0xc7, 0x5d, 0xf4, 0x3c, 0x9c, 0x08, 0x84, 0x15, 0x26, 0x9c, 0x1d, 0xea, 0xe5, + 0x20, 0xe9, 0x25, 0x98, 0xb3, 0x0f, 0x87, 0x09, 0x51, 0xa4, 0x46, 0xfb, 0x70, 0x90, 0xec, 0x59, + 0x98, 0xb7, 0xf7, 0xed, 0x61, 0xba, 0xf3, 0x61, 0x3a, 0x64, 0xef, 0xdb, 0x83, 0x84, 0x0f, 0xd1, + 0x98, 0xdd, 0xc1, 0xba, 0xe6, 0xe1, 0xce, 0xc2, 0xa9, 0x30, 0x7a, 0xa8, 0x00, 0x2d, 0x83, 0xa4, + 0xeb, 0x2a, 0x36, 0xb5, 0x9d, 0x2e, 0x56, 0x35, 0x07, 0x9b, 0x9a, 0xbb, 0xb0, 0x48, 0x91, 0x93, + 0x9e, 0xd3, 0xc7, 0x4a, 0x49, 0xd7, 0x1b, 0xb4, 0xb0, 0x4a, 0xcb, 0xd0, 0x79, 0x98, 0xb5, 0x76, + 0x5e, 0xd3, 0x99, 0x46, 0xaa, 0xb6, 0x83, 0x77, 0x8d, 0x83, 0x85, 0x77, 0x50, 0xf1, 0x96, 0x49, + 0x01, 0xd5, 0xc7, 0x2d, 0x0a, 0x46, 0x8f, 0x82, 0xa4, 0xbb, 0xfb, 0x9a, 0x63, 0x53, 0x93, 0xec, + 0xda, 0x9a, 0x8e, 0x17, 0x1e, 0x62, 0xa8, 0x0c, 0xbe, 0x21, 0xc0, 0x64, 0x46, 0xb8, 0x77, 0x8c, + 0x5d, 0x4f, 0x70, 0x7c, 0x84, 0xcd, 0x08, 0x0a, 0xe3, 0xdc, 0xce, 0x81, 0x44, 0x24, 0x11, 0xa9, + 0xf8, 0x1c, 0x45, 0x2b, 0xd9, 0xfb, 0x76, 0xb8, 0xde, 0x07, 0xa1, 0x48, 0x30, 0x83, 0x4a, 0x1f, + 0x65, 0x8e, 0x9b, 0xbd, 0x1f, 0xaa, 0xf1, 0x19, 0x38, 0x49, 0x90, 0x7a, 0xd8, 0xd3, 0x3a, 0x9a, + 0xa7, 0x85, 0xb0, 0x1f, 0xa7, 0xd8, 0x44, 0xec, 0xeb, 0xbc, 0x30, 0xd2, 0x4e, 0xa7, 0xbf, 0x73, + 0xe8, 0x2b, 0xd6, 0x13, 0xac, 0x9d, 0x04, 0x26, 0x54, 0xeb, 0x6d, 0x73, 0xce, 0xe5, 0x15, 0x28, + 0x84, 0xf5, 0x1e, 0xe5, 0x80, 0x69, 0xbe, 0x14, 0x23, 0x4e, 0x50, 0x7d, 0x73, 0x95, 0xb8, 0x2f, + 0xaf, 0x36, 0xa4, 0x38, 0x71, 0xa3, 0xd6, 0x9a, 0xed, 0x86, 0xaa, 0x6c, 0x6f, 0xb4, 0x9b, 0xeb, + 0x0d, 0x29, 0x11, 0x72, 0xec, 0x6f, 0x24, 0xb3, 0x0f, 0x4b, 0x8f, 0xc8, 0xbf, 0x94, 0x80, 0x52, + 0x34, 0x52, 0x43, 0xef, 0x84, 0x53, 0x22, 0xe1, 0xe2, 0x62, 0x4f, 0xbd, 0x63, 0x38, 0x74, 0x42, + 0xf6, 0x34, 0xb6, 0x38, 0xfa, 0xfa, 0x33, 0xcf, 0xb1, 0x5a, 0xd8, 0x7b, 0x8f, 0xe1, 0x90, 0xe9, + 0xd6, 0xd3, 0x3c, 0xb4, 0x06, 0x8b, 0xa6, 0xa5, 0xba, 0x9e, 0x66, 0x76, 0x34, 0xa7, 0xa3, 0x06, + 0xa9, 0x2e, 0x55, 0xd3, 0x75, 0xec, 0xba, 0x16, 0x5b, 0x08, 0x7d, 0x2e, 0xf7, 0x99, 0x56, 0x8b, + 0x23, 0x07, 0x2b, 0x44, 0x95, 0xa3, 0x0e, 0xa8, 0x6f, 0x62, 0x9c, 0xfa, 0x9e, 0x81, 0x5c, 0x4f, + 0xb3, 0x55, 0x6c, 0x7a, 0xce, 0x21, 0xf5, 0xcf, 0xb3, 0x4a, 0xb6, 0xa7, 0xd9, 0x0d, 0xf2, 0x8d, + 0x6e, 0xc2, 0xc3, 0x01, 0xaa, 0xda, 0xc5, 0x7b, 0x9a, 0x7e, 0xa8, 0x52, 0x67, 0x9c, 0xa6, 0x0d, + 0x54, 0xdd, 0x32, 0x77, 0xbb, 0x86, 0xee, 0xb9, 0xd4, 0x3e, 0x30, 0x1b, 0x27, 0x07, 0x14, 0x6b, + 0x94, 0xe0, 0x86, 0x6b, 0x99, 0xd4, 0x07, 0xaf, 0x0b, 0xec, 0xaf, 0x4b, 0xf8, 0x75, 0x23, 0x99, + 0x4d, 0x4a, 0xa9, 0x1b, 0xc9, 0x6c, 0x4a, 0x4a, 0xdf, 0x48, 0x66, 0xd3, 0x52, 0xe6, 0x46, 0x32, + 0x9b, 0x95, 0x72, 0x37, 0x92, 0xd9, 0x9c, 0x04, 0xf2, 0xcf, 0x67, 0xa1, 0x10, 0x8e, 0x0c, 0x48, + 0xa0, 0xa5, 0xd3, 0xb5, 0x31, 0x46, 0xad, 0xe7, 0x83, 0x47, 0xc6, 0x11, 0xcb, 0x75, 0xb2, 0x68, + 0xae, 0xa4, 0x99, 0x1b, 0xae, 0x30, 0x4a, 0xe2, 0xb0, 0x10, 0xb5, 0xc6, 0xcc, 0xed, 0xc9, 0x2a, + 0xfc, 0x0b, 0x5d, 0x83, 0xf4, 0x6b, 0x2e, 0xe5, 0x9d, 0xa6, 0xbc, 0xdf, 0x71, 0x34, 0xef, 0x1b, + 0x2d, 0xca, 0x3c, 0x77, 0xa3, 0xa5, 0x6e, 0x6c, 0x2a, 0xeb, 0xd5, 0x35, 0x85, 0x93, 0xa3, 0xd3, + 0x90, 0xec, 0x6a, 0xaf, 0x1f, 0x46, 0x97, 0x57, 0x0a, 0x42, 0xcb, 0x50, 0xee, 0x9b, 0xb7, 0xb1, + 0x63, 0xec, 0x1a, 0x64, 0xa8, 0x08, 0x56, 0x39, 0x8c, 0x55, 0x0a, 0x4a, 0xd7, 0x08, 0xfe, 0x94, + 0xea, 0x71, 0x1a, 0x92, 0x77, 0xb0, 0x76, 0x2b, 0xba, 0x08, 0x52, 0x10, 0x3a, 0x07, 0x85, 0x0e, + 0xde, 0xe9, 0xef, 0xa9, 0x0e, 0xee, 0x68, 0xba, 0x17, 0x35, 0xfd, 0x79, 0x5a, 0xa4, 0xd0, 0x12, + 0xf4, 0x22, 0xe4, 0xc8, 0x18, 0x99, 0x74, 0x8c, 0x67, 0xa9, 0x08, 0x9e, 0x38, 0x5a, 0x04, 0x7c, + 0x88, 0x05, 0x91, 0x12, 0xd0, 0xa3, 0xab, 0x90, 0xf6, 0x34, 0x67, 0x0f, 0x7b, 0xd4, 0xf2, 0x97, + 0x46, 0x24, 0x3f, 0x46, 0x70, 0x6a, 0x53, 0x0a, 0x1a, 0xd3, 0x72, 0xea, 0xb7, 0xd1, 0xca, 0x5c, + 0x80, 0x14, 0x55, 0x0f, 0x04, 0xc0, 0x15, 0x44, 0x9a, 0x41, 0x59, 0x48, 0xd6, 0x37, 0x15, 0x62, + 0x69, 0x24, 0x28, 0x30, 0xa8, 0xba, 0xd5, 0x6c, 0xd4, 0x1b, 0x52, 0x5c, 0xbe, 0x04, 0x69, 0x36, + 0xe6, 0xc4, 0x0a, 0xf9, 0xa3, 0x2e, 0xcd, 0xf0, 0x4f, 0xce, 0x23, 0x26, 0x4a, 0xb7, 0xd7, 0x6b, + 0x0d, 0x45, 0x8a, 0xcb, 0xdb, 0x50, 0x1e, 0x90, 0x13, 0x3a, 0x01, 0xb3, 0x4a, 0xa3, 0xdd, 0xd8, + 0x20, 0x71, 0x96, 0xba, 0xbd, 0xf1, 0xe2, 0xc6, 0xe6, 0x7b, 0x36, 0xa4, 0x99, 0x28, 0x58, 0x98, + 0xb4, 0x18, 0x9a, 0x07, 0x29, 0x00, 0xb7, 0x36, 0xb7, 0x15, 0xda, 0x9a, 0xef, 0x88, 0x83, 0x34, + 0x28, 0x35, 0x74, 0x0a, 0xe6, 0xda, 0x55, 0xe5, 0x5a, 0xa3, 0xad, 0xb2, 0xd8, 0xd1, 0x67, 0x3d, + 0x0f, 0x52, 0xb8, 0xe0, 0x6a, 0x93, 0x86, 0xc6, 0x8b, 0x70, 0x26, 0x0c, 0x6d, 0xbc, 0xdc, 0x6e, + 0x6c, 0xb4, 0x68, 0xe5, 0xd5, 0x8d, 0x6b, 0xc4, 0xbe, 0x0e, 0xf0, 0x13, 0xd1, 0x6a, 0x82, 0x34, + 0x35, 0xca, 0xaf, 0xb1, 0xb6, 0x2a, 0x25, 0x07, 0xc1, 0x9b, 0x1b, 0x8d, 0xcd, 0xab, 0x52, 0x6a, + 0xb0, 0x76, 0x1a, 0xc1, 0xa6, 0x51, 0x05, 0x4e, 0x0e, 0x42, 0xd5, 0xc6, 0x46, 0x5b, 0x79, 0x45, + 0xca, 0x0c, 0x56, 0xdc, 0x6a, 0x28, 0x37, 0x9b, 0xf5, 0x86, 0x94, 0x45, 0x27, 0x01, 0x45, 0x5b, + 0xd4, 0xbe, 0xbe, 0xb9, 0x2a, 0xe5, 0x86, 0x2c, 0x8a, 0xec, 0x42, 0x21, 0x1c, 0x46, 0x7e, 0x7d, + 0x72, 0x49, 0x1f, 0x89, 0x43, 0x3e, 0x14, 0x16, 0x12, 0x7f, 0x5e, 0xeb, 0x76, 0xad, 0x3b, 0xaa, + 0xd6, 0x35, 0x34, 0x97, 0xdb, 0x1b, 0xa0, 0xa0, 0x2a, 0x81, 0x4c, 0x3b, 0xbf, 0xa7, 0xb7, 0xf0, + 0xe9, 0x3f, 0x8f, 0x16, 0x3e, 0x25, 0xa5, 0xe5, 0x1f, 0x8a, 0x81, 0x34, 0x18, 0xef, 0x0d, 0x74, + 0x3f, 0x36, 0xae, 0xfb, 0x5f, 0x97, 0xb1, 0xfb, 0x58, 0x0c, 0x4a, 0xd1, 0x20, 0x6f, 0xa0, 0x79, + 0x0f, 0xfc, 0x99, 0x36, 0xef, 0xb7, 0xe3, 0x50, 0x8c, 0x84, 0x76, 0xd3, 0xb6, 0xee, 0xfd, 0x30, + 0x6b, 0x74, 0x70, 0xcf, 0xb6, 0x3c, 0x6c, 0xea, 0x87, 0x6a, 0x17, 0xdf, 0xc6, 0xdd, 0x05, 0x99, + 0x1a, 0xe5, 0x0b, 0x47, 0x07, 0x8f, 0xcb, 0xcd, 0x80, 0x6e, 0x8d, 0x90, 0xad, 0xcc, 0x35, 0x57, + 0x1b, 0xeb, 0x5b, 0x9b, 0xed, 0xc6, 0x46, 0xfd, 0x15, 0x61, 0x5d, 0x14, 0xc9, 0x18, 0x40, 0x7b, + 0x1b, 0x8d, 0xf6, 0x16, 0x48, 0x83, 0x8d, 0x22, 0xb6, 0x62, 0x44, 0xb3, 0xa4, 0x19, 0x34, 0x07, + 0xe5, 0x8d, 0x4d, 0xb5, 0xd5, 0x5c, 0x6d, 0xa8, 0x8d, 0xab, 0x57, 0x1b, 0xf5, 0x76, 0x8b, 0xa5, + 0x03, 0x7d, 0xec, 0xb6, 0x14, 0x0f, 0x8b, 0xf8, 0x07, 0x13, 0x30, 0x37, 0xa2, 0x25, 0xa8, 0xca, + 0x03, 0x79, 0x96, 0x5b, 0x78, 0x62, 0x9a, 0xd6, 0x2f, 0x13, 0x57, 0x7a, 0x4b, 0x73, 0x3c, 0x1e, + 0xf7, 0x3f, 0x0a, 0x44, 0x4a, 0xa6, 0x47, 0x56, 0x76, 0x87, 0xa7, 0x59, 0x59, 0x74, 0x5f, 0x0e, + 0xe0, 0x2c, 0xd3, 0xfa, 0x38, 0x20, 0xdb, 0x72, 0x0d, 0xcf, 0xb8, 0x8d, 0x55, 0xc3, 0x14, 0x39, + 0x59, 0x12, 0xed, 0x27, 0x15, 0x49, 0x94, 0x34, 0x4d, 0xcf, 0xc7, 0x36, 0xf1, 0x9e, 0x36, 0x80, + 0x4d, 0x3c, 0x8f, 0x84, 0x22, 0x89, 0x12, 0x1f, 0xfb, 0x01, 0x28, 0x74, 0xac, 0x3e, 0x09, 0x81, + 0x18, 0x1e, 0xb1, 0x16, 0x31, 0x25, 0xcf, 0x60, 0x3e, 0x0a, 0x0f, 0x6e, 0x83, 0x64, 0x70, 0x41, + 0xc9, 0x33, 0x18, 0x43, 0x79, 0x04, 0xca, 0xda, 0xde, 0x9e, 0x43, 0x98, 0x0b, 0x46, 0x2c, 0x5c, + 0x2f, 0xf9, 0x60, 0x8a, 0x58, 0xb9, 0x01, 0x59, 0x21, 0x07, 0xe2, 0xc1, 0x12, 0x49, 0xa8, 0x36, + 0xcb, 0x41, 0xc5, 0xcf, 0xe5, 0x94, 0xac, 0x29, 0x0a, 0x1f, 0x80, 0x82, 0xe1, 0xaa, 0xc1, 0xde, + 0x56, 0x7c, 0x29, 0x7e, 0x2e, 0xab, 0xe4, 0x0d, 0xd7, 0xdf, 0x17, 0x90, 0x3f, 0x19, 0x87, 0x52, + 0x74, 0xd7, 0x0e, 0xad, 0x42, 0xb6, 0x6b, 0xe9, 0x1a, 0x55, 0x2d, 0xb6, 0x65, 0x7c, 0x6e, 0xc2, + 0x46, 0xdf, 0xf2, 0x1a, 0xc7, 0x57, 0x7c, 0xca, 0xca, 0xbf, 0x8d, 0x41, 0x56, 0x80, 0xd1, 0x49, + 0x48, 0xda, 0x9a, 0xb7, 0x4f, 0xd9, 0xa5, 0x6a, 0x71, 0x29, 0xa6, 0xd0, 0x6f, 0x02, 0x77, 0x6d, + 0xcd, 0xa4, 0x2a, 0xc0, 0xe1, 0xe4, 0x9b, 0x8c, 0x6b, 0x17, 0x6b, 0x1d, 0x9a, 0x0b, 0xb0, 0x7a, + 0x3d, 0x6c, 0x7a, 0xae, 0x18, 0x57, 0x0e, 0xaf, 0x73, 0x30, 0x7a, 0x0c, 0x66, 0x3d, 0x47, 0x33, + 0xba, 0x11, 0xdc, 0x24, 0xc5, 0x95, 0x44, 0x81, 0x8f, 0xbc, 0x02, 0xa7, 0x05, 0xdf, 0x0e, 0xf6, + 0x34, 0x7d, 0x1f, 0x77, 0x02, 0xa2, 0x34, 0xcd, 0xf9, 0x9d, 0xe2, 0x08, 0xab, 0xbc, 0x5c, 0xd0, + 0xca, 0x9f, 0x8d, 0xc3, 0xac, 0xc8, 0x5e, 0x74, 0x7c, 0x61, 0xad, 0x03, 0x68, 0xa6, 0x69, 0x79, + 0x61, 0x71, 0x0d, 0xab, 0xf2, 0x10, 0xdd, 0x72, 0xd5, 0x27, 0x52, 0x42, 0x0c, 0x2a, 0xbf, 0x17, + 0x03, 0x08, 0x8a, 0xc6, 0xca, 0x6d, 0x11, 0xf2, 0x7c, 0x4f, 0x96, 0x6e, 0xec, 0xb3, 0x84, 0x17, + 0x30, 0xd0, 0x55, 0xa3, 0x4b, 0xd3, 0x92, 0x3b, 0x78, 0xcf, 0x30, 0xf9, 0x7e, 0x0a, 0xfb, 0x10, + 0x69, 0xc9, 0x64, 0xb0, 0x3d, 0xa5, 0x40, 0xd6, 0xc5, 0x3d, 0xcd, 0xf4, 0x0c, 0x9d, 0xef, 0x90, + 0x5c, 0x3e, 0x56, 0xe3, 0x97, 0x5b, 0x9c, 0x5a, 0xf1, 0xf9, 0xc8, 0xe7, 0x20, 0x2b, 0xa0, 0xc4, + 0xf1, 0xdb, 0xd8, 0xdc, 0x68, 0x48, 0x33, 0x28, 0x03, 0x89, 0x56, 0xa3, 0x2d, 0xc5, 0x48, 0xd8, + 0x59, 0x5d, 0x6b, 0x56, 0x5b, 0x52, 0xbc, 0xf6, 0xd7, 0x60, 0x4e, 0xb7, 0x7a, 0x83, 0x15, 0xd6, + 0xa4, 0x81, 0x94, 0x9f, 0x7b, 0x3d, 0xf6, 0xea, 0x13, 0x1c, 0x69, 0xcf, 0xea, 0x6a, 0xe6, 0xde, + 0xb2, 0xe5, 0xec, 0x05, 0xc7, 0x22, 0x48, 0x74, 0xe0, 0x86, 0x0e, 0x47, 0xd8, 0x3b, 0x7f, 0x1a, + 0x8b, 0xfd, 0x48, 0x3c, 0x71, 0x6d, 0xab, 0xf6, 0x93, 0xf1, 0xca, 0x35, 0x46, 0xb8, 0x25, 0xba, + 0xa3, 0xe0, 0xdd, 0x2e, 0xd6, 0x49, 0xe3, 0xe1, 0xf7, 0x1f, 0x83, 0xf9, 0x3d, 0x6b, 0xcf, 0xa2, + 0x9c, 0x2e, 0x90, 0x5f, 0xfc, 0x5c, 0x45, 0xce, 0x87, 0x56, 0x26, 0x1e, 0xc2, 0x58, 0xd9, 0x80, + 0x39, 0x8e, 0xac, 0xd2, 0xed, 0x5b, 0x96, 0x5c, 0x40, 0x47, 0x66, 0xb6, 0x17, 0x7e, 0xfa, 0x77, + 0xa9, 0x57, 0xa2, 0xcc, 0x72, 0x52, 0x52, 0xc6, 0xf2, 0x0f, 0x2b, 0x0a, 0x9c, 0x88, 0xf0, 0x63, + 0x36, 0x02, 0x3b, 0x13, 0x38, 0xfe, 0x0b, 0xce, 0x71, 0x2e, 0xc4, 0xb1, 0xc5, 0x49, 0x57, 0xea, + 0x50, 0x3c, 0x0e, 0xaf, 0x7f, 0xc9, 0x79, 0x15, 0x70, 0x98, 0xc9, 0x35, 0x28, 0x53, 0x26, 0x7a, + 0xdf, 0xf5, 0xac, 0x1e, 0x35, 0xc0, 0x47, 0xb3, 0xf9, 0x57, 0xbf, 0xcb, 0x26, 0x6d, 0x89, 0x90, + 0xd5, 0x7d, 0xaa, 0x95, 0x15, 0xa0, 0x3b, 0xd6, 0x1d, 0xac, 0x77, 0x27, 0x70, 0xf8, 0x0c, 0x6f, + 0x88, 0x8f, 0xbf, 0x72, 0x13, 0xe6, 0xc9, 0x6f, 0x6a, 0x1f, 0xc3, 0x2d, 0x99, 0x9c, 0x06, 0x5f, + 0xf8, 0x77, 0x1f, 0x64, 0x76, 0x61, 0xce, 0x67, 0x10, 0x6a, 0x53, 0x68, 0x14, 0xf7, 0xb0, 0xe7, + 0x61, 0xc7, 0x55, 0xb5, 0xee, 0xa8, 0xe6, 0x85, 0xf2, 0x88, 0x0b, 0x3f, 0xf0, 0xe5, 0xe8, 0x28, + 0x5e, 0x63, 0x94, 0xd5, 0x6e, 0x77, 0x65, 0x1b, 0x4e, 0x8d, 0xd0, 0x8a, 0x29, 0x78, 0xfe, 0x20, + 0xe7, 0x39, 0x3f, 0xa4, 0x19, 0x84, 0xed, 0x16, 0x08, 0xb8, 0x3f, 0x96, 0x53, 0xf0, 0xfc, 0x28, + 0xe7, 0x89, 0x38, 0xad, 0x18, 0x52, 0xc2, 0xf1, 0x06, 0xcc, 0xde, 0xc6, 0xce, 0x8e, 0xe5, 0xf2, + 0xdc, 0xed, 0x14, 0xec, 0x3e, 0xc6, 0xd9, 0x95, 0x39, 0x21, 0x4d, 0xe6, 0x12, 0x5e, 0xcf, 0x43, + 0x76, 0x57, 0xd3, 0xf1, 0x14, 0x2c, 0xee, 0x72, 0x16, 0x19, 0x82, 0x4f, 0x48, 0xab, 0x50, 0xd8, + 0xb3, 0xf8, 0x12, 0x39, 0x99, 0xfc, 0x87, 0x38, 0x79, 0x5e, 0xd0, 0x70, 0x16, 0xb6, 0x65, 0xf7, + 0xbb, 0x64, 0xfd, 0x9c, 0xcc, 0xe2, 0x87, 0x05, 0x0b, 0x41, 0xc3, 0x59, 0x1c, 0x43, 0xac, 0x1f, + 0x17, 0x2c, 0xdc, 0x90, 0x3c, 0x5f, 0x80, 0xbc, 0x65, 0x76, 0x0f, 0x2d, 0x73, 0x9a, 0x46, 0x7c, + 0x82, 0x73, 0x00, 0x4e, 0x42, 0x18, 0x5c, 0x81, 0xdc, 0xb4, 0x03, 0xf1, 0x63, 0x5f, 0x16, 0xd3, + 0x43, 0x8c, 0xc0, 0x35, 0x28, 0x0b, 0x03, 0x65, 0x58, 0xe6, 0x14, 0x2c, 0x7e, 0x9c, 0xb3, 0x28, + 0x85, 0xc8, 0x78, 0x37, 0x3c, 0xec, 0x7a, 0x7b, 0x78, 0x1a, 0x26, 0x9f, 0x14, 0xdd, 0xe0, 0x24, + 0x5c, 0x94, 0x3b, 0xd8, 0xd4, 0xf7, 0xa7, 0xe3, 0xf0, 0x29, 0x21, 0x4a, 0x41, 0x43, 0x58, 0xd4, + 0xa1, 0xd8, 0xd3, 0x1c, 0x77, 0x5f, 0xeb, 0x4e, 0x35, 0x1c, 0x3f, 0xc1, 0x79, 0x14, 0x7c, 0x22, + 0x2e, 0x91, 0xbe, 0x79, 0x1c, 0x36, 0x3f, 0x29, 0x24, 0x12, 0x22, 0xe3, 0x53, 0xcf, 0xf5, 0x68, + 0xa2, 0xfb, 0x38, 0xdc, 0xfe, 0xae, 0x98, 0x7a, 0x8c, 0x76, 0x3d, 0xcc, 0xf1, 0x0a, 0xe4, 0x5c, + 0xe3, 0xf5, 0xa9, 0xd8, 0xfc, 0x3d, 0x31, 0xd2, 0x94, 0x80, 0x10, 0xbf, 0x02, 0xa7, 0x47, 0x2e, + 0x13, 0x53, 0x30, 0xfb, 0xfb, 0x9c, 0xd9, 0xc9, 0x11, 0x4b, 0x05, 0x37, 0x09, 0xc7, 0x65, 0xf9, + 0x0f, 0x84, 0x49, 0xc0, 0x03, 0xbc, 0xb6, 0x48, 0xd0, 0xe2, 0x6a, 0xbb, 0xc7, 0x93, 0xda, 0x3f, + 0x14, 0x52, 0x63, 0xb4, 0x11, 0xa9, 0xb5, 0xe1, 0x24, 0xe7, 0x78, 0xbc, 0x71, 0xfd, 0x29, 0x61, + 0x58, 0x19, 0xf5, 0x76, 0x74, 0x74, 0xbf, 0x01, 0x2a, 0xbe, 0x38, 0x85, 0x77, 0xec, 0xaa, 0x3d, + 0xcd, 0x9e, 0x82, 0xf3, 0x4f, 0x73, 0xce, 0xc2, 0xe2, 0xfb, 0xee, 0xb5, 0xbb, 0xae, 0xd9, 0x84, + 0xf9, 0xcb, 0xb0, 0x20, 0x98, 0xf7, 0x4d, 0x07, 0xeb, 0xd6, 0x9e, 0x69, 0xbc, 0x8e, 0x3b, 0x53, + 0xb0, 0xfe, 0x99, 0x81, 0xa1, 0xda, 0x0e, 0x91, 0x13, 0xce, 0x4d, 0x90, 0x7c, 0x5f, 0x45, 0x35, + 0x7a, 0xb6, 0xe5, 0x78, 0x13, 0x38, 0xfe, 0xac, 0x18, 0x29, 0x9f, 0xae, 0x49, 0xc9, 0x56, 0x1a, + 0xc0, 0x4e, 0x7f, 0x4c, 0xab, 0x92, 0x9f, 0xe6, 0x8c, 0x8a, 0x01, 0x15, 0x37, 0x1c, 0xba, 0xd5, + 0xb3, 0x35, 0x67, 0x1a, 0xfb, 0xf7, 0x8f, 0x84, 0xe1, 0xe0, 0x24, 0xdc, 0x70, 0x10, 0x8f, 0x8e, + 0xac, 0xf6, 0x53, 0x70, 0xf8, 0x39, 0x61, 0x38, 0x04, 0x0d, 0x67, 0x21, 0x1c, 0x86, 0x29, 0x58, + 0xfc, 0xbc, 0x60, 0x21, 0x68, 0x08, 0x8b, 0x97, 0x82, 0x85, 0xd6, 0xc1, 0x7b, 0x86, 0xeb, 0x39, + 0xcc, 0x25, 0x3f, 0x9a, 0xd5, 0x2f, 0x7c, 0x39, 0xea, 0x84, 0x29, 0x21, 0x52, 0x62, 0x89, 0xf8, + 0xd6, 0x07, 0x0d, 0xd9, 0x26, 0x37, 0xec, 0x17, 0x85, 0x25, 0x0a, 0x91, 0x91, 0xb6, 0x85, 0x3c, + 0x44, 0x22, 0x76, 0x9d, 0x04, 0x2a, 0x53, 0xb0, 0xfb, 0xc7, 0x03, 0x8d, 0x6b, 0x09, 0x5a, 0xc2, + 0x33, 0xe4, 0xff, 0xf4, 0xcd, 0x5b, 0xf8, 0x70, 0x2a, 0xed, 0xfc, 0xa5, 0x01, 0xff, 0x67, 0x9b, + 0x51, 0x32, 0x1b, 0x52, 0x1e, 0xf0, 0xa7, 0xd0, 0xa4, 0xb3, 0x7e, 0x0b, 0xdf, 0xfc, 0x15, 0xde, + 0xdf, 0xa8, 0x3b, 0xb5, 0xb2, 0x46, 0x94, 0x3c, 0xea, 0xf4, 0x4c, 0x66, 0xf6, 0xc1, 0xaf, 0xf8, + 0x7a, 0x1e, 0xf1, 0x79, 0x56, 0xae, 0x42, 0x31, 0xe2, 0xf0, 0x4c, 0x66, 0xf5, 0x2d, 0x9c, 0x55, + 0x21, 0xec, 0xef, 0xac, 0x5c, 0x82, 0x24, 0x71, 0x5e, 0x26, 0x93, 0x7f, 0x2b, 0x27, 0xa7, 0xe8, + 0x2b, 0xef, 0x82, 0xac, 0x70, 0x5a, 0x26, 0x93, 0xfe, 0x0d, 0x4e, 0xea, 0x93, 0x10, 0x72, 0xe1, + 0xb0, 0x4c, 0x26, 0xff, 0x9b, 0x82, 0x5c, 0x90, 0x10, 0xf2, 0xe9, 0x45, 0xf8, 0x2b, 0xdf, 0x9e, + 0xe4, 0x8b, 0x8e, 0x90, 0xdd, 0x15, 0xc8, 0x70, 0x4f, 0x65, 0x32, 0xf5, 0xb7, 0xf1, 0xca, 0x05, + 0xc5, 0xca, 0xb3, 0x90, 0x9a, 0x52, 0xe0, 0xdf, 0xc9, 0x49, 0x19, 0xfe, 0x4a, 0x1d, 0xf2, 0x21, + 0xef, 0x64, 0x32, 0xf9, 0x77, 0x71, 0xf2, 0x30, 0x15, 0x69, 0x3a, 0xf7, 0x4e, 0x26, 0x33, 0xf8, + 0x5b, 0xa2, 0xe9, 0x9c, 0x82, 0x88, 0x4d, 0x38, 0x26, 0x93, 0xa9, 0x3f, 0x2c, 0xa4, 0x2e, 0x48, + 0x56, 0x5e, 0x80, 0x9c, 0xbf, 0xd8, 0x4c, 0xa6, 0xff, 0x6e, 0x4e, 0x1f, 0xd0, 0x10, 0x09, 0x84, + 0x16, 0xbb, 0xc9, 0x2c, 0xfe, 0xb6, 0x90, 0x40, 0x88, 0x8a, 0x4c, 0xa3, 0x41, 0x07, 0x66, 0x32, + 0xa7, 0xef, 0x11, 0xd3, 0x68, 0xc0, 0x7f, 0x21, 0xa3, 0x49, 0x6d, 0xfe, 0x64, 0x16, 0xdf, 0x2b, + 0x46, 0x93, 0xe2, 0x93, 0x66, 0x0c, 0x7a, 0x04, 0x93, 0x79, 0x7c, 0xbf, 0x68, 0xc6, 0x80, 0x43, + 0xb0, 0xb2, 0x05, 0x68, 0xd8, 0x1b, 0x98, 0xcc, 0xef, 0x23, 0x9c, 0xdf, 0xec, 0x90, 0x33, 0xb0, + 0xf2, 0x1e, 0x38, 0x39, 0xda, 0x13, 0x98, 0xcc, 0xf5, 0x07, 0xbe, 0x32, 0x10, 0xbb, 0x85, 0x1d, + 0x81, 0x95, 0x76, 0xb0, 0xa4, 0x84, 0xbd, 0x80, 0xc9, 0x6c, 0x7f, 0xf0, 0x2b, 0x51, 0xc3, 0x1d, + 0x76, 0x02, 0x56, 0xaa, 0x00, 0xc1, 0x02, 0x3c, 0x99, 0xd7, 0xc7, 0x38, 0xaf, 0x10, 0x11, 0x99, + 0x1a, 0x7c, 0xfd, 0x9d, 0x4c, 0x7f, 0x57, 0x4c, 0x0d, 0x4e, 0x41, 0xa6, 0x86, 0x58, 0x7a, 0x27, + 0x53, 0xff, 0x90, 0x98, 0x1a, 0x82, 0x84, 0x68, 0x76, 0x68, 0x75, 0x9b, 0xcc, 0xe1, 0x13, 0x42, + 0xb3, 0x43, 0x54, 0x2b, 0x1b, 0x30, 0x3b, 0xb4, 0x20, 0x4e, 0x66, 0xf5, 0x23, 0x9c, 0x95, 0x34, + 0xb8, 0x1e, 0x86, 0x17, 0x2f, 0xbe, 0x18, 0x4e, 0xe6, 0xf6, 0xa3, 0x03, 0x8b, 0x17, 0x5f, 0x0b, + 0x57, 0xae, 0x40, 0xd6, 0xec, 0x77, 0xbb, 0x64, 0xf2, 0xa0, 0xa3, 0xcf, 0xe7, 0x2e, 0xfc, 0xd7, + 0xaf, 0x72, 0xe9, 0x08, 0x82, 0x95, 0x4b, 0x90, 0xc2, 0xbd, 0x1d, 0xdc, 0x99, 0x44, 0xf9, 0xa5, + 0xaf, 0x0a, 0x83, 0x49, 0xb0, 0x57, 0x5e, 0x00, 0x60, 0xa9, 0x11, 0xba, 0x71, 0x3e, 0x81, 0xf6, + 0xf7, 0xbe, 0xca, 0x0f, 0xc4, 0x05, 0x24, 0x01, 0x03, 0x76, 0xbc, 0xee, 0x68, 0x06, 0x5f, 0x8e, + 0x32, 0xa0, 0x23, 0xf2, 0x3c, 0x64, 0x5e, 0x73, 0x2d, 0xd3, 0xd3, 0xf6, 0x26, 0x51, 0xff, 0x3e, + 0xa7, 0x16, 0xf8, 0x44, 0x60, 0x3d, 0xcb, 0xc1, 0x9e, 0xb6, 0xe7, 0x4e, 0xa2, 0xfd, 0x6f, 0x9c, + 0xd6, 0x27, 0x20, 0xc4, 0xba, 0xe6, 0x7a, 0xd3, 0xf4, 0xfb, 0xbf, 0x0b, 0x62, 0x41, 0x40, 0x1a, + 0x4d, 0x7e, 0xdf, 0xc2, 0x87, 0x93, 0x68, 0xff, 0x40, 0x34, 0x9a, 0xe3, 0xaf, 0xbc, 0x0b, 0x72, + 0xe4, 0x27, 0x3b, 0xe5, 0x3a, 0x81, 0xf8, 0x0f, 0x39, 0x71, 0x40, 0x41, 0x6a, 0x76, 0xbd, 0x8e, + 0x67, 0x4c, 0x16, 0xf6, 0x1f, 0xf1, 0x91, 0x16, 0xf8, 0x2b, 0x55, 0xc8, 0xbb, 0x5e, 0xa7, 0xd3, + 0xe7, 0xfe, 0xe9, 0x04, 0xf2, 0x3f, 0xfe, 0xaa, 0x9f, 0xb2, 0xf0, 0x69, 0xc8, 0x68, 0xdf, 0xb9, + 0xe5, 0xd9, 0x16, 0xdd, 0x6f, 0x99, 0xc4, 0xe1, 0x2b, 0x9c, 0x43, 0x88, 0x64, 0xa5, 0x0e, 0x05, + 0xd2, 0x17, 0x07, 0xdb, 0x98, 0x6e, 0x8e, 0x4d, 0x60, 0xf1, 0x27, 0x5c, 0x00, 0x11, 0xa2, 0xda, + 0x37, 0x7d, 0xe6, 0x73, 0x67, 0x63, 0x9f, 0xfd, 0xdc, 0xd9, 0xd8, 0x6f, 0x7f, 0xee, 0x6c, 0xec, + 0xc3, 0x9f, 0x3f, 0x3b, 0xf3, 0xd9, 0xcf, 0x9f, 0x9d, 0xf9, 0xcd, 0xcf, 0x9f, 0x9d, 0x19, 0x9d, + 0x25, 0x86, 0x6b, 0xd6, 0x35, 0x8b, 0xe5, 0x87, 0x5f, 0x7d, 0x68, 0xcf, 0xf0, 0xf6, 0xfb, 0x3b, + 0xcb, 0xba, 0xd5, 0xbb, 0xa0, 0x5b, 0x6e, 0xcf, 0x72, 0x2f, 0x44, 0xf3, 0xba, 0xf4, 0x17, 0xfc, + 0xef, 0x18, 0x89, 0x99, 0xa3, 0xe9, 0x5c, 0xcd, 0x3c, 0x1c, 0x77, 0x99, 0xee, 0x32, 0x24, 0xaa, + 0xe6, 0x21, 0x3a, 0xcd, 0x0c, 0x9c, 0xda, 0x77, 0xba, 0xfc, 0xa8, 0x65, 0x86, 0x7c, 0x6f, 0x3b, + 0x5d, 0x34, 0x1f, 0x9c, 0x87, 0x8e, 0x9d, 0x2b, 0xf0, 0x43, 0xce, 0xb5, 0xef, 0x8a, 0x1d, 0xaf, + 0x27, 0xd9, 0xaa, 0x79, 0x48, 0x3b, 0xb2, 0x15, 0x7b, 0xf5, 0xf1, 0x89, 0x79, 0xee, 0x5b, 0xa6, + 0x75, 0xc7, 0x24, 0xcd, 0xb6, 0x77, 0x44, 0x8e, 0xfb, 0xec, 0x60, 0x8e, 0xfb, 0x3d, 0xb8, 0xdb, + 0x7d, 0x91, 0xe0, 0xb5, 0x09, 0xc9, 0x4e, 0x9a, 0x9d, 0xea, 0x87, 0xef, 0x89, 0xc3, 0xd9, 0xa1, + 0x74, 0x36, 0x57, 0x82, 0x71, 0x42, 0x58, 0x81, 0xec, 0xaa, 0xd0, 0xad, 0x05, 0xc8, 0xb8, 0x58, + 0xb7, 0xcc, 0x8e, 0x4b, 0x05, 0x91, 0x50, 0xc4, 0x27, 0x11, 0x84, 0xa9, 0x99, 0x96, 0xcb, 0x0f, + 0x2b, 0xb3, 0x8f, 0xda, 0x47, 0x8f, 0x29, 0x88, 0xa2, 0xa8, 0x49, 0x48, 0xe3, 0xa9, 0x29, 0xa5, + 0x21, 0x3a, 0x11, 0xc9, 0xfc, 0x4f, 0x2b, 0x95, 0xef, 0x8f, 0xc3, 0xe2, 0xa0, 0x54, 0xc8, 0xcc, + 0x72, 0x3d, 0xad, 0x67, 0x8f, 0x13, 0xcb, 0x15, 0xc8, 0xb5, 0x05, 0xce, 0xb1, 0xe5, 0x72, 0xf7, + 0x98, 0x72, 0x29, 0xf9, 0x55, 0x09, 0xc1, 0x5c, 0x9c, 0x52, 0x30, 0x7e, 0x3f, 0xee, 0x49, 0x32, + 0xff, 0x2b, 0x0d, 0xa7, 0xd9, 0x74, 0x52, 0xd9, 0x54, 0x62, 0x1f, 0x5c, 0x26, 0x85, 0x70, 0xd1, + 0xe4, 0x7d, 0x12, 0xf9, 0x45, 0x98, 0x6b, 0x12, 0x6b, 0x41, 0xa2, 0xa0, 0x60, 0x87, 0x67, 0xe4, + 0x79, 0xee, 0xa5, 0x88, 0xc3, 0xcf, 0xf7, 0xb7, 0xc2, 0x20, 0xf9, 0x9b, 0x63, 0x20, 0xb5, 0x74, + 0xad, 0xab, 0x39, 0x5f, 0x2b, 0x2b, 0xf4, 0x2c, 0x00, 0x3b, 0xee, 0xe1, 0x5f, 0xdc, 0x2b, 0x5d, + 0x5c, 0x58, 0x0e, 0x77, 0x6e, 0x99, 0xd5, 0x44, 0x4f, 0x50, 0xe5, 0x28, 0x2e, 0xf9, 0x79, 0xfe, + 0x65, 0x80, 0xa0, 0x00, 0x9d, 0x81, 0x53, 0xad, 0x7a, 0x75, 0xad, 0xaa, 0x88, 0x43, 0x42, 0xad, + 0xad, 0x46, 0xbd, 0x79, 0xb5, 0xd9, 0x58, 0x95, 0x66, 0xd0, 0x49, 0x40, 0xe1, 0x42, 0xff, 0x50, + 0xd3, 0x09, 0x98, 0x0d, 0xc3, 0xd9, 0x2d, 0x95, 0x38, 0xf1, 0x14, 0x8d, 0x9e, 0xdd, 0xc5, 0x74, + 0xe7, 0x51, 0x35, 0x84, 0xd4, 0x26, 0x3b, 0x21, 0xbf, 0xf6, 0xef, 0xd9, 0xcd, 0x85, 0xb9, 0x80, + 0xdc, 0x97, 0xf9, 0xca, 0x1a, 0xcc, 0x6a, 0xba, 0x8e, 0xed, 0x08, 0xcb, 0x09, 0xa6, 0x9a, 0x30, + 0xa4, 0x7b, 0xa9, 0x9c, 0x32, 0xe0, 0xf6, 0x2c, 0xa4, 0x5d, 0xda, 0xfb, 0x49, 0x2c, 0x7e, 0x9d, + 0xb3, 0xe0, 0xe8, 0x2b, 0x26, 0xcc, 0x12, 0xcf, 0x4f, 0x73, 0x70, 0xa8, 0x19, 0x47, 0xe7, 0x19, + 0xfe, 0xc9, 0xcf, 0x3e, 0x49, 0x77, 0x56, 0x1f, 0x88, 0x0e, 0xcb, 0x08, 0x75, 0x52, 0x24, 0xce, + 0x3b, 0x68, 0x28, 0x86, 0x92, 0xa8, 0x8f, 0x37, 0xf8, 0xe8, 0xca, 0x7e, 0x99, 0x57, 0x76, 0x76, + 0x94, 0x0e, 0x84, 0x6a, 0x2a, 0x72, 0xae, 0xac, 0xa0, 0xd6, 0x18, 0x37, 0xa7, 0x5f, 0x7d, 0x6c, + 0x78, 0x75, 0x62, 0xff, 0x3d, 0x41, 0x39, 0x5f, 0x09, 0x57, 0xe3, 0xcf, 0xbd, 0x8f, 0x26, 0x61, + 0x56, 0xeb, 0x19, 0xa6, 0x75, 0x81, 0xfe, 0xcb, 0xe7, 0x5c, 0x8a, 0x7e, 0x4c, 0xb1, 0x29, 0x79, + 0x99, 0x4d, 0x85, 0xc9, 0x1a, 0xf3, 0x87, 0xdf, 0xf1, 0xe3, 0xa9, 0x60, 0xba, 0xac, 0xac, 0x83, + 0x24, 0x0e, 0xf1, 0x62, 0x53, 0xb7, 0x3a, 0x53, 0x65, 0x29, 0xfe, 0x48, 0xf0, 0x10, 0xf9, 0xad, + 0x06, 0x27, 0x5d, 0x79, 0x27, 0x64, 0x7d, 0x36, 0x93, 0x3c, 0x13, 0xc1, 0xc4, 0xa7, 0x20, 0x7e, + 0x09, 0x9b, 0x99, 0xd3, 0x78, 0xa1, 0x5f, 0x11, 0xf4, 0x6c, 0x86, 0x6e, 0x90, 0xde, 0x5c, 0x83, + 0x52, 0xc7, 0x32, 0x3d, 0xd5, 0xea, 0x19, 0x1e, 0xee, 0xd9, 0xde, 0x44, 0xbf, 0xee, 0x4f, 0x18, + 0x93, 0xac, 0x52, 0x24, 0x74, 0x9b, 0x82, 0x8c, 0xb4, 0x84, 0xdd, 0xd3, 0x9b, 0xa6, 0x25, 0xff, + 0xc3, 0x6f, 0x09, 0xa5, 0x21, 0x2d, 0xb9, 0x27, 0xed, 0x70, 0x3b, 0xb7, 0xb8, 0x31, 0xf7, 0x0e, + 0x98, 0x16, 0xf8, 0xda, 0xf1, 0xc9, 0x04, 0x9c, 0xe5, 0xc8, 0x3b, 0x9a, 0x8b, 0x2f, 0xdc, 0x7e, + 0x6a, 0x07, 0x7b, 0xda, 0x53, 0x17, 0x74, 0xcb, 0x10, 0x2b, 0xf9, 0x1c, 0x37, 0xd6, 0xa4, 0x7c, + 0x99, 0x97, 0x57, 0x46, 0x6e, 0x77, 0x57, 0xc6, 0x1b, 0xf9, 0xca, 0xb0, 0x0e, 0xca, 0x5d, 0x48, + 0xd6, 0x2d, 0xc3, 0x24, 0x6b, 0x5b, 0x07, 0x9b, 0x56, 0x8f, 0x9b, 0x5b, 0xf6, 0x81, 0xae, 0x43, + 0x5a, 0xeb, 0x59, 0x7d, 0xd3, 0x63, 0xa6, 0xb6, 0xf6, 0xe4, 0x67, 0xde, 0x5c, 0x9c, 0xf9, 0x4f, + 0x6f, 0x2e, 0x9e, 0x60, 0x6c, 0xdd, 0xce, 0xad, 0x65, 0xc3, 0xba, 0xd0, 0xd3, 0xbc, 0x7d, 0x32, + 0x7d, 0x7f, 0xe3, 0xd3, 0x4f, 0x00, 0xaf, 0xaf, 0x69, 0x7a, 0x9f, 0xfa, 0xc2, 0x4f, 0x9d, 0x8f, + 0x29, 0x9c, 0x7e, 0x25, 0xf9, 0xc5, 0x8f, 0x2f, 0xc6, 0x64, 0x1b, 0x32, 0xab, 0x58, 0x3f, 0xa2, + 0xc2, 0xe6, 0x40, 0x85, 0x4f, 0xf1, 0x0a, 0xcf, 0x0c, 0x57, 0xc8, 0x0e, 0xec, 0xad, 0x62, 0x3d, + 0x54, 0xed, 0x2a, 0xd6, 0xa3, 0x35, 0xd6, 0x56, 0x7f, 0xf3, 0x77, 0xce, 0xce, 0x7c, 0xe0, 0x73, + 0x67, 0x67, 0xc6, 0x0e, 0x99, 0x3c, 0x79, 0xc8, 0xfc, 0x91, 0xfa, 0xf1, 0x24, 0xdc, 0x4f, 0x6f, + 0x84, 0x3a, 0x3d, 0xc3, 0xf4, 0x2e, 0xe8, 0xce, 0xa1, 0xed, 0x59, 0x64, 0xe2, 0x5a, 0xbb, 0x7c, + 0xa0, 0x66, 0x83, 0xe2, 0x65, 0x56, 0x3c, 0x7a, 0x98, 0xe4, 0x5d, 0x48, 0x6d, 0x11, 0x3a, 0x22, + 0x08, 0xcf, 0xf2, 0xb4, 0x2e, 0xf7, 0x36, 0xd8, 0x07, 0x81, 0xb2, 0x5b, 0xa4, 0x71, 0x06, 0x35, + 0xc4, 0x05, 0xd2, 0x2e, 0xd6, 0x76, 0xd9, 0x65, 0x9c, 0x04, 0x75, 0x53, 0xb3, 0x04, 0x40, 0xef, + 0xdd, 0xcc, 0x43, 0x4a, 0xeb, 0xb3, 0x03, 0x33, 0x09, 0xe2, 0xbf, 0xd2, 0x0f, 0xf9, 0x45, 0xc8, + 0xf0, 0x7d, 0x73, 0x24, 0x41, 0xe2, 0x16, 0x3e, 0xa4, 0xf5, 0x14, 0x14, 0xf2, 0x13, 0x2d, 0x43, + 0x8a, 0x36, 0x9e, 0xdf, 0x32, 0x5c, 0x58, 0x1e, 0x6a, 0xfd, 0x32, 0x6d, 0xa4, 0xc2, 0xd0, 0xe4, + 0x1b, 0x90, 0x5d, 0xb5, 0x88, 0xf6, 0x44, 0xb9, 0xe5, 0x18, 0x37, 0xda, 0x66, 0xbb, 0xcf, 0xc7, + 0x4e, 0x61, 0x1f, 0xe8, 0x24, 0xa4, 0xd9, 0xe5, 0x2c, 0x7e, 0xe8, 0x87, 0x7f, 0xc9, 0x75, 0xc8, + 0x50, 0xde, 0x9b, 0x36, 0x59, 0xea, 0xfd, 0xf3, 0xea, 0x39, 0x7e, 0x55, 0x97, 0xb3, 0x8f, 0x07, + 0x8d, 0x45, 0x90, 0xec, 0x68, 0x9e, 0xc6, 0xfb, 0x4d, 0x7f, 0xcb, 0xef, 0x86, 0x2c, 0x67, 0xe2, + 0xa2, 0x8b, 0x90, 0xb0, 0x6c, 0x97, 0x1f, 0xdb, 0xa9, 0x8c, 0xeb, 0xca, 0xa6, 0x5d, 0x4b, 0x12, + 0xa5, 0x52, 0x08, 0x72, 0x6d, 0x63, 0xac, 0x5a, 0x3c, 0x13, 0x51, 0x8b, 0x1e, 0xf6, 0x76, 0x76, + 0xbd, 0xe0, 0x07, 0x1b, 0xce, 0x21, 0x55, 0xf0, 0x15, 0xe5, 0x6e, 0x1c, 0xce, 0x86, 0x4a, 0x6f, + 0x63, 0xc7, 0x35, 0x2c, 0x93, 0x69, 0x13, 0xd7, 0x14, 0x14, 0x6a, 0x20, 0x2f, 0x1f, 0xa3, 0x2a, + 0xef, 0x82, 0x44, 0xd5, 0xb6, 0x51, 0x05, 0xb2, 0xf4, 0x5b, 0xb7, 0x98, 0xae, 0x24, 0x15, 0xff, + 0x9b, 0x94, 0xb9, 0xd6, 0xae, 0x77, 0x47, 0x73, 0xfc, 0xbb, 0xcb, 0xe2, 0x5b, 0x7e, 0x1e, 0x72, + 0x75, 0xcb, 0x74, 0xb1, 0xe9, 0xf6, 0xa9, 0x0f, 0xbb, 0xd3, 0xb5, 0xf4, 0x5b, 0x9c, 0x03, 0xfb, + 0x20, 0xc2, 0xd6, 0x6c, 0x9b, 0x52, 0x26, 0x15, 0xf2, 0x93, 0xcf, 0x9e, 0xcd, 0xb1, 0xe2, 0xb9, + 0x74, 0x3c, 0xf1, 0xf0, 0x0e, 0x06, 0xce, 0x68, 0x0c, 0xee, 0x1b, 0x9e, 0x48, 0xb7, 0xf0, 0xa1, + 0x7b, 0xdc, 0x79, 0xf4, 0x32, 0xe4, 0xb6, 0xe8, 0xb3, 0x22, 0x2f, 0xe2, 0x43, 0x54, 0x81, 0x0c, + 0xee, 0x5c, 0xbc, 0x74, 0xe9, 0xa9, 0xe7, 0x99, 0x96, 0x5f, 0x9f, 0x51, 0x04, 0x00, 0x9d, 0x85, + 0x9c, 0x8b, 0x75, 0xfb, 0xe2, 0xa5, 0xcb, 0xb7, 0x9e, 0x62, 0x6a, 0x75, 0x7d, 0x46, 0x09, 0x40, + 0x2b, 0x59, 0xd2, 0xe3, 0x2f, 0x7e, 0x62, 0x31, 0x56, 0x4b, 0x41, 0xc2, 0xed, 0xf7, 0xde, 0x36, + 0xdd, 0xf8, 0x83, 0x34, 0x2c, 0x85, 0x4a, 0xd9, 0xa2, 0x70, 0x5b, 0xeb, 0x1a, 0x1d, 0x2d, 0x78, + 0x0c, 0x46, 0x0a, 0xf5, 0x9f, 0x62, 0x8c, 0xb1, 0xf6, 0x47, 0x4a, 0x51, 0xfe, 0x99, 0x18, 0x14, + 0x6e, 0x0a, 0xce, 0x2d, 0xec, 0xa1, 0x2b, 0x00, 0x7e, 0x4d, 0x62, 0xaa, 0x9c, 0x59, 0x1e, 0xac, + 0x6b, 0xd9, 0xa7, 0x51, 0x42, 0xe8, 0xe8, 0x59, 0xaa, 0x80, 0xb6, 0xe5, 0xf2, 0x7b, 0xac, 0x13, + 0x48, 0x7d, 0x64, 0xf4, 0x38, 0x20, 0x6a, 0xd5, 0xd4, 0xdb, 0x96, 0x67, 0x98, 0x7b, 0xaa, 0x6d, + 0xdd, 0xe1, 0xaf, 0x03, 0x24, 0x14, 0x89, 0x96, 0xdc, 0xa4, 0x05, 0x5b, 0x04, 0x4e, 0x1a, 0x9d, + 0xf3, 0xb9, 0x90, 0x70, 0x4c, 0xeb, 0x74, 0x1c, 0xec, 0xba, 0xdc, 0x70, 0x89, 0x4f, 0x74, 0x05, + 0x32, 0x76, 0x7f, 0x47, 0x15, 0x56, 0x22, 0x7f, 0xf1, 0xbe, 0x51, 0x73, 0x5e, 0xe8, 0x06, 0x9f, + 0xf5, 0x69, 0xbb, 0xbf, 0x43, 0x34, 0xe5, 0x01, 0x28, 0x8c, 0x68, 0x4c, 0xfe, 0x76, 0xd0, 0x0e, + 0xfa, 0x92, 0x0d, 0xef, 0x81, 0x6a, 0x3b, 0x86, 0xe5, 0x18, 0xde, 0x21, 0x3d, 0x6e, 0x97, 0x50, + 0x24, 0x51, 0xb0, 0xc5, 0xe1, 0xf2, 0x2d, 0x28, 0xb7, 0xa8, 0x9b, 0x1e, 0xb4, 0xfc, 0x52, 0xd0, + 0xbe, 0xd8, 0xe4, 0xf6, 0x8d, 0x6d, 0x59, 0x7c, 0xa8, 0x65, 0xe7, 0xff, 0x43, 0x0c, 0xf2, 0x35, + 0x32, 0x71, 0x9b, 0xab, 0x57, 0xbb, 0xda, 0x1e, 0x7a, 0x0a, 0x4e, 0xd4, 0xd6, 0x36, 0xeb, 0x2f, + 0xaa, 0xcd, 0x55, 0xf5, 0xea, 0x5a, 0xf5, 0x5a, 0x70, 0xbe, 0xb7, 0x72, 0xf2, 0x8d, 0xbb, 0x4b, + 0x28, 0x84, 0xbb, 0x6d, 0xd2, 0x58, 0x12, 0x5d, 0x80, 0xf9, 0x28, 0x49, 0xb5, 0xd6, 0x6a, 0x6c, + 0xb4, 0xa5, 0x58, 0xe5, 0xc4, 0x1b, 0x77, 0x97, 0x66, 0x43, 0x14, 0xd5, 0x1d, 0x17, 0x9b, 0xde, + 0x30, 0x41, 0x7d, 0x73, 0x7d, 0xbd, 0xd9, 0x96, 0xe2, 0x43, 0x04, 0x75, 0xab, 0xd7, 0x33, 0x3c, + 0xf4, 0x28, 0xcc, 0x46, 0x09, 0x36, 0x9a, 0x6b, 0x52, 0xa2, 0x82, 0xde, 0xb8, 0xbb, 0x54, 0x0a, + 0x61, 0x6f, 0x18, 0xdd, 0x4a, 0xf6, 0x43, 0x3f, 0x7a, 0x76, 0xe6, 0x53, 0x7f, 0xe7, 0x6c, 0xac, + 0xb6, 0x3e, 0x76, 0xce, 0x3d, 0x7d, 0xbc, 0x39, 0x17, 0x5d, 0xb7, 0xbf, 0x7a, 0x5f, 0xc4, 0xdc, + 0x70, 0x3f, 0x2c, 0x64, 0x8c, 0xa7, 0x9d, 0x6e, 0x93, 0x72, 0x0b, 0x95, 0xa3, 0xdd, 0x83, 0xca, + 0x84, 0x45, 0xa1, 0x32, 0xd1, 0x30, 0xc8, 0xcf, 0x43, 0x71, 0x4b, 0x73, 0xbc, 0x16, 0xf6, 0xae, + 0x63, 0xad, 0x83, 0x9d, 0xa8, 0xff, 0x50, 0x14, 0xfe, 0x03, 0x82, 0x24, 0x75, 0x12, 0xd8, 0xfa, + 0x49, 0x7f, 0xcb, 0xfb, 0x90, 0xa4, 0x27, 0x89, 0x7d, 0xdf, 0x82, 0x53, 0x30, 0xdf, 0x82, 0xac, + 0x0c, 0x87, 0x1e, 0x76, 0x45, 0xfa, 0x8b, 0x7e, 0xa0, 0x67, 0x84, 0x87, 0x90, 0x38, 0xda, 0x43, + 0xe0, 0xd3, 0x8b, 0xfb, 0x09, 0x5d, 0xc8, 0xf0, 0x21, 0xf6, 0x1b, 0x12, 0x0b, 0x1a, 0x82, 0xd6, + 0xa1, 0x6c, 0x6b, 0x8e, 0x47, 0x6f, 0x16, 0xee, 0xd3, 0x5e, 0xf0, 0x19, 0xbc, 0x38, 0x6c, 0x4f, + 0x22, 0x9d, 0xe5, 0xb5, 0x14, 0xed, 0x30, 0x50, 0xfe, 0x2f, 0x49, 0x48, 0x73, 0x61, 0xbc, 0x0b, + 0x32, 0x5c, 0xac, 0x7c, 0xce, 0xdd, 0xbf, 0x3c, 0xbc, 0xcc, 0x2e, 0xfb, 0xcb, 0x21, 0xe7, 0x27, + 0x68, 0xd0, 0xc3, 0x90, 0xd5, 0xf7, 0x35, 0xc3, 0x54, 0x8d, 0x0e, 0x77, 0x40, 0xf3, 0x9f, 0x7b, + 0x73, 0x31, 0x53, 0x27, 0xb0, 0xe6, 0xaa, 0x92, 0xa1, 0x85, 0xcd, 0x0e, 0xf1, 0x69, 0xf6, 0xb1, + 0xb1, 0xb7, 0xef, 0x71, 0xbb, 0xc1, 0xbf, 0xd0, 0x73, 0x90, 0x24, 0x0a, 0xc1, 0xef, 0x9d, 0x57, + 0x86, 0x22, 0x0b, 0x3f, 0xf5, 0x53, 0xcb, 0x92, 0x8a, 0x3f, 0xfc, 0x9f, 0x17, 0x63, 0x0a, 0xa5, + 0x40, 0x75, 0x28, 0x76, 0x35, 0xd7, 0x53, 0xe9, 0x7a, 0x4c, 0xaa, 0x4f, 0x51, 0x16, 0xa7, 0x87, + 0x05, 0xc2, 0x05, 0xcb, 0x9b, 0x9e, 0x27, 0x54, 0x0c, 0xd4, 0x41, 0xe7, 0x40, 0xa2, 0x4c, 0x74, + 0x3a, 0x03, 0x99, 0x97, 0x98, 0xa6, 0x72, 0x2f, 0x11, 0x38, 0x9b, 0x98, 0xd4, 0x57, 0x3c, 0x03, + 0x39, 0x7a, 0xd3, 0x95, 0xa2, 0xb0, 0xe3, 0xeb, 0x59, 0x02, 0xa0, 0x85, 0x8f, 0x40, 0x39, 0xb0, + 0xfa, 0x0c, 0x25, 0xcb, 0xb8, 0x04, 0x60, 0x8a, 0xf8, 0x24, 0xcc, 0x9b, 0xf8, 0x80, 0x1e, 0xa8, + 0x8f, 0x60, 0xe7, 0x28, 0x36, 0x22, 0x65, 0x37, 0xa3, 0x14, 0x0f, 0x41, 0x49, 0x17, 0xc2, 0x67, + 0xb8, 0x40, 0x71, 0x8b, 0x3e, 0x94, 0xa2, 0x9d, 0x86, 0xac, 0x66, 0xdb, 0x0c, 0x21, 0xcf, 0xad, + 0xbe, 0x6d, 0xd3, 0xa2, 0xf3, 0x30, 0x4b, 0xfb, 0xe8, 0x60, 0xb7, 0xdf, 0xf5, 0x38, 0x93, 0x02, + 0xc5, 0x29, 0x93, 0x02, 0x85, 0xc1, 0x29, 0xee, 0x83, 0x50, 0xc4, 0xb7, 0x8d, 0x0e, 0x36, 0x75, + 0xcc, 0xf0, 0x8a, 0x14, 0xaf, 0x20, 0x80, 0x14, 0xe9, 0x51, 0xf0, 0xad, 0xb9, 0x2a, 0x56, 0x9a, + 0x12, 0xe3, 0x27, 0xe0, 0x55, 0x06, 0x96, 0x17, 0x20, 0xb9, 0xaa, 0x79, 0x1a, 0x71, 0x97, 0xbc, + 0x03, 0xb6, 0x7c, 0x16, 0x14, 0xf2, 0x53, 0xfe, 0xf9, 0x04, 0x24, 0x6f, 0x5a, 0x1e, 0x46, 0x4f, + 0x87, 0x5c, 0xd9, 0xd2, 0x28, 0x7d, 0x6e, 0x19, 0x7b, 0x26, 0xee, 0xac, 0xbb, 0x7b, 0xa1, 0x67, + 0x69, 0x02, 0x75, 0x8a, 0x47, 0xd4, 0x69, 0x1e, 0x52, 0x8e, 0xd5, 0x37, 0x3b, 0xe2, 0xe0, 0x37, + 0xfd, 0x40, 0x0d, 0xc8, 0xfa, 0x5a, 0x92, 0x9c, 0xa4, 0x25, 0x65, 0xa2, 0x25, 0x44, 0x87, 0x39, + 0x40, 0xc9, 0xec, 0x70, 0x65, 0xa9, 0x41, 0xce, 0x37, 0x5e, 0x5c, 0xdb, 0xa6, 0x53, 0xd8, 0x80, + 0x8c, 0x2c, 0x91, 0xfe, 0xd8, 0xfb, 0xc2, 0x63, 0x1a, 0x27, 0xf9, 0x05, 0x5c, 0x7a, 0x11, 0xb5, + 0xe2, 0x4f, 0xe4, 0x64, 0x68, 0xbf, 0x02, 0xb5, 0x62, 0xcf, 0xe4, 0xdc, 0x07, 0x39, 0xd7, 0xd8, + 0x33, 0x35, 0xaf, 0xef, 0x60, 0xae, 0x79, 0x01, 0x80, 0x94, 0x06, 0x97, 0x20, 0x98, 0xa6, 0x85, + 0x5e, 0xee, 0xba, 0x00, 0x73, 0xc1, 0x9b, 0x59, 0x01, 0x17, 0xa6, 0x65, 0xc8, 0x2f, 0x6a, 0x89, + 0x12, 0xf9, 0x57, 0x62, 0x90, 0xe6, 0x2b, 0x56, 0x30, 0x0c, 0xb1, 0xd1, 0xc3, 0x10, 0x1f, 0x37, + 0x0c, 0x89, 0x7b, 0x1f, 0x86, 0x2a, 0x80, 0xdf, 0x4c, 0x97, 0x3f, 0x84, 0x32, 0xc2, 0xad, 0x62, + 0x4d, 0x6c, 0x19, 0x7b, 0x7c, 0xde, 0x87, 0x88, 0xe4, 0xdf, 0x8a, 0x11, 0x0f, 0x9f, 0x97, 0xa3, + 0x2a, 0x14, 0x45, 0xbb, 0xd4, 0xdd, 0xae, 0xb6, 0xc7, 0x55, 0xf1, 0xfe, 0xb1, 0x8d, 0x23, 0xab, + 0xb0, 0x92, 0xe7, 0xed, 0xa1, 0xfe, 0xc4, 0xc8, 0x61, 0x8d, 0x8f, 0x19, 0xd6, 0x88, 0x1e, 0x25, + 0xee, 0x4d, 0x8f, 0x22, 0x23, 0x9e, 0x1c, 0x18, 0x71, 0xf9, 0x77, 0x62, 0xfc, 0xc5, 0xae, 0x0e, + 0xbb, 0xc1, 0xf1, 0x67, 0x35, 0x54, 0xaf, 0x72, 0xdd, 0xea, 0xe0, 0x8e, 0x3a, 0x34, 0x66, 0x0f, + 0x0e, 0x73, 0x8c, 0xb6, 0x39, 0x18, 0x3b, 0x24, 0xb8, 0xb4, 0x82, 0x31, 0xfc, 0x74, 0x1c, 0x66, + 0x87, 0xf0, 0xff, 0xe2, 0x8d, 0x65, 0x74, 0xf6, 0xa6, 0xa6, 0x9c, 0xbd, 0xe9, 0xb1, 0xb3, 0xf7, + 0x67, 0xe3, 0x34, 0x01, 0x60, 0x5b, 0xae, 0xd6, 0xfd, 0x7a, 0xd8, 0xde, 0x33, 0x90, 0xb3, 0xad, + 0xae, 0xca, 0x4a, 0xd8, 0xd5, 0x9b, 0xac, 0x6d, 0x75, 0x95, 0x21, 0x35, 0x4b, 0xbd, 0x45, 0x86, + 0x39, 0xfd, 0x16, 0x0c, 0x42, 0x66, 0x70, 0x42, 0x39, 0x50, 0x60, 0xa2, 0xe0, 0x5e, 0xd3, 0x93, + 0x44, 0x06, 0xd4, 0x0d, 0x8b, 0x0d, 0x7b, 0x79, 0xac, 0xd9, 0x0c, 0x53, 0xe1, 0x78, 0x84, 0x82, + 0x39, 0x19, 0xa3, 0x32, 0x47, 0x61, 0x8b, 0xa5, 0x70, 0x3c, 0xf9, 0xfb, 0x62, 0x00, 0x6b, 0x44, + 0xb2, 0xb4, 0xbf, 0xc4, 0xdf, 0x71, 0x69, 0x13, 0xd4, 0x48, 0xcd, 0x67, 0xc7, 0x0d, 0x1a, 0xaf, + 0xbf, 0xe0, 0x86, 0xdb, 0x5d, 0x87, 0x62, 0xa0, 0xdb, 0x2e, 0x16, 0x8d, 0x39, 0x7b, 0x44, 0x54, + 0xda, 0xc2, 0x9e, 0x52, 0xb8, 0x1d, 0xfa, 0x92, 0xff, 0x59, 0x0c, 0x72, 0xb4, 0x4d, 0xeb, 0xd8, + 0xd3, 0x22, 0x63, 0x18, 0xbb, 0xf7, 0x31, 0xbc, 0x1f, 0x80, 0xb1, 0x71, 0x8d, 0xd7, 0x31, 0xd7, + 0xac, 0x1c, 0x85, 0xb4, 0x8c, 0xd7, 0x31, 0xba, 0xec, 0x0b, 0x3c, 0x71, 0xb4, 0xc0, 0x45, 0xd4, + 0xca, 0xc5, 0x7e, 0x0a, 0x32, 0xf4, 0x4d, 0xc9, 0x03, 0x97, 0x07, 0xa2, 0x69, 0xb3, 0xdf, 0x6b, + 0x1f, 0xb8, 0xf2, 0x6b, 0x90, 0x69, 0x1f, 0xb0, 0x7c, 0xe2, 0x19, 0xc8, 0x39, 0x96, 0xc5, 0xbd, + 0x3f, 0xe6, 0x75, 0x67, 0x09, 0x80, 0x3a, 0x3b, 0x22, 0x87, 0x16, 0x0f, 0x72, 0x68, 0x41, 0x12, + 0x30, 0x31, 0x55, 0x12, 0x90, 0x44, 0x9f, 0xc5, 0xc8, 0x4c, 0x42, 0x8f, 0xc3, 0xa9, 0x56, 0xf3, + 0xda, 0x46, 0x63, 0x55, 0x5d, 0x6f, 0x5d, 0x1b, 0xb8, 0x56, 0x5f, 0x29, 0xbf, 0x71, 0x77, 0x29, + 0xcf, 0xc3, 0xce, 0x71, 0xd8, 0x5b, 0x4a, 0xe3, 0xe6, 0x66, 0xbb, 0x21, 0xc5, 0x18, 0xf6, 0x96, + 0x83, 0x6f, 0x5b, 0x1e, 0x7b, 0xb4, 0xf5, 0x49, 0x38, 0x3d, 0x02, 0xdb, 0x0f, 0x3e, 0x67, 0xdf, + 0xb8, 0xbb, 0x54, 0xdc, 0x72, 0x30, 0xd3, 0x32, 0x4a, 0xb1, 0x0c, 0x0b, 0xc3, 0x14, 0x9b, 0x5b, + 0x9b, 0xad, 0xea, 0x9a, 0xb4, 0x54, 0x91, 0xde, 0xb8, 0xbb, 0x54, 0x10, 0x26, 0x83, 0xe0, 0xbf, + 0xfd, 0xd1, 0xe7, 0xb7, 0x65, 0x23, 0x59, 0x63, 0x16, 0xd7, 0xd9, 0x9a, 0xa3, 0xf5, 0x8e, 0x1b, + 0x7e, 0x4e, 0xd8, 0xf0, 0x97, 0x7f, 0x26, 0x0e, 0x65, 0x3f, 0xb8, 0xd9, 0xa2, 0x35, 0xa0, 0xa7, + 0xc3, 0x19, 0xbf, 0xfc, 0xd8, 0xb5, 0x83, 0x61, 0x8b, 0x84, 0xe0, 0x3b, 0x21, 0x2b, 0x9c, 0x64, + 0x3e, 0xa9, 0x96, 0x46, 0xac, 0x6f, 0x1c, 0x83, 0x93, 0xfa, 0x14, 0xe8, 0x05, 0xc8, 0xf9, 0x53, + 0xcc, 0x7f, 0xd8, 0x6c, 0xfc, 0x9c, 0xe4, 0xf4, 0x01, 0x0d, 0x7a, 0x3e, 0x08, 0xe3, 0x92, 0xe3, + 0x02, 0xc3, 0x9b, 0x0c, 0x81, 0x13, 0xfb, 0x21, 0xdc, 0x93, 0x90, 0xd4, 0x76, 0x74, 0x83, 0x1b, + 0xe0, 0xfb, 0x86, 0xe9, 0xaa, 0xb5, 0x7a, 0x93, 0x13, 0x51, 0x4c, 0xb9, 0xc9, 0x93, 0x29, 0x5c, + 0x5e, 0xf4, 0x19, 0x99, 0x03, 0x95, 0xc5, 0xc2, 0xcc, 0xbb, 0xc8, 0xf6, 0xb4, 0x83, 0x1a, 0x0d, + 0x87, 0x4f, 0x41, 0x86, 0x14, 0xee, 0xf1, 0x87, 0x0a, 0x12, 0x4a, 0xba, 0xa7, 0x1d, 0x5c, 0xd3, + 0xdc, 0x1b, 0xc9, 0x6c, 0x42, 0x4a, 0xca, 0x3f, 0x41, 0x3c, 0x95, 0x88, 0x54, 0xd0, 0x63, 0x80, + 0x08, 0x85, 0xb6, 0x87, 0x55, 0x32, 0x75, 0xa9, 0x78, 0x05, 0xdf, 0x72, 0x4f, 0x3b, 0xa8, 0xee, + 0xe1, 0x8d, 0x7e, 0x8f, 0x36, 0xc0, 0x45, 0xeb, 0x20, 0x09, 0x64, 0x31, 0xb2, 0x5c, 0xfc, 0xa7, + 0x87, 0x1f, 0x46, 0xe5, 0x08, 0x6c, 0x01, 0xf8, 0x08, 0x59, 0x00, 0x4a, 0x8c, 0x9f, 0x7f, 0xc4, + 0x23, 0xd2, 0x95, 0x44, 0xb4, 0x2b, 0xf2, 0x0b, 0x50, 0x1e, 0x18, 0x01, 0x24, 0x43, 0x91, 0x67, + 0xac, 0xe8, 0xf6, 0x39, 0x8b, 0x70, 0x72, 0x4a, 0x9e, 0x65, 0xa6, 0xe8, 0x71, 0x82, 0x95, 0xec, + 0x2f, 0x7c, 0x7c, 0x31, 0x46, 0x37, 0x73, 0x1e, 0x83, 0x62, 0x64, 0x0c, 0x44, 0x16, 0x39, 0x16, + 0x64, 0x91, 0x03, 0xe4, 0x57, 0xa1, 0x40, 0x0c, 0x10, 0xee, 0x70, 0xdc, 0x87, 0xa1, 0xcc, 0x0c, + 0xe4, 0xa0, 0xac, 0x99, 0xc3, 0xb3, 0x2e, 0x04, 0x2e, 0x0b, 0x0f, 0x28, 0x2a, 0xf6, 0xbc, 0xc0, + 0xba, 0xa6, 0xb9, 0xf2, 0x26, 0x40, 0x30, 0xa8, 0xa8, 0x0a, 0xf7, 0x13, 0xe3, 0x11, 0x3e, 0xee, + 0xc9, 0x9f, 0xb4, 0x8a, 0x78, 0x8c, 0x15, 0x82, 0x14, 0x1c, 0xe9, 0x64, 0x0f, 0x5b, 0x5d, 0xa7, + 0x18, 0xb5, 0x97, 0x3e, 0xf5, 0xb9, 0xb3, 0xb1, 0xb7, 0xc7, 0x16, 0xfc, 0xc7, 0x57, 0xe0, 0x4c, + 0xa8, 0x90, 0x28, 0x60, 0x24, 0x11, 0x55, 0x0e, 0xe9, 0x2b, 0x29, 0x9c, 0x94, 0x50, 0x3a, 0x32, + 0xff, 0x5b, 0x39, 0xda, 0xec, 0x4c, 0xce, 0x36, 0x4d, 0xce, 0x77, 0x8d, 0x4e, 0xca, 0xff, 0xd3, + 0x1c, 0x64, 0x14, 0xfc, 0xfe, 0x3e, 0x76, 0x3d, 0x74, 0x11, 0x92, 0x58, 0xdf, 0xb7, 0x46, 0xe5, + 0x40, 0x49, 0x07, 0x97, 0x39, 0x5e, 0x43, 0xdf, 0xb7, 0xae, 0xcf, 0x28, 0x14, 0x17, 0x5d, 0x82, + 0xd4, 0x6e, 0xb7, 0xcf, 0xd3, 0x57, 0x03, 0x36, 0x2b, 0x4c, 0x74, 0x95, 0x20, 0x5d, 0x9f, 0x51, + 0x18, 0x36, 0xa9, 0x8a, 0xbe, 0x68, 0x9d, 0x38, 0xba, 0xaa, 0xa6, 0xb9, 0x4b, 0xab, 0x22, 0xb8, + 0xa8, 0x06, 0x60, 0x98, 0x86, 0xa7, 0xd2, 0xd4, 0x0e, 0xb7, 0x1a, 0x0f, 0x8c, 0xa7, 0x34, 0x3c, + 0x9a, 0x0c, 0xba, 0x3e, 0xa3, 0xe4, 0x0c, 0xf1, 0x41, 0x9a, 0xfb, 0xfe, 0x3e, 0x76, 0x0e, 0xb9, + 0xb7, 0x36, 0xb6, 0xb9, 0x2f, 0x11, 0x24, 0xd2, 0x5c, 0x8a, 0x4d, 0x8c, 0x2c, 0x7b, 0x1c, 0xcf, + 0x3b, 0xe0, 0x4f, 0xbe, 0x2e, 0x8e, 0xa3, 0xa4, 0x2f, 0xe4, 0xb5, 0x0f, 0xae, 0xcf, 0x28, 0x19, + 0x9d, 0xfd, 0x44, 0xcf, 0xf9, 0x2e, 0x58, 0x7e, 0xd8, 0xeb, 0x89, 0xd0, 0xb2, 0xb4, 0xcf, 0x8c, + 0x70, 0xc5, 0xd0, 0x06, 0x94, 0xba, 0x86, 0xeb, 0xa9, 0xae, 0xa9, 0xd9, 0xee, 0xbe, 0xe5, 0xb9, + 0x34, 0x7f, 0x92, 0xbf, 0xf8, 0xd0, 0x38, 0x0e, 0x6b, 0x86, 0xeb, 0xb5, 0x04, 0xf2, 0xf5, 0x19, + 0xa5, 0xd8, 0x0d, 0x03, 0x08, 0x3f, 0x6b, 0x77, 0x17, 0x3b, 0x3e, 0x43, 0x9a, 0x67, 0x39, 0x82, + 0xdf, 0x26, 0xc1, 0x16, 0xf4, 0x84, 0x9f, 0x15, 0x06, 0xa0, 0x6f, 0x80, 0xb9, 0xae, 0xa5, 0x75, + 0x7c, 0x76, 0xaa, 0xbe, 0xdf, 0x37, 0x6f, 0xd1, 0xa4, 0x4c, 0xfe, 0xe2, 0xa3, 0x63, 0x1b, 0x69, + 0x69, 0x1d, 0xc1, 0xa2, 0x4e, 0x08, 0xae, 0xcf, 0x28, 0xb3, 0xdd, 0x41, 0x20, 0x7a, 0x1f, 0xcc, + 0x6b, 0xb6, 0xdd, 0x3d, 0x1c, 0xe4, 0x5e, 0xa6, 0xdc, 0xcf, 0x8f, 0xe3, 0x5e, 0x25, 0x34, 0x83, + 0xec, 0x91, 0x36, 0x04, 0x45, 0x6d, 0x90, 0x6c, 0x07, 0xd3, 0x1b, 0x53, 0x36, 0xf7, 0x32, 0xe8, + 0x7b, 0x52, 0xf9, 0x8b, 0x8f, 0x8c, 0xe3, 0xbd, 0xc5, 0xf0, 0x85, 0x53, 0x72, 0x7d, 0x46, 0x29, + 0xdb, 0x51, 0x10, 0xe3, 0x6a, 0xe9, 0x98, 0x3e, 0x77, 0xc7, 0xb9, 0xce, 0x4e, 0xe2, 0x4a, 0xf1, + 0xa3, 0x5c, 0x23, 0x20, 0xd4, 0x80, 0x3c, 0x0b, 0x45, 0x55, 0x62, 0x0c, 0xe9, 0x2b, 0x54, 0xf9, + 0x8b, 0xf2, 0xd8, 0x19, 0x4a, 0x51, 0x6f, 0x5a, 0x1e, 0xbe, 0x3e, 0xa3, 0x00, 0xf6, 0xbf, 0x90, + 0x06, 0x27, 0xe8, 0x83, 0x5c, 0x87, 0x6a, 0xd4, 0xf0, 0x2e, 0xcc, 0x51, 0x86, 0x8f, 0x8d, 0x63, + 0x78, 0x93, 0x12, 0xdd, 0x0c, 0xdb, 0xe1, 0xeb, 0x33, 0xca, 0xdc, 0xed, 0x61, 0x30, 0x51, 0xb1, + 0x5d, 0xc3, 0xd4, 0xba, 0xc6, 0xeb, 0x98, 0x2d, 0xa1, 0xf4, 0x29, 0xca, 0x23, 0x54, 0xec, 0x2a, + 0xc7, 0xa6, 0x0b, 0x2b, 0x51, 0xb1, 0xdd, 0x30, 0xa0, 0x96, 0xe1, 0x67, 0x3d, 0xfd, 0xa7, 0xd5, + 0x32, 0x52, 0x96, 0x3d, 0xa7, 0x76, 0x23, 0x99, 0x05, 0x29, 0x2f, 0x3f, 0x02, 0xf9, 0x90, 0x61, + 0x42, 0x0b, 0x90, 0xe1, 0xa7, 0x61, 0xc4, 0xa9, 0x51, 0xfe, 0x29, 0x97, 0xa0, 0x10, 0x36, 0x46, + 0xf2, 0x87, 0x63, 0x3e, 0x25, 0x7d, 0x53, 0x62, 0x21, 0x9a, 0x91, 0xce, 0x05, 0x9e, 0xca, 0x83, + 0x62, 0x69, 0x13, 0xe5, 0x6c, 0xfb, 0xb5, 0x40, 0x81, 0x7c, 0x65, 0x45, 0x8b, 0x90, 0xb7, 0x2f, + 0xda, 0x3e, 0x4a, 0x82, 0xa2, 0x80, 0x7d, 0xd1, 0x16, 0x08, 0x0f, 0x40, 0x81, 0xf4, 0x5b, 0x0d, + 0xfb, 0x4b, 0x39, 0x25, 0x4f, 0x60, 0x1c, 0x45, 0xfe, 0xd7, 0x71, 0x90, 0x06, 0x0d, 0x98, 0x9f, + 0xaa, 0x8e, 0x1d, 0x3b, 0x55, 0x7d, 0x7a, 0x30, 0x49, 0x1e, 0xe4, 0xc5, 0xd7, 0x40, 0x0a, 0xd2, + 0xbb, 0x6c, 0xa9, 0x19, 0xef, 0xff, 0x0d, 0x38, 0xaa, 0x4a, 0x59, 0x1f, 0xf0, 0x5c, 0xaf, 0x46, + 0x36, 0x2b, 0xc5, 0x9f, 0x7c, 0x18, 0x1c, 0x70, 0xdf, 0x89, 0xd9, 0xb6, 0x3b, 0x9a, 0x87, 0x45, + 0x7e, 0x2c, 0xb4, 0x6f, 0xf9, 0x30, 0x94, 0x35, 0xdb, 0x56, 0x5d, 0x4f, 0xf3, 0x30, 0xf7, 0x35, + 0x58, 0xe6, 0xa1, 0xa8, 0xd9, 0x76, 0x8b, 0x40, 0x99, 0xaf, 0xf1, 0x10, 0x94, 0x88, 0x4d, 0x37, + 0xb4, 0xae, 0x70, 0x15, 0xd2, 0xcc, 0x25, 0xe1, 0x50, 0xe6, 0x1d, 0xc8, 0x1d, 0x7f, 0xc4, 0xa9, + 0x3d, 0xf7, 0x63, 0xaa, 0x58, 0x28, 0xa6, 0x42, 0xfc, 0xad, 0x0f, 0x26, 0x1f, 0xf1, 0x3e, 0xca, + 0xe8, 0x4d, 0x83, 0x79, 0x1a, 0x7f, 0xdd, 0x66, 0xc9, 0x92, 0xac, 0xc2, 0x3e, 0x64, 0x05, 0x4a, + 0x51, 0xdb, 0x8f, 0x4a, 0x10, 0xf7, 0x0e, 0x78, 0x2d, 0x71, 0xef, 0x80, 0x78, 0xba, 0xfe, 0x0b, + 0xb9, 0xa5, 0x11, 0xab, 0x1d, 0xa7, 0x0b, 0x72, 0x1d, 0x72, 0x19, 0x8a, 0x91, 0x35, 0x41, 0x3e, + 0x09, 0xf3, 0xa3, 0x4c, 0xbc, 0xbc, 0xef, 0xc3, 0x23, 0xa6, 0x1a, 0x5d, 0x82, 0xac, 0x6f, 0xe3, + 0x47, 0x44, 0xc7, 0xb4, 0x5a, 0x81, 0xac, 0xf8, 0xa8, 0x91, 0x74, 0x7e, 0x3c, 0x92, 0xce, 0x97, + 0xbf, 0x09, 0x16, 0xc6, 0xd9, 0xef, 0x81, 0x24, 0x5f, 0xd2, 0x17, 0xd8, 0x49, 0x48, 0xf3, 0xa7, + 0x28, 0xe3, 0x74, 0x03, 0x8b, 0x7f, 0x11, 0x41, 0x32, 0x5b, 0x9e, 0x60, 0xfb, 0x5a, 0xf4, 0x43, + 0x56, 0xe1, 0xf4, 0x58, 0x1b, 0x3e, 0x7e, 0x2b, 0x8c, 0x31, 0xe2, 0x5b, 0x61, 0xba, 0x68, 0x8e, + 0x4b, 0xfb, 0x2a, 0x0e, 0xb2, 0xb0, 0x2f, 0xf9, 0x23, 0x09, 0x38, 0x39, 0xda, 0x92, 0xa3, 0x25, + 0x28, 0x10, 0xbf, 0xd5, 0x8b, 0xba, 0xb8, 0xd0, 0xd3, 0x0e, 0xda, 0xdc, 0xbf, 0xe5, 0x5b, 0x09, + 0x71, 0x7f, 0x2b, 0x01, 0x6d, 0xc3, 0x6c, 0xd7, 0xd2, 0xb5, 0xae, 0x1a, 0xda, 0xca, 0xe1, 0x93, + 0xe8, 0xc1, 0x21, 0x61, 0x47, 0x53, 0x86, 0xc4, 0xe0, 0x70, 0xfd, 0x2f, 0x53, 0x1e, 0x6b, 0xfe, + 0xae, 0x0f, 0x5a, 0x85, 0x7c, 0xcf, 0x70, 0x77, 0xf0, 0xbe, 0x76, 0xdb, 0xb0, 0x1c, 0x3e, 0x9b, + 0x86, 0x95, 0x66, 0x3d, 0xc0, 0x11, 0x3b, 0x4c, 0x21, 0xb2, 0xd0, 0x90, 0xa4, 0x46, 0x6e, 0x7c, + 0xa5, 0x8f, 0x6d, 0x4d, 0xc6, 0xed, 0x21, 0x65, 0xc6, 0xee, 0x21, 0x8d, 0xda, 0xb0, 0xc9, 0x8e, + 0xde, 0xb0, 0xf9, 0x50, 0x78, 0x68, 0xa2, 0x6b, 0xdf, 0xd0, 0x1e, 0x0e, 0x6a, 0xc1, 0x3c, 0xa7, + 0xef, 0x44, 0x64, 0x3f, 0xe2, 0xa8, 0x03, 0x9b, 0x5f, 0x83, 0x32, 0x47, 0x82, 0x7c, 0xbc, 0xd8, + 0x13, 0xf7, 0x26, 0x76, 0xb1, 0x89, 0x9a, 0x0c, 0x6d, 0xa2, 0xfe, 0x3f, 0x36, 0x14, 0x1f, 0x4c, + 0xc0, 0xec, 0x90, 0x23, 0x31, 0x72, 0x77, 0x78, 0x5c, 0x46, 0x56, 0x74, 0x2c, 0x71, 0xec, 0x8e, + 0xf1, 0xb1, 0x4e, 0x4e, 0x1e, 0xeb, 0xd4, 0x5b, 0x38, 0xd6, 0xe9, 0x7b, 0x1b, 0xeb, 0xb7, 0x75, + 0x14, 0x3e, 0x16, 0x83, 0xca, 0x78, 0xef, 0x6b, 0xe4, 0x70, 0x1c, 0x6b, 0x03, 0x61, 0xdc, 0x1a, + 0xf7, 0x10, 0x94, 0x06, 0x7c, 0x43, 0xa6, 0xca, 0xc5, 0x48, 0x14, 0x2e, 0x7f, 0x4b, 0xc2, 0x5f, + 0x78, 0x22, 0x0e, 0xdc, 0x88, 0xd9, 0xfa, 0x12, 0xcc, 0x75, 0xb0, 0x6e, 0x74, 0xee, 0x75, 0xb2, + 0xce, 0x72, 0xea, 0xff, 0x3f, 0x57, 0x87, 0xb5, 0xe4, 0x7b, 0x01, 0xb2, 0x0a, 0x76, 0x6d, 0xe2, + 0x8f, 0xa1, 0x1a, 0xe4, 0xf0, 0x81, 0x8e, 0x6d, 0x2f, 0x38, 0x54, 0x31, 0x2a, 0x44, 0x60, 0xd8, + 0x0d, 0x81, 0x49, 0x02, 0x64, 0x9f, 0x0c, 0x3d, 0xcd, 0x73, 0x00, 0xe3, 0xc3, 0x79, 0x4e, 0x1e, + 0x4e, 0x02, 0x5c, 0x16, 0x49, 0x80, 0xc4, 0xd8, 0xf8, 0x96, 0x51, 0x0d, 0x64, 0x01, 0x9e, 0xe6, + 0x59, 0x80, 0xe4, 0x84, 0xca, 0x22, 0x69, 0x80, 0x7a, 0x24, 0x0d, 0x90, 0x9e, 0xd0, 0xcd, 0x31, + 0x79, 0x80, 0xcb, 0x22, 0x0f, 0x90, 0x99, 0xd0, 0xe2, 0x81, 0x44, 0xc0, 0xbb, 0x42, 0x89, 0x80, + 0xdc, 0x70, 0xb6, 0x35, 0x42, 0x3a, 0x22, 0x13, 0xf0, 0xbc, 0x9f, 0x09, 0x28, 0x8c, 0xcd, 0x22, + 0x70, 0xe2, 0xc1, 0x54, 0xc0, 0xe6, 0x50, 0x2a, 0xa0, 0xc8, 0xff, 0xb0, 0xd1, 0x38, 0x16, 0x13, + 0x72, 0x01, 0x9b, 0x43, 0xb9, 0x80, 0xd2, 0x04, 0x86, 0x13, 0x92, 0x01, 0xdf, 0x38, 0x3a, 0x19, + 0x30, 0x3e, 0x5c, 0xe7, 0xcd, 0x9c, 0x2e, 0x1b, 0xa0, 0x8e, 0xc9, 0x06, 0x48, 0x63, 0x23, 0x57, + 0xc6, 0x7e, 0xea, 0x74, 0xc0, 0xf6, 0x88, 0x74, 0x00, 0x0b, 0xdc, 0xcf, 0x8d, 0x65, 0x3e, 0x45, + 0x3e, 0x60, 0x7b, 0x44, 0x3e, 0x00, 0x4d, 0x64, 0x3b, 0x31, 0x21, 0x70, 0x35, 0x9a, 0x10, 0x98, + 0x1b, 0xe3, 0x75, 0x06, 0xb3, 0x7d, 0x4c, 0x46, 0x60, 0x67, 0x5c, 0x46, 0x80, 0x45, 0xed, 0x8f, + 0x8f, 0xe5, 0x78, 0x8c, 0x94, 0xc0, 0xe6, 0x50, 0x4a, 0xe0, 0xc4, 0x04, 0x4d, 0x9b, 0x3e, 0x27, + 0xc0, 0x1e, 0x5a, 0x67, 0x4f, 0xac, 0x83, 0x94, 0xbf, 0x91, 0xcc, 0xe6, 0xa5, 0x82, 0xfc, 0x28, + 0xf1, 0x60, 0x06, 0xec, 0x1c, 0x89, 0x15, 0xb0, 0xe3, 0x58, 0x8e, 0xb8, 0xc7, 0x40, 0x3f, 0xe4, + 0x73, 0x24, 0x46, 0x0c, 0x6c, 0xda, 0x11, 0xf9, 0x03, 0x1a, 0x93, 0x85, 0xec, 0x98, 0xfc, 0x0b, + 0xb1, 0x80, 0x96, 0x66, 0x10, 0xc2, 0xf1, 0x65, 0x8e, 0xc7, 0x97, 0xa1, 0xac, 0x42, 0x3c, 0x9a, + 0x55, 0x58, 0x84, 0x3c, 0x89, 0xb5, 0x06, 0x12, 0x06, 0x9a, 0xed, 0x27, 0x0c, 0xc4, 0x01, 0x2a, + 0x96, 0x7b, 0xe0, 0xcb, 0x12, 0xdb, 0x4d, 0x2c, 0xfb, 0x87, 0xc9, 0x58, 0xa8, 0x8b, 0x9e, 0x80, + 0xb9, 0x10, 0xae, 0x1f, 0xc3, 0xb1, 0xe8, 0x59, 0xf2, 0xb1, 0xab, 0x3c, 0x98, 0xfb, 0xe7, 0xb1, + 0x40, 0x42, 0x41, 0xa6, 0x61, 0x54, 0x52, 0x20, 0xf6, 0x16, 0x25, 0x05, 0xe2, 0xf7, 0x9c, 0x14, + 0x08, 0xc7, 0xa4, 0x89, 0x68, 0x4c, 0xfa, 0x3f, 0x63, 0xc1, 0x98, 0xf8, 0x21, 0xbe, 0x6e, 0x75, + 0x30, 0x8f, 0x12, 0xe9, 0x6f, 0xe2, 0x92, 0x74, 0xad, 0x3d, 0x1e, 0x0b, 0x92, 0x9f, 0x04, 0xcb, + 0x5f, 0x78, 0x72, 0x7c, 0x5d, 0xf1, 0x03, 0xcc, 0x54, 0xf8, 0x1e, 0x07, 0xbf, 0xdc, 0x90, 0x0e, + 0x2e, 0x37, 0xf8, 0x97, 0x8f, 0x33, 0xa1, 0xcb, 0xc7, 0xe8, 0x39, 0xc8, 0xd1, 0x64, 0xbf, 0x6a, + 0xd9, 0xe2, 0xaf, 0x82, 0x9d, 0x19, 0x7f, 0xb1, 0xc1, 0xa5, 0x47, 0xae, 0xd9, 0x65, 0x88, 0xc0, + 0xe3, 0xc8, 0x45, 0x3c, 0x8e, 0xfb, 0x20, 0x47, 0x5a, 0xcf, 0xfe, 0xba, 0x05, 0xf0, 0x9b, 0xeb, + 0x02, 0x20, 0xff, 0x64, 0x1c, 0xca, 0x03, 0x0b, 0xcd, 0xc8, 0xbe, 0x8f, 0xda, 0x46, 0x9e, 0x4e, + 0x1e, 0x67, 0x01, 0xf6, 0x34, 0x57, 0xbd, 0xa3, 0x99, 0x1e, 0xee, 0x70, 0xa1, 0x84, 0x20, 0xa8, + 0x02, 0x59, 0xf2, 0xd5, 0x77, 0x71, 0x87, 0x67, 0x5f, 0xfc, 0x6f, 0x74, 0x1d, 0xd2, 0xf8, 0x36, + 0x7d, 0xdd, 0x95, 0xbd, 0x91, 0x7c, 0x72, 0x38, 0x1c, 0x26, 0xc5, 0xb5, 0x05, 0x32, 0xd8, 0x5f, + 0x7a, 0x73, 0x51, 0x62, 0xd8, 0x8f, 0xfb, 0x17, 0xc6, 0x14, 0x4e, 0x1f, 0x95, 0x42, 0x76, 0x40, + 0x0a, 0x34, 0x0f, 0x58, 0x10, 0xe1, 0x3d, 0x91, 0x29, 0x3b, 0xe3, 0xad, 0x14, 0x7b, 0xb8, 0x67, + 0x5b, 0x56, 0x57, 0x65, 0x73, 0xbc, 0x0a, 0xa5, 0xe8, 0xba, 0xca, 0xfe, 0xf2, 0x94, 0xa7, 0x19, + 0xa6, 0x1a, 0x71, 0x82, 0x0b, 0x0c, 0xc8, 0xe6, 0xd4, 0x8d, 0x64, 0x36, 0x26, 0xc5, 0x6f, 0x24, + 0xb3, 0x71, 0x29, 0x21, 0x6f, 0xc1, 0x89, 0x91, 0xeb, 0x2a, 0x7a, 0x16, 0x72, 0xc1, 0x92, 0xcc, + 0x8e, 0xe9, 0x1f, 0x91, 0x69, 0x09, 0x70, 0xe5, 0x5f, 0x8e, 0x05, 0x2c, 0xa3, 0xb9, 0x9b, 0x06, + 0xa4, 0xd9, 0x99, 0x49, 0x7e, 0x3e, 0xe6, 0x89, 0xe9, 0x56, 0xe4, 0x65, 0x76, 0xa0, 0x52, 0xe1, + 0xc4, 0xf2, 0xfb, 0x20, 0xcd, 0x20, 0x28, 0x0f, 0x99, 0xe0, 0x1d, 0x69, 0x80, 0x74, 0xb5, 0x5e, + 0x6f, 0x6c, 0x89, 0x47, 0x61, 0x6b, 0x9b, 0x4a, 0x5b, 0x8a, 0x13, 0xb0, 0xd2, 0xb8, 0xd1, 0xa8, + 0xb7, 0xa5, 0x04, 0x9a, 0x85, 0x22, 0xfb, 0xad, 0x5e, 0xdd, 0x54, 0xd6, 0xab, 0x6d, 0x29, 0x19, + 0x02, 0xb5, 0x1a, 0x1b, 0xab, 0x0d, 0x45, 0x4a, 0xc9, 0x4f, 0xc1, 0xe9, 0xb1, 0x6b, 0x78, 0x90, + 0x98, 0x89, 0x85, 0x12, 0x33, 0xf2, 0x47, 0xe2, 0x24, 0xa8, 0x19, 0xb7, 0x30, 0xa3, 0x1b, 0x03, + 0x1d, 0xbf, 0x78, 0x8c, 0x55, 0x7d, 0xa0, 0xf7, 0x24, 0x8e, 0x71, 0xf0, 0x2e, 0xf6, 0xf4, 0x7d, + 0xe6, 0x28, 0x30, 0x0b, 0x54, 0x54, 0x8a, 0x1c, 0x4a, 0x89, 0x5c, 0x86, 0xf6, 0x1a, 0xd6, 0x3d, + 0x95, 0x29, 0x91, 0xcb, 0xff, 0x50, 0x6e, 0x91, 0x41, 0x5b, 0x0c, 0x28, 0x7f, 0xd3, 0xb1, 0x64, + 0x99, 0x83, 0x94, 0xd2, 0x68, 0x2b, 0xaf, 0x48, 0x09, 0x84, 0xa0, 0x44, 0x7f, 0xaa, 0xad, 0x8d, + 0xea, 0x56, 0xeb, 0xfa, 0x26, 0x91, 0xe5, 0x1c, 0x94, 0x85, 0x2c, 0x05, 0x30, 0x25, 0x3f, 0x06, + 0xa7, 0xc6, 0x78, 0x15, 0x23, 0x0e, 0xb1, 0x7e, 0x22, 0x16, 0xc6, 0x8e, 0x7a, 0x06, 0x9b, 0x90, + 0x76, 0x3d, 0xcd, 0xeb, 0xbb, 0x5c, 0x88, 0xcf, 0x4e, 0xeb, 0x66, 0x2c, 0x8b, 0x1f, 0x2d, 0x4a, + 0xae, 0x70, 0x36, 0xf2, 0x25, 0x28, 0x45, 0x4b, 0xc6, 0xcb, 0x20, 0x50, 0xa2, 0xb8, 0x7c, 0x05, + 0xd0, 0xb0, 0xf7, 0x31, 0x22, 0xbc, 0x8c, 0x8d, 0x0a, 0x2f, 0x7f, 0x2c, 0x06, 0x67, 0x8e, 0xf0, + 0x34, 0xd0, 0x4b, 0x03, 0x9d, 0x7c, 0xfe, 0x38, 0x7e, 0xca, 0x32, 0x83, 0x0d, 0x74, 0xf3, 0x69, + 0x28, 0x84, 0xe1, 0xd3, 0x75, 0xf2, 0x4b, 0xf1, 0x60, 0x12, 0x47, 0xe3, 0xe0, 0xc0, 0x04, 0xc6, + 0xbe, 0x46, 0x13, 0xf8, 0x4e, 0x00, 0xef, 0x40, 0x9c, 0xa2, 0xe6, 0xeb, 0xe8, 0xfd, 0x23, 0xf2, + 0x8b, 0x58, 0x6f, 0x1f, 0xf0, 0x49, 0x90, 0xf3, 0xf8, 0x2f, 0x17, 0xb5, 0xc2, 0x49, 0x81, 0x3e, + 0x5d, 0x63, 0x5d, 0xff, 0xcf, 0xe4, 0x4e, 0xb7, 0x18, 0x07, 0xc9, 0x03, 0x06, 0x76, 0xd1, 0x2b, + 0x70, 0x6a, 0xc0, 0x51, 0xf0, 0x59, 0x27, 0xa7, 0xf5, 0x17, 0x4e, 0x44, 0xfd, 0x05, 0xc1, 0x3a, + 0xbc, 0xda, 0xa7, 0xa2, 0xab, 0xfd, 0x2b, 0x00, 0x41, 0x72, 0x20, 0x38, 0xf6, 0x17, 0x0b, 0x1f, + 0xfb, 0xbb, 0x04, 0x29, 0xa2, 0x49, 0x42, 0x4e, 0xc3, 0xa6, 0x98, 0x68, 0x42, 0x28, 0xb9, 0xc0, + 0xb0, 0x65, 0x03, 0xd0, 0x70, 0x82, 0x76, 0x4c, 0x15, 0xef, 0x8a, 0x56, 0xf1, 0xc0, 0xd8, 0x54, + 0xef, 0xe8, 0xaa, 0x5e, 0x87, 0x14, 0x1d, 0xf9, 0x91, 0x77, 0x29, 0xdf, 0x0b, 0xa0, 0x79, 0x9e, + 0x63, 0xec, 0xf4, 0x83, 0x0a, 0x16, 0x47, 0x6b, 0x4e, 0x55, 0xe0, 0xd5, 0xee, 0xe3, 0x2a, 0x34, + 0x1f, 0x90, 0x86, 0xd4, 0x28, 0xc4, 0x50, 0xde, 0x80, 0x52, 0x94, 0x76, 0xf4, 0xdd, 0xd0, 0xe0, + 0x71, 0x95, 0x9c, 0xf0, 0x6f, 0x7c, 0xef, 0x88, 0x3f, 0x78, 0x44, 0x3f, 0xe4, 0x0f, 0xc4, 0xa1, + 0x10, 0x56, 0xbc, 0xbf, 0x7c, 0x2e, 0x88, 0xfc, 0xad, 0x31, 0xc8, 0xfa, 0xdd, 0x3f, 0xe2, 0xb0, + 0x73, 0x70, 0x47, 0xd8, 0xdf, 0xbc, 0x60, 0xdb, 0x44, 0x09, 0x7f, 0x9b, 0xe8, 0x8a, 0xbf, 0xfc, + 0x8d, 0x4b, 0x88, 0x84, 0x65, 0x2d, 0x0e, 0x1c, 0xf2, 0xd5, 0xfe, 0xca, 0x74, 0x57, 0xf1, 0xe6, + 0x21, 0x15, 0xbe, 0x46, 0xc7, 0x3e, 0xe4, 0x4e, 0xe8, 0x84, 0x11, 0x9b, 0x88, 0xe1, 0x3b, 0x7b, + 0xb1, 0x63, 0xdf, 0xd9, 0xf3, 0x6b, 0x89, 0x87, 0x6b, 0xf9, 0x9e, 0x18, 0x64, 0xc5, 0x9c, 0x40, + 0xef, 0x0e, 0x9f, 0x3c, 0x13, 0x5b, 0x9b, 0x63, 0xed, 0x11, 0xe7, 0x1f, 0x3a, 0x78, 0x36, 0x74, + 0xe0, 0x3a, 0x71, 0xdc, 0x03, 0xd7, 0xdc, 0xb3, 0xfb, 0xe3, 0x18, 0x48, 0x83, 0x33, 0xf6, 0x6b, + 0x6e, 0xdd, 0xf0, 0x32, 0x97, 0x18, 0xb1, 0xcc, 0x8d, 0x3b, 0x45, 0x9d, 0x1c, 0x77, 0x8a, 0x7a, + 0xb8, 0xd7, 0xa9, 0x7b, 0xec, 0xf5, 0x07, 0xe3, 0x90, 0x0f, 0xa5, 0x47, 0xd1, 0x33, 0x91, 0x13, + 0xd9, 0x4b, 0x47, 0xa5, 0x52, 0x43, 0x47, 0xb2, 0x23, 0x62, 0x8a, 0x1f, 0x5f, 0x4c, 0x6f, 0xfd, + 0xed, 0xac, 0xd1, 0x17, 0x58, 0x53, 0x63, 0x2e, 0xb0, 0xfe, 0xf5, 0x18, 0x64, 0x7d, 0xb7, 0xfb, + 0xb8, 0x9b, 0x98, 0x27, 0x21, 0xcd, 0x3d, 0x4b, 0xb6, 0x8b, 0xc9, 0xbf, 0x46, 0xa6, 0x95, 0x2b, + 0x90, 0x15, 0x7f, 0xb3, 0x90, 0xaf, 0x6a, 0xfe, 0xf7, 0xf9, 0xe7, 0x21, 0x1f, 0xda, 0x00, 0x26, + 0xa6, 0x71, 0xa3, 0xf1, 0x1e, 0x69, 0xa6, 0x92, 0x79, 0xe3, 0xee, 0x52, 0x62, 0x03, 0xdf, 0x21, + 0xb3, 0x59, 0x69, 0xd4, 0xaf, 0x37, 0xea, 0x2f, 0x4a, 0xb1, 0x4a, 0xfe, 0x8d, 0xbb, 0x4b, 0x19, + 0x05, 0xd3, 0x8c, 0xe2, 0xf9, 0x17, 0xa1, 0x3c, 0x30, 0x30, 0x51, 0xb7, 0x05, 0x41, 0x69, 0x75, + 0x7b, 0x6b, 0xad, 0x59, 0xaf, 0xb6, 0x1b, 0x2a, 0x3b, 0xb7, 0x8b, 0x4e, 0xc1, 0xdc, 0x5a, 0xf3, + 0xda, 0xf5, 0xb6, 0x5a, 0x5f, 0x6b, 0x36, 0x36, 0xda, 0x6a, 0xb5, 0xdd, 0xae, 0xd6, 0x5f, 0x94, + 0xe2, 0x17, 0xef, 0xe6, 0x21, 0x59, 0xad, 0xd5, 0x9b, 0xa8, 0x0e, 0x49, 0x9a, 0x0a, 0x39, 0xf2, + 0x04, 0x58, 0xe5, 0xe8, 0xdc, 0x30, 0xba, 0x0a, 0x29, 0x9a, 0x25, 0x41, 0x47, 0x1f, 0x09, 0xab, + 0x4c, 0x48, 0x16, 0x93, 0xc6, 0xd0, 0x19, 0x79, 0xe4, 0x19, 0xb1, 0xca, 0xd1, 0xb9, 0x63, 0xb4, + 0x06, 0x19, 0x11, 0x24, 0x4f, 0x3a, 0xb8, 0x55, 0x99, 0x98, 0xd0, 0x25, 0x5d, 0x63, 0xc9, 0x86, + 0xa3, 0x8f, 0x8f, 0x55, 0x26, 0x64, 0x95, 0x51, 0xd3, 0xbf, 0xcf, 0x34, 0xe1, 0x44, 0x58, 0x65, + 0x52, 0x9e, 0x18, 0x29, 0x90, 0x0b, 0xd2, 0x38, 0x93, 0x0f, 0xc5, 0x55, 0xa6, 0x48, 0x98, 0xa3, + 0xf7, 0x41, 0x31, 0x1a, 0xea, 0x4e, 0x77, 0xea, 0xac, 0x32, 0x65, 0x46, 0x9a, 0xf0, 0x8f, 0xc6, + 0xbd, 0xd3, 0x9d, 0x42, 0xab, 0x4c, 0x99, 0xa0, 0x46, 0xaf, 0xc1, 0xec, 0x70, 0x5c, 0x3a, 0xfd, + 0xa1, 0xb4, 0xca, 0x31, 0x52, 0xd6, 0xa8, 0x07, 0x68, 0x44, 0x3c, 0x7b, 0x8c, 0x33, 0x6a, 0x95, + 0xe3, 0x64, 0xb0, 0x51, 0x07, 0xca, 0x83, 0x41, 0xe2, 0xb4, 0x67, 0xd6, 0x2a, 0x53, 0x67, 0xb3, + 0x59, 0x2d, 0xd1, 0xe0, 0x72, 0xda, 0x33, 0x6c, 0x95, 0xa9, 0x93, 0xdb, 0x68, 0x1b, 0x20, 0x14, + 0x1f, 0x4e, 0x71, 0xa6, 0xad, 0x32, 0x4d, 0x9a, 0x1b, 0xd9, 0x30, 0x37, 0x2a, 0x70, 0x3c, 0xce, + 0x11, 0xb7, 0xca, 0xb1, 0xb2, 0xdf, 0x44, 0x9f, 0xa3, 0x21, 0xe0, 0x74, 0x47, 0xde, 0x2a, 0x53, + 0xa6, 0xc1, 0x6b, 0xd5, 0xb1, 0xe7, 0x9c, 0x1f, 0x39, 0xf2, 0x9c, 0x73, 0x70, 0x72, 0xd9, 0x3f, + 0xdb, 0xfc, 0x99, 0x67, 0xe0, 0x1d, 0xfc, 0x05, 0x1d, 0xd7, 0xd3, 0x6e, 0x19, 0xe6, 0x9e, 0xff, + 0x94, 0x11, 0xff, 0xe6, 0x87, 0x9c, 0x4f, 0xf2, 0xe7, 0x7a, 0x04, 0x74, 0xc2, 0x83, 0x46, 0x63, + 0x5f, 0x79, 0x9c, 0x74, 0x1f, 0x62, 0xf2, 0xf1, 0xe5, 0x23, 0x1e, 0x4b, 0x9a, 0xf0, 0x24, 0xd3, + 0x88, 0xc7, 0x94, 0x2a, 0x47, 0xbe, 0x31, 0x50, 0x39, 0xea, 0xdc, 0xb7, 0xfc, 0xfd, 0x31, 0x28, + 0x5d, 0x37, 0x5c, 0xcf, 0x72, 0x0c, 0x5d, 0xeb, 0xd2, 0xe5, 0xe5, 0xca, 0xb4, 0xb7, 0xb2, 0x6a, + 0x39, 0xe2, 0xae, 0xf0, 0xf7, 0x96, 0xf8, 0x4d, 0xa1, 0x55, 0x48, 0xdf, 0xd6, 0xba, 0xec, 0x4e, + 0x54, 0xf8, 0xb1, 0xb5, 0x41, 0x99, 0x87, 0xfc, 0xa8, 0x30, 0x17, 0x46, 0xbb, 0x12, 0x5f, 0x88, + 0xc9, 0xdf, 0x1e, 0x03, 0x29, 0x68, 0x99, 0x82, 0x75, 0xcb, 0xe9, 0xd0, 0x50, 0xc0, 0xb6, 0x43, + 0x67, 0x05, 0xc4, 0x27, 0x75, 0xf9, 0x8c, 0x1e, 0xf6, 0xfd, 0xb6, 0xf1, 0x4e, 0x56, 0x32, 0xe4, + 0x60, 0x8d, 0xb8, 0x72, 0x9e, 0x18, 0x75, 0xe5, 0x5c, 0xfe, 0x3e, 0x7a, 0xc3, 0xa5, 0xd7, 0x33, + 0x5c, 0x32, 0x3b, 0x14, 0x1a, 0xdc, 0xdf, 0x80, 0xa4, 0xa3, 0x79, 0x3c, 0xe4, 0xad, 0x5d, 0x3e, + 0xf6, 0x93, 0x51, 0xac, 0xcf, 0x94, 0x07, 0x7a, 0x09, 0xb2, 0x3d, 0xed, 0x40, 0xa5, 0xfc, 0xe2, + 0x5f, 0x13, 0xbf, 0x4c, 0x4f, 0x3b, 0x20, 0xed, 0x43, 0xef, 0x83, 0x32, 0x61, 0xa9, 0xef, 0x6b, + 0xe6, 0x1e, 0x66, 0x9c, 0x13, 0x5f, 0x13, 0xe7, 0x62, 0x4f, 0x3b, 0xa8, 0x53, 0x6e, 0x84, 0x3f, + 0x7f, 0x5a, 0xeb, 0x57, 0x63, 0x3c, 0x8f, 0x41, 0x05, 0x83, 0x34, 0x90, 0x74, 0xff, 0x8b, 0x56, + 0x2a, 0x36, 0x5d, 0x1e, 0x19, 0xa7, 0x09, 0x03, 0x62, 0xad, 0x15, 0x49, 0xf3, 0x3e, 0xfb, 0xe6, + 0x62, 0x8c, 0xd5, 0x5a, 0xd6, 0x87, 0xc4, 0x9e, 0x67, 0xe9, 0x19, 0x75, 0xca, 0x01, 0x2f, 0x0a, + 0xaf, 0x9a, 0x31, 0x04, 0x46, 0x4d, 0xca, 0x79, 0x1f, 0x3e, 0x15, 0x83, 0xfc, 0x6a, 0xe8, 0x31, + 0xc7, 0x05, 0xc8, 0xf4, 0x2c, 0xd3, 0xb8, 0x85, 0x1d, 0x7f, 0xd7, 0x8c, 0x7d, 0x12, 0xcf, 0x97, + 0xfd, 0x4d, 0x40, 0xef, 0x50, 0xbc, 0x77, 0x24, 0xbe, 0x09, 0xd5, 0x1d, 0xbc, 0xe3, 0x1a, 0x42, + 0xce, 0x8a, 0xf8, 0x44, 0x8f, 0x82, 0xe4, 0x62, 0xbd, 0xef, 0x18, 0xde, 0xa1, 0xaa, 0x5b, 0xa6, + 0xa7, 0xe9, 0x1e, 0xcf, 0x0c, 0x94, 0x05, 0xbc, 0xce, 0xc0, 0x84, 0x49, 0x07, 0x7b, 0x9a, 0xd1, + 0x65, 0x67, 0x45, 0x73, 0x8a, 0xf8, 0xe4, 0x4d, 0x7d, 0x23, 0x13, 0x8e, 0x8c, 0xeb, 0x20, 0x59, + 0x36, 0x76, 0x22, 0x47, 0x64, 0x98, 0x36, 0x2e, 0xfc, 0xc6, 0xa7, 0x9f, 0x98, 0xe7, 0x02, 0xe7, + 0xc7, 0x2b, 0xd8, 0xdf, 0x2e, 0x50, 0xca, 0x82, 0x42, 0x9c, 0x9d, 0x79, 0x25, 0xb2, 0x4f, 0xd6, + 0xdf, 0x09, 0x1e, 0xb6, 0x99, 0x1f, 0x12, 0x6a, 0xd5, 0x3c, 0xac, 0x2d, 0xfc, 0x7a, 0xc0, 0x3a, + 0x88, 0x9c, 0x5f, 0xc4, 0x87, 0xe1, 0x4d, 0x33, 0xca, 0x86, 0x04, 0x15, 0xaf, 0x69, 0x46, 0x57, + 0xfc, 0xf9, 0x54, 0x85, 0x7f, 0xa1, 0x15, 0x3f, 0xe1, 0x99, 0xa4, 0x11, 0x9a, 0x3c, 0x4e, 0x37, + 0x6a, 0x96, 0xd9, 0x89, 0x66, 0x36, 0x51, 0x1d, 0xd2, 0x9e, 0x75, 0x0b, 0x9b, 0x5c, 0x40, 0xb5, + 0xc7, 0x8e, 0xf1, 0x36, 0x9c, 0xc2, 0x49, 0xd1, 0x37, 0x82, 0xd4, 0xc1, 0x5d, 0xbc, 0xc7, 0x6e, + 0x70, 0xee, 0x6b, 0x0e, 0x66, 0xef, 0x07, 0xdc, 0xd3, 0xcb, 0x6f, 0x65, 0x9f, 0x55, 0x8b, 0x72, + 0x42, 0x5b, 0xd1, 0xe7, 0x42, 0x33, 0x7c, 0x3b, 0x7b, 0x4c, 0x1f, 0x43, 0x9a, 0x17, 0xb6, 0x85, + 0x91, 0xe7, 0x45, 0x1f, 0x05, 0xa9, 0x6f, 0xee, 0x58, 0x26, 0xfd, 0xab, 0x83, 0x3c, 0xae, 0xcb, + 0xb2, 0xbd, 0x53, 0x1f, 0xce, 0xf7, 0x4e, 0xb7, 0xa0, 0x14, 0xa0, 0xd2, 0x19, 0x92, 0x3b, 0xee, + 0x0c, 0x29, 0xfa, 0x0c, 0x08, 0x0a, 0x5a, 0x07, 0x08, 0xe6, 0x20, 0xdd, 0xbc, 0xcb, 0x8f, 0x1f, + 0xb1, 0x60, 0x36, 0x87, 0x3b, 0x13, 0x62, 0x80, 0xbe, 0x01, 0xe6, 0x7a, 0x86, 0xa9, 0xba, 0xb8, + 0xbb, 0xab, 0x72, 0xc9, 0x11, 0xbe, 0xf9, 0xe3, 0x8f, 0xe6, 0x6c, 0xcf, 0x30, 0x5b, 0xb8, 0xbb, + 0xbb, 0xea, 0x73, 0x41, 0xef, 0x84, 0x33, 0x41, 0xef, 0x2d, 0x53, 0xdd, 0xb7, 0xba, 0x1d, 0xd5, + 0xc1, 0xbb, 0xaa, 0x4e, 0x5f, 0xf7, 0x2b, 0x50, 0x99, 0x9d, 0xf2, 0x51, 0x36, 0xcd, 0xeb, 0x56, + 0xb7, 0xa3, 0xe0, 0xdd, 0x3a, 0x29, 0x46, 0x0f, 0x42, 0xd0, 0x75, 0xd5, 0xe8, 0xb8, 0x0b, 0xc5, + 0xa5, 0xc4, 0xb9, 0xa4, 0x52, 0xf0, 0x81, 0xcd, 0x8e, 0xbb, 0x92, 0xfd, 0xd0, 0xc7, 0x17, 0x67, + 0xbe, 0xf8, 0xf1, 0xc5, 0x19, 0xf9, 0x2a, 0x7d, 0xe5, 0x8a, 0xcf, 0x23, 0xec, 0xa2, 0xcb, 0x90, + 0xd3, 0xc4, 0x07, 0xbb, 0xc3, 0x76, 0xc4, 0x3c, 0x0c, 0x50, 0xe5, 0x9f, 0x88, 0x41, 0x7a, 0xf5, + 0xe6, 0x96, 0x66, 0x38, 0xa8, 0x01, 0xb3, 0x81, 0x62, 0x4e, 0x3b, 0xa5, 0x03, 0x5d, 0x16, 0x73, + 0x7a, 0x63, 0xdc, 0xe1, 0xb9, 0x5c, 0xed, 0x81, 0xdf, 0xf8, 0xf4, 0x13, 0xf7, 0x73, 0x36, 0x37, + 0x07, 0xce, 0xd1, 0x09, 0x7e, 0x83, 0xe7, 0xeb, 0x42, 0x7d, 0xbe, 0x01, 0x19, 0xd6, 0x54, 0x17, + 0xbd, 0x00, 0x29, 0x9b, 0xfc, 0xe0, 0x7b, 0x02, 0x67, 0xc7, 0x2a, 0x38, 0xc5, 0x0f, 0xab, 0x03, + 0xa3, 0x93, 0xbf, 0x3d, 0x0e, 0xb0, 0x7a, 0xf3, 0x66, 0xdb, 0x31, 0xec, 0x2e, 0xf6, 0xde, 0xaa, + 0xbe, 0x6f, 0xc3, 0x89, 0xd0, 0xed, 0x6c, 0x47, 0x3f, 0x7e, 0xff, 0xe7, 0x82, 0x8b, 0xda, 0x8e, + 0x3e, 0x92, 0x6d, 0xc7, 0xf5, 0x7c, 0xb6, 0x89, 0xe3, 0xb3, 0x5d, 0x75, 0xbd, 0x61, 0xc9, 0xbe, + 0x0c, 0xf9, 0x40, 0x18, 0x2e, 0x6a, 0x42, 0xd6, 0xe3, 0xbf, 0xb9, 0x80, 0xe5, 0xf1, 0x02, 0x16, + 0x64, 0x61, 0x21, 0xfb, 0xe4, 0xf2, 0x9f, 0xc6, 0x00, 0x42, 0x73, 0xe4, 0xcf, 0xa7, 0x8e, 0xa1, + 0x26, 0xa4, 0xb9, 0x25, 0x4e, 0xdc, 0xf3, 0x1b, 0x9c, 0x8c, 0x41, 0x48, 0xa8, 0xdf, 0x19, 0x87, + 0xb9, 0x6d, 0x31, 0x7b, 0xff, 0xfc, 0xcb, 0x60, 0x1b, 0x32, 0xd8, 0xf4, 0x1c, 0xc3, 0xdf, 0xd5, + 0x7a, 0x72, 0xdc, 0x98, 0x8f, 0xe8, 0x54, 0xc3, 0xf4, 0x9c, 0xc3, 0xb0, 0x06, 0x08, 0x5e, 0x21, + 0x79, 0x7c, 0x34, 0x01, 0x0b, 0xe3, 0x48, 0x89, 0x37, 0xac, 0x3b, 0x98, 0x02, 0xa2, 0x97, 0x56, + 0x4b, 0x02, 0xcc, 0xd7, 0x18, 0x05, 0x88, 0x57, 0x46, 0x94, 0x8b, 0xa0, 0xde, 0x9b, 0x1b, 0x56, + 0x0a, 0x38, 0xd0, 0x55, 0xa6, 0x0d, 0x65, 0x71, 0x0b, 0x66, 0x47, 0xeb, 0x6a, 0xa6, 0x2e, 0xdc, + 0xd5, 0x63, 0x2d, 0x09, 0xe2, 0x26, 0x4d, 0x8d, 0xb1, 0x40, 0x0d, 0xc8, 0x08, 0x6e, 0xc9, 0xe3, + 0x73, 0x13, 0xb4, 0xe8, 0x01, 0x28, 0x84, 0x17, 0x06, 0xea, 0x7a, 0x24, 0x95, 0x7c, 0x68, 0x5d, + 0x98, 0xb4, 0xf2, 0xa4, 0x8f, 0x5c, 0x79, 0xb8, 0x77, 0xf7, 0xc3, 0xf4, 0xb0, 0x7a, 0xe7, 0x2f, + 0xfe, 0xb0, 0x6c, 0x01, 0xb0, 0xa9, 0x4a, 0x2c, 0x29, 0x1f, 0x99, 0x7b, 0x98, 0xef, 0x39, 0xc6, + 0x64, 0xd5, 0xf5, 0xbe, 0x5e, 0x23, 0xf4, 0x5b, 0x71, 0x28, 0x84, 0x47, 0xe8, 0x2f, 0xe5, 0xa2, + 0x85, 0x36, 0x02, 0x33, 0xc5, 0x2e, 0xf4, 0x3c, 0x3a, 0xce, 0x4c, 0x0d, 0x69, 0xf3, 0x04, 0xfb, + 0xf4, 0x85, 0x04, 0xa4, 0xf9, 0x89, 0xbb, 0xcd, 0x21, 0x47, 0x36, 0x36, 0xe9, 0x49, 0x82, 0xa2, + 0x78, 0x92, 0x60, 0xa4, 0x1f, 0xfb, 0x10, 0x94, 0x48, 0x40, 0x1c, 0x39, 0xc6, 0x17, 0x3b, 0x57, + 0xa4, 0x71, 0x6d, 0x70, 0x68, 0x1d, 0x2d, 0x42, 0x9e, 0xa0, 0x05, 0x76, 0x98, 0xe0, 0x40, 0x4f, + 0x3b, 0x68, 0x30, 0x08, 0x7a, 0x02, 0xd0, 0xbe, 0x9f, 0x98, 0x50, 0x03, 0x41, 0x10, 0xbc, 0xd9, + 0xa0, 0x44, 0xa0, 0xdf, 0x0f, 0x40, 0x5a, 0xa1, 0xb2, 0x67, 0xa7, 0xf9, 0xa3, 0xde, 0x04, 0xb2, + 0x4a, 0x9f, 0x9e, 0xfe, 0x96, 0x18, 0xf3, 0x87, 0x07, 0xc2, 0x66, 0x1e, 0x8e, 0xb4, 0xa7, 0x98, + 0x14, 0x7f, 0xf4, 0xe6, 0x62, 0xe5, 0x50, 0xeb, 0x75, 0x57, 0xe4, 0x11, 0x7c, 0xe4, 0x51, 0x91, + 0x3c, 0x71, 0x9c, 0xa3, 0x61, 0x37, 0x6a, 0x82, 0x74, 0x0b, 0x1f, 0xaa, 0x0e, 0xff, 0x9b, 0xdc, + 0xea, 0x2e, 0xc6, 0x3c, 0x70, 0x39, 0xbd, 0x3c, 0xe2, 0x11, 0xf0, 0xe5, 0xba, 0x65, 0x98, 0x7c, + 0x0b, 0xac, 0x74, 0x0b, 0x1f, 0x2a, 0x9c, 0xee, 0x2a, 0xc6, 0x2b, 0xef, 0x20, 0x33, 0xe5, 0x8d, + 0x2f, 0xfc, 0xd4, 0xf9, 0x33, 0xa1, 0x07, 0xad, 0x0f, 0xfc, 0xdc, 0x1c, 0x1b, 0x5e, 0xe2, 0xf4, + 0xa2, 0x60, 0x01, 0xf2, 0x8f, 0xfd, 0xaf, 0x03, 0x84, 0x82, 0x82, 0xd8, 0xd1, 0xc1, 0x46, 0x40, + 0x1f, 0x09, 0x36, 0x42, 0xd3, 0xf3, 0xdd, 0x81, 0xfd, 0x8f, 0x4f, 0xea, 0x4d, 0x58, 0x33, 0x39, + 0x11, 0x9d, 0xf5, 0x33, 0xf2, 0xbf, 0x89, 0xc1, 0xe9, 0x21, 0x4d, 0xf6, 0x9b, 0xac, 0x03, 0x72, + 0x42, 0x85, 0x54, 0x23, 0xc4, 0x3e, 0xf3, 0xbd, 0x4d, 0x8c, 0x59, 0x67, 0x68, 0x11, 0x78, 0x6b, + 0x16, 0x32, 0x6e, 0xc5, 0x7e, 0x2d, 0x06, 0xf3, 0xe1, 0x06, 0xf8, 0x5d, 0x69, 0x41, 0x21, 0x5c, + 0x35, 0xef, 0xc4, 0x3b, 0xa6, 0xe9, 0x44, 0xb8, 0xfd, 0x11, 0x26, 0xe8, 0x66, 0x60, 0x2d, 0x58, + 0x52, 0xf0, 0xa9, 0xa9, 0x85, 0x22, 0x1a, 0x36, 0xd2, 0x6a, 0xb0, 0xb1, 0xf9, 0xbd, 0x18, 0x24, + 0xb7, 0x2c, 0xab, 0x8b, 0xde, 0x0f, 0xb3, 0xa6, 0xe5, 0xa9, 0x64, 0x66, 0xe1, 0x8e, 0xca, 0x73, + 0x04, 0xcc, 0x12, 0x37, 0x8e, 0x94, 0xd5, 0x97, 0xde, 0x5c, 0x1c, 0xa6, 0x1c, 0xf5, 0xa8, 0x7c, + 0xd9, 0xb4, 0xbc, 0x1a, 0x45, 0x6a, 0xb3, 0x34, 0xc2, 0x2e, 0x14, 0xa3, 0xd5, 0x31, 0x6b, 0x5d, + 0x9d, 0x54, 0x5d, 0x71, 0x62, 0x55, 0x85, 0x9d, 0x50, 0x3d, 0xec, 0x8d, 0xe8, 0x3f, 0x20, 0x23, + 0xf7, 0x5e, 0x90, 0x6e, 0x0e, 0x9e, 0x5f, 0x6a, 0x40, 0x46, 0x9c, 0x57, 0x8a, 0x4d, 0x79, 0x14, + 0x2a, 0x2c, 0x4e, 0x4e, 0x4b, 0x93, 0xae, 0x9f, 0x8d, 0xc3, 0xe9, 0xba, 0x65, 0xba, 0x3c, 0xa1, + 0xc3, 0x27, 0x35, 0x4b, 0xc3, 0x1e, 0xa2, 0x47, 0xc7, 0xa4, 0x9b, 0x0a, 0xc3, 0x49, 0xa5, 0x9b, + 0x50, 0x26, 0xab, 0xab, 0x6e, 0x99, 0x5f, 0x63, 0x4e, 0xa9, 0x68, 0x75, 0x3b, 0xbc, 0x45, 0xb7, + 0xf0, 0x21, 0xe1, 0x6b, 0xe2, 0x3b, 0x11, 0xbe, 0x89, 0x7b, 0xe3, 0x6b, 0xe2, 0x3b, 0x21, 0xbe, + 0xc1, 0x76, 0x79, 0x32, 0xb2, 0x5d, 0x7e, 0x19, 0x12, 0xc4, 0x12, 0xa6, 0x8e, 0x61, 0x3b, 0x08, + 0x41, 0x68, 0x45, 0x6b, 0xc1, 0x69, 0x9e, 0x24, 0x70, 0x37, 0x77, 0xa9, 0x44, 0x31, 0xed, 0xd0, + 0x8b, 0xf8, 0x70, 0x44, 0xc6, 0xa0, 0x30, 0x55, 0xc6, 0xe0, 0xfc, 0xcf, 0xc5, 0x00, 0x82, 0xdc, + 0x18, 0x7a, 0x1c, 0x4e, 0xd5, 0x36, 0x37, 0x56, 0xd5, 0x56, 0xbb, 0xda, 0xde, 0x6e, 0x45, 0xff, + 0x6c, 0x8c, 0x78, 0x08, 0xcb, 0xb5, 0xb1, 0x6e, 0xec, 0x1a, 0xb8, 0x83, 0x1e, 0x86, 0xf9, 0x28, + 0x36, 0xf9, 0x6a, 0xac, 0x4a, 0xb1, 0x4a, 0xe1, 0x8d, 0xbb, 0x4b, 0x59, 0x16, 0x1e, 0xe0, 0x0e, + 0x3a, 0x07, 0x27, 0x86, 0xf1, 0x9a, 0x1b, 0xd7, 0xa4, 0x78, 0xa5, 0xf8, 0xc6, 0xdd, 0xa5, 0x9c, + 0x1f, 0x47, 0x20, 0x19, 0x50, 0x18, 0x93, 0xf3, 0x4b, 0x54, 0xe0, 0x8d, 0xbb, 0x4b, 0x69, 0x36, + 0x63, 0x2a, 0xc9, 0x0f, 0xfd, 0xe8, 0xd9, 0x99, 0xf3, 0xef, 0x05, 0x68, 0x9a, 0xbb, 0x8e, 0xa6, + 0x53, 0xcb, 0x50, 0x81, 0x93, 0xcd, 0x8d, 0xab, 0x4a, 0xb5, 0xde, 0x6e, 0x6e, 0x6e, 0x0c, 0xfc, + 0xb5, 0x9b, 0x68, 0xd9, 0xea, 0xe6, 0x76, 0x6d, 0xad, 0xa1, 0xb6, 0x9a, 0xd7, 0x36, 0xd8, 0xae, + 0x7f, 0xa4, 0xec, 0x3d, 0x1b, 0xed, 0xe6, 0x7a, 0x43, 0x8a, 0xd7, 0x2e, 0x8f, 0xdd, 0x55, 0xba, + 0x2f, 0x32, 0x17, 0x83, 0xd5, 0x28, 0xb2, 0x95, 0xf4, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x98, + 0x91, 0x83, 0x6e, 0x31, 0xa3, 0x00, 0x00, } r := bytes.NewReader(gzipped) gzipr, err := compress_gzip.NewReader(r) @@ -5171,7 +5173,7 @@ func (m *Validator) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.ConsensusPubkey == nil { - m.ConsensusPubkey = &types1.Any{} + m.ConsensusPubkey = &any.Any{} } if err := m.ConsensusPubkey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -7719,7 +7721,7 @@ func (m *ValidatorUpdates) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Updates = append(m.Updates, types3.ValidatorUpdate{}) + m.Updates = append(m.Updates, types2.ValidatorUpdate{}) if err := m.Updates[len(m.Updates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -7838,7 +7840,7 @@ func (m *ConsPubKeyRotationHistory) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.OldConsPubkey == nil { - m.OldConsPubkey = &types1.Any{} + m.OldConsPubkey = &any.Any{} } if err := m.OldConsPubkey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -7874,7 +7876,7 @@ func (m *ConsPubKeyRotationHistory) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.NewConsPubkey == nil { - m.NewConsPubkey = &types1.Any{} + m.NewConsPubkey = &any.Any{} } if err := m.NewConsPubkey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/x/staking/types/tx.pb.go b/x/staking/types/tx.pb.go index c5b66a095871..711adcfa20ba 100644 --- a/x/staking/types/tx.pb.go +++ b/x/staking/types/tx.pb.go @@ -8,14 +8,14 @@ import ( cosmossdk_io_math "cosmossdk.io/math" fmt "fmt" _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" - types1 "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + any "github.com/cosmos/gogoproto/types/any" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -46,10 +46,10 @@ type MsgCreateValidator struct { // Deprecated: Use of Delegator Address in MsgCreateValidator is deprecated. // The validator address bytes and delegator address bytes refer to the same account while creating validator (defer // only in bech32 notation). - DelegatorAddress string `protobuf:"bytes,4,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` // Deprecated: Do not use. - ValidatorAddress string `protobuf:"bytes,5,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` - Pubkey *types.Any `protobuf:"bytes,6,opt,name=pubkey,proto3" json:"pubkey,omitempty"` - Value types1.Coin `protobuf:"bytes,7,opt,name=value,proto3" json:"value"` + DelegatorAddress string `protobuf:"bytes,4,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` // Deprecated: Do not use. + ValidatorAddress string `protobuf:"bytes,5,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + Pubkey *any.Any `protobuf:"bytes,6,opt,name=pubkey,proto3" json:"pubkey,omitempty"` + Value types.Coin `protobuf:"bytes,7,opt,name=value,proto3" json:"value"` } func (m *MsgCreateValidator) Reset() { *m = MsgCreateValidator{} } @@ -207,9 +207,9 @@ var xxx_messageInfo_MsgEditValidatorResponse proto.InternalMessageInfo // MsgDelegate defines a SDK message for performing a delegation of coins // from a delegator to a validator. type MsgDelegate struct { - DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` - ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` - Amount types1.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` + ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` } func (m *MsgDelegate) Reset() { *m = MsgDelegate{} } @@ -285,10 +285,10 @@ var xxx_messageInfo_MsgDelegateResponse proto.InternalMessageInfo // MsgBeginRedelegate defines a SDK message for performing a redelegation // of coins from a delegator and source validator to a destination validator. type MsgBeginRedelegate struct { - DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` - ValidatorSrcAddress string `protobuf:"bytes,2,opt,name=validator_src_address,json=validatorSrcAddress,proto3" json:"validator_src_address,omitempty"` - ValidatorDstAddress string `protobuf:"bytes,3,opt,name=validator_dst_address,json=validatorDstAddress,proto3" json:"validator_dst_address,omitempty"` - Amount types1.Coin `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount"` + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` + ValidatorSrcAddress string `protobuf:"bytes,2,opt,name=validator_src_address,json=validatorSrcAddress,proto3" json:"validator_src_address,omitempty"` + ValidatorDstAddress string `protobuf:"bytes,3,opt,name=validator_dst_address,json=validatorDstAddress,proto3" json:"validator_dst_address,omitempty"` + Amount types.Coin `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount"` } func (m *MsgBeginRedelegate) Reset() { *m = MsgBeginRedelegate{} } @@ -372,9 +372,9 @@ func (m *MsgBeginRedelegateResponse) GetCompletionTime() time.Time { // MsgUndelegate defines a SDK message for performing an undelegation from a // delegate and a validator. type MsgUndelegate struct { - DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` - ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` - Amount types1.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` + ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` } func (m *MsgUndelegate) Reset() { *m = MsgUndelegate{} } @@ -416,7 +416,7 @@ type MsgUndelegateResponse struct { // amount returns the amount of undelegated coins // // Since: cosmos-sdk 0.50 - Amount types1.Coin `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount"` + Amount types.Coin `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount"` } func (m *MsgUndelegateResponse) Reset() { *m = MsgUndelegateResponse{} } @@ -459,11 +459,11 @@ func (m *MsgUndelegateResponse) GetCompletionTime() time.Time { return time.Time{} } -func (m *MsgUndelegateResponse) GetAmount() types1.Coin { +func (m *MsgUndelegateResponse) GetAmount() types.Coin { if m != nil { return m.Amount } - return types1.Coin{} + return types.Coin{} } // MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator @@ -473,7 +473,7 @@ type MsgCancelUnbondingDelegation struct { DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` // amount is always less than or equal to unbonding delegation entry balance - Amount types1.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` + Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"` // creation_height is the height which the unbonding took place. CreationHeight int64 `protobuf:"varint,4,opt,name=creation_height,json=creationHeight,proto3" json:"creation_height,omitempty"` } @@ -653,8 +653,8 @@ var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo // // Since: cosmos-sdk 0.51 type MsgRotateConsPubKey struct { - ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` - NewPubkey *types.Any `protobuf:"bytes,2,opt,name=new_pubkey,json=newPubkey,proto3" json:"new_pubkey,omitempty"` + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + NewPubkey *any.Any `protobuf:"bytes,2,opt,name=new_pubkey,json=newPubkey,proto3" json:"new_pubkey,omitempty"` } func (m *MsgRotateConsPubKey) Reset() { *m = MsgRotateConsPubKey{} } @@ -2330,7 +2330,7 @@ func (m *MsgCreateValidator) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Pubkey == nil { - m.Pubkey = &types.Any{} + m.Pubkey = &any.Any{} } if err := m.Pubkey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -3871,7 +3871,7 @@ func (m *MsgRotateConsPubKey) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.NewPubkey == nil { - m.NewPubkey = &types.Any{} + m.NewPubkey = &any.Any{} } if err := m.NewPubkey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/x/staking/types/validator.go b/x/staking/types/validator.go index 63ed25456fae..2ce46b00b104 100644 --- a/x/staking/types/validator.go +++ b/x/staking/types/validator.go @@ -7,10 +7,10 @@ import ( "strings" "time" - abci "github.com/cometbft/cometbft/abci/types" cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" "cosmossdk.io/core/address" + "cosmossdk.io/core/appmodule" "cosmossdk.io/errors" "cosmossdk.io/math" @@ -20,7 +20,6 @@ import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/types/module" ) const ( @@ -257,58 +256,32 @@ func (d Description) EnsureLength() (Description, error) { return d, nil } -// ABCIValidatorUpdate returns an abci.ValidatorUpdate from a staking validator type -// with the full validator power -func (v Validator) ABCIValidatorUpdate(r math.Int) abci.ValidatorUpdate { - tmProtoPk, err := v.CmtConsPublicKey() - if err != nil { - panic(err) - } - - return abci.ValidatorUpdate{ - PubKey: tmProtoPk, - Power: v.ConsensusPower(r), - } -} - -// ModuleValidatorUpdate returns a module.ValidatorUpdate from a staking validator type -// with the full validator power -func (v Validator) ModuleValidatorUpdate(r math.Int) module.ValidatorUpdate { +// ModuleValidatorUpdate returns a appmodule.ValidatorUpdate from a staking validator type +// with the full validator power. +// It replaces the previous ABCIValidatorUpdate function. +func (v Validator) ModuleValidatorUpdate(r math.Int) appmodule.ValidatorUpdate { consPk, err := v.ConsPubKey() if err != nil { panic(err) } - return module.ValidatorUpdate{ + return appmodule.ValidatorUpdate{ PubKey: consPk.Bytes(), PubKeyType: consPk.Type(), Power: v.ConsensusPower(r), } } -// ABCIValidatorUpdateZero returns an abci.ValidatorUpdate from a staking validator type -// with zero power used for validator updates. -func (v Validator) ABCIValidatorUpdateZero() abci.ValidatorUpdate { - tmProtoPk, err := v.CmtConsPublicKey() - if err != nil { - panic(err) - } - - return abci.ValidatorUpdate{ - PubKey: tmProtoPk, - Power: 0, - } -} - -// ModuleValidatorUpdateZero returns a module.ValidatorUpdate from a staking validator type +// ModuleValidatorUpdateZero returns a appmodule.ValidatorUpdate from a staking validator type // with zero power used for validator updates. -func (v Validator) ModuleValidatorUpdateZero() module.ValidatorUpdate { +// It replaces the previous ABCIValidatorUpdateZero function. +func (v Validator) ModuleValidatorUpdateZero() appmodule.ValidatorUpdate { consPk, err := v.ConsPubKey() if err != nil { panic(err) } - return module.ValidatorUpdate{ + return appmodule.ValidatorUpdate{ PubKey: consPk.Bytes(), PubKeyType: consPk.Type(), Power: 0, diff --git a/x/staking/types/validator_test.go b/x/staking/types/validator_test.go index 504562eb6e91..4fc7ee7262b5 100644 --- a/x/staking/types/validator_test.go +++ b/x/staking/types/validator_test.go @@ -60,24 +60,6 @@ func TestUpdateDescription(t *testing.T) { require.Equal(t, d, d3) } -func TestABCIValidatorUpdate(t *testing.T) { - validator := newValidator(t, valAddr1, pk1) - abciVal := validator.ABCIValidatorUpdate(sdk.DefaultPowerReduction) - pk, err := validator.TmConsPublicKey() - require.NoError(t, err) - require.Equal(t, pk, abciVal.PubKey) - require.Equal(t, validator.BondedTokens().Int64(), abciVal.Power) -} - -func TestABCIValidatorUpdateZero(t *testing.T) { - validator := newValidator(t, valAddr1, pk1) - abciVal := validator.ABCIValidatorUpdateZero() - pk, err := validator.TmConsPublicKey() - require.NoError(t, err) - require.Equal(t, pk, abciVal.PubKey) - require.Equal(t, int64(0), abciVal.Power) -} - func TestShareTokens(t *testing.T) { validator := mkValidator(100, math.LegacyNewDec(100)) assert.True(math.LegacyDecEq(t, math.LegacyNewDec(50), validator.TokensFromShares(math.LegacyNewDec(50)))) diff --git a/x/tx/CHANGELOG.md b/x/tx/CHANGELOG.md index 4d475d2c64d0..a290d125dd73 100644 --- a/x/tx/CHANGELOG.md +++ b/x/tx/CHANGELOG.md @@ -25,13 +25,29 @@ Types of changes (Stanzas): "Bug Fixes" for any bug fixes. "API Breaking" for breaking exported APIs used by developers building on SDK. Ref: https://keepachangelog.com/en/1.0.0/ + +Since v0.13.0, x/tx follows Cosmos SDK semver: https://github.com/cosmos/cosmos-sdk/blob/main/RELEASES.md --> # Changelog ## [Unreleased] -## v0.13.1 +## [v0.13.2](https://github.com/cosmos/cosmos-sdk/releases/tag/x/tx/v0.13.2) - 2024-04-12 + +### Features + +* [#19786](https://github.com/cosmos/cosmos-sdk/pull/19786)/[#19919](https://github.com/cosmos/cosmos-sdk/pull/19919) Add "inline_json" option to Amino JSON encoder. + +### Improvements + +* [#19845](https://github.com/cosmos/cosmos-sdk/pull/19845) Use hybrid resolver instead of only protov2 registry + +### Bug Fixes + +* [#19955](https://github.com/cosmos/cosmos-sdk/pull/19955) Don't shadow Amino marshalling error messages + +## [v0.13.1](https://github.com/cosmos/cosmos-sdk/releases/tag/x/tx/v0.13.1) - 2024-03-05 ### Features @@ -45,7 +61,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#19265](https://github.com/cosmos/cosmos-sdk/pull/19265) Reject denoms that contain a comma. -## v0.13.0 +## [v0.13.0](https://github.com/cosmos/cosmos-sdk/releases/tag/x/tx/v0.13.0) - 2023-12-19 ### Improvements @@ -113,18 +129,18 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements * [#15871](https://github.com/cosmos/cosmos-sdk/pull/15871) - * `HandlerMap` now has a `DefaultMode()` getter method - * Textual types use `signing.ProtoFileResolver` instead of `protoregistry.Files` + * `HandlerMap` now has a `DefaultMode()` getter method + * Textual types use `signing.ProtoFileResolver` instead of `protoregistry.Files` ## v0.6.0 ### API Breaking * [#15709](https://github.com/cosmos/cosmos-sdk/pull/15709): - * `GetSignersContext` has been renamed to `signing.Context` - * `GetSigners` now returns `[][]byte` instead of `[]string` - * `GetSignersOptions` has been renamed to `signing.Options` and requires `address.Codec`s for account and validator addresses - * `GetSignersOptions.ProtoFiles` has been renamed to `signing.Options.FileResolver` + * `GetSignersContext` has been renamed to `signing.Context` + * `GetSigners` now returns `[][]byte` instead of `[]string` + * `GetSignersOptions` has been renamed to `signing.Options` and requires `address.Codec`s for account and validator addresses + * `GetSignersOptions.ProtoFiles` has been renamed to `signing.Options.FileResolver` ### Bug Fixes diff --git a/x/tx/go.mod b/x/tx/go.mod index 4f89786f559d..ec228c1f89b0 100644 --- a/x/tx/go.mod +++ b/x/tx/go.mod @@ -8,7 +8,7 @@ require ( cosmossdk.io/errors v1.0.1 cosmossdk.io/math v1.3.0 github.com/cosmos/cosmos-proto v1.0.0-beta.4 - github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/gogoproto v1.4.12 github.com/google/go-cmp v0.6.0 github.com/google/gofuzz v1.2.0 github.com/iancoleman/strcase v0.3.0 @@ -22,16 +22,15 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/golang/protobuf v1.5.4 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/sys v0.17.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect - google.golang.org/grpc v1.62.1 // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/grpc v1.63.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/x/tx/go.sum b/x/tx/go.sum index ace680bf4848..70152c091a3c 100644 --- a/x/tx/go.sum +++ b/x/tx/go.sum @@ -8,14 +8,12 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU= github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= -github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/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= @@ -42,23 +40,23 @@ github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoM golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/tx/signing/aminojson/aminojson.go b/x/tx/signing/aminojson/aminojson.go index 5b0d9e4d0547..abcb25d5e818 100644 --- a/x/tx/signing/aminojson/aminojson.go +++ b/x/tx/signing/aminojson/aminojson.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" + gogoproto "github.com/cosmos/gogoproto/proto" "google.golang.org/protobuf/reflect/protoregistry" signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" @@ -31,7 +32,7 @@ type SignModeHandlerOptions struct { func NewSignModeHandler(options SignModeHandlerOptions) *SignModeHandler { h := &SignModeHandler{} if options.FileResolver == nil { - h.fileResolver = protoregistry.GlobalFiles + h.fileResolver = gogoproto.HybridResolver } else { h.fileResolver = options.FileResolver } diff --git a/x/tx/signing/aminojson/encoder.go b/x/tx/signing/aminojson/encoder.go index 07a7c8ea0792..d799eb52e627 100644 --- a/x/tx/signing/aminojson/encoder.go +++ b/x/tx/signing/aminojson/encoder.go @@ -81,6 +81,27 @@ func nullSliceAsEmptyEncoder(enc *Encoder, v protoreflect.Value, w io.Writer) er } } +// cosmosInlineJSON takes bytes and inlines them into a JSON document. +// +// This requires the bytes contain valid JSON since otherwise the resulting document would be invalid. +// Invalid JSON will result in an error. +// +// This replicates the behavior of JSON messages embedded in protobuf bytes +// required for CosmWasm, e.g.: +// https://github.com/CosmWasm/wasmd/blob/08567ff20e372e4f4204a91ca64a371538742bed/x/wasm/types/tx.go#L20-L22 +func cosmosInlineJSON(_ *Encoder, v protoreflect.Value, w io.Writer) error { + switch bz := v.Interface().(type) { + case []byte: + if !json.Valid(bz) { + return errors.New("invalid JSON bytes") + } + _, err := w.Write(bz) + return err + default: + return fmt.Errorf("unsupported type %T", bz) + } +} + // keyFieldEncoder replicates the behavior at described at: // https://github.com/cosmos/cosmos-sdk/blob/b49f948b36bc991db5be431607b475633aed697e/proto/cosmos/crypto/secp256k1/keys.proto#L16 // The message is treated if it were bytes directly without the key field specified. diff --git a/x/tx/signing/aminojson/encoder_test.go b/x/tx/signing/aminojson/encoder_test.go new file mode 100644 index 000000000000..1ebf9990ac38 --- /dev/null +++ b/x/tx/signing/aminojson/encoder_test.go @@ -0,0 +1,94 @@ +package aminojson + +import ( + "bytes" + "testing" + + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/reflect/protoreflect" + "gotest.tools/v3/assert" +) + +func TestCosmosInlineJSON(t *testing.T) { + cases := map[string]struct { + value protoreflect.Value + wantErr bool + wantOutput string + }{ + "supported type - valid JSON object": { + value: protoreflect.ValueOfBytes([]byte(`{"test":"value"}`)), + wantErr: false, + wantOutput: `{"test":"value"}`, + }, + "supported type - valid JSON array": { + // spaces are normalized away + value: protoreflect.ValueOfBytes([]byte(`[1,2,3]`)), + wantErr: false, + wantOutput: `[1,2,3]`, + }, + "supported type - valid JSON is not normalized": { + value: protoreflect.ValueOfBytes([]byte(`[1, 2, 3]`)), + wantErr: false, + wantOutput: `[1, 2, 3]`, + }, + "supported type - valid JSON array (empty)": { + value: protoreflect.ValueOfBytes([]byte(`[]`)), + wantErr: false, + wantOutput: `[]`, + }, + "supported type - valid JSON number": { + value: protoreflect.ValueOfBytes([]byte(`43.72`)), + wantErr: false, + wantOutput: `43.72`, + }, + "supported type - valid JSON boolean": { + value: protoreflect.ValueOfBytes([]byte(`true`)), + wantErr: false, + wantOutput: `true`, + }, + "supported type - valid JSON null": { + value: protoreflect.ValueOfBytes([]byte(`null`)), + wantErr: false, + wantOutput: `null`, + }, + "supported type - valid JSON string": { + value: protoreflect.ValueOfBytes([]byte(`"hey yo"`)), + wantErr: false, + wantOutput: `"hey yo"`, + }, + "supported type - invalid JSON": { + value: protoreflect.ValueOfBytes([]byte(`foo`)), + wantErr: true, + }, + "supported type - invalid JSON (empty)": { + value: protoreflect.ValueOfBytes([]byte(``)), + wantErr: true, + }, + "supported type - invalid JSON (nil bytes)": { + value: protoreflect.ValueOfBytes(nil), + wantErr: true, + }, + "unsupported type - bool": { + value: protoreflect.ValueOfBool(true), + wantErr: true, + }, + "unsupported type - int64": { + value: protoreflect.ValueOfInt64(1), + wantErr: true, + }, + } + + for name, tc := range cases { + t.Run(name, func(t *testing.T) { + var buf bytes.Buffer + err := cosmosInlineJSON(nil, tc.value, &buf) + + if tc.wantErr { + require.Error(t, err) + return + } + require.NoError(t, err) + assert.Equal(t, tc.wantOutput, buf.String()) + }) + } +} diff --git a/x/tx/signing/aminojson/internal/testpb/test.proto b/x/tx/signing/aminojson/internal/testpb/test.proto index 8be5a3dc1362..0bbb999426e6 100644 --- a/x/tx/signing/aminojson/internal/testpb/test.proto +++ b/x/tx/signing/aminojson/internal/testpb/test.proto @@ -20,6 +20,10 @@ message WithAList { repeated string list = 2; } +message WithAJson { + bytes field1 = 1 [(amino.encoding) = "inline_json"]; +} + message ABitOfEverything { option (amino.name) = "ABitOfEverything"; diff --git a/x/tx/signing/aminojson/internal/testpb/test.pulsar.go b/x/tx/signing/aminojson/internal/testpb/test.pulsar.go index 7cc06a47766e..0adf0b573d60 100644 --- a/x/tx/signing/aminojson/internal/testpb/test.pulsar.go +++ b/x/tx/signing/aminojson/internal/testpb/test.pulsar.go @@ -1286,6 +1286,428 @@ func (x *fastReflection_WithAList) ProtoMethods() *protoiface.Methods { } } +var ( + md_WithAJson protoreflect.MessageDescriptor + fd_WithAJson_field1 protoreflect.FieldDescriptor +) + +func init() { + file_testpb_test_proto_init() + md_WithAJson = File_testpb_test_proto.Messages().ByName("WithAJson") + fd_WithAJson_field1 = md_WithAJson.Fields().ByName("field1") +} + +var _ protoreflect.Message = (*fastReflection_WithAJson)(nil) + +type fastReflection_WithAJson WithAJson + +func (x *WithAJson) ProtoReflect() protoreflect.Message { + return (*fastReflection_WithAJson)(x) +} + +func (x *WithAJson) slowProtoReflect() protoreflect.Message { + mi := &file_testpb_test_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_WithAJson_messageType fastReflection_WithAJson_messageType +var _ protoreflect.MessageType = fastReflection_WithAJson_messageType{} + +type fastReflection_WithAJson_messageType struct{} + +func (x fastReflection_WithAJson_messageType) Zero() protoreflect.Message { + return (*fastReflection_WithAJson)(nil) +} +func (x fastReflection_WithAJson_messageType) New() protoreflect.Message { + return new(fastReflection_WithAJson) +} +func (x fastReflection_WithAJson_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_WithAJson +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_WithAJson) Descriptor() protoreflect.MessageDescriptor { + return md_WithAJson +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_WithAJson) Type() protoreflect.MessageType { + return _fastReflection_WithAJson_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_WithAJson) New() protoreflect.Message { + return new(fastReflection_WithAJson) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_WithAJson) Interface() protoreflect.ProtoMessage { + return (*WithAJson)(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_WithAJson) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Field1) != 0 { + value := protoreflect.ValueOfBytes(x.Field1) + if !f(fd_WithAJson_field1, value) { + return + } + } +} + +// 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_WithAJson) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "testpb.WithAJson.field1": + return len(x.Field1) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.WithAJson")) + } + panic(fmt.Errorf("message testpb.WithAJson 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_WithAJson) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "testpb.WithAJson.field1": + x.Field1 = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.WithAJson")) + } + panic(fmt.Errorf("message testpb.WithAJson 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_WithAJson) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "testpb.WithAJson.field1": + value := x.Field1 + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.WithAJson")) + } + panic(fmt.Errorf("message testpb.WithAJson 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_WithAJson) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "testpb.WithAJson.field1": + x.Field1 = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.WithAJson")) + } + panic(fmt.Errorf("message testpb.WithAJson 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_WithAJson) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "testpb.WithAJson.field1": + panic(fmt.Errorf("field field1 of message testpb.WithAJson is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.WithAJson")) + } + panic(fmt.Errorf("message testpb.WithAJson does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_WithAJson) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "testpb.WithAJson.field1": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.WithAJson")) + } + panic(fmt.Errorf("message testpb.WithAJson does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_WithAJson) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in testpb.WithAJson", 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_WithAJson) 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_WithAJson) 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_WithAJson) 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_WithAJson) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*WithAJson) + 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.Field1) + 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().(*WithAJson) + 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.Field1) > 0 { + i -= len(x.Field1) + copy(dAtA[i:], x.Field1) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Field1))) + 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().(*WithAJson) + 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: WithAJson: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: WithAJson: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Field1", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Field1 = append(x.Field1[:0], dAtA[iNdEx:postIndex]...) + if x.Field1 == nil { + x.Field1 = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + var _ protoreflect.List = (*_ABitOfEverything_6_list)(nil) type _ABitOfEverything_6_list struct { @@ -1382,7 +1804,7 @@ func (x *ABitOfEverything) ProtoReflect() protoreflect.Message { } func (x *ABitOfEverything) slowProtoReflect() protoreflect.Message { - mi := &file_testpb_test_proto_msgTypes[2] + mi := &file_testpb_test_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2616,7 +3038,7 @@ func (x *Duration) ProtoReflect() protoreflect.Message { } func (x *Duration) slowProtoReflect() protoreflect.Message { - mi := &file_testpb_test_proto_msgTypes[3] + mi := &file_testpb_test_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3130,7 +3552,7 @@ func (x *NestedMessage) ProtoReflect() protoreflect.Message { } func (x *NestedMessage) slowProtoReflect() protoreflect.Message { - mi := &file_testpb_test_proto_msgTypes[4] + mi := &file_testpb_test_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3716,6 +4138,41 @@ func (x *WithAList) GetList() []string { return nil } +type WithAJson struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Field1 []byte `protobuf:"bytes,1,opt,name=field1,proto3" json:"field1,omitempty"` +} + +func (x *WithAJson) Reset() { + *x = WithAJson{} + if protoimpl.UnsafeEnabled { + mi := &file_testpb_test_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WithAJson) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WithAJson) ProtoMessage() {} + +// Deprecated: Use WithAJson.ProtoReflect.Descriptor instead. +func (*WithAJson) Descriptor() ([]byte, []int) { + return file_testpb_test_proto_rawDescGZIP(), []int{2} +} + +func (x *WithAJson) GetField1() []byte { + if x != nil { + return x.Field1 + } + return nil +} + type ABitOfEverything struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3742,7 +4199,7 @@ type ABitOfEverything struct { func (x *ABitOfEverything) Reset() { *x = ABitOfEverything{} if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_proto_msgTypes[2] + mi := &file_testpb_test_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3756,7 +4213,7 @@ func (*ABitOfEverything) ProtoMessage() {} // Deprecated: Use ABitOfEverything.ProtoReflect.Descriptor instead. func (*ABitOfEverything) Descriptor() ([]byte, []int) { - return file_testpb_test_proto_rawDescGZIP(), []int{2} + return file_testpb_test_proto_rawDescGZIP(), []int{3} } func (x *ABitOfEverything) GetMessage() *NestedMessage { @@ -3883,7 +4340,7 @@ type Duration struct { func (x *Duration) Reset() { *x = Duration{} if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_proto_msgTypes[3] + mi := &file_testpb_test_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3897,7 +4354,7 @@ func (*Duration) ProtoMessage() {} // Deprecated: Use Duration.ProtoReflect.Descriptor instead. func (*Duration) Descriptor() ([]byte, []int) { - return file_testpb_test_proto_rawDescGZIP(), []int{3} + return file_testpb_test_proto_rawDescGZIP(), []int{4} } func (x *Duration) GetDuration() *durationpb.Duration { @@ -3926,7 +4383,7 @@ type NestedMessage struct { func (x *NestedMessage) Reset() { *x = NestedMessage{} if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_proto_msgTypes[4] + mi := &file_testpb_test_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3940,7 +4397,7 @@ func (*NestedMessage) ProtoMessage() {} // Deprecated: Use NestedMessage.ProtoReflect.Descriptor instead. func (*NestedMessage) Descriptor() ([]byte, []int) { - return file_testpb_test_proto_rawDescGZIP(), []int{4} + return file_testpb_test_proto_rawDescGZIP(), []int{5} } func (x *NestedMessage) GetFoo() string { @@ -3989,57 +4446,60 @@ var file_testpb_test_proto_rawDesc = []byte{ 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x11, 0x64, 0x6f, 0x6e, 0x74, 0x4f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x73, - 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x92, 0x03, - 0x0a, 0x10, 0x41, 0x42, 0x69, 0x74, 0x4f, 0x66, 0x45, 0x76, 0x65, 0x72, 0x79, 0x74, 0x68, 0x69, - 0x6e, 0x67, 0x12, 0x2f, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4e, 0x65, 0x73, - 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x12, 0x22, 0x0a, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x0e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x41, 0x6e, 0x45, 0x6e, 0x75, - 0x6d, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x70, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x74, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x73, 0x74, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x6f, 0x6c, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x04, 0x62, 0x6f, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, - 0x65, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x12, - 0x10, 0x0a, 0x03, 0x69, 0x33, 0x32, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x69, 0x33, - 0x32, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x33, 0x32, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x07, 0x52, 0x03, - 0x66, 0x33, 0x32, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x33, 0x32, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x03, 0x75, 0x33, 0x32, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x33, 0x32, 0x18, 0x0d, 0x20, - 0x01, 0x28, 0x11, 0x52, 0x04, 0x73, 0x69, 0x33, 0x32, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x66, 0x33, - 0x32, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0f, 0x52, 0x04, 0x73, 0x66, 0x33, 0x32, 0x12, 0x10, 0x0a, - 0x03, 0x69, 0x36, 0x34, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x69, 0x36, 0x34, 0x12, - 0x10, 0x0a, 0x03, 0x66, 0x36, 0x34, 0x18, 0x10, 0x20, 0x01, 0x28, 0x06, 0x52, 0x03, 0x66, 0x36, - 0x34, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x36, 0x34, 0x18, 0x11, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, - 0x75, 0x36, 0x34, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x36, 0x34, 0x18, 0x12, 0x20, 0x01, 0x28, - 0x12, 0x52, 0x04, 0x73, 0x69, 0x36, 0x34, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x66, 0x36, 0x34, 0x18, - 0x13, 0x20, 0x01, 0x28, 0x10, 0x52, 0x04, 0x73, 0x66, 0x36, 0x34, 0x3a, 0x15, 0x8a, 0xe7, 0xb0, - 0x2a, 0x10, 0x41, 0x42, 0x69, 0x74, 0x4f, 0x66, 0x45, 0x76, 0x65, 0x72, 0x79, 0x74, 0x68, 0x69, - 0x6e, 0x67, 0x22, 0x7b, 0x0a, 0x08, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x35, - 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x64, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, - 0x47, 0x0a, 0x0d, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x12, 0x10, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x66, - 0x6f, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x61, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x03, 0x62, 0x61, 0x72, 0x3a, 0x12, 0x8a, 0xe7, 0xb0, 0x2a, 0x0d, 0x4e, 0x65, 0x73, 0x74, 0x65, - 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2a, 0x29, 0x0a, 0x06, 0x41, 0x6e, 0x45, 0x6e, - 0x75, 0x6d, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, - 0x00, 0x12, 0x07, 0x0a, 0x03, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x57, - 0x4f, 0x10, 0x02, 0x42, 0x83, 0x01, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x70, 0x62, 0x42, 0x09, 0x54, 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x32, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x78, 0x2f, - 0x74, 0x78, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, 0x74, 0x65, 0x73, - 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, - 0x70, 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xe2, 0x02, 0x12, 0x54, 0x65, - 0x73, 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x35, 0x0a, + 0x09, 0x57, 0x69, 0x74, 0x68, 0x41, 0x4a, 0x73, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x06, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x10, 0x9a, 0xe7, 0xb0, 0x2a, + 0x0b, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x52, 0x06, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x31, 0x22, 0x92, 0x03, 0x0a, 0x10, 0x41, 0x42, 0x69, 0x74, 0x4f, 0x66, 0x45, + 0x76, 0x65, 0x72, 0x79, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x12, 0x2f, 0x0a, 0x07, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x65, 0x73, + 0x74, 0x70, 0x62, 0x2e, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x22, 0x0a, 0x04, 0x65, 0x6e, + 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, + 0x62, 0x2e, 0x41, 0x6e, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x1a, + 0x0a, 0x08, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x03, 0x28, 0x05, + 0x52, 0x08, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x74, + 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x74, 0x72, 0x12, 0x12, 0x0a, 0x04, + 0x62, 0x6f, 0x6f, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x62, 0x6f, 0x6f, 0x6c, + 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x33, 0x32, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x03, 0x69, 0x33, 0x32, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x33, 0x32, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x07, 0x52, 0x03, 0x66, 0x33, 0x32, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x33, + 0x32, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x75, 0x33, 0x32, 0x12, 0x12, 0x0a, 0x04, + 0x73, 0x69, 0x33, 0x32, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x11, 0x52, 0x04, 0x73, 0x69, 0x33, 0x32, + 0x12, 0x12, 0x0a, 0x04, 0x73, 0x66, 0x33, 0x32, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0f, 0x52, 0x04, + 0x73, 0x66, 0x33, 0x32, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x36, 0x34, 0x18, 0x0f, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x03, 0x69, 0x36, 0x34, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x36, 0x34, 0x18, 0x10, 0x20, + 0x01, 0x28, 0x06, 0x52, 0x03, 0x66, 0x36, 0x34, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x36, 0x34, 0x18, + 0x11, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x75, 0x36, 0x34, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, + 0x36, 0x34, 0x18, 0x12, 0x20, 0x01, 0x28, 0x12, 0x52, 0x04, 0x73, 0x69, 0x36, 0x34, 0x12, 0x12, + 0x0a, 0x04, 0x73, 0x66, 0x36, 0x34, 0x18, 0x13, 0x20, 0x01, 0x28, 0x10, 0x52, 0x04, 0x73, 0x66, + 0x36, 0x34, 0x3a, 0x15, 0x8a, 0xe7, 0xb0, 0x2a, 0x10, 0x41, 0x42, 0x69, 0x74, 0x4f, 0x66, 0x45, + 0x76, 0x65, 0x72, 0x79, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x22, 0x7b, 0x0a, 0x08, 0x44, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x35, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x47, 0x0a, 0x0d, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x66, 0x6f, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x61, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x62, 0x61, 0x72, 0x3a, 0x12, 0x8a, 0xe7, 0xb0, + 0x2a, 0x0d, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2a, + 0x29, 0x0a, 0x06, 0x41, 0x6e, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x4e, 0x44, + 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x4f, 0x4e, 0x45, 0x10, + 0x01, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x57, 0x4f, 0x10, 0x02, 0x42, 0x83, 0x01, 0x0a, 0x0a, 0x63, + 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x42, 0x09, 0x54, 0x65, 0x73, 0x74, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x78, 0x2f, 0x74, 0x78, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, + 0x73, 0x6f, 0x6e, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, + 0x74, 0x70, 0x62, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, + 0xaa, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, + 0x70, 0x62, 0xe2, 0x02, 0x12, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4055,24 +4515,25 @@ func file_testpb_test_proto_rawDescGZIP() []byte { } var file_testpb_test_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_testpb_test_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_testpb_test_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_testpb_test_proto_goTypes = []interface{}{ (AnEnum)(0), // 0: testpb.AnEnum (*WithAMap)(nil), // 1: testpb.WithAMap (*WithAList)(nil), // 2: testpb.WithAList - (*ABitOfEverything)(nil), // 3: testpb.ABitOfEverything - (*Duration)(nil), // 4: testpb.Duration - (*NestedMessage)(nil), // 5: testpb.NestedMessage - nil, // 6: testpb.WithAMap.StrMapEntry - (*durationpb.Duration)(nil), // 7: google.protobuf.Duration - (*timestamppb.Timestamp)(nil), // 8: google.protobuf.Timestamp + (*WithAJson)(nil), // 3: testpb.WithAJson + (*ABitOfEverything)(nil), // 4: testpb.ABitOfEverything + (*Duration)(nil), // 5: testpb.Duration + (*NestedMessage)(nil), // 6: testpb.NestedMessage + nil, // 7: testpb.WithAMap.StrMapEntry + (*durationpb.Duration)(nil), // 8: google.protobuf.Duration + (*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp } var file_testpb_test_proto_depIdxs = []int32{ - 6, // 0: testpb.WithAMap.str_map:type_name -> testpb.WithAMap.StrMapEntry - 5, // 1: testpb.ABitOfEverything.message:type_name -> testpb.NestedMessage + 7, // 0: testpb.WithAMap.str_map:type_name -> testpb.WithAMap.StrMapEntry + 6, // 1: testpb.ABitOfEverything.message:type_name -> testpb.NestedMessage 0, // 2: testpb.ABitOfEverything.enum:type_name -> testpb.AnEnum - 7, // 3: testpb.Duration.duration:type_name -> google.protobuf.Duration - 8, // 4: testpb.Duration.timestamp:type_name -> google.protobuf.Timestamp + 8, // 3: testpb.Duration.duration:type_name -> google.protobuf.Duration + 9, // 4: testpb.Duration.timestamp:type_name -> google.protobuf.Timestamp 5, // [5:5] is the sub-list for method output_type 5, // [5:5] is the sub-list for method input_type 5, // [5:5] is the sub-list for extension type_name @@ -4111,7 +4572,7 @@ func file_testpb_test_proto_init() { } } file_testpb_test_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ABitOfEverything); i { + switch v := v.(*WithAJson); i { case 0: return &v.state case 1: @@ -4123,7 +4584,7 @@ func file_testpb_test_proto_init() { } } file_testpb_test_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Duration); i { + switch v := v.(*ABitOfEverything); i { case 0: return &v.state case 1: @@ -4135,6 +4596,18 @@ func file_testpb_test_proto_init() { } } file_testpb_test_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Duration); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_testpb_test_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NestedMessage); i { case 0: return &v.state @@ -4153,7 +4626,7 @@ func file_testpb_test_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_testpb_test_proto_rawDesc, NumEnums: 1, - NumMessages: 6, + NumMessages: 7, NumExtensions: 0, NumServices: 0, }, diff --git a/x/tx/signing/aminojson/json_marshal.go b/x/tx/signing/aminojson/json_marshal.go index 800dfc7fd320..f276cb39d23e 100644 --- a/x/tx/signing/aminojson/json_marshal.go +++ b/x/tx/signing/aminojson/json_marshal.go @@ -7,6 +7,7 @@ import ( "io" "sort" + gogoproto "github.com/cosmos/gogoproto/proto" "github.com/pkg/errors" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" @@ -55,7 +56,7 @@ type Encoder struct { // rules. func NewEncoder(options EncoderOptions) Encoder { if options.FileResolver == nil { - options.FileResolver = protoregistry.GlobalFiles + options.FileResolver = gogoproto.HybridResolver } if options.TypeResolver == nil { options.TypeResolver = protoregistry.GlobalTypes @@ -72,6 +73,7 @@ func NewEncoder(options EncoderOptions) Encoder { }, aminoFieldEncoders: map[string]FieldEncoder{ "legacy_coins": nullSliceAsEmptyEncoder, + "inline_json": cosmosInlineJSON, }, protoTypeEncoders: map[string]MessageEncoder{ "google.protobuf.Timestamp": marshalTimestamp, @@ -162,6 +164,9 @@ func (enc Encoder) DefineTypeEncoding(typeURL string, encoder MessageEncoder) En func (enc Encoder) Marshal(message proto.Message) ([]byte, error) { buf := &bytes.Buffer{} err := enc.beginMarshal(message.ProtoReflect(), buf, false) + if err != nil { + return nil, err + } if enc.indent != "" { indentBuf := &bytes.Buffer{} @@ -169,10 +174,10 @@ func (enc Encoder) Marshal(message proto.Message) ([]byte, error) { return nil, err } - return indentBuf.Bytes(), err + return indentBuf.Bytes(), nil } - return buf.Bytes(), err + return buf.Bytes(), nil } func (enc Encoder) beginMarshal(msg protoreflect.Message, writer io.Writer, isAny bool) error { diff --git a/x/tx/signing/aminojson/json_marshal_test.go b/x/tx/signing/aminojson/json_marshal_test.go index be8caf8c7364..a51b83bb49da 100644 --- a/x/tx/signing/aminojson/json_marshal_test.go +++ b/x/tx/signing/aminojson/json_marshal_test.go @@ -210,6 +210,34 @@ func TestMarshalDuration(t *testing.T) { require.Equal(t, `{"duration":"1s"}`, string(bz)) } +func TestWithAJson(t *testing.T) { + encoder := aminojson.NewEncoder(aminojson.EncoderOptions{}) + + // list + msg := &testpb.WithAJson{ + Field1: []byte(`[{"name":"child1"}]`), + } + bz, err := encoder.Marshal(msg) + require.NoError(t, err) + require.Equal(t, `{"field1":[{"name":"child1"}]}`, string(bz)) + + // string + msg = &testpb.WithAJson{ + Field1: []byte(`"hello again"`), + } + bz, err = encoder.Marshal(msg) + require.NoError(t, err) + require.Equal(t, `{"field1":"hello again"}`, string(bz)) + + // object + msg = &testpb.WithAJson{ + Field1: []byte(`{"deeper":{"nesting":1}}`), + } + bz, err = encoder.Marshal(msg) + require.NoError(t, err) + require.Equal(t, `{"field1":{"deeper":{"nesting":1}}}`, string(bz)) +} + func TestIndent(t *testing.T) { encoder := aminojson.NewEncoder(aminojson.EncoderOptions{Indent: " "}) diff --git a/x/tx/signing/context.go b/x/tx/signing/context.go index d90fb4a5cb30..7aca6fd2b1cd 100644 --- a/x/tx/signing/context.go +++ b/x/tx/signing/context.go @@ -5,6 +5,7 @@ import ( "fmt" cosmos_proto "github.com/cosmos/cosmos-proto" + gogoproto "github.com/cosmos/gogoproto/proto" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protodesc" "google.golang.org/protobuf/reflect/protoreflect" @@ -79,7 +80,7 @@ type ProtoFileResolver interface { func NewContext(options Options) (*Context, error) { protoFiles := options.FileResolver if protoFiles == nil { - protoFiles = protoregistry.GlobalFiles + protoFiles = gogoproto.HybridResolver } protoTypes := options.TypeResolver diff --git a/x/tx/signing/textual/handler.go b/x/tx/signing/textual/handler.go index 67ab53a5c095..e31981b9286e 100644 --- a/x/tx/signing/textual/handler.go +++ b/x/tx/signing/textual/handler.go @@ -8,6 +8,7 @@ import ( "reflect" cosmos_proto "github.com/cosmos/cosmos-proto" + gogoproto "github.com/cosmos/gogoproto/proto" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" @@ -71,7 +72,7 @@ func NewSignModeHandler(o SignModeOptions) (*SignModeHandler, error) { return nil, errors.New("coinMetadataQuerier must be non-empty") } if o.FileResolver == nil { - o.FileResolver = protoregistry.GlobalFiles + o.FileResolver = gogoproto.HybridResolver } if o.TypeResolver == nil { o.TypeResolver = protoregistry.GlobalTypes diff --git a/x/upgrade/go.mod b/x/upgrade/go.mod index 5e3ad6c9ac12..dd13036e64c3 100644 --- a/x/upgrade/go.mod +++ b/x/upgrade/go.mod @@ -11,11 +11,11 @@ require ( cosmossdk.io/store v1.0.2 cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 cosmossdk.io/x/gov v0.0.0-20230925135524-a1bc045b3190 - github.com/cometbft/cometbft v0.38.6 + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.4 github.com/cosmos/cosmos-sdk v0.51.0 - github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/gogoproto v1.4.12 github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/hashicorp/go-cleanhttp v0.5.2 @@ -25,8 +25,8 @@ require ( github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.9.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 - google.golang.org/grpc v1.62.1 + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de + google.golang.org/grpc v1.63.2 google.golang.org/protobuf v1.33.0 ) @@ -73,7 +73,7 @@ require ( github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect @@ -129,7 +129,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect @@ -141,13 +141,13 @@ require ( github.com/mtibben/percent v0.2.1 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.0 // indirect github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.19.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.50.0 // indirect + github.com/prometheus/common v0.52.2 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect @@ -176,22 +176,22 @@ require ( go.opentelemetry.io/otel/metric v1.22.0 // indirect go.opentelemetry.io/otel/trace v1.22.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.21.0 // indirect + golang.org/x/crypto v0.22.0 // indirect golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.22.0 // indirect + golang.org/x/net v0.24.0 // indirect golang.org/x/oauth2 v0.18.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.19.0 // indirect + golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.18.0 // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect google.golang.org/api v0.162.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect diff --git a/x/upgrade/go.sum b/x/upgrade/go.sum index d3f21be0cced..3cf1d3b0e9b9 100644 --- a/x/upgrade/go.sum +++ b/x/upgrade/go.sum @@ -320,8 +320,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -343,8 +343,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/cosmos/iavl v1.0.0 h1:bw6t0Mv/mVCJvlMTOPHWLs5uUE3BRBfVWCRelOzl+so= github.com/cosmos/iavl v1.0.0/go.mod h1:CmTGqMnRnucjxbjduneZXT+0vPgNElYvdefjX2q9tYc= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= @@ -364,8 +364,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= @@ -742,8 +742,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -850,8 +850,8 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= @@ -892,8 +892,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= -github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -1075,8 +1075,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1177,8 +1177,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1220,8 +1220,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1317,13 +1317,13 @@ golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1585,12 +1585,12 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1632,8 +1632,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= -google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/x/upgrade/keeper/abci.go b/x/upgrade/keeper/abci.go index 6ef39c8062b0..bd2844dcbf23 100644 --- a/x/upgrade/keeper/abci.go +++ b/x/upgrade/keeper/abci.go @@ -4,7 +4,6 @@ import ( "context" "errors" "fmt" - "time" storetypes "cosmossdk.io/store/types" "cosmossdk.io/x/upgrade/types" @@ -22,7 +21,7 @@ import ( // a migration to be executed if needed upon this switch (migration defined in the new binary) // skipUpgradeHeightArray is a set of block heights for which the upgrade must be skipped func (k Keeper) PreBlocker(ctx context.Context) error { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) + defer telemetry.ModuleMeasureSince(types.ModuleName, telemetry.Now(), telemetry.MetricKeyBeginBlocker) blockHeight := k.environment.HeaderService.GetHeaderInfo(ctx).Height plan, err := k.GetUpgradePlan(ctx) diff --git a/x/upgrade/proto/buf.gen.gogo.yaml b/x/upgrade/proto/buf.gen.gogo.yaml index 9c8ba0a4b1fd..db36231d0c82 100644 --- a/x/upgrade/proto/buf.gen.gogo.yaml +++ b/x/upgrade/proto/buf.gen.gogo.yaml @@ -2,7 +2,7 @@ version: v1 plugins: - name: gocosmos out: .. - opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any - name: grpc-gateway out: .. opt: logtostderr=true,allow_colon_final_segments=true diff --git a/x/upgrade/types/upgrade.pb.go b/x/upgrade/types/upgrade.pb.go index 8bf85395893b..b56040ef2001 100644 --- a/x/upgrade/types/upgrade.pb.go +++ b/x/upgrade/types/upgrade.pb.go @@ -6,11 +6,11 @@ package types import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + any "github.com/cosmos/gogoproto/types/any" _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" @@ -52,7 +52,7 @@ type Plan struct { // Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been // moved to the IBC module in the sub module 02-client. // If this field is not empty, an error will be thrown. - UpgradedClientState *types.Any `protobuf:"bytes,5,opt,name=upgraded_client_state,json=upgradedClientState,proto3" json:"upgraded_client_state,omitempty"` // Deprecated: Do not use. + UpgradedClientState *any.Any `protobuf:"bytes,5,opt,name=upgraded_client_state,json=upgradedClientState,proto3" json:"upgraded_client_state,omitempty"` // Deprecated: Do not use. } func (m *Plan) Reset() { *m = Plan{} } @@ -844,7 +844,7 @@ func (m *Plan) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.UpgradedClientState == nil { - m.UpgradedClientState = &types.Any{} + m.UpgradedClientState = &any.Any{} } if err := m.UpgradedClientState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err