diff --git a/x/ibc/03-connection/keeper/handshake.go b/x/ibc/03-connection/keeper/handshake.go index 64cac7628b..a1814476cb 100644 --- a/x/ibc/03-connection/keeper/handshake.go +++ b/x/ibc/03-connection/keeper/handshake.go @@ -141,8 +141,8 @@ func (k Keeper) ConnOpenAck( return sdkerrors.Wrap(types.ErrConnectionNotFound, "cannot relay ACK of open attempt") } - // Check connection on ChainA is on correct state: INIT - if connection.State != ibctypes.INIT { + // Check connection on ChainA is on correct state: INIT or TRYOPEN + if connection.State != ibctypes.INIT && connection.State != ibctypes.TRYOPEN { return sdkerrors.Wrapf( types.ErrInvalidConnectionState, "connection state is not INIT (got %s)", connection.State.String(), diff --git a/x/ibc/03-connection/keeper/handshake_test.go b/x/ibc/03-connection/keeper/handshake_test.go index ccd2071f0b..4522f1ea72 100644 --- a/x/ibc/03-connection/keeper/handshake_test.go +++ b/x/ibc/03-connection/keeper/handshake_test.go @@ -156,6 +156,15 @@ func (suite *KeeperTestSuite) TestConnOpenAck() { suite.chainA.updateClient(suite.chainB) return suite.chainB.Header.GetHeight() }, true}, + {"success from tryopen", version, func() uint64 { + suite.chainA.CreateClient(suite.chainB) + suite.chainB.CreateClient(suite.chainA) + suite.chainB.createConnection(testConnectionIDB, testConnectionIDA, testClientIDA, testClientIDB, ibctypes.TRYOPEN) + suite.chainA.createConnection(testConnectionIDA, testConnectionIDB, testClientIDB, testClientIDA, ibctypes.TRYOPEN) + suite.chainB.updateClient(suite.chainA) + suite.chainA.updateClient(suite.chainB) + return suite.chainB.Header.GetHeight() + }, true}, {"consensus height > latest height", version, func() uint64 { return 10 }, false},