Skip to content

Commit

Permalink
refactor: removing GetRoot from ConsensusState interface (#1186)
Browse files Browse the repository at this point in the history
* refactor: removing GetRoot from ConsensusState interface

* refactor: remove unnecessary GetRoot definitions

* chore: changelog
  • Loading branch information
seantking authored Mar 30, 2022
1 parent fadd9d0 commit c2602a5
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 15 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 0 additions & 5 deletions modules/core/02-client/legacy/v100/solomachine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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!")
Expand Down
4 changes: 0 additions & 4 deletions modules/core/exported/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 0 additions & 5 deletions modules/light-clients/06-solomachine/types/consensus_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit c2602a5

Please sign in to comment.