Skip to content

Commit

Permalink
chore: define StakingKeeper expected interface in 07-tendermint
Browse files Browse the repository at this point in the history
  • Loading branch information
damiannolan committed Mar 26, 2024
1 parent 25ca208 commit 002d450
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions modules/light-clients/07-tendermint/consensus_host.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package tendermint

import (
"context"
"reflect"

Check notice

Code scanning / CodeQL

Sensitive package import Note

Certain system packages contain functions which may be a possible source of non-determinism
"time"

errorsmod "cosmossdk.io/errors"
upgradetypes "cosmossdk.io/x/upgrade/types"

sdk "github.com/cosmos/cosmos-sdk/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

"github.com/cometbft/cometbft/light"

Expand All @@ -18,9 +21,15 @@ import (

var _ clienttypes.ConsensusHost = (*ConsensusHost)(nil)

// ConsensusHost implements the 02-client clienttypes.ConsensusHost interface
// ConsensusHost implements the 02-client clienttypes.ConsensusHost interface.
type ConsensusHost struct {
stakingKeeper clienttypes.StakingKeeper
stakingKeeper StakingKeeper
}

// StakingKeeper defines an expected interface for the tendermint ConsensusHost.
type StakingKeeper interface {
GetHistoricalInfo(ctx context.Context, height int64) (stakingtypes.HistoricalInfo, error)
UnbondingTime(ctx context.Context) (time.Duration, error)
}

// NewConsensusHost creates and returns a new ConsensusHost for tendermint consensus.
Expand Down

0 comments on commit 002d450

Please sign in to comment.