From f9c61b658603fabb7a4b6008f7e7e78d15d410ff Mon Sep 17 00:00:00 2001 From: Sean King Date: Tue, 29 Mar 2022 10:25:50 +0200 Subject: [PATCH 1/3] refactor: removing GetRoot from ConsensusState interface --- modules/core/exported/client.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/core/exported/client.go b/modules/core/exported/client.go index 39095aff28f..c1f30ce0804 100644 --- a/modules/core/exported/client.go +++ b/modules/core/exported/client.go @@ -185,10 +185,6 @@ type ConsensusState interface { ClientType() string // Consensus kind - // GetRoot returns the commitment root of the consensus state, - // which is used for key-value pair verification. - GetRoot() Root - // GetTimestamp returns the timestamp (in nanoseconds) of the consensus state GetTimestamp() uint64 From c352e537b7d0ecc5622e7e41880b41348bd68486 Mon Sep 17 00:00:00 2001 From: Sean King Date: Tue, 29 Mar 2022 10:32:03 +0200 Subject: [PATCH 2/3] refactor: remove unnecessary GetRoot definitions --- modules/core/02-client/legacy/v100/solomachine.go | 5 ----- .../light-clients/06-solomachine/types/consensus_state.go | 5 ----- .../06-solomachine/types/consensus_state_test.go | 1 - 3 files changed, 11 deletions(-) diff --git a/modules/core/02-client/legacy/v100/solomachine.go b/modules/core/02-client/legacy/v100/solomachine.go index c9814439902..28901dd7709 100644 --- a/modules/core/02-client/legacy/v100/solomachine.go +++ b/modules/core/02-client/legacy/v100/solomachine.go @@ -197,11 +197,6 @@ func (cs ConsensusState) GetTimestamp() uint64 { panic("legacy solo machine is deprecated!") } -// GetRoot panics! -func (cs ConsensusState) GetRoot() exported.Root { - panic("legacy solo machine is deprecated!") -} - // ValidateBasic panics! func (cs ConsensusState) ValidateBasic() error { panic("legacy solo machine is deprecated!") diff --git a/modules/light-clients/06-solomachine/types/consensus_state.go b/modules/light-clients/06-solomachine/types/consensus_state.go index 3012f91a567..61b15b65882 100644 --- a/modules/light-clients/06-solomachine/types/consensus_state.go +++ b/modules/light-clients/06-solomachine/types/consensus_state.go @@ -22,11 +22,6 @@ func (cs ConsensusState) GetTimestamp() uint64 { return cs.Timestamp } -// GetRoot returns nil since solo machines do not have roots. -func (cs ConsensusState) GetRoot() exported.Root { - return nil -} - // GetPubKey unmarshals the public key into a cryptotypes.PubKey type. // An error is returned if the public key is nil or the cached value // is not a PubKey. diff --git a/modules/light-clients/06-solomachine/types/consensus_state_test.go b/modules/light-clients/06-solomachine/types/consensus_state_test.go index 33e200c5461..5b2b29cadcd 100644 --- a/modules/light-clients/06-solomachine/types/consensus_state_test.go +++ b/modules/light-clients/06-solomachine/types/consensus_state_test.go @@ -11,7 +11,6 @@ func (suite *SoloMachineTestSuite) TestConsensusState() { suite.Require().Equal(exported.Solomachine, consensusState.ClientType()) suite.Require().Equal(suite.solomachine.Time, consensusState.GetTimestamp()) - suite.Require().Nil(consensusState.GetRoot()) } func (suite *SoloMachineTestSuite) TestConsensusStateValidateBasic() { From 75766f276b70101a83680562b057dc2532ee6c1f Mon Sep 17 00:00:00 2001 From: Sean King Date: Wed, 30 Mar 2022 08:31:41 +0200 Subject: [PATCH 3/3] chore: changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c302b4c759e..5651a3d7ebd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### State Machine Breaking ### Improvements +* [\#1186](https://github.com/cosmos/ibc-go/pull/1186/files) Removing `GetRoot` function from ConsensusState interface in `02-client`. `GetRoot` is unused by core IBC. ### Features