Skip to content

Commit 91bd0ab

Browse files
committed
check for empty exported keepers instead of empty sdk-defined keeper structs
1 parent 43d4559 commit 91bd0ab

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

modules/core/keeper/keeper.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import (
99
capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper"
1010
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
1111

12-
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
13-
upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper"
1412
clientkeeper "github.com/cosmos/ibc-go/v3/modules/core/02-client/keeper"
1513
clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types"
1614
connectionkeeper "github.com/cosmos/ibc-go/v3/modules/core/03-connection/keeper"
@@ -89,10 +87,10 @@ func (k *Keeper) SetRouter(rtr *porttypes.Router) {
8987

9088
func checkEmptyKeepers(stakingKeeper clienttypes.StakingKeeper, upgradeKeeper clienttypes.UpgradeKeeper,
9189
scopedKeeper capabilitykeeper.ScopedKeeper) error {
92-
if reflect.DeepEqual(stakingkeeper.Keeper{}, stakingKeeper.(stakingkeeper.Keeper)) {
90+
if reflect.ValueOf(stakingKeeper).IsZero() {
9391
return fmt.Errorf("empty staking keeper")
9492
}
95-
if reflect.DeepEqual(upgradekeeper.Keeper{}, upgradeKeeper.(upgradekeeper.Keeper)) {
93+
if reflect.ValueOf(upgradeKeeper).IsZero() {
9694
return fmt.Errorf("empty upgradeKeeper")
9795
}
9896
if reflect.DeepEqual(capabilitykeeper.ScopedKeeper{}, scopedKeeper) {

0 commit comments

Comments
 (0)