Skip to content

Commit

Permalink
chore: add panic on invalid staking keeper
Browse files Browse the repository at this point in the history
  • Loading branch information
chatton committed Apr 3, 2024
1 parent f1d2a0a commit be61348
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 0 additions & 2 deletions modules/core/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import (
"testing"
"time"

ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint"

testifysuite "github.com/stretchr/testify/suite"

upgradekeeper "cosmossdk.io/x/upgrade/keeper"
Expand Down
4 changes: 4 additions & 0 deletions modules/light-clients/07-tendermint/consensus_host.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ type StakingKeeper interface {

// NewConsensusHost creates and returns a new ConsensusHost for tendermint consensus.
func NewConsensusHost(stakingKeeper clienttypes.StakingKeeper) clienttypes.ConsensusHost {
if stakingKeeper == nil {
panic("staking keeper cannot be nil")
}

return &ConsensusHost{
stakingKeeper: stakingKeeper,
}
Expand Down

0 comments on commit be61348

Please sign in to comment.