Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added switch case to detect blank pointers in keeper #2403

Merged
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updated error message for keeper
  • Loading branch information
alizahidraja committed Sep 28, 2022
commit 5ed5fb53f507abb174746d8bba28b6894fc91bf2
8 changes: 4 additions & 4 deletions modules/core/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,22 @@ func NewKeeper(
switch reflect.TypeOf(stakingKeeper).Kind() {
case reflect.Ptr:
if reflect.ValueOf(&stakingKeeper).IsZero() {
panic(fmt.Errorf("cannot initialize IBC keeper: empty staking keeper"))
panic(fmt.Errorf("cannot initialize IBC keeper: empty staking keeper pointer"))
}
default:
if reflect.ValueOf(stakingKeeper).IsZero() {
panic(fmt.Errorf("cannot initialize IBC keeper: empty staking keeper"))
panic(fmt.Errorf("cannot initialize IBC keeper: empty staking keeper value"))
}
}

switch reflect.TypeOf(upgradeKeeper).Kind() {
case reflect.Ptr:
if reflect.ValueOf(&upgradeKeeper).IsZero() {
panic(fmt.Errorf("cannot initialize IBC keeper: empty upgrade keeper"))
panic(fmt.Errorf("cannot initialize IBC keeper: empty upgrade keeper pointer"))
}
default:
if reflect.ValueOf(upgradeKeeper).IsZero() {
panic(fmt.Errorf("cannot initialize IBC keeper: empty upgrade keeper"))
panic(fmt.Errorf("cannot initialize IBC keeper: empty upgrade keeper value"))
}
}

Expand Down