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

chore: removing solomachine consensus state nil check #1895

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
4 changes: 0 additions & 4 deletions modules/light-clients/06-solomachine/client_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,6 @@ func produceVerificationArgs(
return nil, nil, 0, 0, err
}

if cs.ConsensusState == nil {
return nil, nil, 0, 0, sdkerrors.Wrap(clienttypes.ErrInvalidConsensus, "consensus state cannot be empty")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we panic here or will we just let it panic when we try to use it later on?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will panic when we try to use .ConsensusState. I think it is okay to let that happen imo. The panic message gets redacted anyways

}

// sequence is encoded in the revision height of height struct
sequence := height.GetRevisionHeight()
latestSequence := cs.GetLatestHeight().GetRevisionHeight()
Expand Down
14 changes: 0 additions & 14 deletions modules/light-clients/06-solomachine/client_state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,13 +447,6 @@ func (suite *SoloMachineTestSuite) TestVerifyMembership() {
},
true,
},
{
"consensus state in client state is nil",
func() {
clientState = solomachine.NewClientState(1, nil, false)
},
false,
},
{
"client state latest height is less than sequence",
func() {
Expand Down Expand Up @@ -665,13 +658,6 @@ func (suite *SoloMachineTestSuite) TestVerifyNonMembership() {
},
true,
},
{
"consensus state in client state is nil",
func() {
clientState = solomachine.NewClientState(1, nil, false)
},
false,
},
{
"client state latest height is less than sequence",
func() {
Expand Down