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: address linter findings in 07-tendermint #6136

Merged
merged 19 commits into from
Apr 15, 2024
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: 3 additions & 1 deletion modules/light-clients/07-tendermint/header_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ func (suite *TendermintTestSuite) TestHeaderValidateBasic() {
header.SignedHeader.Commit = nil
}, false},
{"trusted height is equal to header height", func() {
header.TrustedHeight = header.GetHeight().(clienttypes.Height)
var ok bool
header.TrustedHeight, ok = header.GetHeight().(clienttypes.Height)
suite.Require().True(ok)
}, false},
{"validator set nil", func() {
header.ValidatorSet = nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,8 @@ func (suite *TendermintTestSuite) TestRecoverClient() {

// assert that status of subject client is now Active
clientStore := suite.chainA.App.GetIBCKeeper().ClientKeeper.ClientStore(ctx, subjectClientID)
tmClientState := subjectPath.EndpointA.GetClientState().(*ibctm.ClientState)
tmClientState, ok := subjectPath.EndpointA.GetClientState().(*ibctm.ClientState)
suite.Require().True(ok)
suite.Require().Equal(exported.Active, tmClientState.Status(ctx, clientStore, suite.chainA.App.AppCodec()))
} else {
suite.Require().Error(err)
Expand Down Expand Up @@ -435,12 +436,14 @@ func (suite *TendermintTestSuite) TestVerifyUpgradeAndUpdateState() {
suite.Require().NoError(err)

// change upgraded client state height to be lower than current client state height
tmClient := upgradedClientState.(*ibctm.ClientState)
tmClient, ok := upgradedClientState.(*ibctm.ClientState)
suite.Require().True(ok)

newLatestheight, ok := path.EndpointA.GetClientLatestHeight().Decrement()
suite.Require().True(ok)

tmClient.LatestHeight = newLatestheight.(clienttypes.Height)
tmClient.LatestHeight, ok = newLatestheight.(clienttypes.Height)
suite.Require().True(ok)
upgradedClientStateAny, err = codectypes.NewAnyWithValue(tmClient)
suite.Require().NoError(err)

Expand All @@ -464,7 +467,8 @@ func (suite *TendermintTestSuite) TestVerifyUpgradeAndUpdateState() {
path.SetupClients()

clientID = path.EndpointA.ClientID
clientState := path.EndpointA.GetClientState().(*ibctm.ClientState)
clientState, ok := path.EndpointA.GetClientState().(*ibctm.ClientState)
suite.Require().True(ok)
revisionNumber := clienttypes.ParseChainID(clientState.ChainId)

newUnbondindPeriod := ubdPeriod + trustingPeriod
Expand Down
Loading
Loading