package v8 import ( "fmt" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" "github.com/cosmos/cosmos-sdk/baseapp" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/router/types" icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types" icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" "github.com/persistenceOne/persistence-sdk/v2/x/halving" oracletypes "github.com/persistenceOne/persistence-sdk/v2/x/oracle/types" ) func getLegacySubspaces(paramsKeeper *paramskeeper.Keeper) paramstypes.Subspace { // Set param key table for params module migration for _, subspace := range paramsKeeper.GetSubspaces() { subspace := subspace var keyTable paramstypes.KeyTable switch subspace.Name() { case authtypes.ModuleName: keyTable = authtypes.ParamKeyTable() //nolint:staticcheck case banktypes.ModuleName: keyTable = banktypes.ParamKeyTable() //nolint:staticcheck case stakingtypes.ModuleName: keyTable = stakingtypes.ParamKeyTable() case minttypes.ModuleName: keyTable = minttypes.ParamKeyTable() //nolint:staticcheck case distrtypes.ModuleName: keyTable = distrtypes.ParamKeyTable() //nolint:staticcheck case slashingtypes.ModuleName: keyTable = slashingtypes.ParamKeyTable() //nolint:staticcheck case govtypes.ModuleName: keyTable = govv1.ParamKeyTable() //nolint:staticcheck case crisistypes.ModuleName: keyTable = crisistypes.ParamKeyTable() //nolint:staticcheck // wasm case wasmtypes.ModuleName: keyTable = wasmtypes.ParamKeyTable() //nolint:staticcheck // these modules have not migrated away from x/params case halving.DefaultParamspace, ibcexported.ModuleName, ibctransfertypes.ModuleName, icacontrollertypes.SubModuleName, icahosttypes.SubModuleName, oracletypes.ModuleName, packetforwardtypes.ModuleName: continue default: panic(fmt.Sprintf("param key table not set for subspace: %s", subspace.Name())) } if !subspace.HasKeyTable() { subspace.WithKeyTable(keyTable) } } return paramsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable()) }