Skip to content

Commit

Permalink
remove GetFrozenHeight from ClientState interface (#165)
Browse files Browse the repository at this point in the history
* remove GetFrozenHeight from ClientState interface

* add changelog
  • Loading branch information
colin-axner authored May 11, 2021
1 parent 4007cfa commit 744199a
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 20 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### API Breaking

* (module/core/02-client) [\#165](https://github.com/cosmos/ibc-go/pull/165) Remove GetFrozenHeight from the ClientState interface.
* (modules) [\#166](https://github.com/cosmos/ibc-go/pull/166) Remove GetHeight from the misbehaviour interface. The `consensus_height` attribute has been removed from Misbehaviour events.
* (modules) [\#162](https://github.com/cosmos/ibc-go/pull/162) Remove deprecated Handler types in core IBC and the ICS 20 transfer module.
* (modules/core) [\#161](https://github.com/cosmos/ibc-go/pull/161) Remove Type(), Route(), GetSignBytes() from 02-client, 03-connection, and 04-channel messages.
Expand Down
1 change: 0 additions & 1 deletion modules/core/exported/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ type ClientState interface {

ClientType() string
GetLatestHeight() Height
GetFrozenHeight() Height
Validate() error
GetProofSpecs() []*ics23.ProofSpec

Expand Down
7 changes: 0 additions & 7 deletions modules/light-clients/06-solomachine/types/client_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,6 @@ func (cs ClientState) IsFrozen() bool {
return cs.FrozenSequence != 0
}

// GetFrozenHeight returns the frozen sequence of the client.
// Return exported.Height to satisfy interface
// Revision number is always 0 for a solo-machine
func (cs ClientState) GetFrozenHeight() exported.Height {
return clienttypes.NewHeight(0, cs.FrozenSequence)
}

// GetProofSpecs returns nil proof specs since client state verification uses signatures.
func (cs ClientState) GetProofSpecs() []*ics23.ProofSpec {
return nil
Expand Down
6 changes: 0 additions & 6 deletions modules/light-clients/07-tendermint/types/client_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,6 @@ func (cs ClientState) Status(
return exported.Active
}

// GetFrozenHeight returns the height at which client is frozen
// NOTE: FrozenHeight is zero if client is unfrozen
func (cs ClientState) GetFrozenHeight() exported.Height {
return cs.FrozenHeight
}

// IsExpired returns whether or not the client has passed the trusting period since the last
// update (in which case no headers are considered valid).
func (cs ClientState) IsExpired(latestTimestamp, now time.Time) bool {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ func (suite *TendermintTestSuite) TestCheckSubstituteAndUpdateState() {

if tc.expPass {
suite.Require().NoError(err)
suite.Require().Equal(clienttypes.ZeroHeight(), updatedClient.GetFrozenHeight())
suite.Require().Equal(clienttypes.ZeroHeight(), updatedClient.(*types.ClientState).FrozenHeight)
} else {
suite.Require().Error(err)
suite.Require().Nil(updatedClient)
Expand Down
5 changes: 0 additions & 5 deletions modules/light-clients/09-localhost/types/client_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ func (cs ClientState) Status(_ sdk.Context, _ sdk.KVStore, _ codec.BinaryCodec,
return exported.Active
}

// GetFrozenHeight returns an uninitialized IBC Height.
func (cs ClientState) GetFrozenHeight() exported.Height {
return clienttypes.ZeroHeight()
}

// Validate performs a basic validation of the client state fields.
func (cs ClientState) Validate() error {
if strings.TrimSpace(cs.ChainId) == "" {
Expand Down

0 comments on commit 744199a

Please sign in to comment.