diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index e360907353d9..fab7e3de6060 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -59,7 +59,6 @@ /x/group/ @kocubinski @akhilkumarpilli @cosmos/sdk-core-dev /x/mint/ @lucaslopezf @facundomedica @cosmos/sdk-core-dev /x/nft/ @alpe @lucaslopezf @cosmos/sdk-core-dev -/x/params/ @cosmos/sdk-core-dev # deprecated so whole team /x/protocolpool/ @facundomedica @hieuvubk @alpe @cosmos/sdk-core-dev /x/simulation/ @cosmos/sdk-core-dev # deprecated so whole team /x/slashing/ @testinginprod @raynaudoe @lucaslopezf @cosmos/sdk-core-dev diff --git a/.github/dependabot.yml b/.github/dependabot.yml index cd97261d4e15..68919c4fd69d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -296,15 +296,6 @@ updates: labels: - "A:automerge" - dependencies - - package-ecosystem: gomod - directory: "/x/params" - schedule: - interval: weekly - day: wednesday - time: "03:05" - labels: - - "A:automerge" - - dependencies - package-ecosystem: gomod directory: "/x/auth" schedule: diff --git a/.github/pr_labeler.yml b/.github/pr_labeler.yml index ae243fdddb2a..f42f8cc3aeec 100644 --- a/.github/pr_labeler.yml +++ b/.github/pr_labeler.yml @@ -69,8 +69,6 @@ - x/mint/**/* "C:x/nft": - x/nft/**/* -"C:x/params": - - x/params/**/* "C:x/protocolpool": - x/protocolpool/**/* "C:x/slashing": diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f8440047b6b8..9878ca45fb23 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1136,36 +1136,6 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} with: projectBaseDir: x/evidence/ - test-x-params: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version: "1.23" - check-latest: true - cache: true - cache-dependency-path: x/params/go.sum - - uses: technote-space/get-diff-action@v6.1.2 - id: git_diff - with: - PATTERNS: | - x/params/**/*.go - x/params/go.mod - x/params/go.sum - - name: tests - if: env.GIT_DIFF - run: | - cd x/params - 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/params/ test-x-upgrade: runs-on: ubuntu-latest steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index 8259c4604fa7..8d9abbf8a522 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i ### API Breaking Changes +* (x/params) [#22995](https://github.com/cosmos/cosmos-sdk/pull/22995) Remove `x/params`. Migrate to the new params system introduced in `v0.47` as demonstrated [here](https://github.com/cosmos/cosmos-sdk/blob/main/UPGRADING.md#xparams). * (testutil) [#22392](https://github.com/cosmos/cosmos-sdk/pull/22392) Remove `testutil/network` package. Use the integration framework or systemtests framework instead. ### Deprecated diff --git a/README.md b/README.md index 18e635236824..40ce10e489fa 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ Core dependencies not mentioned here as compatible across all maintained SDK ver See an exhaustive list of core dependencies at [cosmossdk.io](https://cosmossdk.io). | Version | v2 | 0.52.z | 0.50.z | 0.47.z | -| ------------------------ | ----- | --------- | -------------- | ------- | +|--------------------------|-------|-----------|----------------|---------| | cosmossdk.io/core | 1.y.z | 1.y.z | 0.11.z | 0.5.z | | cosmossdk.io/api | 0.8.z | 0.8.z | 0.7.z | 0.3.z | | cosmossdk.io/x/tx | 1.y.z | 1.y.z | < 1.y.z | N/A | @@ -89,7 +89,7 @@ Module Dependencies are the modules that an application may depend on and which > N/A signals that the module was not available in the Cosmos SDK at that time. | Cosmos SDK | v2 | 0.52.z | 0.50.z | -| --------------------------- | ----- | ------ | ------ | +|-----------------------------|-------|--------|--------| | cosmossdk.io/x/accounts | 0.2.z | 0.2.z | N/A | | cosmossdk.io/x/bank | 0.2.z | 0.2.z | X | | cosmossdk.io/x/circuit | 0.2.z | 0.2.z | 0.1.z | @@ -102,6 +102,7 @@ Module Dependencies are the modules that an application may depend on and which | cosmossdk.io/x/group | 0.2.z | 0.2.z | X | | cosmossdk.io/x/mint | 0.2.z | 0.2.z | X | | cosmossdk.io/x/nft | 0.2.z | 0.2.z | 0.1.z | +| cosmossdk.io/x/params | N/A | 0.2.z | X | | cosmossdk.io/x/protocolpool | 0.2.z | 0.2.z | N/A | | cosmossdk.io/x/slashing | 0.2.z | 0.2.z | X | | cosmossdk.io/x/staking | 0.2.z | 0.2.z | X | diff --git a/UPGRADING.md b/UPGRADING.md index 4e6c67a615d7..6479991c121f 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -44,6 +44,15 @@ To be able to simulate nested messages within a transaction, message types conta the nested messages. By implementing this interface, the BaseApp can simulate these nested messages during transaction simulation. --> +### Modules + +#### `x/params` + +The `x/params` module has been removed from the Cosmos SDK. The following [migration](https://github.com/cosmos/cosmos-sdk/blob/828fcf2f05db0c4759ed370852b6dacc589ea472/x/mint/migrations/v2/migrate.go) +and [PR])(https://github.com/cosmos/cosmos-sdk/pull/12363) can be used as a reference for migrating a legacy params module to the supported module-managed params paradigm. + +More information can be found in the [deprecation notice](https://github.com/cosmos/cosmos-sdk/blob/main/UPGRADING.md#xparams). + ## [v0.52.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.52.0-beta.1) Documentation to migrate an application from v0.50.x to server/v2 is available elsewhere. @@ -1276,7 +1285,7 @@ The `params` module was deprecated since v0.46. The Cosmos SDK has migrated away Cosmos SDK modules now store their parameters directly in its respective modules. The `params` module will be removed in `v0.50`, as mentioned [in v0.46 release](https://github.com/cosmos/cosmos-sdk/blob/v0.46.1/UPGRADING.md#xparams). It is strongly encouraged to migrate away from `x/params` before `v0.50`. -When performing a chain migration, the params table must be initizalied manually. This was done in the modules keepers in previous versions. +When performing a chain migration, the params table must be initialized manually. This was done in the modules keepers in previous versions. Have a look at `simapp.RegisterUpgradeHandlers()` for an example. #### `x/crisis` diff --git a/baseapp/params_legacy.go b/baseapp/params_legacy.go deleted file mode 100644 index 1d096a7d0344..000000000000 --- a/baseapp/params_legacy.go +++ /dev/null @@ -1,149 +0,0 @@ -// Deprecated: - -// Legacy types are defined below to aid in the migration of CometBFT consensus -// parameters from use of the now deprecated x/params modules to a new dedicated -// x/consensus module. -// -// Application developers should ensure that they implement their upgrade handler -// correctly such that app.ConsensusParamsKeeper.Set() is called with the values -// returned by GetConsensusParams(). -// -// Example: -// -// baseAppLegacySS := app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable()) -// -// app.UpgradeKeeper.SetUpgradeHandler( -// UpgradeName, -// func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { -// if cp := baseapp.GetConsensusParams(ctx, baseAppLegacySS); cp != nil { -// app.ConsensusParamsKeeper.Set(ctx, cp) -// } else { -// ctx.Logger().Info("warning: consensus parameters are undefined; skipping migration", "upgrade", UpgradeName) -// } -// -// return app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM) -// }, -// ) -// -// Developers can also bypass the use of the legacy Params subspace and set the -// values to app.ConsensusParamsKeeper.Set() explicitly. -// -// Note, for new chains this is not necessary as CometBFT's consensus parameters -// will automatically be set for you in InitChain. - -package baseapp - -import ( - "errors" - "fmt" - - cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -const Paramspace = "baseapp" - -var ( - ParamStoreKeyBlockParams = []byte("BlockParams") - ParamStoreKeyEvidenceParams = []byte("EvidenceParams") - ParamStoreKeyValidatorParams = []byte("ValidatorParams") -) - -type LegacyParamStore interface { - Get(ctx sdk.Context, key []byte, ptr interface{}) - Has(ctx sdk.Context, key []byte) bool -} - -func ValidateBlockParams(i interface{}) error { - v, ok := i.(cmtproto.BlockParams) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - if v.MaxBytes <= 0 { - return fmt.Errorf("block maximum bytes must be positive: %d", v.MaxBytes) - } - - if v.MaxGas < -1 { - return fmt.Errorf("block maximum gas must be greater than or equal to -1: %d", v.MaxGas) - } - - return nil -} - -func ValidateEvidenceParams(i interface{}) error { - v, ok := i.(cmtproto.EvidenceParams) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - if v.MaxAgeNumBlocks <= 0 { - return fmt.Errorf("evidence maximum age in blocks must be positive: %d", v.MaxAgeNumBlocks) - } - - if v.MaxAgeDuration <= 0 { - return fmt.Errorf("evidence maximum age time duration must be positive: %v", v.MaxAgeDuration) - } - - if v.MaxBytes < 0 { - return fmt.Errorf("maximum evidence bytes must be non-negative: %v", v.MaxBytes) - } - - return nil -} - -func ValidateValidatorParams(i interface{}) error { - v, ok := i.(cmtproto.ValidatorParams) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - if len(v.PubKeyTypes) == 0 { - return errors.New("validator allowed pubkey types must not be empty") - } - - return nil -} - -func GetConsensusParams(ctx sdk.Context, paramStore LegacyParamStore) *cmtproto.ConsensusParams { - if paramStore == nil { - return nil - } - - cp := new(cmtproto.ConsensusParams) - - if paramStore.Has(ctx, ParamStoreKeyBlockParams) { - var bp cmtproto.BlockParams - - paramStore.Get(ctx, ParamStoreKeyBlockParams, &bp) - cp.Block = &bp - } - - if paramStore.Has(ctx, ParamStoreKeyEvidenceParams) { - var ep cmtproto.EvidenceParams - - paramStore.Get(ctx, ParamStoreKeyEvidenceParams, &ep) - cp.Evidence = &ep - } - - if paramStore.Has(ctx, ParamStoreKeyValidatorParams) { - var vp cmtproto.ValidatorParams - - paramStore.Get(ctx, ParamStoreKeyValidatorParams, &vp) - cp.Validator = &vp - } - - return cp -} - -func MigrateParams(ctx sdk.Context, lps LegacyParamStore, ps ParamStore) error { - if cp := GetConsensusParams(ctx, lps); cp != nil { - if err := ps.Set(ctx, *cp); err != nil { - return err - } - } else { - ctx.Logger().Info("warning: consensus parameters are undefined; skipping migration") - } - return nil -} diff --git a/buf.work.yaml b/buf.work.yaml index afd7c4ea0d8e..02ac56559034 100644 --- a/buf.work.yaml +++ b/buf.work.yaml @@ -14,7 +14,6 @@ directories: - x/group/proto - x/mint/proto - x/nft/proto - - x/params/proto - x/protocolpool/proto - x/slashing/proto - x/staking/proto diff --git a/go.work.example b/go.work.example index 06807167c58c..87d19b22f66a 100644 --- a/go.work.example +++ b/go.work.example @@ -44,7 +44,6 @@ use ( ./x/group ./x/mint ./x/nft - ./x/params ./x/protocolpool ./x/slashing ./x/staking diff --git a/simapp/v2/go.mod b/simapp/v2/go.mod index 8dd19b9569b1..8d78ba12ee11 100644 --- a/simapp/v2/go.mod +++ b/simapp/v2/go.mod @@ -271,7 +271,6 @@ replace ( cosmossdk.io/x/group => ../../x/group cosmossdk.io/x/mint => ../../x/mint cosmossdk.io/x/nft => ../../x/nft - cosmossdk.io/x/params => ../../x/params cosmossdk.io/x/protocolpool => ../../x/protocolpool cosmossdk.io/x/slashing => ../../x/slashing cosmossdk.io/x/staking => ../../x/staking diff --git a/tests/go.mod b/tests/go.mod index 390fd370e326..c302474f63a8 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -255,7 +255,6 @@ replace ( cosmossdk.io/x/group => ../x/group cosmossdk.io/x/mint => ../x/mint cosmossdk.io/x/nft => ../x/nft - cosmossdk.io/x/params => ../x/params cosmossdk.io/x/protocolpool => ../x/protocolpool cosmossdk.io/x/slashing => ../x/slashing cosmossdk.io/x/staking => ../x/staking diff --git a/x/params/CHANGELOG.md b/x/params/CHANGELOG.md deleted file mode 100644 index d053e72b7f2a..000000000000 --- a/x/params/CHANGELOG.md +++ /dev/null @@ -1,28 +0,0 @@ - - -# Changelog - -## [Unreleased] - -## [v0.2.0-rc.1](https://github.com/cosmos/cosmos-sdk/releases/tag/x/params/v0.2.0-rc.1) - 2024-12-18 diff --git a/x/params/README.md b/x/params/README.md deleted file mode 100644 index 961b1f12836c..000000000000 --- a/x/params/README.md +++ /dev/null @@ -1,79 +0,0 @@ ---- -sidebar_position: 1 ---- - -# `x/params` - -> Note: The Params module has been deprecated in favour of each module housing its own parameters. - -## Abstract - -Package params provides a globally available parameter store. - -There are two main types, Keeper and Subspace. Subspace is an isolated namespace for a -paramstore, where keys are prefixed by preconfigured spacename. Keeper has a -permission to access all existing spaces. - -Subspace can be used by the individual keepers, which need a private parameter store -that the other keepers cannot modify. The params Keeper can be used to add a route to `x/gov` router in order to modify any parameter in case a proposal passes. - -The following contents explains how to use params module for master and user modules. - -## Contents - -* [Keeper](#keeper) -* [Subspace](#subspace) - * [Key](#key) - * [KeyTable](#keytable) - * [ParamSet](#paramset) - -## Keeper - -In the app initialization stage, [subspaces](#subspace) can be allocated for other modules' keeper using `Keeper.Subspace` and are stored in `Keeper.spaces`. Then, those modules can have a reference to their specific parameter store through `Keeper.GetSubspace`. - -Example: - -```go -type ExampleKeeper struct { - paramSpace paramtypes.Subspace -} - -func (k ExampleKeeper) SetParams(ctx sdk.Context, params types.Params) { - k.paramSpace.SetParamSet(ctx, ¶ms) -} -``` - -## Subspace - -`Subspace` is a prefixed subspace of the parameter store. Each module which uses the -parameter store will take a `Subspace` to isolate permission to access. - -### Key - -Parameter keys are human readable alphanumeric strings. A parameter for the key -`"ExampleParameter"` is stored under `[]byte("SubspaceName" + "/" + "ExampleParameter")`, - where `"SubspaceName"` is the name of the subspace. - -Subkeys are secondary parameter keys those are used along with a primary parameter key. -Subkeys can be used for grouping or dynamic parameter key generation during runtime. - -### KeyTable - -All of the parameter keys that will be used should be registered at the compile -time. `KeyTable` is essentially a `map[string]attribute`, where the `string` is a parameter key. - -Currently, `attribute` consists of a `reflect.Type`, which indicates the parameter -type to check that provided key and value are compatible and registered, as well as a function `ValueValidatorFn` to validate values. - -Only primary keys have to be registered on the `KeyTable`. Subkeys inherit the -attribute of the primary key. - -### ParamSet - -Modules often define parameters as a proto message. The generated struct can implement -`ParamSet` interface to be used with the following methods: - -* `KeyTable.RegisterParamSet()`: registers all parameters in the struct -* `Subspace.{Get, Set}ParamSet()`: Get to & Set from the struct - -The implementer should be a pointer in order to use `GetParamSet()`. diff --git a/x/params/autocli.go b/x/params/autocli.go deleted file mode 100644 index d364a0c3c3e6..000000000000 --- a/x/params/autocli.go +++ /dev/null @@ -1,31 +0,0 @@ -package params - -import ( - autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - paramsv1beta1 "cosmossdk.io/api/cosmos/params/v1beta1" -) - -// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. -func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { - return &autocliv1.ModuleOptions{ - Query: &autocliv1.ServiceCommandDescriptor{ - Service: paramsv1beta1.Query_ServiceDesc.ServiceName, - RpcCommandOptions: []*autocliv1.RpcCommandOptions{ - { - RpcMethod: "Params", - Use: "subspace ", - Short: "Query for raw parameters by subspace and key", - PositionalArgs: []*autocliv1.PositionalArgDescriptor{ - {ProtoField: "subspace"}, - {ProtoField: "key"}, - }, - }, - { - RpcMethod: "Subspaces", - Use: "subspaces", - Short: "Query for all registered subspaces and all keys for a subspace", - }, - }, - }, - } -} diff --git a/x/params/client/cli/tx.go b/x/params/client/cli/tx.go deleted file mode 100644 index 02618689d77a..000000000000 --- a/x/params/client/cli/tx.go +++ /dev/null @@ -1,92 +0,0 @@ -package cli - -import ( - "fmt" - "strings" - - "github.com/spf13/cobra" - - govv1beta1 "cosmossdk.io/x/gov/types/v1beta1" - paramscutils "cosmossdk.io/x/params/client/utils" - paramproposal "cosmossdk.io/x/params/types/proposal" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/tx" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/version" -) - -// NewSubmitParamChangeProposalTxCmd returns a CLI command handler for creating -// a parameter change proposal governance transaction. -func NewSubmitParamChangeProposalTxCmd() *cobra.Command { - return &cobra.Command{ - Use: "param-change ", - Args: cobra.ExactArgs(1), - Short: "Submit a parameter change proposal", - Long: strings.TrimSpace( - fmt.Sprintf(`Submit a parameter proposal along with an initial deposit. -The proposal details must be supplied via a JSON file. For values that contains -objects, only non-empty fields will be updated. - -IMPORTANT: Currently parameter changes are evaluated but not validated, so it is -very important that any "value" change is valid (ie. correct type and within bounds) -for its respective parameter, eg. "MaxValidators" should be an integer and not a decimal. - -Proper vetting of a parameter change proposal should prevent this from happening -(no deposits should occur during the governance process), but it should be noted -regardless. - -Example: -$ %s tx gov submit-proposal param-change --from= - -Where proposal.json contains: - -{ - "title": "Staking Param Change", - "description": "Update max validators", - "changes": [ - { - "subspace": "staking", - "key": "MaxValidators", - "value": 105 - } - ], - "deposit": "1000stake" -} -`, - version.AppName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - proposal, err := paramscutils.ParseParamChangeProposalJSON(clientCtx.LegacyAmino, args[0]) - if err != nil { - return err - } - - from, err := clientCtx.AddressCodec.BytesToString(clientCtx.GetFromAddress()) - if err != nil { - return err - } - - content := paramproposal.NewParameterChangeProposal( - proposal.Title, proposal.Description, proposal.Changes.ToParamChanges(), - ) - - deposit, err := sdk.ParseCoinsNormalized(proposal.Deposit) - if err != nil { - return err - } - - msg, err := govv1beta1.NewMsgSubmitProposal(content, deposit, from) - if err != nil { - return err - } - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } -} diff --git a/x/params/client/cli/tx_test.go b/x/params/client/cli/tx_test.go deleted file mode 100644 index c124c4c6ea2c..000000000000 --- a/x/params/client/cli/tx_test.go +++ /dev/null @@ -1,43 +0,0 @@ -package cli - -import ( - "testing" - - "github.com/stretchr/testify/require" - - "cosmossdk.io/x/params/client/utils" - - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/testutil" -) - -func TestParseProposal(t *testing.T) { - cdc := codec.NewLegacyAmino() - okJSON := testutil.WriteToNewTempFile(t, ` -{ - "title": "Staking Param Change", - "description": "Update max validators", - "changes": [ - { - "subspace": "staking", - "key": "MaxValidators", - "value": 1 - } - ], - "deposit": "1000stake" -} -`) - proposal, err := utils.ParseParamChangeProposalJSON(cdc, okJSON.Name()) - require.NoError(t, err) - - require.Equal(t, "Staking Param Change", proposal.Title) - require.Equal(t, "Update max validators", proposal.Description) - require.Equal(t, "1000stake", proposal.Deposit) - require.Equal(t, utils.ParamChangesJSON{ - { - Subspace: "staking", - Key: "MaxValidators", - Value: []byte{0x31}, - }, - }, proposal.Changes) -} diff --git a/x/params/client/proposal_handler.go b/x/params/client/proposal_handler.go deleted file mode 100644 index 6137d2382984..000000000000 --- a/x/params/client/proposal_handler.go +++ /dev/null @@ -1,9 +0,0 @@ -package client - -import ( - govclient "cosmossdk.io/x/gov/client" - "cosmossdk.io/x/params/client/cli" -) - -// ProposalHandler is the param change proposal handler. -var ProposalHandler = govclient.NewProposalHandler(cli.NewSubmitParamChangeProposalTxCmd) diff --git a/x/params/client/utils/utils.go b/x/params/client/utils/utils.go deleted file mode 100644 index b5fb6f579ef4..000000000000 --- a/x/params/client/utils/utils.go +++ /dev/null @@ -1,69 +0,0 @@ -package utils - -import ( - "encoding/json" - "os" - - "cosmossdk.io/x/params/types/proposal" - - "github.com/cosmos/cosmos-sdk/codec" -) - -type ( - // ParamChangesJSON defines a slice of ParamChangeJSON objects which can be - // converted to a slice of ParamChange objects. - ParamChangesJSON []ParamChangeJSON - - // ParamChangeJSON defines a parameter change used in JSON input. This - // allows values to be specified in raw JSON instead of being string encoded. - ParamChangeJSON struct { - Subspace string `json:"subspace" yaml:"subspace"` - Key string `json:"key" yaml:"key"` - Value json.RawMessage `json:"value" yaml:"value"` - } - - // ParamChangeProposalJSON defines a ParameterChangeProposal with a deposit used - // to parse parameter change proposals from a JSON file. - ParamChangeProposalJSON struct { - Title string `json:"title" yaml:"title"` - Description string `json:"description" yaml:"description"` - Changes ParamChangesJSON `json:"changes" yaml:"changes"` - Deposit string `json:"deposit" yaml:"deposit"` - } -) - -func NewParamChangeJSON(subspace, key string, value json.RawMessage) ParamChangeJSON { - return ParamChangeJSON{subspace, key, value} -} - -// ToParamChange converts a ParamChangeJSON object to ParamChange. -func (pcj ParamChangeJSON) ToParamChange() proposal.ParamChange { - return proposal.NewParamChange(pcj.Subspace, pcj.Key, string(pcj.Value)) -} - -// ToParamChanges converts a slice of ParamChangeJSON objects to a slice of -// ParamChange. -func (pcj ParamChangesJSON) ToParamChanges() []proposal.ParamChange { - res := make([]proposal.ParamChange, len(pcj)) - for i, pc := range pcj { - res[i] = pc.ToParamChange() - } - return res -} - -// ParseParamChangeProposalJSON reads and parses a ParamChangeProposalJSON from -// file. -func ParseParamChangeProposalJSON(cdc *codec.LegacyAmino, proposalFile string) (ParamChangeProposalJSON, error) { - proposal := ParamChangeProposalJSON{} - - contents, err := os.ReadFile(proposalFile) - if err != nil { - return proposal, err - } - - if err := cdc.UnmarshalJSON(contents, &proposal); err != nil { - return proposal, err - } - - return proposal, nil -} diff --git a/x/params/client/utils/utils_test.go b/x/params/client/utils/utils_test.go deleted file mode 100644 index c19857339b42..000000000000 --- a/x/params/client/utils/utils_test.go +++ /dev/null @@ -1,32 +0,0 @@ -package utils - -import ( - "encoding/json" - "testing" - - "github.com/stretchr/testify/require" -) - -func TestNewParamChangeJSON(t *testing.T) { - pcj := NewParamChangeJSON("subspace", "key", json.RawMessage(`{}`)) - require.Equal(t, "subspace", pcj.Subspace) - require.Equal(t, "key", pcj.Key) - require.Equal(t, json.RawMessage(`{}`), pcj.Value) -} - -func TestToParamChanges(t *testing.T) { - pcj1 := NewParamChangeJSON("subspace", "key1", json.RawMessage(`{}`)) - pcj2 := NewParamChangeJSON("subspace", "key2", json.RawMessage(`{}`)) - pcjs := ParamChangesJSON{pcj1, pcj2} - - paramChanges := pcjs.ToParamChanges() - require.Len(t, paramChanges, 2) - - require.Equal(t, paramChanges[0].Subspace, pcj1.Subspace) - require.Equal(t, paramChanges[0].Key, pcj1.Key) - require.Equal(t, paramChanges[0].Value, string(pcj1.Value)) - - require.Equal(t, paramChanges[1].Subspace, pcj2.Subspace) - require.Equal(t, paramChanges[1].Key, pcj2.Key) - require.Equal(t, paramChanges[1].Value, string(pcj2.Value)) -} diff --git a/x/params/depinject.go b/x/params/depinject.go deleted file mode 100644 index ad94b5c1d410..000000000000 --- a/x/params/depinject.go +++ /dev/null @@ -1,71 +0,0 @@ -package params - -import ( - modulev1 "cosmossdk.io/api/cosmos/params/module/v1" - "cosmossdk.io/core/appmodule" - "cosmossdk.io/depinject" - "cosmossdk.io/depinject/appconfig" - store "cosmossdk.io/store/types" - govv1beta1 "cosmossdk.io/x/gov/types/v1beta1" - "cosmossdk.io/x/params/keeper" - "cosmossdk.io/x/params/types" - "cosmossdk.io/x/params/types/proposal" - - "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, - ProvideSubspace, - )) -} - -type ModuleInputs struct { - depinject.In - - KvStoreKey *store.KVStoreKey - TransientStoreKey *store.TransientStoreKey - Cdc codec.Codec - LegacyAmino *codec.LegacyAmino -} - -type ModuleOutputs struct { - depinject.Out - - ParamsKeeper keeper.Keeper - Module appmodule.AppModule - GovHandler govv1beta1.HandlerRoute -} - -func ProvideModule(in ModuleInputs) ModuleOutputs { - k := keeper.NewKeeper(in.Cdc, in.LegacyAmino, in.KvStoreKey, in.TransientStoreKey) - - m := NewAppModule(k) - govHandler := govv1beta1.HandlerRoute{RouteKey: proposal.RouterKey, Handler: NewParamChangeProposalHandler(k)} - - return ModuleOutputs{ParamsKeeper: k, Module: m, GovHandler: govHandler} -} - -type SubspaceInputs struct { - depinject.In - - Key depinject.ModuleKey - Keeper keeper.Keeper - KeyTables map[string]types.KeyTable -} - -func ProvideSubspace(in SubspaceInputs) types.Subspace { - moduleName := in.Key.Name() - kt, exists := in.KeyTables[moduleName] - if !exists { - return in.Keeper.Subspace(moduleName) - } - return in.Keeper.Subspace(moduleName).WithKeyTable(kt) -} diff --git a/x/params/doc.go b/x/params/doc.go deleted file mode 100644 index 2a79b0fd51a6..000000000000 --- a/x/params/doc.go +++ /dev/null @@ -1,110 +0,0 @@ -/* -Package params provides a namespaced module parameter store. - -There are two core components, Keeper and Subspace. Subspace is an isolated -namespace for a parameter store, where keys are prefixed by pre-configured -subspace names which modules provide. The Keeper has a permission to access all -existing subspaces. - -Subspace can be used by the individual keepers, which need a private parameter store -that the other keepers cannot modify. - -Basic Usage: - -1. Declare constant module parameter keys and the globally unique Subspace name: - - const ( - ModuleSubspace = "mymodule" - ) - - const ( - KeyParameter1 = "myparameter1" - KeyParameter2 = "myparameter2" - ) - -2. Define parameters as proto message and define the validation functions: - - message MyParams { - int64 my_param1 = 1; - bool my_param2 = 2; - } - - func validateMyParam1(i interface{}) error { - _, ok := i.(int64) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - // validate (if necessary)... - - return nil - } - - func validateMyParam2(i interface{}) error { - _, ok := i.(bool) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - // validate (if necessary)... - - return nil - } - -3. Implement the params.ParamSet interface: - - func (p *MyParams) ParamSetPairs() params.ParamSetPairs { - return params.ParamSetPairs{ - params.NewParamSetPair(KeyParameter1, &p.MyParam1, validateMyParam1), - params.NewParamSetPair(KeyParameter2, &p.MyParam2, validateMyParam2), - } - } - - func ParamKeyTable() params.KeyTable { - return params.NewKeyTable().RegisterParamSet(&MyParams{}) - } - -4. Have the module accept a Subspace in the constructor and set the KeyTable (if necessary): - - func NewKeeper(..., paramSpace params.Subspace, ...) Keeper { - // set KeyTable if it has not already been set - if !paramSpace.HasKeyTable() { - paramSpace = paramSpace.WithKeyTable(ParamKeyTable()) - } - - return Keeper { - // ... - paramSpace: paramSpace, - } - } - -Now we have access to the module's parameters that are namespaced using the keys defined: - - func InitGenesis(ctx sdk.Context, k Keeper, gs GenesisState) { - // ... - k.SetParams(ctx, gs.Params) - } - - func (k Keeper) SetParams(ctx sdk.Context, params Params) { - k.paramSpace.SetParamSet(ctx, ¶ms) - } - - func (k Keeper) GetParams(ctx sdk.Context) (params Params) { - k.paramSpace.GetParamSet(ctx, ¶ms) - return params - } - - func (k Keeper) MyParam1(ctx sdk.Context) (res int64) { - k.paramSpace.Get(ctx, KeyParameter1, &res) - return res - } - - func (k Keeper) MyParam2(ctx sdk.Context) (res bool) { - k.paramSpace.Get(ctx, KeyParameter2, &res) - return res - } - -NOTE: Any call to SetParamSet will panic or any call to Update will error if any -given parameter value is invalid based on the registered value validation function. -*/ -package params diff --git a/x/params/go.mod b/x/params/go.mod deleted file mode 100644 index 14e4aaef03c5..000000000000 --- a/x/params/go.mod +++ /dev/null @@ -1,168 +0,0 @@ -module cosmossdk.io/x/params - -go 1.23.3 - -require ( - cosmossdk.io/api v0.8.0-rc.3 - cosmossdk.io/core v1.0.0-alpha.6 - cosmossdk.io/core/testing v0.0.1 - cosmossdk.io/depinject v1.1.0 - cosmossdk.io/errors v1.0.1 - cosmossdk.io/log v1.5.0 - cosmossdk.io/math v1.4.0 - cosmossdk.io/store v1.10.0-rc.1 - cosmossdk.io/x/gov v0.0.0-20230925135524-a1bc045b3190 - github.com/cometbft/cometbft/api v1.0.0 - github.com/cosmos/cosmos-proto v1.0.0-beta.5 - github.com/cosmos/cosmos-sdk v0.53.0 - github.com/cosmos/gogoproto v1.7.0 - github.com/golang/protobuf v1.5.4 - github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/spf13/cobra v1.8.1 - github.com/stretchr/testify v1.10.0 - go.uber.org/mock v0.5.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 - google.golang.org/grpc v1.68.1 -) - -require ( - buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.36.0-20241120201313-68e42a58b301.1 // indirect - buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.36.0-20240130113600-88ef6483f90f.1 // indirect - cosmossdk.io/collections v1.0.0-rc.1 // indirect - cosmossdk.io/schema v1.0.0 // indirect - cosmossdk.io/x/tx v1.0.0-alpha.3 // indirect - filippo.io/edwards25519 v1.1.0 // indirect - github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect - github.com/99designs/keyring v1.2.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.2.0 // indirect - github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect - github.com/bytedance/sonic v1.12.6 // indirect - github.com/bytedance/sonic/loader v0.2.1 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/cloudwego/base64x v0.1.4 // indirect - github.com/cloudwego/iasm v0.2.0 // indirect - github.com/cockroachdb/errors v1.11.3 // indirect - github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect - github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v1.1.2 // indirect - github.com/cockroachdb/redact v1.1.5 // indirect - github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v1.0.0 // indirect - github.com/cometbft/cometbft-db v1.0.1 // indirect - github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/go-bip39 v1.0.0 // indirect - github.com/cosmos/iavl v1.3.4 // indirect - github.com/cosmos/ics23/go v0.11.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.14.0 // indirect - github.com/danieljoos/wincred v1.2.1 // indirect - github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect - github.com/dgraph-io/badger/v4 v4.5.0 // indirect - github.com/dgraph-io/ristretto/v2 v2.0.0 // indirect - github.com/dustin/go-humanize v1.0.1 // indirect - github.com/dvsekhvalnov/jose2go v1.6.0 // indirect - github.com/emicklei/dot v1.6.2 // indirect - github.com/fatih/color v1.18.0 // indirect - github.com/fsnotify/fsnotify v1.8.0 // indirect - github.com/getsentry/sentry-go v0.27.0 // indirect - github.com/go-kit/log v0.2.1 // indirect - github.com/go-logfmt/logfmt v0.6.0 // indirect - github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect - github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/snappy v0.0.4 // indirect - github.com/google/btree v1.1.3 // indirect - github.com/google/flatbuffers v24.3.25+incompatible // indirect - github.com/google/go-cmp v0.6.0 // indirect - github.com/gorilla/websocket v1.5.3 // indirect - github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect - github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect - github.com/hashicorp/go-hclog v1.6.3 // indirect - github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-metrics v0.5.3 // indirect - github.com/hashicorp/go-plugin v1.6.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.2 // indirect - github.com/hdevalence/ed25519consensus v0.2.0 // indirect - github.com/huandu/skiplist v1.2.1 // indirect - github.com/iancoleman/strcase v0.3.0 // indirect - github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.11 // indirect - github.com/klauspost/cpuid/v2 v2.2.9 // indirect - github.com/kr/pretty v0.3.1 // indirect - github.com/kr/text v0.2.0 // indirect - github.com/linxGnu/grocksdb v1.9.3 // indirect - github.com/magiconair/properties v1.8.9 // indirect - github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/mtibben/percent v0.2.1 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect - github.com/oklog/run v1.1.0 // indirect - github.com/pelletier/go-toml/v2 v2.2.3 // indirect - github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect - github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.20.5 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.61.0 // indirect - github.com/prometheus/procfs v0.15.1 // indirect - github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.12.0 // indirect - github.com/rs/zerolog v1.33.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.5 // indirect - github.com/sourcegraph/conc v0.3.0 // indirect - github.com/spf13/afero v1.11.0 // indirect - github.com/spf13/cast v1.7.1 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.19.0 // indirect - github.com/subosito/gotenv v1.6.0 // indirect - github.com/supranational/blst v0.3.13 // 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/twitchyliquid64/golang-asm v0.15.1 // 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.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect - go.opencensus.io v0.24.0 // indirect - go.uber.org/multierr v1.11.0 // indirect - golang.org/x/arch v0.12.0 // indirect - golang.org/x/crypto v0.31.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/mod v0.22.0 // indirect - golang.org/x/net v0.32.0 // indirect - golang.org/x/sync v0.10.0 // indirect - golang.org/x/sys v0.28.0 // indirect - golang.org/x/term v0.27.0 // indirect - golang.org/x/text v0.21.0 // indirect - golang.org/x/tools v0.27.0 // indirect - google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a // indirect - google.golang.org/protobuf v1.36.0 // indirect - gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect - gotest.tools/v3 v3.5.1 // indirect - pgregory.net/rapid v1.1.0 // indirect - sigs.k8s.io/yaml v1.4.0 // indirect -) - -replace github.com/cosmos/cosmos-sdk => ../.. - -// TODO remove post spinning out all modules -replace ( - cosmossdk.io/x/bank => ../bank - cosmossdk.io/x/gov => ../gov - cosmossdk.io/x/staking => ../staking -) diff --git a/x/params/go.sum b/x/params/go.sum deleted file mode 100644 index 01679f9dbfb3..000000000000 --- a/x/params/go.sum +++ /dev/null @@ -1,648 +0,0 @@ -buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.36.0-20241120201313-68e42a58b301.1 h1:LBP+N3ehp1hseHYlIIHlU0gMM3aGYDcgx/H//Pk12ko= -buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.36.0-20241120201313-68e42a58b301.1/go.mod h1:pab5p7+q6IAI+R+Z2MQ+hP7ZV+FP2mcbucv6xs5WFPk= -buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.36.0-20240130113600-88ef6483f90f.1 h1:5wJBiYyPUS2xpqLJKm7ZEKx1VhesPOXXx5y+JxgVSX4= -buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.36.0-20240130113600-88ef6483f90f.1/go.mod h1:VItWFs9dzQsqOin45pYbA4O/SRdqMPDs4XPZBHL+u2w= -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/api v0.8.0-rc.3 h1:BNVMqBO7jO20fQCLKzAYLI9RPTq9bVn30ncq9vF8SBk= -cosmossdk.io/api v0.8.0-rc.3/go.mod h1:1hADc5N9rDJ4RTH7z3sp6+PXI+shznzk0Frf0/k3ilE= -cosmossdk.io/collections v1.0.0-rc.1 h1:Mzv0YKZJ6aloy4oSnMnyl8b6PtM2dTdDlzRR/079TyM= -cosmossdk.io/collections v1.0.0-rc.1/go.mod h1:nOgrEpyMFOWBy8QmSbq/T6Tgtm2IyOFvxDRWk+DI97k= -cosmossdk.io/core v1.0.0-alpha.6 h1:5ukC4JcQKmemLQXcAgu/QoOvJI50hpBkIIg4ZT2EN8E= -cosmossdk.io/core v1.0.0-alpha.6/go.mod h1:3u9cWq1FAVtiiCrDPpo4LhR+9V6k/ycSG4/Y/tREWCY= -cosmossdk.io/core/testing v0.0.1 h1:gYCTaftcRrz+HoNXmK7r9KgbG1jgBJ8pNzm/Pa/erFQ= -cosmossdk.io/core/testing v0.0.1/go.mod h1:2VDNz/25qtxgPa0+j8LW5e8Ev/xObqoJA7QuJS9/wIQ= -cosmossdk.io/depinject v1.1.0 h1:wLan7LG35VM7Yo6ov0jId3RHWCGRhe8E8bsuARorl5E= -cosmossdk.io/depinject v1.1.0/go.mod h1:kkI5H9jCGHeKeYWXTqYdruogYrEeWvBQCw1Pj4/eCFI= -cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= -cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= -cosmossdk.io/log v1.5.0 h1:dVdzPJW9kMrnAYyMf1duqacoidB9uZIl+7c6z0mnq0g= -cosmossdk.io/log v1.5.0/go.mod h1:Tr46PUJjiUthlwQ+hxYtUtPn4D/oCZXAkYevBeh5+FI= -cosmossdk.io/math v1.4.0 h1:XbgExXFnXmF/CccPPEto40gOO7FpWu9yWNAZPN3nkNQ= -cosmossdk.io/math v1.4.0/go.mod h1:O5PkD4apz2jZs4zqFdTr16e1dcaQCc5z6lkEnrrppuk= -cosmossdk.io/schema v1.0.0 h1:/diH4XJjpV1JQwuIozwr+A4uFuuwanFdnw2kKeiXwwQ= -cosmossdk.io/schema v1.0.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ= -cosmossdk.io/store v1.10.0-rc.1 h1:/YVPJLre7lt/QDbl90k95TLt+IvafF1sHaU6WHd/rpc= -cosmossdk.io/store v1.10.0-rc.1/go.mod h1:eZNgZKvZRlDUk8CE3LTDVMAcSM7zLOet2S8fByQkF3s= -cosmossdk.io/x/tx v1.0.0-alpha.3 h1:+55/JFH5QRqnFhOI2heH3DKsaNL0RpXcJOQNzUvHiaQ= -cosmossdk.io/x/tx v1.0.0-alpha.3/go.mod h1:h4pQ/j6Gfu8goB1R3Jbl4qY4RjYVNAsoylcleTXdSRg= -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/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -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/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/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/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.2.0 h1:tgObeVOf8WAvtuAX6DhJ4xks4CFNwPDZiqzGqIHE51E= -github.com/bgentry/speakeasy v0.2.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= -github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= -github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/AYFd6c= -github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= -github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= -github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= -github.com/bytedance/sonic v1.12.6 h1:/isNmCUF2x3Sh8RAp/4mh4ZGkcFAX/hLrzrK3AvpRzk= -github.com/bytedance/sonic v1.12.6/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk= -github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= -github.com/bytedance/sonic/loader v0.2.1 h1:1GgorWTqf12TA8mma4DDSbaQigE2wOgQo7iCjjJv3+E= -github.com/bytedance/sonic/loader v0.2.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= -github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y= -github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= -github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= -github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= -github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= -github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= -github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= -github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= -github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= -github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v1.1.2 h1:CUh2IPtR4swHlEj48Rhfzw6l/d0qA31fItcIszQVIsA= -github.com/cockroachdb/pebble v1.1.2/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= -github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= -github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= -github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= -github.com/cometbft/cometbft v1.0.0 h1:6Lihx2hP2BwZ/9ybNp3r4QdiV8e4uBYm+rE45GGH8HU= -github.com/cometbft/cometbft v1.0.0/go.mod h1:+hGB2I4vhCEwdceY35lf75XZZzMtm3VDOVt8hj7qkCs= -github.com/cometbft/cometbft-db v1.0.1 h1:SylKuLseMLQKw3+i8y8KozZyJcQSL98qEe2CGMCGTYE= -github.com/cometbft/cometbft-db v1.0.1/go.mod h1:EBrFs1GDRiTqrWXYi4v90Awf/gcdD5ExzdPbg4X8+mk= -github.com/cometbft/cometbft/api v1.0.0 h1:gGBwvsJi/gnHJEtwYfjPIGs2AKg/Vfa1ZuKCPD1/Ko4= -github.com/cometbft/cometbft/api v1.0.0/go.mod h1:EkQiqVSu/p2ebrZEnB2z6Re7r8XNe//M7ylR0qEwWm0= -github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= -github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= -github.com/cosmos/cosmos-db v1.1.1 h1:FezFSU37AlBC8S98NlSagL76oqBRWq/prTPvFcEJNCM= -github.com/cosmos/cosmos-db v1.1.1/go.mod h1:AghjcIPqdhSLP/2Z0yha5xPH3nLnskz81pBx3tcVSAw= -github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= -github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= -github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= -github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= -github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= -github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= -github.com/cosmos/iavl v1.3.4 h1:A0RUAms7TZ0L6EFrrBIPg4Dy7qD9vvD5lJKUxEXURLM= -github.com/cosmos/iavl v1.3.4/go.mod h1:T6SfBcyhulVIY2G/ZtAtQm/QiJvsuhIos52V4dWYk88= -github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= -github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= -github.com/cosmos/ledger-cosmos-go v0.14.0 h1:WfCHricT3rPbkPSVKRH+L4fQGKYHuGOK9Edpel8TYpE= -github.com/cosmos/ledger-cosmos-go v0.14.0/go.mod h1:E07xCWSBl3mTGofZ2QnL4cIUzMbbGVyik84QYKbX3RA= -github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/danieljoos/wincred v1.2.1 h1:dl9cBrupW8+r5250DYkYxocLeZ1Y4vB1kxgtjxw8GQs= -github.com/danieljoos/wincred v1.2.1/go.mod h1:uGaFL9fDn3OLTvzCGulzE+SzjEe5NGlh5FdCcyfPwps= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1/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/dgraph-io/badger/v4 v4.5.0 h1:TeJE3I1pIWLBjYhIYCA1+uxrjWEoJXImFBMEBVSm16g= -github.com/dgraph-io/badger/v4 v4.5.0/go.mod h1:ysgYmIeG8dS/E8kwxT7xHyc7MkmwNYLRoYnFbr7387A= -github.com/dgraph-io/ristretto/v2 v2.0.0 h1:l0yiSOtlJvc0otkqyMaDNysg8E9/F/TYZwMbxscNOAQ= -github.com/dgraph-io/ristretto/v2 v2.0.0/go.mod h1:FVFokF2dRqXyPyeMnK1YDy8Fc6aTe0IKgbcd03CYeEk= -github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= -github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/dustin/go-humanize v1.0.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/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= -github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= -github.com/envoyproxy/go-control-plane v0.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/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= -github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= -github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= -github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= -github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= -github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= -github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= -github.com/getsentry/sentry-go v0.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/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= -github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-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-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/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/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.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.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= -github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= -github.com/google/flatbuffers v24.3.25+incompatible h1:CX395cjN9Kke9mmalRoL3d81AtFUxJM+yDthflgJGkI= -github.com/google/flatbuffers v24.3.25+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5/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/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= -github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/grpc-ecosystem/go-grpc-middleware v1.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/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= -github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= -github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= -github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= -github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-metrics v0.5.3 h1:M5uADWMOGCTUNU1YuC4hfknOeHNaX54LDm4oYSucoNE= -github.com/hashicorp/go-metrics v0.5.3/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= -github.com/hashicorp/go-plugin v1.6.2 h1:zdGAEd0V1lCaU0u+MxWQhtSDQmahpkwOun8U8EiRVog= -github.com/hashicorp/go-plugin v1.6.2/go.mod h1:CkgLQ5CZqNmdL9U9JzM532t8ZiYQ35+pj3b1FD37R0Q= -github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-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/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/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= -github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= -github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/yamux v0.1.2 h1:XtB8kyFOyHXYVFnwT5C3+Bdo8gArse7j2AQ0DA0Uey8= -github.com/hashicorp/yamux v0.1.2/go.mod h1:C+zze2n6e/7wshOZep2A70/aQU6QBRWJO/G6FT1wIns= -github.com/hdevalence/ed25519consensus v0.2.0 h1:37ICyZqdyj0lAZ8P4D1d1id3HqbbG1N3iBb1Tb4rdcU= -github.com/hdevalence/ed25519consensus v0.2.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3c= -github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0JrPVhn/06U= -github.com/huandu/skiplist v1.2.1 h1:dTi93MgjwErA/8idWTzIw4Y1kZsMWx35fmI2c8Rij7w= -github.com/huandu/skiplist v1.2.1/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= -github.com/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/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= -github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/jhump/protoreflect v1.17.0 h1:qOEr613fac2lOuTgWN4tPAtLL7fUSbuJL5X5XumQh94= -github.com/jhump/protoreflect v1.17.0/go.mod h1:h9+vUUL38jiBzck8ck+6G/aeMX8Z4QUY/NiJPwPNi+8= -github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= -github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -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.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= -github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= -github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.2.9 h1:66ze0taIn2H33fBvCkXuv9BmCwDfafmiIVpKV9kKGuY= -github.com/klauspost/cpuid/v2 v2.2.9/go.mod h1:rqkxqrZ1EhYM9G+hXH7YdowN5R5RGN6NK4QwQ3WMXF8= -github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/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/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= -github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/linxGnu/grocksdb v1.9.3 h1:s1cbPcOd0cU2SKXRG1nEqCOWYAELQjdqg3RVI2MH9ik= -github.com/linxGnu/grocksdb v1.9.3/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= -github.com/magiconair/properties v1.8.9 h1:nWcCbLq1N2v/cpNsy5WvQ37Fb+YElfq20WJ/a8RkpQM= -github.com/magiconair/properties v1.8.9/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/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.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/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/minio/highwayhash v1.0.3 h1:kbnuUMoHYyVl7szWjSxJnxw11k2U709jqFPPmIUyD6Q= -github.com/minio/highwayhash v1.0.3/go.mod h1:GGYsuwP/fPD6Y9hMiXuapVvlIUEhFhMTh0rxU3ik1LQ= -github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= -github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= -github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/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/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= -github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= -github.com/onsi/gomega v1.28.1 h1:MijcGUbfYuznzK/5R4CPNoUP/9Xvuo20sXfEm6XxoTA= -github.com/onsi/gomega v1.28.1/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= -github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= -github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= -github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw= -github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= -github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= -github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= -github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= -github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= -github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/common v0.61.0 h1:3gv/GThfX0cV2lpO7gkTUwZru38mxevy90Bj8YFSRQQ= -github.com/prometheus/common v0.61.0/go.mod h1:zr29OCN/2BsJRaFwG8QOBr41D6kkchKbpeNH7pAjb/s= -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.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= -github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= -github.com/rcrowley/go-metrics v0.0.0-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 v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -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.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= -github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= -github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= -github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -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/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU= -github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= -github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= -github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= -github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= -github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= -github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= -github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= -github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= -github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= -github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= -github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= -github.com/supranational/blst v0.3.13 h1:AYeSxdOMacwu7FBmpfloBz5pbFXDmJL33RuwnKtmTjk= -github.com/supranational/blst v0.3.13/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= -github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= -github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= -github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= -github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= -github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= -github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= -github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/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.4.0-alpha.0.0.20240404170359-43604f3112c5 h1:qxen9oVGzDdIRP6ejyAJc760RwW4SnVDiTYTzwnXuxo= -go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5/go.mod h1:eW0HG9/oHQhvRCvb1/pIXW4cOvtDqeQK+XSi3TnwaXY= -go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= -go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU= -go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM= -go.uber.org/multierr v1.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/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -golang.org/x/arch v0.12.0 h1:UsYJhbzPYGsT0HbEdmYcqtCv8UNGvnaL561NnIUvaKg= -golang.org/x/arch v0.12.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-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.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= -golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= -golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-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.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI= -golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -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.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= -golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-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-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-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-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-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-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-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.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.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= -golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= -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.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.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= -golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-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-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -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-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.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o= -golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-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-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-20240903143218-8af14fe29dc1 h1:hjSy6tcFQZ171igDaN5QHOw2n6vx40juYbC/x67CEhc= -google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:qpvKtACPCQhAdu3PyQgV4l3LMXZEtft7y8QcarRsp9I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a h1:hgh8P4EuoxpsuKMXX/To36nOFD7vixReXgn8lPGnt+o= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.68.1 h1:oI5oTa11+ng8r8XMMN7jAOmWfPZWbYpCFaMUTACxkM0= -google.golang.org/grpc v1.68.1/go.mod h1:+q1XYFJjShcqn0QZHvCyeR4CXPA+llXIeUIfIe00waw= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.36.0 h1:mjIs9gYtt56AzC4ZaffQuh88TZurBGhIJMBZGSxNerQ= -google.golang.org/protobuf v1.36.0/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -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/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.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/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-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= -pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= -pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= -sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= -sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/x/params/keeper/common_test.go b/x/params/keeper/common_test.go deleted file mode 100644 index 07a7ddd8a475..000000000000 --- a/x/params/keeper/common_test.go +++ /dev/null @@ -1,40 +0,0 @@ -package keeper_test - -import ( - storetypes "cosmossdk.io/store/types" - "cosmossdk.io/x/params" - paramskeeper "cosmossdk.io/x/params/keeper" - - "github.com/cosmos/cosmos-sdk/codec" - codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" - sdktestutil "github.com/cosmos/cosmos-sdk/testutil" - sdk "github.com/cosmos/cosmos-sdk/types" - moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" -) - -func testComponents() (*codec.LegacyAmino, sdk.Context, storetypes.StoreKey, storetypes.StoreKey, paramskeeper.Keeper) { - encodingConfig := moduletestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{}, params.AppModule{}) - cdc := encodingConfig.Codec - - legacyAmino := createTestCodec() - mkey := storetypes.NewKVStoreKey("test") - tkey := storetypes.NewTransientStoreKey("transient_test") - ctx := sdktestutil.DefaultContext(mkey, tkey) - keeper := paramskeeper.NewKeeper(cdc, legacyAmino, mkey, tkey) - - return legacyAmino, ctx, mkey, tkey, keeper -} - -type invalid struct{} - -type s struct { - I int -} - -func createTestCodec() *codec.LegacyAmino { - cdc := codec.NewLegacyAmino() - sdk.RegisterLegacyAminoCodec(cdc) - cdc.RegisterConcrete(s{}, "test/s") - cdc.RegisterConcrete(invalid{}, "test/invalid") - return cdc -} diff --git a/x/params/keeper/grpc_query.go b/x/params/keeper/grpc_query.go deleted file mode 100644 index bc6b58574e03..000000000000 --- a/x/params/keeper/grpc_query.go +++ /dev/null @@ -1,69 +0,0 @@ -package keeper - -import ( - "context" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "cosmossdk.io/errors" - "cosmossdk.io/x/params/types/proposal" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -var _ proposal.QueryServer = Keeper{} - -// Params returns subspace params -func (k Keeper) Params(c context.Context, req *proposal.QueryParamsRequest) (*proposal.QueryParamsResponse, error) { - if req == nil { - return nil, status.Errorf(codes.InvalidArgument, "empty request") - } - - if req.Subspace == "" || req.Key == "" { - return nil, status.Errorf(codes.InvalidArgument, "invalid request") - } - - ss, ok := k.GetSubspace(req.Subspace) - if !ok { - return nil, errors.Wrap(proposal.ErrUnknownSubspace, req.Subspace) - } - - ctx := sdk.UnwrapSDKContext(c) - rawValue := ss.GetRaw(ctx, []byte(req.Key)) - param := proposal.NewParamChange(req.Subspace, req.Key, string(rawValue)) - - return &proposal.QueryParamsResponse{Param: param}, nil -} - -// Subspaces implements the gRPC query handler for fetching all registered -// subspaces and all the keys for each subspace. -func (k Keeper) Subspaces( - goCtx context.Context, - req *proposal.QuerySubspacesRequest, -) (*proposal.QuerySubspacesResponse, error) { - if req == nil { - return nil, status.Errorf(codes.InvalidArgument, "empty request") - } - - spaces := k.GetSubspaces() - resp := &proposal.QuerySubspacesResponse{ - Subspaces: make([]*proposal.Subspace, len(spaces)), - } - - ctx := sdk.UnwrapSDKContext(goCtx) - for i, ss := range spaces { - var keys []string - ss.IterateKeys(ctx, func(key []byte) bool { - keys = append(keys, string(key)) - return false - }) - - resp.Subspaces[i] = &proposal.Subspace{ - Subspace: ss.Name(), - Keys: keys, - } - } - - return resp, nil -} diff --git a/x/params/keeper/grpc_query_test.go b/x/params/keeper/grpc_query_test.go deleted file mode 100644 index 22b5e168e319..000000000000 --- a/x/params/keeper/grpc_query_test.go +++ /dev/null @@ -1,103 +0,0 @@ -package keeper_test - -import ( - "fmt" - - "cosmossdk.io/x/params/types" - "cosmossdk.io/x/params/types/proposal" -) - -func (suite *KeeperTestSuite) TestGRPCQueryParams() { - var ( - req *proposal.QueryParamsRequest - expValue string - space types.Subspace - ) - key := []byte("key") - - testCases := []struct { - msg string - malleate func() - expPass bool - }{ - { - "empty request", - func() { - req = &proposal.QueryParamsRequest{} - }, - false, - }, - { - "invalid request with subspace not found", - func() { - req = &proposal.QueryParamsRequest{Subspace: "test"} - }, - false, - }, - { - "invalid request with subspace and key not found", - func() { - req = &proposal.QueryParamsRequest{Subspace: "test", Key: "key"} - }, - false, - }, - { - "success", - func() { - space = suite.paramsKeeper.Subspace("test"). - WithKeyTable(types.NewKeyTable(types.NewParamSetPair(key, paramJSON{}, validateNoOp))) - req = &proposal.QueryParamsRequest{Subspace: "test", Key: "key"} - expValue = "" - }, - true, - }, - { - "update value success", - func() { - err := space.Update(suite.ctx, key, []byte(`{"param1":"10241024"}`)) - suite.Require().NoError(err) - req = &proposal.QueryParamsRequest{Subspace: "test", Key: "key"} - expValue = `{"param1":"10241024"}` - }, - true, - }, - } - - suite.SetupTest() - - for _, tc := range testCases { - suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { - tc.malleate() - - res, err := suite.queryClient.Params(suite.ctx, req) - - if tc.expPass { - suite.Require().NoError(err) - suite.Require().NotNil(res) - suite.Require().Equal(expValue, res.Param.Value) - } else { - suite.Require().Error(err) - suite.Require().Nil(res) - } - }) - } -} - -func (suite *KeeperTestSuite) TestGRPCQuerySubspaces() { - // NOTE: Each subspace will not have any keys that we can check against - // because InitGenesis has not been called during app construction. - resp, err := suite.queryClient.Subspaces(suite.ctx, &proposal.QuerySubspacesRequest{}) - suite.Require().NoError(err) - suite.Require().NotNil(resp) - - spaces := make([]string, len(resp.Subspaces)) - i := 0 - for _, ss := range resp.Subspaces { - spaces[i] = ss.Subspace - i++ - } - - // require the response contains a few subspaces we know exist - suite.Require().Contains(spaces, "bank") - suite.Require().Contains(spaces, "staking") -} diff --git a/x/params/keeper/keeper.go b/x/params/keeper/keeper.go deleted file mode 100644 index 31255d138657..000000000000 --- a/x/params/keeper/keeper.go +++ /dev/null @@ -1,74 +0,0 @@ -package keeper - -import ( - "cosmossdk.io/log" - storetypes "cosmossdk.io/store/types" - "cosmossdk.io/x/params/types" - "cosmossdk.io/x/params/types/proposal" - - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// Keeper of the global paramstore -type Keeper struct { - cdc codec.BinaryCodec - legacyAmino *codec.LegacyAmino - key storetypes.StoreKey - tkey storetypes.StoreKey - spaces map[string]*types.Subspace -} - -// NewKeeper constructs a params keeper -func NewKeeper(cdc codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey storetypes.StoreKey) Keeper { - return Keeper{ - cdc: cdc, - legacyAmino: legacyAmino, - key: key, - tkey: tkey, - spaces: make(map[string]*types.Subspace), - } -} - -// Logger returns a module-specific logger. -func (k Keeper) Logger(ctx sdk.Context) log.Logger { - return ctx.Logger().With("module", "x/"+proposal.ModuleName) -} - -// Allocate subspace used for keepers -func (k Keeper) Subspace(s string) types.Subspace { - _, ok := k.spaces[s] - if ok { - panic("subspace already occupied") - } - - if s == "" { - panic("cannot use empty string for subspace") - } - - space := types.NewSubspace(k.cdc, k.legacyAmino, k.key, k.tkey, s) - k.spaces[s] = &space - - return space -} - -// Get existing substore from keeper -func (k Keeper) GetSubspace(s string) (types.Subspace, bool) { - space, ok := k.spaces[s] - if !ok { - return types.Subspace{}, false - } - return *space, ok -} - -// GetSubspaces returns all the registered subspaces. -func (k Keeper) GetSubspaces() []types.Subspace { - spaces := make([]types.Subspace, len(k.spaces)) - i := 0 - for _, ss := range k.spaces { - spaces[i] = *ss - i++ - } - - return spaces -} diff --git a/x/params/keeper/keeper_test.go b/x/params/keeper/keeper_test.go deleted file mode 100644 index 25b7609fed08..000000000000 --- a/x/params/keeper/keeper_test.go +++ /dev/null @@ -1,284 +0,0 @@ -package keeper_test - -import ( - "reflect" - "testing" - - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" - - "cosmossdk.io/math" - "cosmossdk.io/store/prefix" - storetypes "cosmossdk.io/store/types" - "cosmossdk.io/x/params" - "cosmossdk.io/x/params/keeper" - "cosmossdk.io/x/params/types" - "cosmossdk.io/x/params/types/proposal" - - "github.com/cosmos/cosmos-sdk/baseapp" - codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" - "github.com/cosmos/cosmos-sdk/testutil" - sdk "github.com/cosmos/cosmos-sdk/types" - moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" -) - -type KeeperTestSuite struct { - suite.Suite - - ctx sdk.Context - paramsKeeper keeper.Keeper - queryClient proposal.QueryClient -} - -func (suite *KeeperTestSuite) SetupTest() { - encodingCfg := moduletestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{}, params.AppModule{}) - key := storetypes.NewKVStoreKey(types.StoreKey) - tkey := storetypes.NewTransientStoreKey("params_transient_test") - - suite.ctx = testutil.DefaultContext(key, tkey) - suite.paramsKeeper = keeper.NewKeeper(encodingCfg.Codec, encodingCfg.Amino, key, tkey) - suite.paramsKeeper.Subspace("bank") - suite.paramsKeeper.Subspace("staking") - - queryHelper := baseapp.NewQueryServerTestHelper(suite.ctx, encodingCfg.InterfaceRegistry) - proposal.RegisterQueryServer(queryHelper, suite.paramsKeeper) - - suite.queryClient = proposal.NewQueryClient(queryHelper) -} - -func TestKeeperTestSuite(t *testing.T) { - suite.Run(t, new(KeeperTestSuite)) -} - -func validateNoOp(_ interface{}) error { return nil } - -func TestKeeper(t *testing.T) { - kvs := []struct { - key string - param int64 - }{ - {"key1", 10}, - {"key2", 55}, - {"key3", 182}, - {"key4", 17582}, - {"key5", 2768554}, - {"key6", 1157279}, - {"key7", 9058701}, - } - - table := types.NewKeyTable( - types.NewParamSetPair([]byte("key1"), int64(0), validateNoOp), - types.NewParamSetPair([]byte("key2"), int64(0), validateNoOp), - types.NewParamSetPair([]byte("key3"), int64(0), validateNoOp), - types.NewParamSetPair([]byte("key4"), int64(0), validateNoOp), - types.NewParamSetPair([]byte("key5"), int64(0), validateNoOp), - types.NewParamSetPair([]byte("key6"), int64(0), validateNoOp), - types.NewParamSetPair([]byte("key7"), int64(0), validateNoOp), - types.NewParamSetPair([]byte("extra1"), bool(false), validateNoOp), - types.NewParamSetPair([]byte("extra2"), string(""), validateNoOp), - ) - - cdc, ctx, skey, _, keeper := testComponents() - - store := prefix.NewStore(ctx.KVStore(skey), []byte("test/")) - space := keeper.Subspace("test") - require.False(t, space.HasKeyTable()) - space = space.WithKeyTable(table) - require.True(t, space.HasKeyTable()) - - // Set params - for i, kv := range kvs { - require.NotPanics(t, func() { space.Set(ctx, []byte(kv.key), kv.param) }, "space.Set panics, tc #%d", i) - } - - // Test space.Get - for i, kv := range kvs { - var param int64 - require.NotPanics(t, func() { space.Get(ctx, []byte(kv.key), ¶m) }, "space.Get panics, tc #%d", i) - require.Equal(t, kv.param, param, "stored param not equal, tc #%d", i) - } - - // Test space.GetRaw - for i, kv := range kvs { - var param int64 - bz := space.GetRaw(ctx, []byte(kv.key)) - err := cdc.UnmarshalJSON(bz, ¶m) - require.Nil(t, err, "err is not nil, tc #%d", i) - require.Equal(t, kv.param, param, "stored param not equal, tc #%d", i) - } - - // Test store.Get equals space.Get - for i, kv := range kvs { - var param int64 - bz := store.Get([]byte(kv.key)) - require.NotNil(t, bz, "KVStore.Get returns nil, tc #%d", i) - err := cdc.UnmarshalJSON(bz, ¶m) - require.NoError(t, err, "UnmarshalJSON returns error, tc #%d", i) - require.Equal(t, kv.param, param, "stored param not equal, tc #%d", i) - } - - // Test invalid space.Get - for i, kv := range kvs { - var param bool - require.Panics(t, func() { space.Get(ctx, []byte(kv.key), ¶m) }, "invalid space.Get not panics, tc #%d", i) - } - - // Test invalid space.Set - for i, kv := range kvs { - require.Panics(t, func() { space.Set(ctx, []byte(kv.key), true) }, "invalid space.Set not panics, tc #%d", i) - } - - // Test GetSubspace - for i, kv := range kvs { - var gparam, param int64 - gspace, ok := keeper.GetSubspace("test") - require.True(t, ok, "cannot retrieve subspace, tc #%d", i) - - require.NotPanics(t, func() { gspace.Get(ctx, []byte(kv.key), &gparam) }) - require.NotPanics(t, func() { space.Get(ctx, []byte(kv.key), ¶m) }) - require.Equal(t, gparam, param, "GetSubspace().Get not equal with space.Get, tc #%d", i) - - require.NotPanics(t, func() { gspace.Set(ctx, []byte(kv.key), int64(i)) }) - require.NotPanics(t, func() { space.Get(ctx, []byte(kv.key), ¶m) }) - require.Equal(t, int64(i), param, "GetSubspace().Set not equal with space.Get, tc #%d", i) - } -} - -func indirect(ptr interface{}) interface{} { - return reflect.ValueOf(ptr).Elem().Interface() -} - -func TestGetSubspaces(t *testing.T) { - _, _, _, _, keeper := testComponents() - - table := types.NewKeyTable( - types.NewParamSetPair([]byte("string"), "", validateNoOp), - types.NewParamSetPair([]byte("bool"), false, validateNoOp), - ) - - _ = keeper.Subspace("key1").WithKeyTable(table) - _ = keeper.Subspace("key2").WithKeyTable(table) - - spaces := keeper.GetSubspaces() - require.Len(t, spaces, 2) - - var names []string - for _, ss := range spaces { - names = append(names, ss.Name()) - } - - require.Contains(t, names, "key1") - require.Contains(t, names, "key2") -} - -func TestSubspace(t *testing.T) { - cdc, ctx, key, _, keeper := testComponents() - - kvs := []struct { - key string - param interface{} - zero interface{} - ptr interface{} - }{ - {"string", "test", "", new(string)}, - {"bool", true, false, new(bool)}, - {"int16", int16(1), int16(0), new(int16)}, - {"int32", int32(1), int32(0), new(int32)}, - {"int64", int64(1), int64(0), new(int64)}, - {"uint16", uint16(1), uint16(0), new(uint16)}, - {"uint32", uint32(1), uint32(0), new(uint32)}, - {"uint64", uint64(1), uint64(0), new(uint64)}, - {"int", math.NewInt(1), math.Int{}, new(math.Int)}, - {"uint", math.NewUint(1), math.Uint{}, new(math.Uint)}, - {"dec", math.LegacyNewDec(1), math.LegacyDec{}, new(math.LegacyDec)}, - {"struct", s{1}, s{0}, new(s)}, - } - - table := types.NewKeyTable( - types.NewParamSetPair([]byte("string"), "", validateNoOp), - types.NewParamSetPair([]byte("bool"), false, validateNoOp), - types.NewParamSetPair([]byte("int16"), int16(0), validateNoOp), - types.NewParamSetPair([]byte("int32"), int32(0), validateNoOp), - types.NewParamSetPair([]byte("int64"), int64(0), validateNoOp), - types.NewParamSetPair([]byte("uint16"), uint16(0), validateNoOp), - types.NewParamSetPair([]byte("uint32"), uint32(0), validateNoOp), - types.NewParamSetPair([]byte("uint64"), uint64(0), validateNoOp), - types.NewParamSetPair([]byte("int"), math.Int{}, validateNoOp), - types.NewParamSetPair([]byte("uint"), math.Uint{}, validateNoOp), - types.NewParamSetPair([]byte("dec"), math.LegacyDec{}, validateNoOp), - types.NewParamSetPair([]byte("struct"), s{}, validateNoOp), - ) - - store := prefix.NewStore(ctx.KVStore(key), []byte("test/")) - space := keeper.Subspace("test").WithKeyTable(table) - - // Test space.Set, space.Modified - for i, kv := range kvs { - require.False(t, space.Modified(ctx, []byte(kv.key)), "space.Modified returns true before setting, tc #%d", i) - require.NotPanics(t, func() { space.Set(ctx, []byte(kv.key), kv.param) }, "space.Set panics, tc #%d", i) - require.True(t, space.Modified(ctx, []byte(kv.key)), "space.Modified returns false after setting, tc #%d", i) - } - - // Test space.Get, space.GetIfExists - for i, kv := range kvs { - require.NotPanics(t, func() { space.GetIfExists(ctx, []byte("invalid"), kv.ptr) }, "space.GetIfExists panics when no value exists, tc #%d", i) - require.Equal(t, kv.zero, indirect(kv.ptr), "space.GetIfExists unmarshalls when no value exists, tc #%d", i) - require.Panics(t, func() { space.Get(ctx, []byte("invalid"), kv.ptr) }, "invalid space.Get not panics when no value exists, tc #%d", i) - require.Equal(t, kv.zero, indirect(kv.ptr), "invalid space.Get unmarshalls when no value exists, tc #%d", i) - - require.NotPanics(t, func() { space.GetIfExists(ctx, []byte(kv.key), kv.ptr) }, "space.GetIfExists panics, tc #%d", i) - require.Equal(t, kv.param, indirect(kv.ptr), "stored param not equal, tc #%d", i) - require.NotPanics(t, func() { space.Get(ctx, []byte(kv.key), kv.ptr) }, "space.Get panics, tc #%d", i) - require.Equal(t, kv.param, indirect(kv.ptr), "stored param not equal, tc #%d", i) - - require.Panics(t, func() { space.Get(ctx, []byte("invalid"), kv.ptr) }, "invalid space.Get not panics when no value exists, tc #%d", i) - require.Equal(t, kv.param, indirect(kv.ptr), "invalid space.Get unmarshalls when no value existt, tc #%d", i) - - require.Panics(t, func() { space.Get(ctx, []byte(kv.key), nil) }, "invalid space.Get not panics when the pointer is nil, tc #%d", i) - require.Panics(t, func() { space.Get(ctx, []byte(kv.key), new(invalid)) }, "invalid space.Get not panics when the pointer is different type, tc #%d", i) - } - - // Test store.Get equals space.Get - for i, kv := range kvs { - bz := store.Get([]byte(kv.key)) - require.NotNil(t, bz, "store.Get() returns nil, tc #%d", i) - err := cdc.UnmarshalJSON(bz, kv.ptr) - require.NoError(t, err, "cdc.UnmarshalJSON() returns error, tc #%d", i) - require.Equal(t, kv.param, indirect(kv.ptr), "stored param not equal, tc #%d", i) - } -} - -type paramJSON struct { - Param1 int64 `json:"param1,omitempty" yaml:"param1,omitempty"` - Param2 string `json:"param2,omitempty" yaml:"param2,omitempty"` -} - -func TestJSONUpdate(t *testing.T) { - _, ctx, _, _, keeper := testComponents() - - key := []byte("key") - - space := keeper.Subspace("test").WithKeyTable(types.NewKeyTable(types.NewParamSetPair(key, paramJSON{}, validateNoOp))) - - var param paramJSON - - err := space.Update(ctx, key, []byte(`{"param1": "10241024"}`)) - require.NoError(t, err) - space.Get(ctx, key, ¶m) - require.Equal(t, paramJSON{10241024, ""}, param) - - err = space.Update(ctx, key, []byte(`{"param2": "helloworld"}`)) - require.NoError(t, err) - space.Get(ctx, key, ¶m) - require.Equal(t, paramJSON{10241024, "helloworld"}, param) - - err = space.Update(ctx, key, []byte(`{"param1": "20482048"}`)) - require.NoError(t, err) - space.Get(ctx, key, ¶m) - require.Equal(t, paramJSON{20482048, "helloworld"}, param) - - err = space.Update(ctx, key, []byte(`{"param1": "40964096", "param2": "goodbyeworld"}`)) - require.NoError(t, err) - space.Get(ctx, key, ¶m) - require.Equal(t, paramJSON{40964096, "goodbyeworld"}, param) -} diff --git a/x/params/module.go b/x/params/module.go deleted file mode 100644 index cc531691e9cc..000000000000 --- a/x/params/module.go +++ /dev/null @@ -1,83 +0,0 @@ -package params - -import ( - "context" - - gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" - "google.golang.org/grpc" - - "cosmossdk.io/core/appmodule" - "cosmossdk.io/core/registry" - "cosmossdk.io/x/params/keeper" - "cosmossdk.io/x/params/types/proposal" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/types/module" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" -) - -var ( - _ module.HasAminoCodec = AppModule{} - _ module.HasGRPCGateway = AppModule{} - _ module.AppModuleSimulation = AppModule{} - - _ appmodule.AppModule = AppModule{} - _ appmodule.HasRegisterInterfaces = AppModule{} -) - -// ConsensusVersion defines the current x/params module consensus version. -const ConsensusVersion = 1 - -// AppModule implements an application module for the distribution module. -type AppModule struct { - keeper keeper.Keeper -} - -// NewAppModule creates a new AppModule object -func NewAppModule(k keeper.Keeper) AppModule { - return AppModule{ - keeper: k, - } -} - -// IsAppModule implements the appmodule.AppModule interface. -func (am AppModule) IsAppModule() {} - -// Name returns the params module's name. -// Deprecated: kept for legacy reasons. -func (AppModule) Name() string { - return proposal.ModuleName -} - -// RegisterLegacyAminoCodec registers the params module's types on the given LegacyAmino codec. -func (AppModule) RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) { - proposal.RegisterLegacyAminoCodec(registrar) -} - -// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the params module. -func (AppModule) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *gwruntime.ServeMux) { - if err := proposal.RegisterQueryHandlerClient(context.Background(), mux, proposal.NewQueryClient(clientCtx)); err != nil { - panic(err) - } -} - -// RegisterInterfaces registers the module's interface types -func (AppModule) RegisterInterfaces(registrar registry.InterfaceRegistrar) { - proposal.RegisterInterfaces(registrar) -} - -// GenerateGenesisState performs a no-op. -func (AppModule) GenerateGenesisState(simState *module.SimulationState) {} - -// RegisterServices registers module services. -func (am AppModule) RegisterServices(registrar grpc.ServiceRegistrar) error { - proposal.RegisterQueryServer(registrar, am.keeper) - - return nil -} - -// RegisterStoreDecoder doesn't register any type. -func (AppModule) RegisterStoreDecoder(sdr simtypes.StoreDecoderRegistry) {} - -// ConsensusVersion implements HasConsensusVersion -func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion } diff --git a/x/params/proposal_handler.go b/x/params/proposal_handler.go deleted file mode 100644 index 25ec53162ebd..000000000000 --- a/x/params/proposal_handler.go +++ /dev/null @@ -1,50 +0,0 @@ -package params - -import ( - "context" - "fmt" - - errorsmod "cosmossdk.io/errors" - govtypes "cosmossdk.io/x/gov/types/v1beta1" - "cosmossdk.io/x/params/keeper" - "cosmossdk.io/x/params/types/proposal" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -// NewParamChangeProposalHandler creates a new governance Handler for a ParamChangeProposal -func NewParamChangeProposalHandler(k keeper.Keeper) govtypes.Handler { - return func(ctx context.Context, content govtypes.Content) error { - // UnwrapSDKContext makes x/params baseapp compatible only and not server/v2 - // We should investigate if we want to make x/params server/v2 compatible - sdkCtx := sdk.UnwrapSDKContext(ctx) - - switch c := content.(type) { - case *proposal.ParameterChangeProposal: - return handleParameterChangeProposal(sdkCtx, k, c) - - default: - return errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized param proposal content type: %T", c) - } - } -} - -func handleParameterChangeProposal(ctx sdk.Context, k keeper.Keeper, p *proposal.ParameterChangeProposal) error { - for _, c := range p.Changes { - ss, ok := k.GetSubspace(c.Subspace) - if !ok { - return errorsmod.Wrap(proposal.ErrUnknownSubspace, c.Subspace) - } - - k.Logger(ctx).Info( - fmt.Sprintf("attempt to set new parameter value; key: %s, value: %s", c.Key, c.Value), - ) - - if err := ss.Update(ctx, []byte(c.Key), []byte(c.Value)); err != nil { - return errorsmod.Wrapf(proposal.ErrSettingParameter, "key: %s, value: %s, err: %s", c.Key, c.Value, err.Error()) - } - } - - return nil -} diff --git a/x/params/proto/buf.gen.gogo.yaml b/x/params/proto/buf.gen.gogo.yaml deleted file mode 100644 index db36231d0c82..000000000000 --- a/x/params/proto/buf.gen.gogo.yaml +++ /dev/null @@ -1,8 +0,0 @@ -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/params/proto/buf.gen.pulsar.yaml b/x/params/proto/buf.gen.pulsar.yaml deleted file mode 100644 index 88a5b0419d7f..000000000000 --- a/x/params/proto/buf.gen.pulsar.yaml +++ /dev/null @@ -1,18 +0,0 @@ -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/params/proto/buf.lock b/x/params/proto/buf.lock deleted file mode 100644 index 28c135cc08bb..000000000000 --- a/x/params/proto/buf.lock +++ /dev/null @@ -1,28 +0,0 @@ -# Generated by buf. DO NOT EDIT. -version: v1 -deps: - - remote: buf.build - owner: cosmos - repository: cosmos-proto - commit: 04467658e59e44bbb22fe568206e1f70 - digest: shake256:73a640bd60e0c523b0f8237ff34eab67c45a38b64bbbde1d80224819d272dbf316ac183526bd245f994af6608b025f5130483d0133c5edd385531326b5990466 - - remote: buf.build - owner: cosmos - repository: cosmos-sdk - commit: cf13c7d232dd405180c2af616fa8a075 - digest: shake256:769a38e306a98339b549bc96991c97fae8bd3ceb1a7646c7bfe9a74e406ab068372970fbc5abda1891e2f3c36527cf2d3a25f631739d36900787226e564bb612 - - remote: buf.build - owner: cosmos - repository: gogo-proto - commit: 5e5b9fdd01804356895f8f79a6f1ddc1 - digest: shake256:0b85da49e2e5f9ebc4806eae058e2f56096ff3b1c59d1fb7c190413dd15f45dd456f0b69ced9059341c80795d2b6c943de15b120a9e0308b499e43e4b5fc2952 - - remote: buf.build - owner: googleapis - repository: googleapis - commit: 28151c0d0a1641bf938a7672c500e01d - digest: shake256:49215edf8ef57f7863004539deff8834cfb2195113f0b890dd1f67815d9353e28e668019165b9d872395871eeafcbab3ccfdb2b5f11734d3cca95be9e8d139de - - remote: buf.build - owner: protocolbuffers - repository: wellknowntypes - commit: 657250e6a39648cbb169d079a60bd9ba - digest: shake256:00de25001b8dd2e29d85fc4bcc3ede7aed886d76d67f5e0f7a9b320b90f871d3eb73507d50818d823a0512f3f8db77a11c043685528403e31ff3fef18323a9fb diff --git a/x/params/proto/buf.yaml b/x/params/proto/buf.yaml deleted file mode 100644 index 90faba0d4dd3..000000000000 --- a/x/params/proto/buf.yaml +++ /dev/null @@ -1,18 +0,0 @@ -version: v1 -name: buf.build/mods/params -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/params/proto/cosmos/params/module/v1/module.proto b/x/params/proto/cosmos/params/module/v1/module.proto deleted file mode 100644 index c4bea72d25cd..000000000000 --- a/x/params/proto/cosmos/params/module/v1/module.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; - -package cosmos.params.module.v1; - -import "cosmos/app/v1alpha1/module.proto"; - -// Module is the config object of the params module. -message Module { - option (cosmos.app.v1alpha1.module) = { - go_import: "cosmossdk.io/x/params" - }; -} diff --git a/x/params/proto/cosmos/params/v1beta1/params.proto b/x/params/proto/cosmos/params/v1beta1/params.proto deleted file mode 100644 index de2026da3a48..000000000000 --- a/x/params/proto/cosmos/params/v1beta1/params.proto +++ /dev/null @@ -1,28 +0,0 @@ -syntax = "proto3"; -package cosmos.params.v1beta1; - -option go_package = "cosmossdk.io/x/params/types/proposal"; -option (gogoproto.equal_all) = true; - -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; -import "amino/amino.proto"; - -// ParameterChangeProposal defines a proposal to change one or more parameters. -message ParameterChangeProposal { - option (gogoproto.goproto_getters) = false; - option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; - option (amino.name) = "cosmos-sdk/ParameterChangeProposal"; - - string title = 1; - string description = 2; - repeated ParamChange changes = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// ParamChange defines an individual parameter change, for use in -// ParameterChangeProposal. -message ParamChange { - string subspace = 1; - string key = 2; - string value = 3; -} diff --git a/x/params/proto/cosmos/params/v1beta1/query.proto b/x/params/proto/cosmos/params/v1beta1/query.proto deleted file mode 100644 index 93ce576b3546..000000000000 --- a/x/params/proto/cosmos/params/v1beta1/query.proto +++ /dev/null @@ -1,61 +0,0 @@ -syntax = "proto3"; -package cosmos.params.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/params/v1beta1/params.proto"; -import "amino/amino.proto"; -import "cosmos_proto/cosmos.proto"; - -option go_package = "cosmossdk.io/x/params/types/proposal"; - -// Query defines the gRPC querier service. -service Query { - // Params queries a specific parameter of a module, given its subspace and - // key. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/params/v1beta1/params"; - } - - // Subspaces queries for all registered subspaces and all keys for a subspace. - rpc Subspaces(QuerySubspacesRequest) returns (QuerySubspacesResponse) { - option (cosmos_proto.method_added_in) = "cosmos-sdk 0.46"; - option (google.api.http).get = "/cosmos/params/v1beta1/subspaces"; - } -} - -// QueryParamsRequest is request type for the Query/Params RPC method. -message QueryParamsRequest { - // subspace defines the module to query the parameter for. - string subspace = 1; - - // key defines the key of the parameter in the subspace. - string key = 2; -} - -// QueryParamsResponse is response type for the Query/Params RPC method. -message QueryParamsResponse { - // param defines the queried parameter. - ParamChange param = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - -// QuerySubspacesRequest defines a request type for querying for all registered -// subspaces and all keys for a subspace. -message QuerySubspacesRequest { - option (cosmos_proto.message_added_in) = "cosmos-sdk 0.46"; -} - -// QuerySubspacesResponse defines the response types for querying for all -// registered subspaces and all keys for a subspace. -message QuerySubspacesResponse { - option (cosmos_proto.message_added_in) = "cosmos-sdk 0.46"; - repeated Subspace subspaces = 1; -} - -// Subspace defines a parameter subspace name and all the keys that exist for -// the subspace. -message Subspace { - option (cosmos_proto.message_added_in) = "cosmos-sdk 0.46"; - string subspace = 1; - repeated string keys = 2; -} diff --git a/x/params/sonar-project.properties b/x/params/sonar-project.properties deleted file mode 100644 index 7715d230e284..000000000000 --- a/x/params/sonar-project.properties +++ /dev/null @@ -1,16 +0,0 @@ -sonar.projectKey=cosmos-sdk-x-params -sonar.organization=cosmos - -sonar.projectName=Cosmos SDK - X Params -sonar.project.monorepo.enabled=true - -sonar.sources=. -sonar.exclusions=**/*_test.go,**/*.pb.go,**/*.pulsar.go,**/*.pb.gw.go -sonar.coverage.exclusions=**/*_test.go,**/testutil/**,**/*.pb.go,**/*.pb.gw.go,**/*.pulsar.go,test_helpers.go,docs/** -sonar.tests=. -sonar.test.inclusions=**/*_test.go -sonar.go.coverage.reportPaths=coverage.out - -sonar.sourceEncoding=UTF-8 -sonar.scm.provider=git -sonar.scm.forceReloadAll=true diff --git a/x/params/testutil/staking_keeper_mock.go b/x/params/testutil/staking_keeper_mock.go deleted file mode 100644 index d0f560a9e79d..000000000000 --- a/x/params/testutil/staking_keeper_mock.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: x/params/proposal_handler_test.go - -// Package testutil is a generated GoMock package. -package testutil - -import ( - context "context" - reflect "reflect" - - gomock "go.uber.org/mock/gomock" -) - -// MockStakingKeeper is a mock of StakingKeeper interface. -type MockStakingKeeper struct { - ctrl *gomock.Controller - recorder *MockStakingKeeperMockRecorder -} - -// MockStakingKeeperMockRecorder is the mock recorder for MockStakingKeeper. -type MockStakingKeeperMockRecorder struct { - mock *MockStakingKeeper -} - -// NewMockStakingKeeper creates a new mock instance. -func NewMockStakingKeeper(ctrl *gomock.Controller) *MockStakingKeeper { - mock := &MockStakingKeeper{ctrl: ctrl} - mock.recorder = &MockStakingKeeperMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockStakingKeeper) EXPECT() *MockStakingKeeperMockRecorder { - return m.recorder -} - -// MaxValidators mocks base method. -func (m *MockStakingKeeper) MaxValidators(ctx context.Context) (uint32, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "MaxValidators", ctx) - ret0, _ := ret[0].(uint32) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// MaxValidators indicates an expected call of MaxValidators. -func (mr *MockStakingKeeperMockRecorder) MaxValidators(ctx interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MaxValidators", reflect.TypeOf((*MockStakingKeeper)(nil).MaxValidators), ctx) -} diff --git a/x/params/types/common_test.go b/x/params/types/common_test.go deleted file mode 100644 index bd1d653c8650..000000000000 --- a/x/params/types/common_test.go +++ /dev/null @@ -1,98 +0,0 @@ -package types_test - -import ( - "errors" - "fmt" - "time" - - storetypes "cosmossdk.io/store/types" - "cosmossdk.io/x/params/types" -) - -var ( - keyUnbondingTime = []byte("UnbondingTime") - keyMaxValidators = []byte("MaxValidators") - keyBondDenom = []byte("BondDenom") - keyMaxRedelegationEntries = []byte("MaxRedelegationEntries") - - key = storetypes.NewKVStoreKey("storekey") - tkey = storetypes.NewTransientStoreKey("transientstorekey") -) - -type params struct { - UnbondingTime time.Duration `json:"unbonding_time" yaml:"unbonding_time"` - MaxValidators uint16 `json:"max_validators" yaml:"max_validators"` - BondDenom string `json:"bond_denom" yaml:"bond_denom"` -} - -type paramsV2 struct { - UnbondingTime time.Duration `json:"unbonding_time" yaml:"unbonding_time"` - MaxValidators uint16 `json:"max_validators" yaml:"max_validators"` - BondDenom string `json:"bond_denom" yaml:"bond_denom"` - MaxRedelegationEntries uint32 `json:"max_redelegation_entries" yaml:"max_redelegation_entries"` -} - -func validateUnbondingTime(i interface{}) error { - v, ok := i.(time.Duration) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - if v < (24 * time.Hour) { - return errors.New("unbonding time must be at least one day") - } - - return nil -} - -func validateMaxValidators(i interface{}) error { - _, ok := i.(uint16) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - return nil -} - -func validateBondDenom(i interface{}) error { - v, ok := i.(string) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - if len(v) == 0 { - return errors.New("denom cannot be empty") - } - - return nil -} - -func validateMaxRedelegationEntries(i interface{}) error { - _, ok := i.(uint32) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - return nil -} - -func (p *params) ParamSetPairs() types.ParamSetPairs { - return types.ParamSetPairs{ - 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{ - 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}, - } -} - -func paramKeyTable() types.KeyTable { - return types.NewKeyTable().RegisterParamSet(¶ms{}) -} diff --git a/x/params/types/consensus_params_legacy.go b/x/params/types/consensus_params_legacy.go deleted file mode 100644 index 57cafc051a02..000000000000 --- a/x/params/types/consensus_params_legacy.go +++ /dev/null @@ -1,22 +0,0 @@ -package types - -import ( - cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1" - - "github.com/cosmos/cosmos-sdk/baseapp" -) - -// Deprecated. -func ConsensusParamsKeyTable() KeyTable { - return NewKeyTable( - NewParamSetPair( - baseapp.ParamStoreKeyBlockParams, cmtproto.BlockParams{}, baseapp.ValidateBlockParams, - ), - NewParamSetPair( - baseapp.ParamStoreKeyEvidenceParams, cmtproto.EvidenceParams{}, baseapp.ValidateEvidenceParams, - ), - NewParamSetPair( - baseapp.ParamStoreKeyValidatorParams, cmtproto.ValidatorParams{}, baseapp.ValidateValidatorParams, - ), - ) -} diff --git a/x/params/types/deref_test.go b/x/params/types/deref_test.go deleted file mode 100644 index 1cd4406e57c4..000000000000 --- a/x/params/types/deref_test.go +++ /dev/null @@ -1,27 +0,0 @@ -package types - -import ( - "reflect" - "testing" - - "github.com/stretchr/testify/require" -) - -func TestKeyTableUnfurlsPointers(t *testing.T) { - tbl := NewKeyTable() - validator := func(_ interface{}) error { - return nil - } - tbl = tbl.RegisterType(ParamSetPair{ - Key: []byte("key"), - Value: (*****string)(nil), - ValidatorFn: validator, - }) - - got := tbl.m["key"] - want := attribute{ - vfn: validator, - ty: reflect.ValueOf("").Type(), - } - require.Equal(t, got.ty, want.ty) -} diff --git a/x/params/types/doc.go b/x/params/types/doc.go deleted file mode 100644 index 861a4a2f5842..000000000000 --- a/x/params/types/doc.go +++ /dev/null @@ -1,13 +0,0 @@ -/* -To prevent namespace collision between consumer modules, we define a type -Subspace. A Subspace can only be generated by the keeper, and the keeper checks -the existence of the Subspace having the same name before generating the -Subspace. - -Consumer modules must take a Subspace (via Keeper.Subspace), not the keeper -itself. This isolates each modules from the others and make them modify their -respective parameters safely. Keeper can be treated as master permission for all -Subspaces (via Keeper.GetSubspace), so should be passed to proper modules -(ex. x/governance). -*/ -package types diff --git a/x/params/types/keys.go b/x/params/types/keys.go deleted file mode 100644 index 87c925383ccc..000000000000 --- a/x/params/types/keys.go +++ /dev/null @@ -1,6 +0,0 @@ -package types - -const ( - // ModuleName defines the module name - ModuleName = "params" -) diff --git a/x/params/types/paramset.go b/x/params/types/paramset.go deleted file mode 100644 index 80d0852be4f0..000000000000 --- a/x/params/types/paramset.go +++ /dev/null @@ -1,26 +0,0 @@ -package types - -type ( - ValueValidatorFn func(value interface{}) error - - // ParamSetPair is used for associating paramsubspace key and field of param - // structs. - ParamSetPair struct { - Key []byte - Value interface{} - ValidatorFn ValueValidatorFn - } -) - -// NewParamSetPair creates a new ParamSetPair instance. -func NewParamSetPair(key []byte, value interface{}, vfn ValueValidatorFn) ParamSetPair { - return ParamSetPair{key, value, vfn} -} - -// ParamSetPairs Slice of KeyFieldPair -type ParamSetPairs []ParamSetPair - -// ParamSet defines an interface for structs containing parameters for a module -type ParamSet interface { - ParamSetPairs() ParamSetPairs -} diff --git a/x/params/types/proposal/codec.go b/x/params/types/proposal/codec.go deleted file mode 100644 index 5ac249f3ad6f..000000000000 --- a/x/params/types/proposal/codec.go +++ /dev/null @@ -1,18 +0,0 @@ -package proposal - -import ( - "cosmossdk.io/core/registry" - govtypes "cosmossdk.io/x/gov/types/v1beta1" -) - -// RegisterLegacyAminoCodec registers all necessary param module types with a given LegacyAmino codec. -func RegisterLegacyAminoCodec(registrar registry.AminoRegistrar) { - registrar.RegisterConcrete(&ParameterChangeProposal{}, "cosmos-sdk/ParameterChangeProposal") -} - -func RegisterInterfaces(registrar registry.InterfaceRegistrar) { - registrar.RegisterImplementations( - (*govtypes.Content)(nil), - &ParameterChangeProposal{}, - ) -} diff --git a/x/params/types/proposal/errors.go b/x/params/types/proposal/errors.go deleted file mode 100644 index 880864b84433..000000000000 --- a/x/params/types/proposal/errors.go +++ /dev/null @@ -1,13 +0,0 @@ -package proposal - -import "cosmossdk.io/errors" - -// x/params module sentinel errors -var ( - ErrUnknownSubspace = errors.Register(ModuleName, 2, "unknown subspace") - ErrSettingParameter = errors.Register(ModuleName, 3, "failed to set parameter") - ErrEmptyChanges = errors.Register(ModuleName, 4, "submitted parameter changes are empty") - ErrEmptySubspace = errors.Register(ModuleName, 5, "parameter subspace is empty") - ErrEmptyKey = errors.Register(ModuleName, 6, "parameter key is empty") - ErrEmptyValue = errors.Register(ModuleName, 7, "parameter value is empty") -) diff --git a/x/params/types/proposal/keys.go b/x/params/types/proposal/keys.go deleted file mode 100644 index 0649f417433c..000000000000 --- a/x/params/types/proposal/keys.go +++ /dev/null @@ -1,9 +0,0 @@ -package proposal - -const ( - // ModuleName defines the name of the module - ModuleName = "params" - - // RouterKey defines the routing key for a ParameterChangeProposal - RouterKey = "params" -) diff --git a/x/params/types/proposal/params.pb.go b/x/params/types/proposal/params.pb.go deleted file mode 100644 index 04798f81667c..000000000000 --- a/x/params/types/proposal/params.pb.go +++ /dev/null @@ -1,763 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/params/v1beta1/params.proto - -package proposal - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// ParameterChangeProposal defines a proposal to change one or more parameters. -type ParameterChangeProposal struct { - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - Changes []ParamChange `protobuf:"bytes,3,rep,name=changes,proto3" json:"changes"` -} - -func (m *ParameterChangeProposal) Reset() { *m = ParameterChangeProposal{} } -func (m *ParameterChangeProposal) String() string { return proto.CompactTextString(m) } -func (*ParameterChangeProposal) ProtoMessage() {} -func (*ParameterChangeProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_53a944ecb0483e4c, []int{0} -} -func (m *ParameterChangeProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ParameterChangeProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ParameterChangeProposal.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 *ParameterChangeProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_ParameterChangeProposal.Merge(m, src) -} -func (m *ParameterChangeProposal) XXX_Size() int { - return m.Size() -} -func (m *ParameterChangeProposal) XXX_DiscardUnknown() { - xxx_messageInfo_ParameterChangeProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_ParameterChangeProposal proto.InternalMessageInfo - -// ParamChange defines an individual parameter change, for use in -// ParameterChangeProposal. -type ParamChange struct { - Subspace string `protobuf:"bytes,1,opt,name=subspace,proto3" json:"subspace,omitempty"` - Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` -} - -func (m *ParamChange) Reset() { *m = ParamChange{} } -func (m *ParamChange) String() string { return proto.CompactTextString(m) } -func (*ParamChange) ProtoMessage() {} -func (*ParamChange) Descriptor() ([]byte, []int) { - return fileDescriptor_53a944ecb0483e4c, []int{1} -} -func (m *ParamChange) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ParamChange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ParamChange.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 *ParamChange) XXX_Merge(src proto.Message) { - xxx_messageInfo_ParamChange.Merge(m, src) -} -func (m *ParamChange) XXX_Size() int { - return m.Size() -} -func (m *ParamChange) XXX_DiscardUnknown() { - xxx_messageInfo_ParamChange.DiscardUnknown(m) -} - -var xxx_messageInfo_ParamChange proto.InternalMessageInfo - -func (m *ParamChange) GetSubspace() string { - if m != nil { - return m.Subspace - } - return "" -} - -func (m *ParamChange) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -func (m *ParamChange) GetValue() string { - if m != nil { - return m.Value - } - return "" -} - -func init() { - proto.RegisterType((*ParameterChangeProposal)(nil), "cosmos.params.v1beta1.ParameterChangeProposal") - proto.RegisterType((*ParamChange)(nil), "cosmos.params.v1beta1.ParamChange") -} - -func init() { - proto.RegisterFile("cosmos/params/v1beta1/params.proto", fileDescriptor_53a944ecb0483e4c) -} - -var fileDescriptor_53a944ecb0483e4c = []byte{ - // 347 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, - 0x34, 0x84, 0x72, 0xf5, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0x44, 0x21, 0x6a, 0xf4, 0xa0, 0x82, - 0x50, 0x35, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0x15, 0xfa, 0x20, 0x16, 0x44, 0xb1, 0x94, - 0x24, 0x44, 0x71, 0x3c, 0x44, 0x02, 0xa6, 0x13, 0x2c, 0x25, 0x98, 0x98, 0x9b, 0x99, 0x97, 0xaf, - 0x0f, 0x26, 0x21, 0x42, 0x4a, 0x4f, 0x19, 0xb9, 0xc4, 0x03, 0x40, 0xc6, 0xa6, 0x96, 0xa4, 0x16, - 0x39, 0x67, 0x24, 0xe6, 0xa5, 0xa7, 0x06, 0x14, 0xe5, 0x17, 0xe4, 0x17, 0x27, 0xe6, 0x08, 0x89, - 0x70, 0xb1, 0x96, 0x64, 0x96, 0xe4, 0xa4, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0x41, 0x38, - 0x42, 0x0a, 0x5c, 0xdc, 0x29, 0xa9, 0xc5, 0xc9, 0x45, 0x99, 0x05, 0x25, 0x99, 0xf9, 0x79, 0x12, - 0x4c, 0x60, 0x39, 0x64, 0x21, 0x21, 0x77, 0x2e, 0xf6, 0x64, 0xb0, 0x49, 0xc5, 0x12, 0xcc, 0x0a, - 0xcc, 0x1a, 0xdc, 0x46, 0x4a, 0x7a, 0x58, 0x3d, 0xa0, 0x07, 0xb6, 0x18, 0x62, 0xa9, 0x13, 0xe7, - 0x89, 0x7b, 0xf2, 0x0c, 0x2b, 0x9e, 0x6f, 0xd0, 0x62, 0x0c, 0x82, 0xe9, 0xb6, 0xf2, 0xec, 0x58, - 0x20, 0xcf, 0x70, 0x6a, 0x8b, 0xae, 0x14, 0x54, 0x7b, 0x7a, 0x7e, 0x19, 0x5c, 0xaf, 0x73, 0x7e, - 0x5e, 0x49, 0x6a, 0x5e, 0x49, 0xd7, 0xf3, 0x0d, 0x5a, 0xd0, 0x20, 0xd4, 0x2d, 0x4e, 0xc9, 0xd6, - 0xc7, 0xe1, 0x17, 0xa5, 0x40, 0x2e, 0x6e, 0x24, 0xdb, 0x84, 0xa4, 0xb8, 0x38, 0x8a, 0x4b, 0x93, - 0x8a, 0x0b, 0x12, 0x93, 0x61, 0xbe, 0x83, 0xf3, 0x85, 0x04, 0xb8, 0x98, 0xb3, 0x53, 0x2b, 0xa1, - 0x1e, 0x03, 0x31, 0x41, 0x01, 0x51, 0x96, 0x98, 0x53, 0x9a, 0x2a, 0xc1, 0x0c, 0x09, 0x08, 0x30, - 0xc7, 0xc9, 0x69, 0xc5, 0x23, 0x39, 0xc6, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, - 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, - 0x88, 0x52, 0x81, 0x38, 0xaa, 0x38, 0x25, 0x5b, 0x2f, 0x33, 0x5f, 0xbf, 0x02, 0x16, 0xbf, 0x25, - 0x95, 0x05, 0xa9, 0xc5, 0xfa, 0x05, 0x50, 0x67, 0x25, 0xb1, 0x81, 0x63, 0xc1, 0x18, 0x10, 0x00, - 0x00, 0xff, 0xff, 0xe8, 0x12, 0xd9, 0xda, 0x06, 0x02, 0x00, 0x00, -} - -func (this *ParameterChangeProposal) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ParameterChangeProposal) - if !ok { - that2, ok := that.(ParameterChangeProposal) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Title != that1.Title { - return false - } - if this.Description != that1.Description { - return false - } - if len(this.Changes) != len(that1.Changes) { - return false - } - for i := range this.Changes { - if !this.Changes[i].Equal(&that1.Changes[i]) { - return false - } - } - return true -} -func (this *ParamChange) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ParamChange) - if !ok { - that2, ok := that.(ParamChange) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Subspace != that1.Subspace { - return false - } - if this.Key != that1.Key { - return false - } - if this.Value != that1.Value { - return false - } - return true -} -func (m *ParameterChangeProposal) 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 *ParameterChangeProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ParameterChangeProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Changes) > 0 { - for iNdEx := len(m.Changes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Changes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintParams(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintParams(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ParamChange) 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 *ParamChange) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ParamChange) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintParams(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x1a - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintParams(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0x12 - } - if len(m.Subspace) > 0 { - i -= len(m.Subspace) - copy(dAtA[i:], m.Subspace) - i = encodeVarintParams(dAtA, i, uint64(len(m.Subspace))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintParams(dAtA []byte, offset int, v uint64) int { - offset -= sovParams(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *ParameterChangeProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovParams(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovParams(uint64(l)) - } - if len(m.Changes) > 0 { - for _, e := range m.Changes { - l = e.Size() - n += 1 + l + sovParams(uint64(l)) - } - } - return n -} - -func (m *ParamChange) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Subspace) - if l > 0 { - n += 1 + l + sovParams(uint64(l)) - } - l = len(m.Key) - if l > 0 { - n += 1 + l + sovParams(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovParams(uint64(l)) - } - return n -} - -func sovParams(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozParams(x uint64) (n int) { - return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *ParameterChangeProposal) 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 ErrIntOverflowParams - } - 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: ParameterChangeProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ParameterChangeProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - 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 ErrInvalidLengthParams - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - 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 ErrInvalidLengthParams - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Changes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Changes = append(m.Changes, ParamChange{}) - if err := m.Changes[len(m.Changes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ParamChange) 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 ErrIntOverflowParams - } - 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: ParamChange: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ParamChange: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Subspace", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - 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 ErrInvalidLengthParams - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Subspace = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - 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 ErrInvalidLengthParams - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - 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 ErrInvalidLengthParams - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipParams(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, ErrIntOverflowParams - } - 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, ErrIntOverflowParams - } - 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, ErrIntOverflowParams - } - 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, ErrInvalidLengthParams - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupParams - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthParams - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/params/types/proposal/proposal.go b/x/params/types/proposal/proposal.go deleted file mode 100644 index 0fca2032b661..000000000000 --- a/x/params/types/proposal/proposal.go +++ /dev/null @@ -1,69 +0,0 @@ -package proposal - -import ( - govtypes "cosmossdk.io/x/gov/types/v1beta1" -) - -const ( - // ProposalTypeChange defines the type for a ParameterChangeProposal - ProposalTypeChange = "ParameterChange" -) - -// Assert ParameterChangeProposal implements govtypes.Content at compile-time -var _ govtypes.Content = &ParameterChangeProposal{} - -func init() { - govtypes.RegisterProposalType(ProposalTypeChange) -} - -func NewParameterChangeProposal(title, description string, changes []ParamChange) *ParameterChangeProposal { - return &ParameterChangeProposal{title, description, changes} -} - -// GetTitle returns the title of a parameter change proposal. -func (pcp *ParameterChangeProposal) GetTitle() string { return pcp.Title } - -// GetDescription returns the description of a parameter change proposal. -func (pcp *ParameterChangeProposal) GetDescription() string { return pcp.Description } - -// ProposalRoute returns the routing key of a parameter change proposal. -func (pcp *ParameterChangeProposal) ProposalRoute() string { return RouterKey } - -// ProposalType returns the type of a parameter change proposal. -func (pcp *ParameterChangeProposal) ProposalType() string { return ProposalTypeChange } - -// ValidateBasic validates the parameter change proposal -func (pcp *ParameterChangeProposal) ValidateBasic() error { - err := govtypes.ValidateAbstract(pcp) - if err != nil { - return err - } - - return ValidateChanges(pcp.Changes) -} - -func NewParamChange(subspace, key, value string) ParamChange { - return ParamChange{subspace, key, value} -} - -// ValidateChanges performs basic validation checks over a set of ParamChange. It -// returns an error if any ParamChange is invalid. -func ValidateChanges(changes []ParamChange) error { - if len(changes) == 0 { - return ErrEmptyChanges - } - - for _, pc := range changes { - if len(pc.Subspace) == 0 { - return ErrEmptySubspace - } - if len(pc.Key) == 0 { - return ErrEmptyKey - } - if len(pc.Value) == 0 { - return ErrEmptyValue - } - } - - return nil -} diff --git a/x/params/types/proposal/proposal_test.go b/x/params/types/proposal/proposal_test.go deleted file mode 100644 index a18f9c407609..000000000000 --- a/x/params/types/proposal/proposal_test.go +++ /dev/null @@ -1,27 +0,0 @@ -package proposal - -import ( - "testing" - - "github.com/stretchr/testify/require" -) - -func TestParameterChangeProposal(t *testing.T) { - pc1 := NewParamChange("sub", "foo", "baz") - pc2 := NewParamChange("sub", "bar", "cat") - pcp := NewParameterChangeProposal("test title", "test description", []ParamChange{pc1, pc2}) - - require.Equal(t, "test title", pcp.GetTitle()) - require.Equal(t, "test description", pcp.GetDescription()) - require.Equal(t, RouterKey, pcp.ProposalRoute()) - require.Equal(t, ProposalTypeChange, pcp.ProposalType()) - require.Nil(t, pcp.ValidateBasic()) - - pc3 := NewParamChange("", "bar", "cat") - pcp = NewParameterChangeProposal("test title", "test description", []ParamChange{pc3}) - require.Error(t, pcp.ValidateBasic()) - - pc4 := NewParamChange("sub", "", "cat") - pcp = NewParameterChangeProposal("test title", "test description", []ParamChange{pc4}) - require.Error(t, pcp.ValidateBasic()) -} diff --git a/x/params/types/proposal/query.pb.go b/x/params/types/proposal/query.pb.go deleted file mode 100644 index 4f72d4e23500..000000000000 --- a/x/params/types/proposal/query.pb.go +++ /dev/null @@ -1,1224 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/params/v1beta1/query.proto - -package proposal - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - _ "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" - _ "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 - -// QueryParamsRequest is request type for the Query/Params RPC method. -type QueryParamsRequest struct { - // subspace defines the module to query the parameter for. - Subspace string `protobuf:"bytes,1,opt,name=subspace,proto3" json:"subspace,omitempty"` - // key defines the key of the parameter in the subspace. - Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` -} - -func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } -func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryParamsRequest) ProtoMessage() {} -func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2b32979c1792ccc4, []int{0} -} -func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryParamsRequest.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 *QueryParamsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsRequest.Merge(m, src) -} -func (m *QueryParamsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo - -func (m *QueryParamsRequest) GetSubspace() string { - if m != nil { - return m.Subspace - } - return "" -} - -func (m *QueryParamsRequest) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -// QueryParamsResponse is response type for the Query/Params RPC method. -type QueryParamsResponse struct { - // param defines the queried parameter. - Param ParamChange `protobuf:"bytes,1,opt,name=param,proto3" json:"param"` -} - -func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } -func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryParamsResponse) ProtoMessage() {} -func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2b32979c1792ccc4, []int{1} -} -func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryParamsResponse.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 *QueryParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsResponse.Merge(m, src) -} -func (m *QueryParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo - -func (m *QueryParamsResponse) GetParam() ParamChange { - if m != nil { - return m.Param - } - return ParamChange{} -} - -// QuerySubspacesRequest defines a request type for querying for all registered -// subspaces and all keys for a subspace. -type QuerySubspacesRequest struct { -} - -func (m *QuerySubspacesRequest) Reset() { *m = QuerySubspacesRequest{} } -func (m *QuerySubspacesRequest) String() string { return proto.CompactTextString(m) } -func (*QuerySubspacesRequest) ProtoMessage() {} -func (*QuerySubspacesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2b32979c1792ccc4, []int{2} -} -func (m *QuerySubspacesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySubspacesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySubspacesRequest.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 *QuerySubspacesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySubspacesRequest.Merge(m, src) -} -func (m *QuerySubspacesRequest) XXX_Size() int { - return m.Size() -} -func (m *QuerySubspacesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySubspacesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySubspacesRequest proto.InternalMessageInfo - -// QuerySubspacesResponse defines the response types for querying for all -// registered subspaces and all keys for a subspace. -type QuerySubspacesResponse struct { - Subspaces []*Subspace `protobuf:"bytes,1,rep,name=subspaces,proto3" json:"subspaces,omitempty"` -} - -func (m *QuerySubspacesResponse) Reset() { *m = QuerySubspacesResponse{} } -func (m *QuerySubspacesResponse) String() string { return proto.CompactTextString(m) } -func (*QuerySubspacesResponse) ProtoMessage() {} -func (*QuerySubspacesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2b32979c1792ccc4, []int{3} -} -func (m *QuerySubspacesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySubspacesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySubspacesResponse.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 *QuerySubspacesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySubspacesResponse.Merge(m, src) -} -func (m *QuerySubspacesResponse) XXX_Size() int { - return m.Size() -} -func (m *QuerySubspacesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySubspacesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySubspacesResponse proto.InternalMessageInfo - -func (m *QuerySubspacesResponse) GetSubspaces() []*Subspace { - if m != nil { - return m.Subspaces - } - return nil -} - -// Subspace defines a parameter subspace name and all the keys that exist for -// the subspace. -type Subspace struct { - Subspace string `protobuf:"bytes,1,opt,name=subspace,proto3" json:"subspace,omitempty"` - Keys []string `protobuf:"bytes,2,rep,name=keys,proto3" json:"keys,omitempty"` -} - -func (m *Subspace) Reset() { *m = Subspace{} } -func (m *Subspace) String() string { return proto.CompactTextString(m) } -func (*Subspace) ProtoMessage() {} -func (*Subspace) Descriptor() ([]byte, []int) { - return fileDescriptor_2b32979c1792ccc4, []int{4} -} -func (m *Subspace) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Subspace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Subspace.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 *Subspace) XXX_Merge(src proto.Message) { - xxx_messageInfo_Subspace.Merge(m, src) -} -func (m *Subspace) XXX_Size() int { - return m.Size() -} -func (m *Subspace) XXX_DiscardUnknown() { - xxx_messageInfo_Subspace.DiscardUnknown(m) -} - -var xxx_messageInfo_Subspace proto.InternalMessageInfo - -func (m *Subspace) GetSubspace() string { - if m != nil { - return m.Subspace - } - return "" -} - -func (m *Subspace) GetKeys() []string { - if m != nil { - return m.Keys - } - return nil -} - -func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.params.v1beta1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.params.v1beta1.QueryParamsResponse") - proto.RegisterType((*QuerySubspacesRequest)(nil), "cosmos.params.v1beta1.QuerySubspacesRequest") - proto.RegisterType((*QuerySubspacesResponse)(nil), "cosmos.params.v1beta1.QuerySubspacesResponse") - proto.RegisterType((*Subspace)(nil), "cosmos.params.v1beta1.Subspace") -} - -func init() { proto.RegisterFile("cosmos/params/v1beta1/query.proto", fileDescriptor_2b32979c1792ccc4) } - -var fileDescriptor_2b32979c1792ccc4 = []byte{ - // 463 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xb1, 0x8e, 0xd3, 0x30, - 0x1c, 0xc6, 0xe3, 0x94, 0x3b, 0x5d, 0x7c, 0x03, 0xe0, 0xe3, 0x50, 0x88, 0x20, 0x0d, 0x16, 0x48, - 0xe5, 0x74, 0x8d, 0xb9, 0x82, 0x18, 0x40, 0x30, 0xf4, 0x1e, 0x00, 0x08, 0xdb, 0x2d, 0xc8, 0xbd, - 0xb3, 0x42, 0x94, 0x36, 0x76, 0xe3, 0x14, 0x91, 0x95, 0x81, 0x19, 0x89, 0x67, 0x40, 0x62, 0x64, - 0x60, 0xe0, 0x11, 0x2a, 0xa6, 0x0a, 0x16, 0x26, 0x84, 0x5a, 0x24, 0x5e, 0x03, 0xc5, 0x4e, 0x8a, - 0xae, 0x4d, 0xab, 0x2e, 0x95, 0xed, 0x7e, 0xdf, 0xf7, 0xff, 0xe5, 0x73, 0x02, 0x6f, 0x9e, 0x72, - 0x39, 0xe0, 0x92, 0x08, 0x9a, 0xd2, 0x81, 0x24, 0xaf, 0x8f, 0x7a, 0x2c, 0xa3, 0x47, 0x64, 0x38, - 0x62, 0x69, 0xee, 0x8b, 0x94, 0x67, 0x1c, 0xed, 0x6b, 0x89, 0xaf, 0x25, 0x7e, 0x29, 0x71, 0xae, - 0x84, 0x3c, 0xe4, 0x4a, 0x41, 0x8a, 0x95, 0x16, 0x3b, 0xd7, 0x43, 0xce, 0xc3, 0x3e, 0x23, 0x54, - 0x44, 0x84, 0x26, 0x09, 0xcf, 0x68, 0x16, 0xf1, 0x44, 0x96, 0xff, 0xe2, 0xfa, 0x69, 0x65, 0xb2, - 0xd6, 0x5c, 0xa6, 0x83, 0x28, 0xe1, 0x44, 0xfd, 0x96, 0x47, 0xd7, 0xb4, 0xed, 0xa5, 0x9e, 0x56, - 0xe1, 0x14, 0x1b, 0xdc, 0x85, 0xe8, 0x79, 0xc1, 0xfa, 0x4c, 0x45, 0x04, 0x6c, 0x38, 0x62, 0x32, - 0x43, 0x0e, 0xdc, 0x91, 0xa3, 0x9e, 0x14, 0xf4, 0x94, 0xd9, 0xc0, 0x03, 0x2d, 0x2b, 0x98, 0xef, - 0xd1, 0x25, 0xd8, 0x88, 0x59, 0x6e, 0x9b, 0xea, 0xb8, 0x58, 0xe2, 0x13, 0xb8, 0x77, 0x2e, 0x43, - 0x0a, 0x9e, 0x48, 0x86, 0x8e, 0xe1, 0x96, 0x02, 0x53, 0x09, 0xbb, 0x1d, 0xec, 0xd7, 0xf6, 0xe0, - 0x2b, 0xd7, 0xf1, 0x2b, 0x9a, 0x84, 0xac, 0x6b, 0x8d, 0x7f, 0x35, 0x8d, 0x4f, 0x7f, 0x3f, 0x1f, - 0x80, 0x40, 0x7b, 0xf1, 0x21, 0xdc, 0x57, 0xd9, 0x2f, 0xca, 0xf1, 0x15, 0xe2, 0xc3, 0xbd, 0xef, - 0x5f, 0xda, 0x17, 0x75, 0x62, 0x5b, 0x9e, 0xc5, 0xde, 0x5d, 0xff, 0xfe, 0x03, 0xdc, 0x87, 0x57, - 0x17, 0xd5, 0x25, 0xcc, 0x63, 0x68, 0x55, 0x4f, 0x20, 0x6d, 0xe0, 0x35, 0x5a, 0xbb, 0x9d, 0xe6, - 0x0a, 0xa0, 0xca, 0x1c, 0xfc, 0x77, 0xd4, 0x4f, 0x7b, 0x0a, 0x77, 0x2a, 0xed, 0xda, 0xc6, 0x10, - 0xbc, 0x10, 0xb3, 0x5c, 0xda, 0xa6, 0xd7, 0x68, 0x59, 0x81, 0x5a, 0xd7, 0x06, 0x76, 0xbe, 0x9a, - 0x70, 0x4b, 0xf1, 0xa3, 0x77, 0x00, 0x6e, 0xeb, 0x3a, 0xd1, 0x9d, 0x15, 0x98, 0xcb, 0xd7, 0xe6, - 0x1c, 0x6c, 0x22, 0xd5, 0x85, 0xe0, 0xdb, 0x6f, 0x7f, 0xfc, 0xf9, 0x60, 0x36, 0xd1, 0x0d, 0xb2, - 0xee, 0x9d, 0x42, 0x1f, 0x01, 0xb4, 0xe6, 0x6d, 0xa2, 0xc3, 0x75, 0x03, 0x16, 0xaf, 0xc8, 0x69, - 0x6f, 0xa8, 0x2e, 0x89, 0x1e, 0x7d, 0x5b, 0xae, 0x44, 0x41, 0x62, 0xe4, 0xad, 0x80, 0x9c, 0x5f, - 0x50, 0xf7, 0xc9, 0x78, 0xea, 0x82, 0xc9, 0xd4, 0x05, 0xbf, 0xa7, 0x2e, 0x78, 0x3f, 0x73, 0x8d, - 0xc9, 0xcc, 0x35, 0x7e, 0xce, 0x5c, 0xe3, 0xe4, 0x96, 0xb6, 0xca, 0xb3, 0xd8, 0x8f, 0x38, 0x79, - 0x53, 0x45, 0x64, 0xb9, 0x60, 0x92, 0x88, 0x94, 0x0b, 0x2e, 0x69, 0xbf, 0xb7, 0xad, 0x3e, 0x87, - 0x7b, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0xb1, 0xeb, 0xb5, 0x8e, 0xd0, 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 { - // Params queries a specific parameter of a module, given its subspace and - // key. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Subspaces queries for all registered subspaces and all keys for a subspace. - Subspaces(ctx context.Context, in *QuerySubspacesRequest, opts ...grpc.CallOption) (*QuerySubspacesResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { - out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/cosmos.params.v1beta1.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Subspaces(ctx context.Context, in *QuerySubspacesRequest, opts ...grpc.CallOption) (*QuerySubspacesResponse, error) { - out := new(QuerySubspacesResponse) - err := c.cc.Invoke(ctx, "/cosmos.params.v1beta1.Query/Subspaces", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - // Params queries a specific parameter of a module, given its subspace and - // key. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Subspaces queries for all registered subspaces and all keys for a subspace. - Subspaces(context.Context, *QuerySubspacesRequest) (*QuerySubspacesResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} -func (*UnimplementedQueryServer) Subspaces(ctx context.Context, req *QuerySubspacesRequest) (*QuerySubspacesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Subspaces not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryParamsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Params(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.params.v1beta1.Query/Params", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Subspaces_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QuerySubspacesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Subspaces(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.params.v1beta1.Query/Subspaces", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Subspaces(ctx, req.(*QuerySubspacesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var Query_serviceDesc = _Query_serviceDesc -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.params.v1beta1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "Subspaces", - Handler: _Query_Subspaces_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/params/v1beta1/query.proto", -} - -func (m *QueryParamsRequest) 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 *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0x12 - } - if len(m.Subspace) > 0 { - i -= len(m.Subspace) - copy(dAtA[i:], m.Subspace) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Subspace))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryParamsResponse) 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 *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Param.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 *QuerySubspacesRequest) 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 *QuerySubspacesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySubspacesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QuerySubspacesResponse) 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 *QuerySubspacesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySubspacesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Subspaces) > 0 { - for iNdEx := len(m.Subspaces) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Subspaces[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 *Subspace) 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 *Subspace) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Subspace) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Keys) > 0 { - for iNdEx := len(m.Keys) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Keys[iNdEx]) - copy(dAtA[i:], m.Keys[iNdEx]) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Keys[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Subspace) > 0 { - i -= len(m.Subspace) - copy(dAtA[i:], m.Subspace) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Subspace))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *QueryParamsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Subspace) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Key) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Param.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QuerySubspacesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QuerySubspacesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Subspaces) > 0 { - for _, e := range m.Subspaces { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *Subspace) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Subspace) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if len(m.Keys) > 0 { - for _, s := range m.Keys { - l = len(s) - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *QueryParamsRequest) 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: QueryParamsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Subspace", 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.Subspace = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - 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 *QueryParamsResponse) 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: QueryParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Param", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Param.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 *QuerySubspacesRequest) 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: QuerySubspacesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySubspacesRequest: 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 *QuerySubspacesResponse) 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: QuerySubspacesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySubspacesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Subspaces", 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.Subspaces = append(m.Subspaces, &Subspace{}) - if err := m.Subspaces[len(m.Subspaces)-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 *Subspace) 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: Subspace: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Subspace: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Subspace", 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.Subspace = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Keys", 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.Keys = append(m.Keys, 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 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/params/types/proposal/query.pb.gw.go b/x/params/types/proposal/query.pb.gw.go deleted file mode 100644 index 6454d314e358..000000000000 --- a/x/params/types/proposal/query.pb.gw.go +++ /dev/null @@ -1,236 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: cosmos/params/v1beta1/query.proto - -/* -Package proposal is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package proposal - -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 - -var ( - filter_Query_Params_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Params_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Params_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Params(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_Subspaces_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySubspacesRequest - var metadata runtime.ServerMetadata - - msg, err := client.Subspaces(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Subspaces_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySubspacesRequest - var metadata runtime.ServerMetadata - - msg, err := server.Subspaces(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_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Subspaces_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_Subspaces_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_Subspaces_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_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Subspaces_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_Subspaces_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_Subspaces_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1}, []string{"cosmos", "params", "v1beta1"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Subspaces_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "params", "v1beta1", "subspaces"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Params_0 = runtime.ForwardResponseMessage - - forward_Query_Subspaces_0 = runtime.ForwardResponseMessage -) diff --git a/x/params/types/querier.go b/x/params/types/querier.go deleted file mode 100644 index 43914df66ad8..000000000000 --- a/x/params/types/querier.go +++ /dev/null @@ -1,35 +0,0 @@ -package types - -// Querier path constants -const ( - QueryParams = "params" -) - -// QuerySubspaceParams defines the params for querying module params by a given -// subspace and key. -type QuerySubspaceParams struct { - Subspace string - Key string -} - -// SubspaceParamsResponse defines the response for querying parameters by subspace. -type SubspaceParamsResponse struct { - Subspace string - Key string - Value string -} - -func NewQuerySubspaceParams(ss, key string) QuerySubspaceParams { - return QuerySubspaceParams{ - Subspace: ss, - Key: key, - } -} - -func NewSubspaceParamsResponse(ss, key, value string) SubspaceParamsResponse { - return SubspaceParamsResponse{ - Subspace: ss, - Key: key, - Value: value, - } -} diff --git a/x/params/types/subspace.go b/x/params/types/subspace.go deleted file mode 100644 index 69691de8ae8a..000000000000 --- a/x/params/types/subspace.go +++ /dev/null @@ -1,303 +0,0 @@ -package types - -import ( - "fmt" - "maps" - "reflect" - - "cosmossdk.io/store/prefix" - storetypes "cosmossdk.io/store/types" - - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -const ( - // StoreKey is the string store key for the param store - StoreKey = "params" - - // TStoreKey is the string store key for the param transient store - TStoreKey = "transient_params" -) - -// Individual parameter store for each keeper -// Transient store persists for a block, so we use it for -// recording whether the parameter has been changed or not -type Subspace struct { - cdc codec.BinaryCodec - legacyAmino *codec.LegacyAmino - key storetypes.StoreKey // []byte -> []byte, stores parameter - tkey storetypes.StoreKey // []byte -> bool, stores parameter change - name []byte - table KeyTable -} - -// NewSubspace constructs a store with namestore -func NewSubspace(cdc codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey storetypes.StoreKey, name string) Subspace { - return Subspace{ - cdc: cdc, - legacyAmino: legacyAmino, - key: key, - tkey: tkey, - name: []byte(name), - table: NewKeyTable(), - } -} - -// HasKeyTable returns if the Subspace has a KeyTable registered. -func (s Subspace) HasKeyTable() bool { - return len(s.table.m) > 0 -} - -// WithKeyTable initializes KeyTable and returns modified Subspace -func (s Subspace) WithKeyTable(table KeyTable) Subspace { - if table.m == nil { - panic("WithKeyTable() called with nil KeyTable") - } - if len(s.table.m) != 0 { - panic("WithKeyTable() called on already initialized Subspace") - } - - 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 - name := s.name - s.name = make([]byte, len(name), len(name)+table.maxKeyLength()) - copy(s.name, name) - - return s -} - -// Returns a KVStore identical with ctx.KVStore(s.key).Prefix() -func (s Subspace) kvStore(ctx sdk.Context) storetypes.KVStore { - // append here is safe, appends within a function won't cause - // weird side effects when its singlethreaded - return prefix.NewStore(ctx.KVStore(s.key), append(s.name, '/')) -} - -// Returns a transient store for modification -func (s Subspace) transientStore(ctx sdk.Context) storetypes.KVStore { - // append here is safe, appends within a function won't cause - // weird side effects when its singlethreaded - return prefix.NewStore(ctx.TransientStore(s.tkey), append(s.name, '/')) -} - -// Validate attempts to validate a parameter value by its key. If the key is not -// registered or if the validation of the value fails, an error is returned. -func (s Subspace) Validate(ctx sdk.Context, key []byte, value interface{}) error { - attr, ok := s.table.m[string(key)] - if !ok { - return fmt.Errorf("parameter %s not registered", key) - } - - if err := attr.vfn(value); err != nil { - return fmt.Errorf("invalid parameter value: %w", err) - } - - return nil -} - -// Get queries for a parameter by key from the Subspace's KVStore and sets the -// value to the provided pointer. If the value does not exist, it will panic. -func (s Subspace) Get(ctx sdk.Context, key []byte, ptr interface{}) { - s.checkType(key, ptr) - - store := s.kvStore(ctx) - bz := store.Get(key) - - if err := s.legacyAmino.UnmarshalJSON(bz, ptr); err != nil { - panic(err) - } -} - -// GetIfExists queries for a parameter by key from the Subspace's KVStore and -// sets the value to the provided pointer. If the value does not exist, it will -// perform a no-op. -func (s Subspace) GetIfExists(ctx sdk.Context, key []byte, ptr interface{}) { - store := s.kvStore(ctx) - bz := store.Get(key) - if bz == nil { - return - } - - s.checkType(key, ptr) - - if err := s.legacyAmino.UnmarshalJSON(bz, ptr); err != nil { - panic(err) - } -} - -// IterateKeys iterates over all the keys in the subspace and executes the -// provided callback. If the callback returns true for a given key, iteration -// will halt. -func (s Subspace) IterateKeys(ctx sdk.Context, cb func(key []byte) bool) { - store := s.kvStore(ctx) - - iter := storetypes.KVStorePrefixIterator(store, nil) - defer iter.Close() - - for ; iter.Valid(); iter.Next() { - if cb(iter.Key()) { - break - } - } -} - -// GetRaw queries for the raw values bytes for a parameter by key. -func (s Subspace) GetRaw(ctx sdk.Context, key []byte) []byte { - store := s.kvStore(ctx) - return store.Get(key) -} - -// Has returns if a parameter key exists or not in the Subspace's KVStore. -func (s Subspace) Has(ctx sdk.Context, key []byte) bool { - store := s.kvStore(ctx) - return store.Has(key) -} - -// Modified returns true if the parameter key is set in the Subspace's transient -// KVStore. -func (s Subspace) Modified(ctx sdk.Context, key []byte) bool { - tstore := s.transientStore(ctx) - return tstore.Has(key) -} - -// checkType verifies that the provided key and value are comptable and registered. -func (s Subspace) checkType(key []byte, value interface{}) { - attr, ok := s.table.m[string(key)] - if !ok { - panic(fmt.Sprintf("parameter %s not registered", key)) - } - - ty := attr.ty - pty := reflect.TypeOf(value) - if pty.Kind() == reflect.Ptr { - pty = pty.Elem() - } - - if pty != ty { - panic("type mismatch with registered table") - } -} - -// Set stores a value for given a parameter key assuming the parameter type has -// been registered. It will panic if the parameter type has not been registered -// or if the value cannot be encoded. A change record is also set in the Subspace's -// transient KVStore to mark the parameter as modified. -func (s Subspace) Set(ctx sdk.Context, key []byte, value interface{}) { - s.checkType(key, value) - store := s.kvStore(ctx) - - bz, err := s.legacyAmino.MarshalJSON(value) - if err != nil { - panic(err) - } - - store.Set(key, bz) - - tstore := s.transientStore(ctx) - tstore.Set(key, []byte{}) -} - -// Update stores an updated raw value for a given parameter key assuming the -// parameter type has been registered. It will panic if the parameter type has -// not been registered or if the value cannot be encoded. An error is returned -// if the raw value is not compatible with the registered type for the parameter -// key or if the new value is invalid as determined by the registered type's -// validation function. -func (s Subspace) Update(ctx sdk.Context, key, value []byte) error { - attr, ok := s.table.m[string(key)] - if !ok { - panic(fmt.Sprintf("parameter %s not registered", key)) - } - - ty := attr.ty - dest := reflect.New(ty).Interface() - s.GetIfExists(ctx, key, dest) - - if err := s.legacyAmino.UnmarshalJSON(value, dest); err != nil { - return err - } - - // destValue contains the dereferenced value of dest so validation function do - // not have to operate on pointers. - destValue := reflect.Indirect(reflect.ValueOf(dest)).Interface() - if err := s.Validate(ctx, key, destValue); err != nil { - return err - } - - s.Set(ctx, key, dest) - return nil -} - -// GetParamSet iterates through each ParamSetPair where for each pair, it will -// retrieve the value and set it to the corresponding value pointer provided -// in the ParamSetPair by calling Subspace#Get. -func (s Subspace) GetParamSet(ctx sdk.Context, ps ParamSet) { - for _, pair := range ps.ParamSetPairs() { - s.Get(ctx, pair.Key, pair.Value) - } -} - -// GetParamSetIfExists iterates through each ParamSetPair where for each pair, it will -// retrieve the value and set it to the corresponding value pointer provided -// in the ParamSetPair by calling Subspace#GetIfExists. -func (s Subspace) GetParamSetIfExists(ctx sdk.Context, ps ParamSet) { - for _, pair := range ps.ParamSetPairs() { - s.GetIfExists(ctx, pair.Key, pair.Value) - } -} - -// SetParamSet iterates through each ParamSetPair and sets the value with the -// corresponding parameter key in the Subspace's KVStore. -func (s Subspace) SetParamSet(ctx sdk.Context, ps ParamSet) { - for _, pair := range ps.ParamSetPairs() { - // pair.Field is a pointer to the field, so indirecting the ptr. - // go-amino automatically handles it but just for sure, - // since SetStruct is meant to be used in InitGenesis - // so this method will not be called frequently - v := reflect.Indirect(reflect.ValueOf(pair.Value)).Interface() - - if err := pair.ValidatorFn(v); err != nil { - panic(fmt.Sprintf("value from ParamSetPair is invalid: %s", err)) - } - - s.Set(ctx, pair.Key, v) - } -} - -// Name returns the name of the Subspace. -func (s Subspace) Name() string { - return string(s.name) -} - -// Wrapper of Subspace, provides immutable functions only -type ReadOnlySubspace struct { - s Subspace -} - -// Get delegates a read-only Get call to the Subspace. -func (ros ReadOnlySubspace) Get(ctx sdk.Context, key []byte, ptr interface{}) { - ros.s.Get(ctx, key, ptr) -} - -// GetRaw delegates a read-only GetRaw call to the Subspace. -func (ros ReadOnlySubspace) GetRaw(ctx sdk.Context, key []byte) []byte { - return ros.s.GetRaw(ctx, key) -} - -// Has delegates a read-only Has call to the Subspace. -func (ros ReadOnlySubspace) Has(ctx sdk.Context, key []byte) bool { - return ros.s.Has(ctx, key) -} - -// Modified delegates a read-only Modified call to the Subspace. -func (ros ReadOnlySubspace) Modified(ctx sdk.Context, key []byte) bool { - return ros.s.Modified(ctx, key) -} - -// Name delegates a read-only Name call to the Subspace. -func (ros ReadOnlySubspace) Name() string { - return ros.s.Name() -} diff --git a/x/params/types/subspace_test.go b/x/params/types/subspace_test.go deleted file mode 100644 index 651d868ec18f..000000000000 --- a/x/params/types/subspace_test.go +++ /dev/null @@ -1,270 +0,0 @@ -package types_test - -import ( - "bytes" - "fmt" - "testing" - "time" - - "github.com/stretchr/testify/suite" - - coretesting "cosmossdk.io/core/testing" - "cosmossdk.io/log" - "cosmossdk.io/store" - "cosmossdk.io/store/metrics" - storetypes "cosmossdk.io/store/types" - paramsmodule "cosmossdk.io/x/params" - "cosmossdk.io/x/params/types" - - "github.com/cosmos/cosmos-sdk/codec" - codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil" - sdk "github.com/cosmos/cosmos-sdk/types" - moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" -) - -type SubspaceTestSuite struct { - suite.Suite - - cdc codec.Codec - amino *codec.LegacyAmino - ctx sdk.Context - ss types.Subspace -} - -func (suite *SubspaceTestSuite) SetupTest() { - db := coretesting.NewMemDB() - - ms := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) - ms.MountStoreWithDB(key, storetypes.StoreTypeIAVL, db) - ms.MountStoreWithDB(tkey, storetypes.StoreTypeTransient, db) - suite.NoError(ms.LoadLatestVersion()) - - encodingConfig := moduletestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{}, paramsmodule.AppModule{}) - suite.cdc = encodingConfig.Codec - suite.amino = encodingConfig.Amino - - ss := types.NewSubspace(suite.cdc, suite.amino, key, tkey, "testsubspace") - suite.ctx = sdk.NewContext(ms, false, log.NewNopLogger()) - suite.ss = ss.WithKeyTable(paramKeyTable()) -} - -func (suite *SubspaceTestSuite) TestKeyTable() { - suite.Require().True(suite.ss.HasKeyTable()) - suite.Require().Panics(func() { - suite.ss.WithKeyTable(paramKeyTable()) - }) - suite.Require().NotPanics(func() { - ss := types.NewSubspace(suite.cdc, suite.amino, key, tkey, "testsubspace2") - _ = ss.WithKeyTable(paramKeyTable()) - }) -} - -func (suite *SubspaceTestSuite) TestGetSet() { - var v time.Duration - t := time.Hour * 48 - - suite.Require().Panics(func() { - suite.ss.Get(suite.ctx, keyUnbondingTime, &v) - }) - suite.Require().NotEqual(t, v) - suite.Require().NotPanics(func() { - suite.ss.Set(suite.ctx, keyUnbondingTime, t) - }) - suite.Require().NotPanics(func() { - suite.ss.Get(suite.ctx, keyUnbondingTime, &v) - }) - suite.Require().Equal(t, v) -} - -func (suite *SubspaceTestSuite) TestGetIfExists() { - var v time.Duration - - suite.Require().NotPanics(func() { - suite.ss.GetIfExists(suite.ctx, keyUnbondingTime, &v) - }) - suite.Require().Equal(time.Duration(0), v) -} - -func (suite *SubspaceTestSuite) TestGetRaw() { - t := time.Hour * 48 - - suite.Require().NotPanics(func() { - suite.ss.Set(suite.ctx, keyUnbondingTime, t) - }) - suite.Require().NotPanics(func() { - res := suite.ss.GetRaw(suite.ctx, keyUnbondingTime) - suite.Require().Equal("2231373238303030303030303030303022", fmt.Sprintf("%X", res)) - }) -} - -func (suite *SubspaceTestSuite) TestIterateKeys() { - suite.Require().NotPanics(func() { - suite.ss.Set(suite.ctx, keyUnbondingTime, time.Second) - }) - suite.Require().NotPanics(func() { - suite.ss.Set(suite.ctx, keyMaxValidators, uint16(50)) - }) - suite.Require().NotPanics(func() { - suite.ss.Set(suite.ctx, keyBondDenom, "stake") - }) - - var keys [][]byte - suite.ss.IterateKeys(suite.ctx, func(key []byte) bool { - keys = append(keys, key) - return false - }) - suite.Require().Len(keys, 3) - suite.Require().Contains(keys, keyUnbondingTime) - suite.Require().Contains(keys, keyMaxValidators) - suite.Require().Contains(keys, keyBondDenom) - - var keys2 [][]byte - suite.ss.IterateKeys(suite.ctx, func(key []byte) bool { - if bytes.Equal(key, keyUnbondingTime) { - return true - } - - keys2 = append(keys2, key) - return false - }) - suite.Require().Len(keys2, 2) - suite.Require().Contains(keys2, keyMaxValidators) - suite.Require().Contains(keys2, keyBondDenom) -} - -func (suite *SubspaceTestSuite) TestHas() { - t := time.Hour * 48 - - suite.Require().False(suite.ss.Has(suite.ctx, keyUnbondingTime)) - suite.Require().NotPanics(func() { - suite.ss.Set(suite.ctx, keyUnbondingTime, t) - }) - suite.Require().True(suite.ss.Has(suite.ctx, keyUnbondingTime)) -} - -func (suite *SubspaceTestSuite) TestModified() { - t := time.Hour * 48 - - suite.Require().False(suite.ss.Modified(suite.ctx, keyUnbondingTime)) - suite.Require().NotPanics(func() { - suite.ss.Set(suite.ctx, keyUnbondingTime, t) - }) - suite.Require().True(suite.ss.Modified(suite.ctx, keyUnbondingTime)) -} - -func (suite *SubspaceTestSuite) TestUpdate() { - suite.Require().Panics(func() { - err := suite.ss.Update(suite.ctx, []byte("invalid_key"), nil) - suite.Require().NoError(err) - }) - - t := time.Hour * 48 - suite.Require().NotPanics(func() { - suite.ss.Set(suite.ctx, keyUnbondingTime, t) - }) - - bad := time.Minute * 5 - - bz, err := suite.amino.MarshalJSON(bad) - suite.Require().NoError(err) - suite.Require().Error(suite.ss.Update(suite.ctx, keyUnbondingTime, bz)) - - good := time.Hour * 360 - bz, err = suite.amino.MarshalJSON(good) - suite.Require().NoError(err) - suite.Require().NoError(suite.ss.Update(suite.ctx, keyUnbondingTime, bz)) - - var v time.Duration - - suite.Require().NotPanics(func() { - suite.ss.Get(suite.ctx, keyUnbondingTime, &v) - }) - suite.Require().Equal(good, v) -} - -func (suite *SubspaceTestSuite) TestGetParamSet() { - a := params{ - UnbondingTime: time.Hour * 48, - MaxValidators: 100, - BondDenom: "stake", - } - suite.Require().NotPanics(func() { - suite.ss.Set(suite.ctx, keyUnbondingTime, a.UnbondingTime) - suite.ss.Set(suite.ctx, keyMaxValidators, a.MaxValidators) - suite.ss.Set(suite.ctx, keyBondDenom, a.BondDenom) - }) - - b := params{} - suite.Require().NotPanics(func() { - suite.ss.GetParamSet(suite.ctx, &b) - }) - suite.Require().Equal(a.UnbondingTime, b.UnbondingTime) - suite.Require().Equal(a.MaxValidators, b.MaxValidators) - suite.Require().Equal(a.BondDenom, b.BondDenom) -} - -func (suite *SubspaceTestSuite) TestGetParamSetIfExists() { - a := params{ - UnbondingTime: time.Hour * 48, - MaxValidators: 100, - BondDenom: "stake", - } - suite.Require().NotPanics(func() { - suite.ss.Set(suite.ctx, keyUnbondingTime, a.UnbondingTime) - suite.ss.Set(suite.ctx, keyMaxValidators, a.MaxValidators) - suite.ss.Set(suite.ctx, keyBondDenom, a.BondDenom) - }) - - b := paramsV2{} - suite.Require().NotPanics(func() { - suite.ss.GetParamSetIfExists(suite.ctx, &b) - }) - suite.Require().Equal(a.UnbondingTime, b.UnbondingTime) - suite.Require().Equal(a.MaxValidators, b.MaxValidators) - suite.Require().Equal(a.BondDenom, b.BondDenom) - suite.Require().Zero(b.MaxRedelegationEntries) - suite.Require().False(suite.ss.Has(suite.ctx, keyMaxRedelegationEntries), "key from the new param version should not yet exist") -} - -func (suite *SubspaceTestSuite) TestSetParamSet() { - testCases := []struct { - name string - ps types.ParamSet - }{ - {"invalid unbonding time", ¶ms{time.Hour * 1, 100, "stake"}}, - {"invalid bond denom", ¶ms{time.Hour * 48, 100, ""}}, - } - - for _, tc := range testCases { - suite.Run(tc.name, func() { - suite.Require().Panics(func() { - suite.ss.SetParamSet(suite.ctx, tc.ps) - }) - }) - } - - a := params{ - UnbondingTime: time.Hour * 48, - MaxValidators: 100, - BondDenom: "stake", - } - suite.Require().NotPanics(func() { - suite.ss.SetParamSet(suite.ctx, &a) - }) - - b := params{} - suite.Require().NotPanics(func() { - suite.ss.GetParamSet(suite.ctx, &b) - }) - suite.Require().Equal(a.UnbondingTime, b.UnbondingTime) - suite.Require().Equal(a.MaxValidators, b.MaxValidators) - suite.Require().Equal(a.BondDenom, b.BondDenom) -} - -func (suite *SubspaceTestSuite) TestName() { - suite.Require().Equal("testsubspace", suite.ss.Name()) -} - -func TestKeeperTestSuite(t *testing.T) { - suite.Run(t, new(SubspaceTestSuite)) -} diff --git a/x/params/types/table.go b/x/params/types/table.go deleted file mode 100644 index 9daf24888b7d..000000000000 --- a/x/params/types/table.go +++ /dev/null @@ -1,83 +0,0 @@ -package types - -import ( - "reflect" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -type attribute struct { - ty reflect.Type - vfn ValueValidatorFn -} - -// KeyTable subspaces appropriate type for each parameter key -type KeyTable struct { - m map[string]attribute -} - -// IsOnePerModuleType implements depinject.OnePerModuleType -func (KeyTable) IsOnePerModuleType() {} - -func NewKeyTable(pairs ...ParamSetPair) KeyTable { - keyTable := KeyTable{ - m: make(map[string]attribute), - } - - for _, psp := range pairs { - keyTable = keyTable.RegisterType(psp) - } - - return keyTable -} - -// RegisterType registers a single ParamSetPair (key-type pair) in a KeyTable. -func (t KeyTable) RegisterType(psp ParamSetPair) KeyTable { - if len(psp.Key) == 0 { - panic("cannot register ParamSetPair with an parameter empty key") - } - if !sdk.IsAlphaNumeric(string(psp.Key)) { - panic("cannot register ParamSetPair with a non-alphanumeric parameter key") - } - if psp.ValidatorFn == nil { - panic("cannot register ParamSetPair without a value validation function") - } - - keystr := string(psp.Key) - if _, ok := t.m[keystr]; ok { - panic("duplicate parameter key") - } - - rty := reflect.TypeOf(psp.Value) - - // indirect rty if it is a pointer - for rty.Kind() == reflect.Ptr { - rty = rty.Elem() - } - - t.m[keystr] = attribute{ - vfn: psp.ValidatorFn, - ty: rty, - } - - return t -} - -// RegisterParamSet registers multiple ParamSetPairs from a ParamSet in a KeyTable. -func (t KeyTable) RegisterParamSet(ps ParamSet) KeyTable { - for _, psp := range ps.ParamSetPairs() { - t = t.RegisterType(psp) - } - return t -} - -func (t KeyTable) maxKeyLength() (res int) { - for k := range t.m { - l := len(k) - if l > res { - res = l - } - } - - return -} diff --git a/x/params/types/table_test.go b/x/params/types/table_test.go deleted file mode 100644 index 3ef88039ef2a..000000000000 --- a/x/params/types/table_test.go +++ /dev/null @@ -1,46 +0,0 @@ -package types_test - -import ( - "testing" - "time" - - "github.com/stretchr/testify/require" - - "cosmossdk.io/x/params/types" -) - -func TestKeyTable(t *testing.T) { - table := types.NewKeyTable() - - require.Panics(t, func() { table.RegisterType(types.ParamSetPair{[]byte(""), nil, nil}) }) - require.Panics(t, func() { table.RegisterType(types.ParamSetPair{[]byte("!@#$%"), nil, nil}) }) - require.Panics(t, func() { table.RegisterType(types.ParamSetPair{[]byte("hello,"), nil, nil}) }) - require.Panics(t, func() { table.RegisterType(types.ParamSetPair{[]byte("hello"), nil, nil}) }) - - require.NotPanics(t, func() { - table.RegisterType(types.ParamSetPair{keyBondDenom, string("stake"), validateBondDenom}) - }) - require.NotPanics(t, func() { - table.RegisterType(types.ParamSetPair{keyMaxValidators, uint16(100), validateMaxValidators}) - }) - require.Panics(t, func() { - table.RegisterType(types.ParamSetPair{keyUnbondingTime, time.Duration(1), nil}) - }) - require.NotPanics(t, func() { - table.RegisterType(types.ParamSetPair{keyUnbondingTime, time.Duration(1), validateMaxValidators}) - }) - require.NotPanics(t, func() { - newTable := types.NewKeyTable() - newTable.RegisterParamSet(¶ms{}) - }) - - require.Panics(t, func() { table.RegisterParamSet(¶ms{}) }) - require.Panics(t, func() { types.NewKeyTable(types.ParamSetPair{[]byte(""), nil, nil}) }) - - require.NotPanics(t, func() { - types.NewKeyTable( - types.ParamSetPair{[]byte("test"), string("stake"), validateBondDenom}, - types.ParamSetPair{[]byte("test2"), uint16(100), validateMaxValidators}, - ) - }) -}