diff --git a/CHANGELOG.md b/CHANGELOG.md index aad319de529a..a8b7fb2afd87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -261,6 +261,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (signing) [#14087](https://github.com/cosmos/cosmos-sdk/pull/14087) Add SignModeHandlerWithContext interface with a new `GetSignBytesWithContext` to get the sign bytes using `context.Context` as an argument to access state. * (server) [#14062](https://github.com/cosmos/cosmos-sdk/pull/14062) Remove rosetta from server start. * (crypto) [#3129](https://github.com/cosmos/cosmos-sdk/pull/3129) New armor and keyring key derivation uses aead and encryption uses chacha20poly. +* (app) [#17838](https://github.com/cosmos/cosmos-sdk/pull/17838) Params module was removed from simapp and all imports of the params module removed throughout the repo. + * The Cosmos SDK has migrated aay from using params, if you're app still uses it, then you can leave it plugged into your app ### State Machine Breaking diff --git a/UPGRADING.md b/UPGRADING.md index f1a4ce7a9a7a..792e7f826496 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -5,6 +5,10 @@ Note, always read the **SimApp** section for more information on application wir ## [Unreleased] +### Params + +Params Migrations were removed. It is required to migrate to 0.50 prior to upgrading to .51. + ### SimApp In this section we describe the changes made in Cosmos SDK' SimApp. diff --git a/baseapp/block_gas_test.go b/baseapp/block_gas_test.go index 09b9ffe045e5..7ae5cda888cc 100644 --- a/baseapp/block_gas_test.go +++ b/baseapp/block_gas_test.go @@ -86,7 +86,6 @@ func TestBaseApp_BlockGas(t *testing.T) { configurator.NewAppConfig( configurator.AuthModule(), configurator.TxModule(), - configurator.ParamsModule(), configurator.ConsensusModule(), configurator.BankModule(), configurator.StakingModule(), diff --git a/scripts/mockgen.sh b/scripts/mockgen.sh index cda998093a19..294917e18dd5 100755 --- a/scripts/mockgen.sh +++ b/scripts/mockgen.sh @@ -13,7 +13,6 @@ $mockgen_cmd -source=orm/model/ormtable/hooks.go -package ormmocks -destination $mockgen_cmd -source=x/nft/expected_keepers.go -package testutil -destination x/nft/testutil/expected_keepers_mocks.go $mockgen_cmd -source=x/feegrant/expected_keepers.go -package testutil -destination x/feegrant/testutil/expected_keepers_mocks.go $mockgen_cmd -source=x/mint/types/expected_keepers.go -package testutil -destination x/mint/testutil/expected_keepers_mocks.go -$mockgen_cmd -source=x/params/proposal_handler_test.go -package testutil -destination x/params/testutil/staking_keeper_mock.go $mockgen_cmd -source=x/crisis/types/expected_keepers.go -package testutil -destination x/crisis/testutil/expected_keepers_mocks.go $mockgen_cmd -source=x/auth/tx/config/expected_keepers.go -package testutil -destination x/auth/tx/testutil/expected_keepers_mocks.go $mockgen_cmd -source=x/auth/types/expected_keepers.go -package testutil -destination x/auth/testutil/expected_keepers_mocks.go diff --git a/server/api/server_test.go b/server/api/server_test.go index 0484277b800c..1066e1128ad7 100644 --- a/server/api/server_test.go +++ b/server/api/server_test.go @@ -27,7 +27,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/bank" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" _ "github.com/cosmos/cosmos-sdk/x/genutil" - _ "github.com/cosmos/cosmos-sdk/x/params" _ "github.com/cosmos/cosmos-sdk/x/staking" ) diff --git a/simapp/app.go b/simapp/app.go index 68cee5a26e7a..eb414e1a4994 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -95,11 +95,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/mint" mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - "github.com/cosmos/cosmos-sdk/x/params" - paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" - paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" "github.com/cosmos/cosmos-sdk/x/slashing" slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" @@ -155,7 +150,6 @@ type SimApp struct { GovKeeper govkeeper.Keeper CrisisKeeper *crisiskeeper.Keeper UpgradeKeeper *upgradekeeper.Keeper - ParamsKeeper paramskeeper.Keeper AuthzKeeper authzkeeper.Keeper EvidenceKeeper evidencekeeper.Keeper FeeGrantKeeper feegrantkeeper.Keeper @@ -253,7 +247,7 @@ func NewSimApp( keys := storetypes.NewKVStoreKeys( authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, crisistypes.StoreKey, minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey, - govtypes.StoreKey, paramstypes.StoreKey, consensusparamtypes.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey, + govtypes.StoreKey, consensusparamtypes.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey, evidencetypes.StoreKey, circuittypes.StoreKey, authzkeeper.StoreKey, nftkeeper.StoreKey, group.StoreKey, ) @@ -263,7 +257,6 @@ func NewSimApp( panic(err) } - tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey) app := &SimApp{ BaseApp: bApp, legacyAmino: legacyAmino, @@ -271,11 +264,8 @@ func NewSimApp( txConfig: txConfig, interfaceRegistry: interfaceRegistry, keys: keys, - tkeys: tkeys, } - app.ParamsKeeper = initParamsKeeper(appCodec, legacyAmino, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey]) - // set the BaseApp's parameter store app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper(appCodec, runtime.NewKVStoreService(keys[consensusparamtypes.StoreKey]), authtypes.NewModuleAddress(govtypes.ModuleName).String(), runtime.EventService{}) bApp.SetParamStore(app.ConsensusParamsKeeper.ParamsStore) @@ -340,8 +330,6 @@ func NewSimApp( // by granting the governance module the right to execute the message. // See: https://docs.cosmos.network/main/modules/gov#proposal-messages govRouter := govv1beta1.NewRouter() - govRouter.AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler). - AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)) govConfig := govtypes.DefaultConfig() /* Example of setting gov params: @@ -395,7 +383,6 @@ func NewSimApp( staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper), upgrade.NewAppModule(app.UpgradeKeeper, app.AccountKeeper.AddressCodec()), evidence.NewAppModule(app.EvidenceKeeper), - params.NewAppModule(app.ParamsKeeper), authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), groupmodule.NewAppModule(appCodec, app.GroupKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), nftmodule.NewAppModule(appCodec, app.NFTKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), @@ -412,9 +399,7 @@ func NewSimApp( map[string]module.AppModuleBasic{ genutiltypes.ModuleName: genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), govtypes.ModuleName: gov.NewAppModuleBasic( - []govclient.ProposalHandler{ - paramsclient.ProposalHandler, - }, + []govclient.ProposalHandler{}, ), }) app.BasicModuleManager.RegisterLegacyAminoCodec(legacyAmino) @@ -453,7 +438,7 @@ func NewSimApp( authtypes.ModuleName, banktypes.ModuleName, distrtypes.ModuleName, stakingtypes.ModuleName, slashingtypes.ModuleName, govtypes.ModuleName, minttypes.ModuleName, crisistypes.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, authz.ModuleName, - feegrant.ModuleName, nft.ModuleName, group.ModuleName, paramstypes.ModuleName, upgradetypes.ModuleName, + feegrant.ModuleName, nft.ModuleName, group.ModuleName, upgradetypes.ModuleName, vestingtypes.ModuleName, consensusparamtypes.ModuleName, circuittypes.ModuleName, } app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...) @@ -497,7 +482,6 @@ func NewSimApp( // initialize stores app.MountKVStores(keys) - app.MountTransientStores(tkeys) // initialize BaseApp app.SetInitChainer(app.InitChainer) @@ -678,14 +662,6 @@ func (app *SimApp) GetStoreKeys() []storetypes.StoreKey { return keys } -// GetSubspace returns a param subspace for a given module name. -// -// NOTE: This is solely to be used for testing purposes. -func (app *SimApp) GetSubspace(moduleName string) paramstypes.Subspace { - subspace, _ := app.ParamsKeeper.GetSubspace(moduleName) - return subspace -} - // SimulationManager implements the SimulationApp interface func (app *SimApp) SimulationManager() *module.SimulationManager { return app.sm @@ -757,19 +733,3 @@ func BlockedAddresses() map[string]bool { return modAccAddrs } - -// initParamsKeeper init params keeper and its subspaces -func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey storetypes.StoreKey) paramskeeper.Keeper { - paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey) - - paramsKeeper.Subspace(authtypes.ModuleName) - paramsKeeper.Subspace(banktypes.ModuleName) - paramsKeeper.Subspace(stakingtypes.ModuleName) - paramsKeeper.Subspace(minttypes.ModuleName) - paramsKeeper.Subspace(distrtypes.ModuleName) - paramsKeeper.Subspace(slashingtypes.ModuleName) - paramsKeeper.Subspace(govtypes.ModuleName) - paramsKeeper.Subspace(crisistypes.ModuleName) - - return paramsKeeper -} diff --git a/simapp/app_config.go b/simapp/app_config.go index 2b11313e60dd..776ae93732f3 100644 --- a/simapp/app_config.go +++ b/simapp/app_config.go @@ -21,7 +21,6 @@ import ( groupmodulev1 "cosmossdk.io/api/cosmos/group/module/v1" mintmodulev1 "cosmossdk.io/api/cosmos/mint/module/v1" nftmodulev1 "cosmossdk.io/api/cosmos/nft/module/v1" - paramsmodulev1 "cosmossdk.io/api/cosmos/params/module/v1" slashingmodulev1 "cosmossdk.io/api/cosmos/slashing/module/v1" stakingmodulev1 "cosmossdk.io/api/cosmos/staking/module/v1" txconfigv1 "cosmossdk.io/api/cosmos/tx/config/v1" @@ -65,9 +64,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/group/module" // import for side-effects _ "github.com/cosmos/cosmos-sdk/x/mint" // import for side-effects minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - _ "github.com/cosmos/cosmos-sdk/x/params" // import for side-effects - paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" _ "github.com/cosmos/cosmos-sdk/x/slashing" // import for side-effects slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" _ "github.com/cosmos/cosmos-sdk/x/staking" // import for side-effects @@ -152,7 +148,6 @@ var ( feegrant.ModuleName, nft.ModuleName, group.ModuleName, - paramstypes.ModuleName, upgradetypes.ModuleName, vestingtypes.ModuleName, circuittypes.ModuleName, @@ -197,10 +192,6 @@ var ( Name: slashingtypes.ModuleName, Config: appconfig.WrapAny(&slashingmodulev1.Module{}), }, - { - Name: paramstypes.ModuleName, - Config: appconfig.WrapAny(¶msmodulev1.Module{}), - }, { Name: "tx", Config: appconfig.WrapAny(&txconfigv1.Config{}), @@ -267,9 +258,7 @@ var ( map[string]module.AppModuleBasic{ genutiltypes.ModuleName: genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), govtypes.ModuleName: gov.NewAppModuleBasic( - []govclient.ProposalHandler{ - paramsclient.ProposalHandler, - }, + []govclient.ProposalHandler{}, ), }, )) diff --git a/simapp/app_test.go b/simapp/app_test.go index c25a02da91e0..07aa456e1249 100644 --- a/simapp/app_test.go +++ b/simapp/app_test.go @@ -39,7 +39,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/gov" group "github.com/cosmos/cosmos-sdk/x/group/module" "github.com/cosmos/cosmos-sdk/x/mint" - "github.com/cosmos/cosmos-sdk/x/params" "github.com/cosmos/cosmos-sdk/x/slashing" "github.com/cosmos/cosmos-sdk/x/staking" ) @@ -206,7 +205,6 @@ func TestRunMigrations(t *testing.T) { "slashing": slashing.AppModule{}.ConsensusVersion(), "gov": gov.AppModule{}.ConsensusVersion(), "group": group.AppModule{}.ConsensusVersion(), - "params": params.AppModule{}.ConsensusVersion(), "upgrade": upgrade.AppModule{}.ConsensusVersion(), "vesting": vesting.AppModule{}.ConsensusVersion(), "feegrant": feegrantmodule.AppModule{}.ConsensusVersion(), @@ -255,7 +253,6 @@ func TestInitGenesisOnMigration(t *testing.T) { "distribution": distribution.AppModule{}.ConsensusVersion(), "slashing": slashing.AppModule{}.ConsensusVersion(), "gov": gov.AppModule{}.ConsensusVersion(), - "params": params.AppModule{}.ConsensusVersion(), "upgrade": upgrade.AppModule{}.ConsensusVersion(), "vesting": vesting.AppModule{}.ConsensusVersion(), "feegrant": feegrantmodule.AppModule{}.ConsensusVersion(), diff --git a/simapp/app_v2.go b/simapp/app_v2.go index 38dc0b877cbe..14ef1da5538c 100644 --- a/simapp/app_v2.go +++ b/simapp/app_v2.go @@ -41,8 +41,6 @@ import ( govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" groupkeeper "github.com/cosmos/cosmos-sdk/x/group/keeper" mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" - paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" ) @@ -75,7 +73,6 @@ type SimApp struct { GovKeeper *govkeeper.Keeper CrisisKeeper *crisiskeeper.Keeper UpgradeKeeper *upgradekeeper.Keeper - ParamsKeeper paramskeeper.Keeper AuthzKeeper authzkeeper.Keeper EvidenceKeeper evidencekeeper.Keeper FeeGrantKeeper feegrantkeeper.Keeper @@ -177,7 +174,6 @@ func NewSimApp( &app.GovKeeper, &app.CrisisKeeper, &app.UpgradeKeeper, - &app.ParamsKeeper, &app.AuthzKeeper, &app.EvidenceKeeper, &app.FeeGrantKeeper, @@ -317,14 +313,6 @@ func (app *SimApp) kvStoreKeys() map[string]*storetypes.KVStoreKey { return keys } -// GetSubspace returns a param subspace for a given module name. -// -// NOTE: This is solely to be used for testing purposes. -func (app *SimApp) GetSubspace(moduleName string) paramstypes.Subspace { - subspace, _ := app.ParamsKeeper.GetSubspace(moduleName) - return subspace -} - // SimulationManager implements the SimulationApp interface func (app *SimApp) SimulationManager() *module.SimulationManager { return app.sm diff --git a/simapp/simd/cmd/testnet_test.go b/simapp/simd/cmd/testnet_test.go index 8cc84047a640..6d697b0d0d12 100644 --- a/simapp/simd/cmd/testnet_test.go +++ b/simapp/simd/cmd/testnet_test.go @@ -24,7 +24,6 @@ import ( genutiltest "github.com/cosmos/cosmos-sdk/x/genutil/client/testutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" "github.com/cosmos/cosmos-sdk/x/mint" - "github.com/cosmos/cosmos-sdk/x/params" "github.com/cosmos/cosmos-sdk/x/staking" ) @@ -36,7 +35,6 @@ func Test_TestnetCmd(t *testing.T) { staking.AppModuleBasic{}, mint.AppModuleBasic{}, distribution.AppModuleBasic{}, - params.AppModuleBasic{}, consensus.AppModuleBasic{}, ) diff --git a/tests/integration/bank/app_test.go b/tests/integration/bank/app_test.go index da860ca21e8b..8c9d42e81f02 100644 --- a/tests/integration/bank/app_test.go +++ b/tests/integration/bank/app_test.go @@ -31,7 +31,6 @@ import ( distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" _ "github.com/cosmos/cosmos-sdk/x/gov" govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - _ "github.com/cosmos/cosmos-sdk/x/params" _ "github.com/cosmos/cosmos-sdk/x/staking" ) @@ -117,7 +116,6 @@ func createTestSuite(t *testing.T, genesisAccounts []authtypes.GenesisAccount) s app, err := simtestutil.SetupWithConfiguration( depinject.Configs( configurator.NewAppConfig( - configurator.ParamsModule(), configurator.AuthModule(), configurator.StakingModule(), configurator.TxModule(), diff --git a/tests/integration/bank/keeper/deterministic_test.go b/tests/integration/bank/keeper/deterministic_test.go index 1cd35ba7d3c5..5f7a48199bd7 100644 --- a/tests/integration/bank/keeper/deterministic_test.go +++ b/tests/integration/bank/keeper/deterministic_test.go @@ -28,7 +28,6 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" _ "github.com/cosmos/cosmos-sdk/x/consensus" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - _ "github.com/cosmos/cosmos-sdk/x/params" _ "github.com/cosmos/cosmos-sdk/x/staking" ) diff --git a/tests/integration/gov/genesis_test.go b/tests/integration/gov/genesis_test.go index 0142949dbd30..50ef7e3d7b3b 100644 --- a/tests/integration/gov/genesis_test.go +++ b/tests/integration/gov/genesis_test.go @@ -31,7 +31,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/gov/keeper" "github.com/cosmos/cosmos-sdk/x/gov/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - _ "github.com/cosmos/cosmos-sdk/x/params" _ "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -49,7 +48,6 @@ type suite struct { } var appConfig = configurator.NewAppConfig( - configurator.ParamsModule(), configurator.AuthModule(), configurator.StakingModule(), configurator.BankModule(), diff --git a/tests/integration/gov/module_test.go b/tests/integration/gov/module_test.go index 7853a51da6d3..2c758d40d308 100644 --- a/tests/integration/gov/module_test.go +++ b/tests/integration/gov/module_test.go @@ -22,7 +22,6 @@ func TestItCreatesModuleAccountOnInitBlock(t *testing.T) { app, err := simtestutil.SetupAtGenesis( depinject.Configs( configurator.NewAppConfig( - configurator.ParamsModule(), configurator.AuthModule(), configurator.StakingModule(), configurator.BankModule(), diff --git a/tests/integration/rapidgen/rapidgen.go b/tests/integration/rapidgen/rapidgen.go index 66eaee9a568f..f62ee394d724 100644 --- a/tests/integration/rapidgen/rapidgen.go +++ b/tests/integration/rapidgen/rapidgen.go @@ -25,7 +25,6 @@ import ( gov_v1beta1_api "cosmossdk.io/api/cosmos/gov/v1beta1" groupapi "cosmossdk.io/api/cosmos/group/v1" mintapi "cosmossdk.io/api/cosmos/mint/v1beta1" - paramsapi "cosmossdk.io/api/cosmos/params/v1beta1" slashingapi "cosmossdk.io/api/cosmos/slashing/v1beta1" stakingapi "cosmossdk.io/api/cosmos/staking/v1beta1" upgradeapi "cosmossdk.io/api/cosmos/upgrade/v1beta1" @@ -45,7 +44,6 @@ import ( gov_v1beta1_types "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" grouptypes "github.com/cosmos/cosmos-sdk/x/group" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - "github.com/cosmos/cosmos-sdk/x/params/types/proposal" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -267,9 +265,6 @@ var ( GenType(&minttypes.Params{}, &mintapi.Params{}, GenOpts), - // params - GenType(&proposal.ParameterChangeProposal{}, ¶msapi.ParameterChangeProposal{}, GenOpts), - GenType(&slashingtypes.Params{}, &slashingapi.Params{}, GenOpts.WithDisallowNil()), GenType(&stakingtypes.StakeAuthorization{}, &stakingapi.StakeAuthorization{}, GenOpts), diff --git a/tests/integration/runtime/query_test.go b/tests/integration/runtime/query_test.go index 3ae7a2835f59..2c8b1e16ef7a 100644 --- a/tests/integration/runtime/query_test.go +++ b/tests/integration/runtime/query_test.go @@ -24,7 +24,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/auth/tx/config" _ "github.com/cosmos/cosmos-sdk/x/bank" _ "github.com/cosmos/cosmos-sdk/x/consensus" - _ "github.com/cosmos/cosmos-sdk/x/params" _ "github.com/cosmos/cosmos-sdk/x/staking" ) @@ -45,7 +44,6 @@ func initFixture(t assert.TestingT) *fixture { configurator.NewAppConfig( configurator.AuthModule(), configurator.TxModule(), - configurator.ParamsModule(), configurator.ConsensusModule(), configurator.BankModule(), configurator.StakingModule(), @@ -83,7 +81,7 @@ func TestQueryAppConfig(t *testing.T) { } // has all expected modules - for _, modName := range []string{"auth", "bank", "tx", "consensus", "runtime", "params", "staking"} { + for _, modName := range []string{"auth", "bank", "tx", "consensus", "runtime", "staking"} { modConfig := moduleConfigs[modName] if modConfig == nil { t.Fatalf("missing %s", modName) diff --git a/tests/integration/tx/context_test.go b/tests/integration/tx/context_test.go index 2210c9c934fd..7246a2c798d1 100644 --- a/tests/integration/tx/context_test.go +++ b/tests/integration/tx/context_test.go @@ -33,7 +33,6 @@ func TestDefineCustomGetSigners(t *testing.T) { _, err := simtestutil.SetupAtGenesis( depinject.Configs( configurator.NewAppConfig( - configurator.ParamsModule(), configurator.AuthModule(), configurator.StakingModule(), configurator.BankModule(), @@ -61,7 +60,6 @@ func TestDefineCustomGetSigners(t *testing.T) { _, err = simtestutil.SetupAtGenesis( depinject.Configs( configurator.NewAppConfig( - configurator.ParamsModule(), configurator.AuthModule(), configurator.StakingModule(), configurator.BankModule(), diff --git a/tests/integration/tx/decode_test.go b/tests/integration/tx/decode_test.go index f22123e79732..bce4de221af7 100644 --- a/tests/integration/tx/decode_test.go +++ b/tests/integration/tx/decode_test.go @@ -35,7 +35,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/gov" groupmodule "github.com/cosmos/cosmos-sdk/x/group/module" "github.com/cosmos/cosmos-sdk/x/mint" - "github.com/cosmos/cosmos-sdk/x/params" "github.com/cosmos/cosmos-sdk/x/slashing" "github.com/cosmos/cosmos-sdk/x/staking" ) @@ -45,7 +44,7 @@ func TestDecode(t *testing.T) { encCfg := testutil.MakeTestEncodingConfig( auth.AppModuleBasic{}, authzmodule.AppModuleBasic{}, bank.AppModuleBasic{}, consensus.AppModuleBasic{}, distribution.AppModuleBasic{}, evidence.AppModuleBasic{}, feegrantmodule.AppModuleBasic{}, - gov.AppModuleBasic{}, groupmodule.AppModuleBasic{}, mint.AppModuleBasic{}, params.AppModuleBasic{}, + gov.AppModuleBasic{}, groupmodule.AppModuleBasic{}, mint.AppModuleBasic{}, slashing.AppModuleBasic{}, staking.AppModuleBasic{}, upgrade.AppModuleBasic{}, vesting.AppModuleBasic{}) legacytx.RegressionTestingAminoCodec = encCfg.Amino diff --git a/testutil/configurator/configurator.go b/testutil/configurator/configurator.go index d671b2d82884..4964cbf489a1 100644 --- a/testutil/configurator/configurator.go +++ b/testutil/configurator/configurator.go @@ -56,8 +56,8 @@ func defaultConfig() *Config { "feegrant", "nft", "group", - "params", "consensus", + "params", "vesting", "circuit", }, @@ -76,7 +76,6 @@ func defaultConfig() *Config { "feegrant", "nft", "group", - "params", "consensus", "upgrade", "vesting", @@ -97,7 +96,6 @@ func defaultConfig() *Config { "feegrant", "nft", "group", - "params", "consensus", "upgrade", "vesting", diff --git a/testutil/network/network.go b/testutil/network/network.go index eb0c8ead0d7b..8fc1266045f8 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -59,7 +59,6 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" _ "github.com/cosmos/cosmos-sdk/x/consensus" // import consensus as a blank "github.com/cosmos/cosmos-sdk/x/genutil" - _ "github.com/cosmos/cosmos-sdk/x/params" // import params as a blank _ "github.com/cosmos/cosmos-sdk/x/staking" // import staking as a blank stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -175,7 +174,6 @@ func DefaultConfig(factory TestFixtureFactory) Config { func MinimumAppConfig() depinject.Config { return configurator.NewAppConfig( configurator.AuthModule(), - configurator.ParamsModule(), configurator.BankModule(), configurator.GenutilModule(), configurator.StakingModule(), diff --git a/types/query/pagination_test.go b/types/query/pagination_test.go index 13fbe98efa8a..c561481dfb56 100644 --- a/types/query/pagination_test.go +++ b/types/query/pagination_test.go @@ -30,7 +30,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/bank/types" _ "github.com/cosmos/cosmos-sdk/x/consensus" - _ "github.com/cosmos/cosmos-sdk/x/params" ) const ( @@ -71,7 +70,6 @@ func (s *paginationTestSuite) SetupTest() { configurator.NewAppConfig( configurator.AuthModule(), configurator.BankModule(), - configurator.ParamsModule(), configurator.ConsensusModule(), configurator.OmitInitGenesis(), ), diff --git a/x/auth/testutil/app_config.go b/x/auth/testutil/app_config.go index c8e88f2bc6b2..c639c6905c60 100644 --- a/x/auth/testutil/app_config.go +++ b/x/auth/testutil/app_config.go @@ -8,7 +8,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/bank" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/consensus" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/genutil" // import as blank for app wiring - _ "github.com/cosmos/cosmos-sdk/x/params" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/staking" // import as blank for app wiring ) @@ -19,6 +18,5 @@ var AppConfig = configurator.NewAppConfig( configurator.StakingModule(), configurator.TxModule(), configurator.ConsensusModule(), - configurator.ParamsModule(), configurator.GenutilModule(), ) diff --git a/x/auth/types/params_legacy.go b/x/auth/types/params_legacy.go deleted file mode 100644 index 8800f5822283..000000000000 --- a/x/auth/types/params_legacy.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -NOTE: Usage of x/params to manage parameters is deprecated in favor of x/gov -controlled execution of MsgUpdateParams messages. These types remains solely -for migration purposes and will be removed in a future release. -*/ -package types - -import ( - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" -) - -// Parameter keys -var ( - KeyMaxMemoCharacters = []byte("MaxMemoCharacters") - KeyTxSigLimit = []byte("TxSigLimit") - KeyTxSizeCostPerByte = []byte("TxSizeCostPerByte") - KeySigVerifyCostED25519 = []byte("SigVerifyCostED25519") - KeySigVerifyCostSecp256k1 = []byte("SigVerifyCostSecp256k1") -) - -var _ paramtypes.ParamSet = &Params{} - -// Deprecated: ParamKeyTable for auth module -func ParamKeyTable() paramtypes.KeyTable { - return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) -} - -// ParamSetPairs implements the ParamSet interface and returns all the key/value pairs -// pairs of auth module's parameters. -func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { - return paramtypes.ParamSetPairs{ - paramtypes.NewParamSetPair(KeyMaxMemoCharacters, &p.MaxMemoCharacters, validateMaxMemoCharacters), - paramtypes.NewParamSetPair(KeyTxSigLimit, &p.TxSigLimit, validateTxSigLimit), - paramtypes.NewParamSetPair(KeyTxSizeCostPerByte, &p.TxSizeCostPerByte, validateTxSizeCostPerByte), - paramtypes.NewParamSetPair(KeySigVerifyCostED25519, &p.SigVerifyCostED25519, validateSigVerifyCostED25519), - paramtypes.NewParamSetPair(KeySigVerifyCostSecp256k1, &p.SigVerifyCostSecp256k1, validateSigVerifyCostSecp256k1), - } -} diff --git a/x/authz/testutil/app_config.go b/x/authz/testutil/app_config.go index f1e61c100bbb..ff8be58fe3cb 100644 --- a/x/authz/testutil/app_config.go +++ b/x/authz/testutil/app_config.go @@ -10,7 +10,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/genutil" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/gov" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/mint" // import as blank for app wiring - _ "github.com/cosmos/cosmos-sdk/x/params" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/staking" // import as blank for app wiring ) @@ -20,7 +19,6 @@ var AppConfig = configurator.NewAppConfig( configurator.StakingModule(), configurator.TxModule(), configurator.ConsensusModule(), - configurator.ParamsModule(), configurator.GenutilModule(), configurator.AuthzModule(), configurator.MintModule(), diff --git a/x/bank/simulation/genesis.go b/x/bank/simulation/genesis.go index 1dd6fd3dc8ad..65fff19a7c12 100644 --- a/x/bank/simulation/genesis.go +++ b/x/bank/simulation/genesis.go @@ -12,6 +12,9 @@ import ( "github.com/cosmos/cosmos-sdk/x/bank/types" ) +// KeyDefaultSendEnabled is store's key for the DefaultSendEnabled option +var KeyDefaultSendEnabled = []byte("DefaultSendEnabled") + // RandomGenesisDefaultSendEnabledParam computes randomized allow all send transfers param for the bank module func RandomGenesisDefaultSendEnabledParam(r *rand.Rand) bool { // 90% chance of transfers being enabled or P(a) = 0.9 for success @@ -72,7 +75,7 @@ func RandomGenesisBalances(simState *module.SimulationState) []types.Balance { // RandomizedGenState generates a random GenesisState for bank func RandomizedGenState(simState *module.SimulationState) { var defaultSendEnabledParam bool - simState.AppParams.GetOrGenerate(string(types.KeyDefaultSendEnabled), &defaultSendEnabledParam, simState.Rand, func(r *rand.Rand) { defaultSendEnabledParam = RandomGenesisDefaultSendEnabledParam(r) }) + simState.AppParams.GetOrGenerate(string(KeyDefaultSendEnabled), &defaultSendEnabledParam, simState.Rand, func(r *rand.Rand) { defaultSendEnabledParam = RandomGenesisDefaultSendEnabledParam(r) }) sendEnabled := RandomGenesisSendEnabled(simState.Rand, simState.BondDenom) diff --git a/x/bank/simulation/operations_test.go b/x/bank/simulation/operations_test.go index cae5cefcb22a..6e026ce0087d 100644 --- a/x/bank/simulation/operations_test.go +++ b/x/bank/simulation/operations_test.go @@ -26,7 +26,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/bank/types" _ "github.com/cosmos/cosmos-sdk/x/consensus" - _ "github.com/cosmos/cosmos-sdk/x/params" _ "github.com/cosmos/cosmos-sdk/x/staking" ) @@ -50,7 +49,6 @@ func (suite *SimTestSuite) SetupTest() { depinject.Configs( configurator.NewAppConfig( configurator.AuthModule(), - configurator.ParamsModule(), configurator.BankModule(), configurator.StakingModule(), configurator.ConsensusModule(), diff --git a/x/bank/types/params_legacy.go b/x/bank/types/params_legacy.go deleted file mode 100644 index 668358b4df7a..000000000000 --- a/x/bank/types/params_legacy.go +++ /dev/null @@ -1,23 +0,0 @@ -package types - -import paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - -var ( - // KeySendEnabled is store's key for SendEnabled Params - // Deprecated: Use the SendEnabled functionality in the keeper. - KeySendEnabled = []byte("SendEnabled") - // KeyDefaultSendEnabled is store's key for the DefaultSendEnabled option - KeyDefaultSendEnabled = []byte("DefaultSendEnabled") -) - -// Deprecated: ParamKeyTable for bank module. -func ParamKeyTable() paramtypes.KeyTable { - return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) -} - -// Deprecated: ParamSetPairs implements params.ParamSet -func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { - return paramtypes.ParamSetPairs{ - paramtypes.NewParamSetPair(KeyDefaultSendEnabled, &p.DefaultSendEnabled, validateIsBool), - } -} diff --git a/x/consensus/exported/exported.go b/x/consensus/exported/exported.go index 60dd19abb47a..ab6371156338 100644 --- a/x/consensus/exported/exported.go +++ b/x/consensus/exported/exported.go @@ -4,18 +4,9 @@ import ( "context" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" - - sdk "github.com/cosmos/cosmos-sdk/types" ) type ( - // ParamStore defines an interface that implements the legacy x/params Subspace - // type. - // - // NOTE: This is used solely for migration of x/params managed parameters. - ParamStore interface { - Get(ctx sdk.Context, key []byte, ptr interface{}) - } // ConsensusParamSetter defines the interface fulfilled by BaseApp's // ParamStore which allows setting its appVersion field. diff --git a/x/crisis/types/legacy_params.go b/x/crisis/types/legacy_params.go deleted file mode 100644 index bcb689a4fadd..000000000000 --- a/x/crisis/types/legacy_params.go +++ /dev/null @@ -1,31 +0,0 @@ -package types - -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" -) - -// ParamStoreKeyConstantFee is the constant fee parameter -var ParamStoreKeyConstantFee = []byte("ConstantFee") - -// Deprecated: Type declaration for parameters -func ParamKeyTable() paramtypes.KeyTable { - return paramtypes.NewKeyTable( - paramtypes.NewParamSetPair(ParamStoreKeyConstantFee, sdk.Coin{}, validateConstantFee), - ) -} - -func validateConstantFee(i interface{}) error { - v, ok := i.(sdk.Coin) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - if !v.IsValid() { - return fmt.Errorf("invalid constant fee: %s", v) - } - - return nil -} diff --git a/x/distribution/exported/exported.go b/x/distribution/exported/exported.go deleted file mode 100644 index 000114e6194d..000000000000 --- a/x/distribution/exported/exported.go +++ /dev/null @@ -1,18 +0,0 @@ -package exported - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" -) - -type ( - ParamSet = paramtypes.ParamSet - - // Subspace defines an interface that implements the legacy x/params Subspace - // type. - // - // NOTE: This is used solely for migration of x/params managed parameters. - Subspace interface { - GetParamSet(ctx sdk.Context, ps ParamSet) - } -) diff --git a/x/distribution/testutil/app_config.go b/x/distribution/testutil/app_config.go index c824f4dff45c..9bbf0910daa3 100644 --- a/x/distribution/testutil/app_config.go +++ b/x/distribution/testutil/app_config.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/distribution" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/genutil" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/mint" // import as blank for app wiring - _ "github.com/cosmos/cosmos-sdk/x/params" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/staking" // import as blank for app wiring ) @@ -19,7 +18,6 @@ var AppConfig = configurator.NewAppConfig( configurator.StakingModule(), configurator.TxModule(), configurator.ConsensusModule(), - configurator.ParamsModule(), configurator.GenutilModule(), configurator.DistributionModule(), configurator.MintModule(), diff --git a/x/distribution/types/params.go b/x/distribution/types/params.go index f7c980284175..b8438ca73812 100644 --- a/x/distribution/types/params.go +++ b/x/distribution/types/params.go @@ -39,12 +39,3 @@ func validateCommunityTax(i interface{}) error { return nil } - -func validateWithdrawAddrEnabled(i interface{}) error { - _, ok := i.(bool) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - return nil -} diff --git a/x/distribution/types/params_legacy.go b/x/distribution/types/params_legacy.go deleted file mode 100644 index 4805e8bd8c8c..000000000000 --- a/x/distribution/types/params_legacy.go +++ /dev/null @@ -1,22 +0,0 @@ -package types - -import paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - -// Parameter keys -var ( - ParamStoreKeyCommunityTax = []byte("communitytax") - ParamStoreKeyWithdrawAddrEnabled = []byte("withdrawaddrenabled") -) - -// Deprecated: ParamKeyTable returns the parameter key table. -func ParamKeyTable() paramtypes.KeyTable { - return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) -} - -// Deprecated: ParamSetPairs returns the parameter set pairs. -func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { - return paramtypes.ParamSetPairs{ - paramtypes.NewParamSetPair(ParamStoreKeyCommunityTax, &p.CommunityTax, validateCommunityTax), - paramtypes.NewParamSetPair(ParamStoreKeyWithdrawAddrEnabled, &p.WithdrawAddrEnabled, validateWithdrawAddrEnabled), - } -} diff --git a/x/evidence/testutil/app_config.go b/x/evidence/testutil/app_config.go index 30a0645b79f6..ee585bfb434e 100644 --- a/x/evidence/testutil/app_config.go +++ b/x/evidence/testutil/app_config.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/bank" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/consensus" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/genutil" // import as blank for app wiring - _ "github.com/cosmos/cosmos-sdk/x/params" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/slashing" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/staking" // import as blank for app wiring ) @@ -21,7 +20,6 @@ var AppConfig = configurator.NewAppConfig( configurator.SlashingModule(), configurator.TxModule(), configurator.ConsensusModule(), - configurator.ParamsModule(), configurator.EvidenceModule(), configurator.GenutilModule(), ) diff --git a/x/feegrant/simulation/operations_test.go b/x/feegrant/simulation/operations_test.go index f9bd1723e993..8c193a2a82b2 100644 --- a/x/feegrant/simulation/operations_test.go +++ b/x/feegrant/simulation/operations_test.go @@ -36,7 +36,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/consensus" _ "github.com/cosmos/cosmos-sdk/x/genutil" _ "github.com/cosmos/cosmos-sdk/x/mint" - _ "github.com/cosmos/cosmos-sdk/x/params" _ "github.com/cosmos/cosmos-sdk/x/staking" ) @@ -64,7 +63,6 @@ func (suite *SimTestSuite) SetupTest() { configurator.StakingModule(), configurator.TxModule(), configurator.ConsensusModule(), - configurator.ParamsModule(), configurator.GenutilModule(), configurator.FeegrantModule(), ), diff --git a/x/gov/common_test.go b/x/gov/common_test.go index fcca0590bc60..a688b78859f6 100644 --- a/x/gov/common_test.go +++ b/x/gov/common_test.go @@ -30,7 +30,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/gov/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - _ "github.com/cosmos/cosmos-sdk/x/params" _ "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -120,7 +119,6 @@ func createTestSuite(t *testing.T) suite { app, err := simtestutil.SetupWithConfiguration( depinject.Configs( configurator.NewAppConfig( - configurator.ParamsModule(), configurator.AuthModule(), configurator.StakingModule(), configurator.BankModule(), diff --git a/x/gov/module.go b/x/gov/module.go index 8ed657045c10..f70139e041b7 100644 --- a/x/gov/module.go +++ b/x/gov/module.go @@ -33,7 +33,6 @@ import ( govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) const ConsensusVersion = 5 @@ -158,12 +157,8 @@ func (am AppModule) IsAppModule() {} func init() { appmodule.Register( &modulev1.Module{}, - appmodule.Provide(ProvideModule, ProvideKeyTable), - appmodule.Invoke(InvokeAddRoutes, InvokeSetHooks)) -} - -func ProvideKeyTable() paramtypes.KeyTable { - return v1.ParamKeyTable() //nolint:staticcheck // we still need this for upgrades + appmodule.Invoke(InvokeAddRoutes, InvokeSetHooks), + appmodule.Provide(ProvideModule)) } type ModuleInputs struct { diff --git a/x/gov/simulation/operations_test.go b/x/gov/simulation/operations_test.go index a7b8c8751059..bbd1d0307e38 100644 --- a/x/gov/simulation/operations_test.go +++ b/x/gov/simulation/operations_test.go @@ -35,7 +35,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/gov/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - _ "github.com/cosmos/cosmos-sdk/x/params" _ "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" ) @@ -424,7 +423,6 @@ func createTestSuite(t *testing.T, isCheckTx bool) (suite, sdk.Context) { configurator.NewAppConfig( configurator.AuthModule(), configurator.TxModule(), - configurator.ParamsModule(), configurator.BankModule(), configurator.StakingModule(), configurator.ConsensusModule(), diff --git a/x/gov/types/v1/params_legacy.go b/x/gov/types/v1/params_legacy.go deleted file mode 100644 index ceee66b23529..000000000000 --- a/x/gov/types/v1/params_legacy.go +++ /dev/null @@ -1,102 +0,0 @@ -package v1 - -import ( - "errors" - "fmt" - - "cosmossdk.io/math" - - sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" -) - -// Parameter store key -var ( - ParamStoreKeyDepositParams = []byte("depositparams") - ParamStoreKeyVotingParams = []byte("votingparams") - ParamStoreKeyTallyParams = []byte("tallyparams") -) - -// Deprecated: ParamKeyTable - Key declaration for parameters -func ParamKeyTable() paramtypes.KeyTable { - return paramtypes.NewKeyTable( - paramtypes.NewParamSetPair(ParamStoreKeyDepositParams, DepositParams{}, validateDepositParams), - paramtypes.NewParamSetPair(ParamStoreKeyVotingParams, VotingParams{}, validateVotingParams), - paramtypes.NewParamSetPair(ParamStoreKeyTallyParams, TallyParams{}, validateTallyParams), - ) -} - -func validateDepositParams(i interface{}) error { - v, ok := i.(DepositParams) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - if !sdk.Coins(v.MinDeposit).IsValid() { - return fmt.Errorf("invalid minimum deposit: %s", v.MinDeposit) - } - if v.MaxDepositPeriod == nil || v.MaxDepositPeriod.Seconds() <= 0 { - return fmt.Errorf("maximum deposit period must be positive: %d", v.MaxDepositPeriod) - } - - return nil -} - -func validateTallyParams(i interface{}) error { - v, ok := i.(TallyParams) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - quorum, err := math.LegacyNewDecFromStr(v.Quorum) - if err != nil { - return fmt.Errorf("invalid quorum string: %w", err) - } - if quorum.IsNegative() { - return fmt.Errorf("quorom cannot be negative: %s", quorum) - } - if quorum.GT(math.LegacyOneDec()) { - return fmt.Errorf("quorom too large: %s", v) - } - - threshold, err := math.LegacyNewDecFromStr(v.Threshold) - if err != nil { - return fmt.Errorf("invalid threshold string: %w", err) - } - if !threshold.IsPositive() { - return fmt.Errorf("vote threshold must be positive: %s", threshold) - } - if threshold.GT(math.LegacyOneDec()) { - return fmt.Errorf("vote threshold too large: %s", v) - } - - vetoThreshold, err := math.LegacyNewDecFromStr(v.VetoThreshold) - if err != nil { - return fmt.Errorf("invalid vetoThreshold string: %w", err) - } - if !vetoThreshold.IsPositive() { - return fmt.Errorf("veto threshold must be positive: %s", vetoThreshold) - } - if vetoThreshold.GT(math.LegacyOneDec()) { - return fmt.Errorf("veto threshold too large: %s", v) - } - - return nil -} - -func validateVotingParams(i interface{}) error { - v, ok := i.(VotingParams) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - if v.VotingPeriod == nil { - return errors.New("voting period must not be nil") - } - - if v.VotingPeriod.Seconds() <= 0 { - return fmt.Errorf("voting period must be positive: %s", v.VotingPeriod) - } - - return nil -} diff --git a/x/group/testutil/app_config.go b/x/group/testutil/app_config.go index a9dc1f950c37..14d5304e2bfd 100644 --- a/x/group/testutil/app_config.go +++ b/x/group/testutil/app_config.go @@ -10,7 +10,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/genutil" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/group/module" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/mint" // import as blank for app wiring - _ "github.com/cosmos/cosmos-sdk/x/params" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/staking" // import as blank for app wiring ) @@ -20,7 +19,6 @@ var AppConfig = configurator.NewAppConfig( configurator.StakingModule(), configurator.TxModule(), configurator.ConsensusModule(), - configurator.ParamsModule(), configurator.GenutilModule(), configurator.GroupModule(), ) diff --git a/x/mint/testutil/app_config.go b/x/mint/testutil/app_config.go index 4f385518dcb8..ece7b9f08dd8 100644 --- a/x/mint/testutil/app_config.go +++ b/x/mint/testutil/app_config.go @@ -8,7 +8,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/consensus" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/genutil" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/mint" // import as blank for app wiring - _ "github.com/cosmos/cosmos-sdk/x/params" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/staking" // import as blank for app wiring ) @@ -18,7 +17,6 @@ var AppConfig = configurator.NewAppConfig( configurator.StakingModule(), configurator.TxModule(), configurator.ConsensusModule(), - configurator.ParamsModule(), configurator.GenutilModule(), configurator.MintModule(), ) diff --git a/x/mint/types/params_legacy.go b/x/mint/types/params_legacy.go deleted file mode 100644 index 23354e2f89ea..000000000000 --- a/x/mint/types/params_legacy.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -NOTE: Usage of x/params to manage parameters is deprecated in favor of x/gov -controlled execution of MsgUpdateParams messages. These types remains solely -for migration purposes and will be removed in a future release. -*/ -package types - -import ( - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" -) - -// Parameter store keys -var ( - KeyMintDenom = []byte("MintDenom") - KeyInflationRateChange = []byte("InflationRateChange") - KeyInflationMax = []byte("InflationMax") - KeyInflationMin = []byte("InflationMin") - KeyGoalBonded = []byte("GoalBonded") - KeyBlocksPerYear = []byte("BlocksPerYear") -) - -// Deprecated: ParamTable for minting module. -func ParamKeyTable() paramtypes.KeyTable { - return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) -} - -// Implements params.ParamSet -// -// Deprecated. -func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { - return paramtypes.ParamSetPairs{ - paramtypes.NewParamSetPair(KeyMintDenom, &p.MintDenom, validateMintDenom), - paramtypes.NewParamSetPair(KeyInflationRateChange, &p.InflationRateChange, validateInflationRateChange), - paramtypes.NewParamSetPair(KeyInflationMax, &p.InflationMax, validateInflationMax), - paramtypes.NewParamSetPair(KeyInflationMin, &p.InflationMin, validateInflationMin), - paramtypes.NewParamSetPair(KeyGoalBonded, &p.GoalBonded, validateGoalBonded), - paramtypes.NewParamSetPair(KeyBlocksPerYear, &p.BlocksPerYear, validateBlocksPerYear), - } -} diff --git a/x/nft/testutil/app_config.go b/x/nft/testutil/app_config.go index 6e7d85f77539..11a5e72fea4d 100644 --- a/x/nft/testutil/app_config.go +++ b/x/nft/testutil/app_config.go @@ -10,7 +10,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/consensus" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/genutil" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/mint" // import as blank for app wiring - _ "github.com/cosmos/cosmos-sdk/x/params" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/staking" // import as blank for app wiring ) @@ -20,7 +19,6 @@ var AppConfig = configurator.NewAppConfig( configurator.StakingModule(), configurator.TxModule(), configurator.ConsensusModule(), - configurator.ParamsModule(), configurator.GenutilModule(), configurator.MintModule(), configurator.NFTModule(), diff --git a/x/params/proposal_handler_test.go b/x/params/proposal_handler_test.go deleted file mode 100644 index fb81c4daf91f..000000000000 --- a/x/params/proposal_handler_test.go +++ /dev/null @@ -1,116 +0,0 @@ -package params_test - -import ( - "context" - "testing" - - "github.com/golang/mock/gomock" - "github.com/stretchr/testify/suite" - - storetypes "cosmossdk.io/store/types" - - "github.com/cosmos/cosmos-sdk/testutil" - sdk "github.com/cosmos/cosmos-sdk/types" - moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" - govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "github.com/cosmos/cosmos-sdk/x/params" - "github.com/cosmos/cosmos-sdk/x/params/keeper" - paramstestutil "github.com/cosmos/cosmos-sdk/x/params/testutil" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/cosmos/cosmos-sdk/x/params/types/proposal" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" -) - -// StakingKeeper defines the expected staking keeper -type StakingKeeper interface { - MaxValidators(ctx context.Context) (res uint32, err error) -} - -type HandlerTestSuite struct { - suite.Suite - - ctx sdk.Context - govHandler govv1beta1.Handler - stakingKeeper StakingKeeper -} - -func (suite *HandlerTestSuite) SetupTest() { - encodingCfg := moduletestutil.MakeTestEncodingConfig(params.AppModuleBasic{}) - key := storetypes.NewKVStoreKey(paramtypes.StoreKey) - tkey := storetypes.NewTransientStoreKey("params_transient_test") - - ctx := testutil.DefaultContext(key, tkey) - paramsKeeper := keeper.NewKeeper(encodingCfg.Codec, encodingCfg.Amino, key, tkey) - paramsKeeper.Subspace("staking").WithKeyTable(stakingtypes.ParamKeyTable()) //nolint:staticcheck // TODO: depreacte this test case - ctrl := gomock.NewController(suite.T()) - stakingKeeper := paramstestutil.NewMockStakingKeeper(ctrl) - stakingKeeper.EXPECT().MaxValidators(ctx).Return(uint32(1), nil) - - suite.govHandler = params.NewParamChangeProposalHandler(paramsKeeper) - suite.stakingKeeper = stakingKeeper - suite.ctx = ctx -} - -func TestHandlerTestSuite(t *testing.T) { - suite.Run(t, new(HandlerTestSuite)) -} - -func testProposal(changes ...proposal.ParamChange) *proposal.ParameterChangeProposal { - return proposal.NewParameterChangeProposal("title", "description", changes) -} - -func (suite *HandlerTestSuite) TestProposalHandler() { - testCases := []struct { - name string - proposal *proposal.ParameterChangeProposal - onHandle func() - expErr bool - }{ - { - "all fields", - testProposal(proposal.NewParamChange(stakingtypes.ModuleName, string(stakingtypes.KeyMaxValidators), "1")), - func() { - maxVals, err := suite.stakingKeeper.MaxValidators(suite.ctx) - suite.Require().NoError(err) - suite.Require().Equal(uint32(1), maxVals) - }, - false, - }, - { - "invalid type", - testProposal(proposal.NewParamChange(stakingtypes.ModuleName, string(stakingtypes.KeyMaxValidators), "-")), - func() {}, - true, - }, - //{ - // "omit empty fields", - // testProposal(proposal.ParamChange{ - // Subspace: govtypes.ModuleName, - // Key: string(govv1.ParamStoreKeyDepositParams), - // Value: `{"min_deposit": [{"denom": "uatom","amount": "64000000"}], "max_deposit_period": "172800000000000"}`, - // }), - // func() { - // depositParams := suite.app.GovKeeper.GetDepositParams(suite.ctx) - // defaultPeriod := govv1.DefaultPeriod - // suite.Require().Equal(govv1.DepositParams{ - // MinDeposit: sdk.NewCoins(sdk.NewCoin("uatom", sdkmath.NewInt(64000000))), - // MaxDepositPeriod: &defaultPeriod, - // }, depositParams) - // }, - // false, - // }, - } - - for _, tc := range testCases { - tc := tc - suite.Run(tc.name, func() { - err := suite.govHandler(suite.ctx, tc.proposal) - if tc.expErr { - suite.Require().Error(err) - } else { - suite.Require().NoError(err) - tc.onHandle() - } - }) - } -} diff --git a/x/slashing/app_test.go b/x/slashing/app_test.go index 1e1b36e0602e..9bb25eadf7c7 100644 --- a/x/slashing/app_test.go +++ b/x/slashing/app_test.go @@ -57,7 +57,6 @@ func TestSlashingMsgs(t *testing.T) { app, err := sims.SetupWithConfiguration( depinject.Configs( configurator.NewAppConfig( - configurator.ParamsModule(), configurator.AuthModule(), configurator.StakingModule(), configurator.SlashingModule(), diff --git a/x/slashing/testutil/app_config.go b/x/slashing/testutil/app_config.go index f2fd2d14e061..8e2afcc3be72 100644 --- a/x/slashing/testutil/app_config.go +++ b/x/slashing/testutil/app_config.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/distribution" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/genutil" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/mint" // import as blank for app wiring - _ "github.com/cosmos/cosmos-sdk/x/params" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/slashing" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/staking" // import as blank for app wiring ) @@ -21,7 +20,6 @@ var AppConfig = configurator.NewAppConfig( configurator.SlashingModule(), configurator.TxModule(), configurator.ConsensusModule(), - configurator.ParamsModule(), configurator.GenutilModule(), configurator.MintModule(), configurator.DistributionModule(), diff --git a/x/slashing/testutil/expected_keepers_mocks.go b/x/slashing/testutil/expected_keepers_mocks.go index 08f615baf5d6..1c479da554cc 100644 --- a/x/slashing/testutil/expected_keepers_mocks.go +++ b/x/slashing/testutil/expected_keepers_mocks.go @@ -12,8 +12,7 @@ import ( address "cosmossdk.io/core/address" math "cosmossdk.io/math" types "github.com/cosmos/cosmos-sdk/types" - types0 "github.com/cosmos/cosmos-sdk/x/params/types" - types1 "github.com/cosmos/cosmos-sdk/x/staking/types" + types0 "github.com/cosmos/cosmos-sdk/x/staking/types" gomock "github.com/golang/mock/gomock" ) @@ -145,93 +144,6 @@ func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr interface{}) *gom return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpendableCoins", reflect.TypeOf((*MockBankKeeper)(nil).SpendableCoins), ctx, addr) } -// MockParamSubspace is a mock of ParamSubspace interface. -type MockParamSubspace struct { - ctrl *gomock.Controller - recorder *MockParamSubspaceMockRecorder -} - -// MockParamSubspaceMockRecorder is the mock recorder for MockParamSubspace. -type MockParamSubspaceMockRecorder struct { - mock *MockParamSubspace -} - -// NewMockParamSubspace creates a new mock instance. -func NewMockParamSubspace(ctrl *gomock.Controller) *MockParamSubspace { - mock := &MockParamSubspace{ctrl: ctrl} - mock.recorder = &MockParamSubspaceMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockParamSubspace) EXPECT() *MockParamSubspaceMockRecorder { - return m.recorder -} - -// Get mocks base method. -func (m *MockParamSubspace) Get(ctx types.Context, key []byte, ptr interface{}) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "Get", ctx, key, ptr) -} - -// Get indicates an expected call of Get. -func (mr *MockParamSubspaceMockRecorder) Get(ctx, key, ptr interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockParamSubspace)(nil).Get), ctx, key, ptr) -} - -// GetParamSet mocks base method. -func (m *MockParamSubspace) GetParamSet(ctx types.Context, ps types0.ParamSet) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "GetParamSet", ctx, ps) -} - -// GetParamSet indicates an expected call of GetParamSet. -func (mr *MockParamSubspaceMockRecorder) GetParamSet(ctx, ps interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetParamSet", reflect.TypeOf((*MockParamSubspace)(nil).GetParamSet), ctx, ps) -} - -// HasKeyTable mocks base method. -func (m *MockParamSubspace) HasKeyTable() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "HasKeyTable") - ret0, _ := ret[0].(bool) - return ret0 -} - -// HasKeyTable indicates an expected call of HasKeyTable. -func (mr *MockParamSubspaceMockRecorder) HasKeyTable() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasKeyTable", reflect.TypeOf((*MockParamSubspace)(nil).HasKeyTable)) -} - -// SetParamSet mocks base method. -func (m *MockParamSubspace) SetParamSet(ctx types.Context, ps types0.ParamSet) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "SetParamSet", ctx, ps) -} - -// SetParamSet indicates an expected call of SetParamSet. -func (mr *MockParamSubspaceMockRecorder) SetParamSet(ctx, ps interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetParamSet", reflect.TypeOf((*MockParamSubspace)(nil).SetParamSet), ctx, ps) -} - -// WithKeyTable mocks base method. -func (m *MockParamSubspace) WithKeyTable(table types0.KeyTable) types0.Subspace { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "WithKeyTable", table) - ret0, _ := ret[0].(types0.Subspace) - return ret0 -} - -// WithKeyTable indicates an expected call of WithKeyTable. -func (mr *MockParamSubspaceMockRecorder) WithKeyTable(table interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WithKeyTable", reflect.TypeOf((*MockParamSubspace)(nil).WithKeyTable), table) -} - // MockStakingKeeper is a mock of StakingKeeper interface. type MockStakingKeeper struct { ctrl *gomock.Controller @@ -270,10 +182,10 @@ func (mr *MockStakingKeeperMockRecorder) ConsensusAddressCodec() *gomock.Call { } // Delegation mocks base method. -func (m *MockStakingKeeper) Delegation(arg0 context.Context, arg1 types.AccAddress, arg2 types.ValAddress) (types1.DelegationI, error) { +func (m *MockStakingKeeper) Delegation(arg0 context.Context, arg1 types.AccAddress, arg2 types.ValAddress) (types0.DelegationI, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Delegation", arg0, arg1, arg2) - ret0, _ := ret[0].(types1.DelegationI) + ret0, _ := ret[0].(types0.DelegationI) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -285,10 +197,10 @@ func (mr *MockStakingKeeperMockRecorder) Delegation(arg0, arg1, arg2 interface{} } // GetAllValidators mocks base method. -func (m *MockStakingKeeper) GetAllValidators(ctx context.Context) ([]types1.Validator, error) { +func (m *MockStakingKeeper) GetAllValidators(ctx context.Context) ([]types0.Validator, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetAllValidators", ctx) - ret0, _ := ret[0].([]types1.Validator) + ret0, _ := ret[0].([]types0.Validator) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -315,7 +227,7 @@ func (mr *MockStakingKeeperMockRecorder) IsValidatorJailed(ctx, addr interface{} } // IterateValidators mocks base method. -func (m *MockStakingKeeper) IterateValidators(arg0 context.Context, arg1 func(int64, types1.ValidatorI) bool) error { +func (m *MockStakingKeeper) IterateValidators(arg0 context.Context, arg1 func(int64, types0.ValidatorI) bool) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "IterateValidators", arg0, arg1) ret0, _ := ret[0].(error) @@ -402,10 +314,10 @@ func (mr *MockStakingKeeperMockRecorder) Unjail(arg0, arg1 interface{}) *gomock. } // Validator mocks base method. -func (m *MockStakingKeeper) Validator(arg0 context.Context, arg1 types.ValAddress) (types1.ValidatorI, error) { +func (m *MockStakingKeeper) Validator(arg0 context.Context, arg1 types.ValAddress) (types0.ValidatorI, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Validator", arg0, arg1) - ret0, _ := ret[0].(types1.ValidatorI) + ret0, _ := ret[0].(types0.ValidatorI) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -431,10 +343,10 @@ func (mr *MockStakingKeeperMockRecorder) ValidatorAddressCodec() *gomock.Call { } // ValidatorByConsAddr mocks base method. -func (m *MockStakingKeeper) ValidatorByConsAddr(arg0 context.Context, arg1 types.ConsAddress) (types1.ValidatorI, error) { +func (m *MockStakingKeeper) ValidatorByConsAddr(arg0 context.Context, arg1 types.ConsAddress) (types0.ValidatorI, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ValidatorByConsAddr", arg0, arg1) - ret0, _ := ret[0].(types1.ValidatorI) + ret0, _ := ret[0].(types0.ValidatorI) ret1, _ := ret[1].(error) return ret0, ret1 } diff --git a/x/slashing/types/expected_keepers.go b/x/slashing/types/expected_keepers.go index f653d009ccdd..2760c0639cf9 100644 --- a/x/slashing/types/expected_keepers.go +++ b/x/slashing/types/expected_keepers.go @@ -8,7 +8,6 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -26,15 +25,6 @@ type BankKeeper interface { SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins } -// ParamSubspace defines the expected Subspace interfacace -type ParamSubspace interface { - HasKeyTable() bool - WithKeyTable(table paramtypes.KeyTable) paramtypes.Subspace - Get(ctx sdk.Context, key []byte, ptr interface{}) - GetParamSet(ctx sdk.Context, ps paramtypes.ParamSet) - SetParamSet(ctx sdk.Context, ps paramtypes.ParamSet) -} - // StakingKeeper expected staking keeper type StakingKeeper interface { ValidatorAddressCodec() address.Codec diff --git a/x/slashing/types/params_legacy.go b/x/slashing/types/params_legacy.go deleted file mode 100644 index f7ea30db0d55..000000000000 --- a/x/slashing/types/params_legacy.go +++ /dev/null @@ -1,35 +0,0 @@ -/* -NOTE: Usage of x/params to manage parameters is deprecated in favor of x/gov -controlled execution of MsgUpdateParams messages. These types remains solely -for migration purposes and will be removed in a future release. -*/ -package types - -import ( - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" -) - -// Parameter store keys -var ( - KeySignedBlocksWindow = []byte("SignedBlocksWindow") - KeyMinSignedPerWindow = []byte("MinSignedPerWindow") - KeyDowntimeJailDuration = []byte("DowntimeJailDuration") - KeySlashFractionDoubleSign = []byte("SlashFractionDoubleSign") - KeySlashFractionDowntime = []byte("SlashFractionDowntime") -) - -// Deprecated: ParamKeyTable for slashing module -func ParamKeyTable() paramtypes.KeyTable { - return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) -} - -// Deprecated: ParamSetPairs implements params.ParamSet -func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { - return paramtypes.ParamSetPairs{ - paramtypes.NewParamSetPair(KeySignedBlocksWindow, &p.SignedBlocksWindow, validateSignedBlocksWindow), - paramtypes.NewParamSetPair(KeyMinSignedPerWindow, &p.MinSignedPerWindow, validateMinSignedPerWindow), - paramtypes.NewParamSetPair(KeyDowntimeJailDuration, &p.DowntimeJailDuration, validateDowntimeJailDuration), - paramtypes.NewParamSetPair(KeySlashFractionDoubleSign, &p.SlashFractionDoubleSign, validateSlashFractionDoubleSign), - paramtypes.NewParamSetPair(KeySlashFractionDowntime, &p.SlashFractionDowntime, validateSlashFractionDowntime), - } -} diff --git a/x/staking/testutil/app_config.go b/x/staking/testutil/app_config.go index 4f9118e395ce..4bebab4a670a 100644 --- a/x/staking/testutil/app_config.go +++ b/x/staking/testutil/app_config.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/distribution" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/genutil" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/mint" // import as blank for app wiring - _ "github.com/cosmos/cosmos-sdk/x/params" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/slashing" // import as blank for app wiring _ "github.com/cosmos/cosmos-sdk/x/staking" // import as blank for app wiring ) @@ -20,7 +19,6 @@ var AppConfig = configurator.NewAppConfig( configurator.StakingModule(), configurator.TxModule(), configurator.ConsensusModule(), - configurator.ParamsModule(), configurator.GenutilModule(), configurator.MintModule(), configurator.DistributionModule(), diff --git a/x/staking/types/params_legacy.go b/x/staking/types/params_legacy.go deleted file mode 100644 index f2ab55624976..000000000000 --- a/x/staking/types/params_legacy.go +++ /dev/null @@ -1,32 +0,0 @@ -package types - -import paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - -var ( - KeyUnbondingTime = []byte("UnbondingTime") - KeyMaxValidators = []byte("MaxValidators") - KeyMaxEntries = []byte("MaxEntries") - KeyBondDenom = []byte("BondDenom") - KeyHistoricalEntries = []byte("HistoricalEntries") - KeyMinCommissionRate = []byte("MinCommissionRate") -) - -var _ paramtypes.ParamSet = (*Params)(nil) - -// Deprecated: now params can be accessed on key `0x51` on the staking store. -// ParamTable for staking module -func ParamKeyTable() paramtypes.KeyTable { - return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) -} - -// Deprecated: Implements params.ParamSet -func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { - return paramtypes.ParamSetPairs{ - paramtypes.NewParamSetPair(KeyUnbondingTime, &p.UnbondingTime, validateUnbondingTime), - paramtypes.NewParamSetPair(KeyMaxValidators, &p.MaxValidators, validateMaxValidators), - paramtypes.NewParamSetPair(KeyMaxEntries, &p.MaxEntries, validateMaxEntries), - paramtypes.NewParamSetPair(KeyHistoricalEntries, &p.HistoricalEntries, validateHistoricalEntries), - paramtypes.NewParamSetPair(KeyBondDenom, &p.BondDenom, validateBondDenom), - paramtypes.NewParamSetPair(KeyMinCommissionRate, &p.MinCommissionRate, validateMinCommissionRate), - } -}