From daa687cc4ebcfd838599c69e033c842eaa903f76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Colin=20Axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Mon, 10 May 2021 18:41:00 +0200 Subject: [PATCH 1/2] remove GetFrozenHeight from ClientState interface --- modules/core/exported/client.go | 1 - modules/light-clients/06-solomachine/types/client_state.go | 7 ------- modules/light-clients/07-tendermint/types/client_state.go | 6 ------ .../07-tendermint/types/proposal_handle_test.go | 2 +- modules/light-clients/09-localhost/types/client_state.go | 5 ----- 5 files changed, 1 insertion(+), 20 deletions(-) diff --git a/modules/core/exported/client.go b/modules/core/exported/client.go index b79106c174a..8297c50933c 100644 --- a/modules/core/exported/client.go +++ b/modules/core/exported/client.go @@ -44,7 +44,6 @@ type ClientState interface { ClientType() string GetLatestHeight() Height - GetFrozenHeight() Height Validate() error GetProofSpecs() []*ics23.ProofSpec diff --git a/modules/light-clients/06-solomachine/types/client_state.go b/modules/light-clients/06-solomachine/types/client_state.go index 7ce5fa1fade..c187c734571 100644 --- a/modules/light-clients/06-solomachine/types/client_state.go +++ b/modules/light-clients/06-solomachine/types/client_state.go @@ -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 diff --git a/modules/light-clients/07-tendermint/types/client_state.go b/modules/light-clients/07-tendermint/types/client_state.go index 00d919aeaeb..4928a6819aa 100644 --- a/modules/light-clients/07-tendermint/types/client_state.go +++ b/modules/light-clients/07-tendermint/types/client_state.go @@ -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 { diff --git a/modules/light-clients/07-tendermint/types/proposal_handle_test.go b/modules/light-clients/07-tendermint/types/proposal_handle_test.go index 6208aec3165..ce09917853e 100644 --- a/modules/light-clients/07-tendermint/types/proposal_handle_test.go +++ b/modules/light-clients/07-tendermint/types/proposal_handle_test.go @@ -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) diff --git a/modules/light-clients/09-localhost/types/client_state.go b/modules/light-clients/09-localhost/types/client_state.go index 67da74d9c27..294ee4d9d48 100644 --- a/modules/light-clients/09-localhost/types/client_state.go +++ b/modules/light-clients/09-localhost/types/client_state.go @@ -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) == "" { From 54c1ca51ddf2c8999381213a512c938fd75b657b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Colin=20Axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Mon, 10 May 2021 18:44:01 +0200 Subject: [PATCH 2/2] add changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b2866e6764..7b9b7364630 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,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) [\#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. * (modules) [\#140](https://github.com/cosmos/ibc-go/pull/140) IsFrozen() client state interface changed to Status(). gRPC `ClientStatus` route added.