From 94b2e977f105239c1cbebe92f4d0f73062ab3efc Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 19 Jul 2022 14:22:16 +0200 Subject: [PATCH] Remove leftover crossing hello tests in connection handshake (#1724) (#1729) * remove leftover crossing hello tests in connection handshake * fix bug in tests (cherry picked from commit c809ce356c72b2fc5cc7a7a7f00c5d6928c77790) Co-authored-by: Aditya --- .../03-connection/keeper/handshake_test.go | 44 ++----------------- 1 file changed, 3 insertions(+), 41 deletions(-) diff --git a/modules/core/03-connection/keeper/handshake_test.go b/modules/core/03-connection/keeper/handshake_test.go index d82a2cf22f5..aeabf5718c2 100644 --- a/modules/core/03-connection/keeper/handshake_test.go +++ b/modules/core/03-connection/keeper/handshake_test.go @@ -203,45 +203,6 @@ 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 { @@ -249,8 +210,9 @@ func (suite *KeeperTestSuite) TestConnOpenTry() { 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)