Skip to content

Commit

Permalink
adding consensusparamtypes.StoreKey storekey && fixing staking keeper
Browse files Browse the repository at this point in the history
  • Loading branch information
spoo-bar committed Sep 20, 2023
1 parent eadfa20 commit e1095de
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
25 changes: 13 additions & 12 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ import (
govclient "github.com/cosmos/cosmos-sdk/x/gov/client"
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
govV1types "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
govV1Beta1types "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
"github.com/cosmos/cosmos-sdk/x/group"
groupkeeper "github.com/cosmos/cosmos-sdk/x/group/keeper"
Expand Down Expand Up @@ -322,8 +321,10 @@ func NewArchwayApp(
minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey,
govtypes.StoreKey, paramstypes.StoreKey, ibcexported.StoreKey, upgradetypes.StoreKey,
evidencetypes.StoreKey, ibctransfertypes.StoreKey, capabilitytypes.StoreKey,
feegrant.StoreKey, authzkeeper.StoreKey, wasm.StoreKey,
trackingTypes.StoreKey, rewardsTypes.StoreKey, icahosttypes.StoreKey, ibcfeetypes.StoreKey, crisistypes.StoreKey, group.StoreKey, nftkeeper.StoreKey,
feegrant.StoreKey, authzkeeper.StoreKey, wasm.StoreKey, consensusparamtypes.StoreKey,

Check failure on line 324 in app/app.go

View workflow job for this annotation

GitHub Actions / lint

SA1019: wasm.StoreKey is deprecated: Do not use. (staticcheck)
icahosttypes.StoreKey, ibcfeetypes.StoreKey, crisistypes.StoreKey, group.StoreKey, nftkeeper.StoreKey,

trackingTypes.StoreKey, rewardsTypes.StoreKey,
)
tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey)
memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey)
Expand Down Expand Up @@ -391,7 +392,7 @@ func NewArchwayApp(
keys[feegrant.StoreKey],
app.Keepers.AccountKeeper,
)
stakingKeeper := stakingkeeper.NewKeeper(
app.Keepers.StakingKeeper = stakingkeeper.NewKeeper(
appCodec,
keys[stakingtypes.StoreKey],
app.Keepers.AccountKeeper,
Expand All @@ -403,15 +404,15 @@ func NewArchwayApp(
keys[distrtypes.StoreKey],
app.Keepers.AccountKeeper,
app.Keepers.BankKeeper,
stakingKeeper,
app.Keepers.StakingKeeper,
authtypes.FeeCollectorName,
govModuleAddr,
)
app.Keepers.SlashingKeeper = slashingkeeper.NewKeeper(
appCodec,
legacyAmino,
keys[slashingtypes.StoreKey],
stakingKeeper,
app.Keepers.StakingKeeper,
govModuleAddr,
)
app.Keepers.CrisisKeeper = *crisiskeeper.NewKeeper(
Expand Down Expand Up @@ -443,7 +444,7 @@ func NewArchwayApp(

// register the staking hooks
// NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks
stakingKeeper.SetHooks(
app.Keepers.StakingKeeper.SetHooks(
stakingtypes.NewMultiStakingHooks(app.Keepers.DistrKeeper.Hooks(), app.Keepers.SlashingKeeper.Hooks()),
)

Expand Down Expand Up @@ -502,7 +503,7 @@ func NewArchwayApp(
evidenceKeeper := evidencekeeper.NewKeeper(
appCodec,
keys[evidencetypes.StoreKey],
&app.Keepers.StakingKeeper,
app.Keepers.StakingKeeper,
app.Keepers.SlashingKeeper,
)
app.Keepers.EvidenceKeeper = *evidenceKeeper
Expand Down Expand Up @@ -613,7 +614,7 @@ func NewArchwayApp(
keys[govtypes.StoreKey],
app.Keepers.AccountKeeper,
app.Keepers.BankKeeper,
stakingKeeper,
app.Keepers.StakingKeeper,
app.MsgServiceRouter(),
govtypes.DefaultConfig(),
govModuleAddr,
Expand Down Expand Up @@ -644,7 +645,7 @@ func NewArchwayApp(
mint.NewAppModule(appCodec, app.Keepers.MintKeeper, app.Keepers.AccountKeeper, nil, app.getSubspace(minttypes.ModuleName)),
slashing.NewAppModule(appCodec, app.Keepers.SlashingKeeper, app.Keepers.AccountKeeper, app.Keepers.BankKeeper, app.Keepers.StakingKeeper, app.getSubspace(slashingtypes.ModuleName)),
distr.NewAppModule(appCodec, app.Keepers.DistrKeeper, app.Keepers.AccountKeeper, app.Keepers.BankKeeper, app.Keepers.StakingKeeper, app.getSubspace(distrtypes.ModuleName)),
staking.NewAppModule(appCodec, &app.Keepers.StakingKeeper, app.Keepers.AccountKeeper, app.Keepers.BankKeeper, app.getSubspace(stakingtypes.ModuleName)),
staking.NewAppModule(appCodec, app.Keepers.StakingKeeper, app.Keepers.AccountKeeper, app.Keepers.BankKeeper, app.getSubspace(stakingtypes.ModuleName)),
upgrade.NewAppModule(&app.Keepers.UpgradeKeeper),
wasm.NewAppModule(appCodec, &app.Keepers.WASMKeeper, app.Keepers.StakingKeeper, app.Keepers.AccountKeeper, app.Keepers.BankKeeper, app.MsgServiceRouter(), app.getSubspace(wasm.ModuleName)),
evidence.NewAppModule(app.Keepers.EvidenceKeeper),
Expand Down Expand Up @@ -795,7 +796,7 @@ func NewArchwayApp(
authzmodule.NewAppModule(appCodec, app.Keepers.AuthzKeeper, app.Keepers.AccountKeeper, app.Keepers.BankKeeper, app.interfaceRegistry),
gov.NewAppModule(appCodec, &app.Keepers.GovKeeper, app.Keepers.AccountKeeper, app.Keepers.BankKeeper, app.getSubspace(govtypes.ModuleName)),
mint.NewAppModule(appCodec, app.Keepers.MintKeeper, app.Keepers.AccountKeeper, nil, app.getSubspace(minttypes.ModuleName)),
staking.NewAppModule(appCodec, &app.Keepers.StakingKeeper, app.Keepers.AccountKeeper, app.Keepers.BankKeeper, app.getSubspace(stakingtypes.ModuleName)),
staking.NewAppModule(appCodec, app.Keepers.StakingKeeper, app.Keepers.AccountKeeper, app.Keepers.BankKeeper, app.getSubspace(stakingtypes.ModuleName)),
distr.NewAppModule(appCodec, app.Keepers.DistrKeeper, app.Keepers.AccountKeeper, app.Keepers.BankKeeper, app.Keepers.StakingKeeper, app.getSubspace(distrtypes.ModuleName)),
slashing.NewAppModule(appCodec, app.Keepers.SlashingKeeper, app.Keepers.AccountKeeper, app.Keepers.BankKeeper, app.Keepers.StakingKeeper, app.getSubspace(slashingtypes.ModuleName)),
params.NewAppModule(app.Keepers.ParamsKeeper),
Expand Down Expand Up @@ -1036,7 +1037,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(minttypes.ModuleName)
paramsKeeper.Subspace(distrtypes.ModuleName)
paramsKeeper.Subspace(slashingtypes.ModuleName)
paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govV1types.ParamKeyTable())
paramsKeeper.Subspace(govtypes.ModuleName)
paramsKeeper.Subspace(crisistypes.ModuleName)
paramsKeeper.Subspace(ibctransfertypes.ModuleName)
paramsKeeper.Subspace(ibcexported.ModuleName)
Expand Down
2 changes: 1 addition & 1 deletion app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (app *ArchwayApp) ExportAppStateAndValidators(
return servertypes.ExportedApp{}, err
}

validators, err := staking.WriteValidators(ctx, &app.Keepers.StakingKeeper)
validators, err := staking.WriteValidators(ctx, app.Keepers.StakingKeeper)
return servertypes.ExportedApp{
AppState: appState,
Validators: validators,
Expand Down
2 changes: 1 addition & 1 deletion app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type ArchwayKeepers struct {
AccountKeeper authkeeper.AccountKeeper
BankKeeper bankkeeper.Keeper
CapabilityKeeper *capabilitykeeper.Keeper
StakingKeeper stakingkeeper.Keeper
StakingKeeper *stakingkeeper.Keeper
SlashingKeeper slashingkeeper.Keeper
MintKeeper mintkeeper.Keeper
DistrKeeper distrkeeper.Keeper
Expand Down
2 changes: 1 addition & 1 deletion app/test_access.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (s TestSupport) ScopedTransferKeeper() capabilitykeeper.ScopedKeeper {
}

func (s TestSupport) StakingKeeper() stakingkeeper.Keeper {
return s.app.Keepers.StakingKeeper
return *s.app.Keepers.StakingKeeper
}

func (s TestSupport) BankKeeper() bankkeeper.Keeper {
Expand Down

0 comments on commit e1095de

Please sign in to comment.