feat: deprecate x/params (#23826)
This commit is contained in:
parent
9b83b2f7b6
commit
4ed61468a2
105
simapp/app.go
105
simapp/app.go
@ -94,11 +94,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"
|
||||
@ -141,8 +136,7 @@ type SimApp struct {
|
||||
interfaceRegistry types.InterfaceRegistry
|
||||
|
||||
// keys to access the substores
|
||||
keys map[string]*storetypes.KVStoreKey
|
||||
tkeys map[string]*storetypes.TransientStoreKey
|
||||
keys map[string]*storetypes.KVStoreKey
|
||||
|
||||
// keepers
|
||||
AccountKeeper authkeeper.AccountKeeper
|
||||
@ -153,7 +147,6 @@ type SimApp struct {
|
||||
DistrKeeper distrkeeper.Keeper
|
||||
GovKeeper govkeeper.Keeper
|
||||
UpgradeKeeper *upgradekeeper.Keeper
|
||||
ParamsKeeper paramskeeper.Keeper
|
||||
AuthzKeeper authzkeeper.Keeper
|
||||
EvidenceKeeper evidencekeeper.Keeper
|
||||
FeeGrantKeeper feegrantkeeper.Keeper
|
||||
@ -252,11 +245,21 @@ func NewSimApp(
|
||||
bApp.SetTxEncoder(txConfig.TxEncoder())
|
||||
|
||||
keys := storetypes.NewKVStoreKeys(
|
||||
authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey,
|
||||
minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey,
|
||||
govtypes.StoreKey, paramstypes.StoreKey, consensusparamtypes.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey,
|
||||
evidencetypes.StoreKey, circuittypes.StoreKey,
|
||||
authzkeeper.StoreKey, nftkeeper.StoreKey, group.StoreKey,
|
||||
authtypes.StoreKey,
|
||||
banktypes.StoreKey,
|
||||
stakingtypes.StoreKey,
|
||||
minttypes.StoreKey,
|
||||
distrtypes.StoreKey,
|
||||
slashingtypes.StoreKey,
|
||||
govtypes.StoreKey,
|
||||
consensusparamtypes.StoreKey,
|
||||
upgradetypes.StoreKey,
|
||||
feegrant.StoreKey,
|
||||
evidencetypes.StoreKey,
|
||||
circuittypes.StoreKey,
|
||||
authzkeeper.StoreKey,
|
||||
nftkeeper.StoreKey,
|
||||
group.StoreKey,
|
||||
)
|
||||
|
||||
// register streaming services
|
||||
@ -264,7 +267,6 @@ func NewSimApp(
|
||||
panic(err)
|
||||
}
|
||||
|
||||
tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey)
|
||||
app := &SimApp{
|
||||
BaseApp: bApp,
|
||||
legacyAmino: legacyAmino,
|
||||
@ -272,11 +274,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)
|
||||
@ -353,8 +352,7 @@ 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))
|
||||
govRouter.AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler)
|
||||
govConfig := govtypes.DefaultConfig()
|
||||
/*
|
||||
Example of setting gov params:
|
||||
@ -370,7 +368,7 @@ func NewSimApp(
|
||||
|
||||
app.GovKeeper = *govKeeper.SetHooks(
|
||||
govtypes.NewMultiGovHooks(
|
||||
// register the governance hooks
|
||||
// register the governance hooks
|
||||
),
|
||||
)
|
||||
|
||||
@ -392,18 +390,17 @@ func NewSimApp(
|
||||
app.AccountKeeper, app.StakingKeeper, app,
|
||||
txConfig,
|
||||
),
|
||||
auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)),
|
||||
auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, nil),
|
||||
vesting.NewAppModule(app.AccountKeeper, app.BankKeeper),
|
||||
bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)),
|
||||
bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, nil),
|
||||
feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry),
|
||||
gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)),
|
||||
mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil, app.GetSubspace(minttypes.ModuleName)),
|
||||
slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName), app.interfaceRegistry),
|
||||
distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)),
|
||||
staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)),
|
||||
gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, nil),
|
||||
mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil, nil),
|
||||
slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, nil, app.interfaceRegistry),
|
||||
distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, nil),
|
||||
staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, nil),
|
||||
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),
|
||||
@ -420,9 +417,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)
|
||||
@ -457,11 +452,23 @@ func NewSimApp(
|
||||
// properly initialized with tokens from genesis accounts.
|
||||
// NOTE: The genutils module must also occur after auth so that it can access the params from auth.
|
||||
genesisModuleOrder := []string{
|
||||
authtypes.ModuleName, banktypes.ModuleName,
|
||||
distrtypes.ModuleName, stakingtypes.ModuleName, slashingtypes.ModuleName, govtypes.ModuleName,
|
||||
minttypes.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, authz.ModuleName,
|
||||
feegrant.ModuleName, nft.ModuleName, group.ModuleName, paramstypes.ModuleName, upgradetypes.ModuleName,
|
||||
vestingtypes.ModuleName, consensusparamtypes.ModuleName, circuittypes.ModuleName,
|
||||
authtypes.ModuleName,
|
||||
banktypes.ModuleName,
|
||||
distrtypes.ModuleName,
|
||||
stakingtypes.ModuleName,
|
||||
slashingtypes.ModuleName,
|
||||
govtypes.ModuleName,
|
||||
minttypes.ModuleName,
|
||||
genutiltypes.ModuleName,
|
||||
evidencetypes.ModuleName,
|
||||
authz.ModuleName,
|
||||
feegrant.ModuleName,
|
||||
nft.ModuleName,
|
||||
group.ModuleName,
|
||||
upgradetypes.ModuleName,
|
||||
vestingtypes.ModuleName,
|
||||
consensusparamtypes.ModuleName,
|
||||
circuittypes.ModuleName,
|
||||
}
|
||||
app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...)
|
||||
app.ModuleManager.SetOrderExportGenesis(genesisModuleOrder...)
|
||||
@ -495,7 +502,7 @@ func NewSimApp(
|
||||
// NOTE: this is not required apps that don't use the simulator for fuzz testing
|
||||
// transactions
|
||||
overrideModules := map[string]module.AppModuleSimulation{
|
||||
authtypes.ModuleName: auth.NewAppModule(app.appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)),
|
||||
authtypes.ModuleName: auth.NewAppModule(app.appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, nil),
|
||||
}
|
||||
app.sm = module.NewSimulationManagerFromAppModules(app.ModuleManager.Modules, overrideModules)
|
||||
|
||||
@ -503,7 +510,6 @@ func NewSimApp(
|
||||
|
||||
// initialize stores
|
||||
app.MountKVStores(keys)
|
||||
app.MountTransientStores(tkeys)
|
||||
|
||||
// initialize BaseApp
|
||||
app.SetInitChainer(app.InitChainer)
|
||||
@ -687,14 +693,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
|
||||
@ -766,18 +764,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)
|
||||
|
||||
return paramsKeeper
|
||||
}
|
||||
|
||||
@ -20,7 +20,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"
|
||||
@ -62,9 +61,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
|
||||
@ -147,7 +143,6 @@ var (
|
||||
feegrant.ModuleName,
|
||||
nft.ModuleName,
|
||||
group.ModuleName,
|
||||
paramstypes.ModuleName,
|
||||
upgradetypes.ModuleName,
|
||||
vestingtypes.ModuleName,
|
||||
circuittypes.ModuleName,
|
||||
@ -192,10 +187,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{
|
||||
@ -260,9 +251,7 @@ var (
|
||||
map[string]module.AppModuleBasic{
|
||||
genutiltypes.ModuleName: genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator),
|
||||
govtypes.ModuleName: gov.NewAppModuleBasic(
|
||||
[]govclient.ProposalHandler{
|
||||
paramsclient.ProposalHandler,
|
||||
},
|
||||
[]govclient.ProposalHandler{},
|
||||
),
|
||||
},
|
||||
))
|
||||
|
||||
@ -40,8 +40,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"
|
||||
)
|
||||
@ -73,7 +71,6 @@ type SimApp struct {
|
||||
DistrKeeper distrkeeper.Keeper
|
||||
GovKeeper *govkeeper.Keeper
|
||||
UpgradeKeeper *upgradekeeper.Keeper
|
||||
ParamsKeeper paramskeeper.Keeper
|
||||
AuthzKeeper authzkeeper.Keeper
|
||||
EvidenceKeeper evidencekeeper.Keeper
|
||||
FeeGrantKeeper feegrantkeeper.Keeper
|
||||
@ -173,7 +170,6 @@ func NewSimApp(
|
||||
&app.DistrKeeper,
|
||||
&app.GovKeeper,
|
||||
&app.UpgradeKeeper,
|
||||
&app.ParamsKeeper,
|
||||
&app.AuthzKeeper,
|
||||
&app.EvidenceKeeper,
|
||||
&app.FeeGrantKeeper,
|
||||
@ -238,7 +234,7 @@ func NewSimApp(
|
||||
// NOTE: this is not required apps that don't use the simulator for fuzz testing
|
||||
// transactions
|
||||
overrideModules := map[string]module.AppModuleSimulation{
|
||||
authtypes.ModuleName: auth.NewAppModule(app.appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)),
|
||||
authtypes.ModuleName: auth.NewAppModule(app.appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, nil),
|
||||
}
|
||||
app.sm = module.NewSimulationManagerFromAppModules(app.ModuleManager.Modules, overrideModules)
|
||||
|
||||
@ -337,14 +333,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
|
||||
|
||||
@ -38,7 +38,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"
|
||||
)
|
||||
@ -203,7 +202,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(),
|
||||
@ -251,7 +249,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(),
|
||||
|
||||
@ -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{},
|
||||
)
|
||||
|
||||
|
||||
@ -38,7 +38,6 @@ import (
|
||||
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||
consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types"
|
||||
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
|
||||
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing"
|
||||
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
|
||||
"github.com/cosmos/cosmos-sdk/x/slashing/testutil"
|
||||
@ -81,7 +80,7 @@ type fixture struct {
|
||||
|
||||
func initFixture(t testing.TB) *fixture {
|
||||
keys := storetypes.NewKVStoreKeys(
|
||||
authtypes.StoreKey, banktypes.StoreKey, paramtypes.StoreKey, consensusparamtypes.StoreKey, evidencetypes.StoreKey, stakingtypes.StoreKey, slashingtypes.StoreKey,
|
||||
authtypes.StoreKey, banktypes.StoreKey, consensusparamtypes.StoreKey, evidencetypes.StoreKey, stakingtypes.StoreKey, slashingtypes.StoreKey,
|
||||
)
|
||||
cdc := moduletestutil.MakeTestEncodingConfig(auth.AppModuleBasic{}, evidence.AppModuleBasic{}).Codec
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ sidebar_position: 1
|
||||
|
||||
# `x/params`
|
||||
|
||||
> Note: The Params module has been depreacted in favour of each module housing its own parameters.
|
||||
NOTE: `x/params` is deprecated as of Cosmos SDK v0.53 and will be removed in the next release.
|
||||
|
||||
## Abstract
|
||||
|
||||
|
||||
@ -11,6 +11,8 @@ import (
|
||||
)
|
||||
|
||||
// Keeper of the global paramstore
|
||||
//
|
||||
// Deprecated: the params keeper is deprecated and will be removed in the next Cosmos SDK major release.
|
||||
type Keeper struct {
|
||||
cdc codec.BinaryCodec
|
||||
legacyAmino *codec.LegacyAmino
|
||||
@ -20,6 +22,8 @@ type Keeper struct {
|
||||
}
|
||||
|
||||
// NewKeeper constructs a params keeper
|
||||
//
|
||||
// Deprecated: the params keeper is deprecated and will be removed in the next Cosmos SDK major release.
|
||||
func NewKeeper(cdc codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey storetypes.StoreKey) Keeper {
|
||||
return Keeper{
|
||||
cdc: cdc,
|
||||
|
||||
@ -57,6 +57,8 @@ func (am AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistr
|
||||
}
|
||||
|
||||
// AppModule implements an application module for the distribution module.
|
||||
//
|
||||
// Deprecated: the params module is deprecated and will be removed in the next Cosmos SDK major release.
|
||||
type AppModule struct {
|
||||
AppModuleBasic
|
||||
|
||||
@ -64,6 +66,8 @@ type AppModule struct {
|
||||
}
|
||||
|
||||
// NewAppModule creates a new AppModule object
|
||||
//
|
||||
// Deprecated: the params module is deprecated and will be removed in the next Cosmos SDK major release.
|
||||
func NewAppModule(k keeper.Keeper) AppModule {
|
||||
return AppModule{
|
||||
AppModuleBasic: AppModuleBasic{},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user