From 002d4502edc6ffa78d239840bfbc8115596dda35 Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Tue, 26 Mar 2024 13:36:16 +0100 Subject: [PATCH] chore: define StakingKeeper expected interface in 07-tendermint --- .../light-clients/07-tendermint/consensus_host.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/light-clients/07-tendermint/consensus_host.go b/modules/light-clients/07-tendermint/consensus_host.go index d0c62c75c08..0ce7bb4e802 100644 --- a/modules/light-clients/07-tendermint/consensus_host.go +++ b/modules/light-clients/07-tendermint/consensus_host.go @@ -1,12 +1,15 @@ package tendermint import ( + "context" "reflect" + "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" @@ -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.