Skip to content

Commit

Permalink
remove stakingtypes.TStoreKey
Browse files Browse the repository at this point in the history
  • Loading branch information
mpoke authored and sainoe committed Nov 2, 2022
1 parent ac6db35 commit 85dbf4c
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 26 deletions.
4 changes: 2 additions & 2 deletions simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func NewSimApp(
evidencetypes.StoreKey, capabilitytypes.StoreKey,
authzkeeper.StoreKey,
)
tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey, stakingtypes.TStoreKey)
tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey)

// NOTE: The testingkey is just mounted for testing purposes. Actual applications should
// not include this key.
Expand Down Expand Up @@ -243,7 +243,7 @@ func NewSimApp(
appCodec, keys[banktypes.StoreKey], app.AccountKeeper, app.GetSubspace(banktypes.ModuleName), app.ModuleAccountAddrs(),
)
stakingKeeper := stakingkeeper.NewKeeper(
appCodec, keys[stakingtypes.StoreKey], tkeys[stakingtypes.TStoreKey], app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName),
appCodec, keys[stakingtypes.StoreKey], app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName),
)
app.MintKeeper = mintkeeper.NewKeeper(
appCodec, keys[minttypes.StoreKey], app.GetSubspace(minttypes.ModuleName), &stakingKeeper,
Expand Down
1 change: 0 additions & 1 deletion x/auth/legacy/v043/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,6 @@ func createValidator(t *testing.T, ctx sdk.Context, app *simapp.SimApp, powers i
app.StakingKeeper = stakingkeeper.NewKeeper(
cdc,
app.GetKey(stakingtypes.StoreKey),
app.GetTKey(stakingtypes.TStoreKey),
app.AccountKeeper,
app.BankKeeper,
app.GetSubspace(stakingtypes.ModuleName),
Expand Down
1 change: 0 additions & 1 deletion x/gov/keeper/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ func createValidators(t *testing.T, ctx sdk.Context, app *simapp.SimApp, powers
app.StakingKeeper = stakingkeeper.NewKeeper(
cdc,
app.GetKey(stakingtypes.StoreKey),
app.GetTKey(stakingtypes.TStoreKey),
app.AccountKeeper,
app.BankKeeper,
app.GetSubspace(stakingtypes.ModuleName),
Expand Down
1 change: 0 additions & 1 deletion x/staking/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ func getBaseSimappWithCustomKeeper() (*codec.LegacyAmino, *simapp.SimApp, sdk.Co
app.StakingKeeper = keeper.NewKeeper(
appCodec,
app.GetKey(types.StoreKey),
app.GetTKey(types.TStoreKey),
app.AccountKeeper,
app.BankKeeper,
app.GetSubspace(types.ModuleName),
Expand Down
1 change: 0 additions & 1 deletion x/staking/keeper/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ func createTestInput() (*codec.LegacyAmino, *simapp.SimApp, sdk.Context) {
app.StakingKeeper = keeper.NewKeeper(
app.AppCodec(),
app.GetKey(types.StoreKey),
app.GetTKey(types.TStoreKey),
app.AccountKeeper,
app.BankKeeper,
app.GetSubspace(types.ModuleName),
Expand Down
1 change: 0 additions & 1 deletion x/staking/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,6 @@ func createValidators(t *testing.T, ctx sdk.Context, app *simapp.SimApp, powers
app.StakingKeeper = keeper.NewKeeper(
cdc,
app.GetKey(types.StoreKey),
app.GetTKey(types.TStoreKey),
app.AccountKeeper,
app.BankKeeper,
app.GetSubspace(types.ModuleName),
Expand Down
28 changes: 13 additions & 15 deletions x/staking/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,17 @@ var _ types.DelegationSet = Keeper{}

// keeper of the staking store
type Keeper struct {
storeKey sdk.StoreKey
transientKey sdk.StoreKey
cdc codec.BinaryCodec
authKeeper types.AccountKeeper
bankKeeper types.BankKeeper
hooks types.StakingHooks
paramstore paramtypes.Subspace
storeKey sdk.StoreKey
cdc codec.BinaryCodec
authKeeper types.AccountKeeper
bankKeeper types.BankKeeper
hooks types.StakingHooks
paramstore paramtypes.Subspace
}

// NewKeeper creates a new staking Keeper instance
func NewKeeper(
cdc codec.BinaryCodec, key, tKey sdk.StoreKey, ak types.AccountKeeper, bk types.BankKeeper,
cdc codec.BinaryCodec, key sdk.StoreKey, ak types.AccountKeeper, bk types.BankKeeper,
ps paramtypes.Subspace,
) Keeper {
// set KeyTable if it has not already been set
Expand All @@ -49,13 +48,12 @@ func NewKeeper(
}

return Keeper{
storeKey: key,
transientKey: tKey,
cdc: cdc,
authKeeper: ak,
bankKeeper: bk,
paramstore: ps,
hooks: nil,
storeKey: key,
cdc: cdc,
authKeeper: ak,
bankKeeper: bk,
paramstore: ps,
hooks: nil,
}
}

Expand Down
1 change: 0 additions & 1 deletion x/staking/keeper/unbonding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ func setup(t *testing.T, hookCalled *bool, ubdeID *uint64) (
stakingKeeper := keeper.NewKeeper(
app.AppCodec(),
app.GetKey(types.StoreKey),
app.GetKey(types.StoreKey),
app.AccountKeeper,
app.BankKeeper,
app.GetSubspace(types.ModuleName),
Expand Down
3 changes: 0 additions & 3 deletions x/staking/types/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ const (
// StoreKey is the string store representation
StoreKey = ModuleName

// TStoreKey is the string transient store representation
TStoreKey = "transient_staking"

// QuerierRoute is the querier route for the staking module
QuerierRoute = ModuleName

Expand Down

0 comments on commit 85dbf4c

Please sign in to comment.