Skip to content

Commit

Permalink
check for empty exported keepers instead of empty sdk-defined keeper …
Browse files Browse the repository at this point in the history
…structs
  • Loading branch information
catShaark committed Apr 23, 2022
1 parent 43d4559 commit 91bd0ab
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions modules/core/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import (
capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"

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

func checkEmptyKeepers(stakingKeeper clienttypes.StakingKeeper, upgradeKeeper clienttypes.UpgradeKeeper,
scopedKeeper capabilitykeeper.ScopedKeeper) error {
if reflect.DeepEqual(stakingkeeper.Keeper{}, stakingKeeper.(stakingkeeper.Keeper)) {
if reflect.ValueOf(stakingKeeper).IsZero() {
return fmt.Errorf("empty staking keeper")
}
if reflect.DeepEqual(upgradekeeper.Keeper{}, upgradeKeeper.(upgradekeeper.Keeper)) {
if reflect.ValueOf(upgradeKeeper).IsZero() {
return fmt.Errorf("empty upgradeKeeper")
}
if reflect.DeepEqual(capabilitykeeper.ScopedKeeper{}, scopedKeeper) {
Expand Down

0 comments on commit 91bd0ab

Please sign in to comment.