Alter connection handshake (#6209)
* Alter connection handshake * Add test-case Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
parent
6d7fc911c2
commit
513c5f30c2
|
@ -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(),
|
||||
|
|
|
@ -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},
|
||||
|
|
Loading…
Reference in New Issue