Skip to content

Commit c2602a5

Browse files
authored
refactor: removing GetRoot from ConsensusState interface (#1186)
* refactor: removing GetRoot from ConsensusState interface * refactor: remove unnecessary GetRoot definitions * chore: changelog
1 parent fadd9d0 commit c2602a5

File tree

5 files changed

+1
-15
lines changed

5 files changed

+1
-15
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
4343
### State Machine Breaking
4444

4545
### Improvements
46+
* [\#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.
4647

4748
### Features
4849

modules/core/02-client/legacy/v100/solomachine.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,6 @@ func (cs ConsensusState) GetTimestamp() uint64 {
197197
panic("legacy solo machine is deprecated!")
198198
}
199199

200-
// GetRoot panics!
201-
func (cs ConsensusState) GetRoot() exported.Root {
202-
panic("legacy solo machine is deprecated!")
203-
}
204-
205200
// ValidateBasic panics!
206201
func (cs ConsensusState) ValidateBasic() error {
207202
panic("legacy solo machine is deprecated!")

modules/core/exported/client.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,6 @@ type ConsensusState interface {
185185

186186
ClientType() string // Consensus kind
187187

188-
// GetRoot returns the commitment root of the consensus state,
189-
// which is used for key-value pair verification.
190-
GetRoot() Root
191-
192188
// GetTimestamp returns the timestamp (in nanoseconds) of the consensus state
193189
GetTimestamp() uint64
194190

modules/light-clients/06-solomachine/types/consensus_state.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ func (cs ConsensusState) GetTimestamp() uint64 {
2222
return cs.Timestamp
2323
}
2424

25-
// GetRoot returns nil since solo machines do not have roots.
26-
func (cs ConsensusState) GetRoot() exported.Root {
27-
return nil
28-
}
29-
3025
// GetPubKey unmarshals the public key into a cryptotypes.PubKey type.
3126
// An error is returned if the public key is nil or the cached value
3227
// is not a PubKey.

modules/light-clients/06-solomachine/types/consensus_state_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ func (suite *SoloMachineTestSuite) TestConsensusState() {
1111

1212
suite.Require().Equal(exported.Solomachine, consensusState.ClientType())
1313
suite.Require().Equal(suite.solomachine.Time, consensusState.GetTimestamp())
14-
suite.Require().Nil(consensusState.GetRoot())
1514
}
1615

1716
func (suite *SoloMachineTestSuite) TestConsensusStateValidateBasic() {

0 commit comments

Comments
 (0)