Skip to content

Commit

Permalink
remove params
Browse files Browse the repository at this point in the history
  • Loading branch information
technicallyty committed Feb 4, 2025
1 parent 5648045 commit 6797942
Showing 1 changed file with 4 additions and 36 deletions.
40 changes: 4 additions & 36 deletions tests/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ import (
mintkeeper "cosmossdk.io/x/mint/keeper"
minttypes "cosmossdk.io/x/mint/types"
"cosmossdk.io/x/nft"
paramskeeper "cosmossdk.io/x/params/keeper"
paramstypes "cosmossdk.io/x/params/types"
"cosmossdk.io/x/slashing"
slashingkeeper "cosmossdk.io/x/slashing/keeper"
slashingtypes "cosmossdk.io/x/slashing/types"
Expand Down Expand Up @@ -156,8 +154,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
AuthKeeper authkeeper.AccountKeeper
Expand All @@ -170,7 +167,6 @@ type SimApp struct {
DistrKeeper distrkeeper.Keeper
GovKeeper govkeeper.Keeper
UpgradeKeeper *upgradekeeper.Keeper
ParamsKeeper paramskeeper.Keeper
AuthzKeeper authzkeeper.Keeper
FeeGrantKeeper feegrantkeeper.Keeper
GroupKeeper groupkeeper.Keeper
Expand Down Expand Up @@ -271,7 +267,7 @@ func NewSimApp(
evidencetypes.StoreKey, accounts.StoreKey,
authtypes.StoreKey, banktypes.StoreKey, stakingtypes.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,
circuittypes.StoreKey, pooltypes.StoreKey,
authzkeeper.StoreKey, group.StoreKey, feemarkettypes.StoreKey,
)
Expand All @@ -281,19 +277,15 @@ func NewSimApp(
panic(err)
}

tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey)
app := &SimApp{
BaseApp: bApp,
legacyAmino: legacyAmino,
appCodec: appCodec,
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.NewEnvironment(runtime.NewKVStoreService(keys[consensusparamtypes.StoreKey]), app.Logger()), authtypes.NewModuleAddress(govtypes.ModuleName).String())
bApp.SetParamStore(app.ConsensusParamsKeeper.ParamsStore)
Expand Down Expand Up @@ -438,7 +430,7 @@ func NewSimApp(

app.GovKeeper = *govKeeper.SetHooks(
govtypes.NewMultiGovHooks(
// register the governance hooks
// register the governance hooks
),
)

Expand Down Expand Up @@ -515,7 +507,7 @@ func NewSimApp(
authtypes.ModuleName, accounts.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,
feegrant.ModuleName, nft.ModuleName, group.ModuleName, upgradetypes.ModuleName,
vestingtypes.ModuleName, consensusparamtypes.ModuleName, circuittypes.ModuleName, pooltypes.ModuleName,
feemarkettypes.ModuleName,
}
Expand Down Expand Up @@ -555,7 +547,6 @@ func NewSimApp(

// initialize stores
app.MountKVStores(keys)
app.MountTransientStores(tkeys)

// initialize BaseApp
app.SetInitChainer(app.InitChainer)
Expand Down Expand Up @@ -727,14 +718,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
Expand Down Expand Up @@ -814,18 +797,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
}

0 comments on commit 6797942

Please sign in to comment.