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

Remove leftover crossing hello tests in connection handshake (backport #1724) #1729

Merged
merged 1 commit into from
Jul 19, 2022
Merged
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
44 changes: 3 additions & 41 deletions modules/core/03-connection/keeper/handshake_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,54 +203,16 @@ func (suite *KeeperTestSuite) TestConnOpenTry() {
err := path.EndpointA.ConnOpenInit()
suite.Require().NoError(err)
}, false},
{"invalid previous connection is in TRYOPEN", func() {
// open init chainA
err := path.EndpointA.ConnOpenInit()
suite.Require().NoError(err)

// open try chainB
err = path.EndpointB.ConnOpenTry()
suite.Require().NoError(err)

err = path.EndpointB.UpdateClient()
suite.Require().NoError(err)

// retrieve client state of chainA to pass as counterpartyClient
counterpartyClient = suite.chainA.GetClientState(path.EndpointA.ClientID)
}, false},
{"invalid previous connection has invalid versions", func() {
// open init chainA
err := path.EndpointA.ConnOpenInit()
suite.Require().NoError(err)

// open try chainB
err = path.EndpointB.ConnOpenTry()
suite.Require().NoError(err)

// modify connB to be in INIT with incorrect versions
connection, found := suite.chainB.App.GetIBCKeeper().ConnectionKeeper.GetConnection(suite.chainB.GetContext(), path.EndpointB.ConnectionID)
suite.Require().True(found)

connection.State = types.INIT
connection.Versions = []*types.Version{{}}

suite.chainB.App.GetIBCKeeper().ConnectionKeeper.SetConnection(suite.chainB.GetContext(), path.EndpointB.ConnectionID, connection)

err = path.EndpointB.UpdateClient()
suite.Require().NoError(err)

// retrieve client state of chainA to pass as counterpartyClient
counterpartyClient = suite.chainA.GetClientState(path.EndpointA.ClientID)
}, false},
}

for _, tc := range testCases {
tc := tc

suite.Run(tc.msg, func() {
suite.SetupTest() // reset
consensusHeight = clienttypes.ZeroHeight() // must be explicitly changed in malleate
versions = types.GetCompatibleVersions() // must be explicitly changed in malleate
consensusHeight = clienttypes.ZeroHeight() // may be changed in malleate
versions = types.GetCompatibleVersions() // may be changed in malleate
delayPeriod = 0 // may be changed in malleate
path = ibctesting.NewPath(suite.chainA, suite.chainB)
suite.coordinator.SetupClients(path)

Expand Down