Skip to content

Commit

Permalink
ibc: remove GetClientConsensusStateLTE (cosmos#7812)
Browse files Browse the repository at this point in the history
  • Loading branch information
fedekunze authored Nov 5, 2020
1 parent 71166c8 commit 97963c7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
16 changes: 0 additions & 16 deletions x/ibc/core/02-client/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,22 +156,6 @@ func (k Keeper) GetLatestClientConsensusState(ctx sdk.Context, clientID string)
return k.GetClientConsensusState(ctx, clientID, clientState.GetLatestHeight())
}

// GetClientConsensusStateLTE will get the latest ConsensusState of a particular client at the latest height
// less than or equal to the given height
// It will only search for heights within the same version
func (k Keeper) GetClientConsensusStateLTE(ctx sdk.Context, clientID string, maxHeight exported.Height) (exported.ConsensusState, bool) {
h := maxHeight
ok := true
for ok {
found := k.HasClientConsensusState(ctx, clientID, h)
if found {
return k.GetClientConsensusState(ctx, clientID, h)
}
h, ok = h.Decrement()
}
return nil, false
}

// GetSelfConsensusState introspects the (self) past historical info at a given height
// and returns the expected consensus state at that height.
// For now, can only retrieve self consensus states for the current version
Expand Down
5 changes: 0 additions & 5 deletions x/ibc/core/02-client/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,6 @@ func (suite KeeperTestSuite) TestConsensusStateHelpers() {
latest, ok := suite.keeper.GetLatestClientConsensusState(suite.ctx, testClientID)
suite.Require().True(ok)
suite.Require().Equal(nextState, latest, "Latest client not returned correctly")

// Should return existing consensusState at latestClientHeight
lte, ok := suite.keeper.GetClientConsensusStateLTE(suite.ctx, testClientID, types.NewHeight(0, height+3))
suite.Require().True(ok)
suite.Require().Equal(suite.consensusState, lte, "LTE helper function did not return latest client state below height: %d", height+3)
}

// 2 clients in total are created on chainA. The first client is updated so it contains an initial consensus state
Expand Down

0 comments on commit 97963c7

Please sign in to comment.