Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: removing GetRoot from ConsensusState interface #1186

Merged
merged 3 commits into from
Mar 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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