@@ -253,13 +253,17 @@ func (suite *KeeperTestSuite) TestWriteAcknowledgement() {
253
253
"failure: client not found" ,
254
254
func () {
255
255
packet .DestinationClient = ibctesting .InvalidID
256
+ suite .chainB .App .GetIBCKeeper ().ChannelKeeperV2 .SetPacketReceipt (suite .chainB .GetContext (), packet .DestinationClient , packet .Sequence )
257
+ suite .chainB .App .GetIBCKeeper ().ChannelKeeperV2 .SetAsyncPacket (suite .chainB .GetContext (), packet .DestinationClient , packet .Sequence , packet )
256
258
},
257
259
clienttypes .ErrCounterpartyNotFound ,
258
260
},
259
261
{
260
262
"failure: counterparty client identifier different than source client" ,
261
263
func () {
262
264
packet .SourceClient = unusedChannel
265
+ suite .chainB .App .GetIBCKeeper ().ChannelKeeperV2 .SetPacketReceipt (suite .chainB .GetContext (), packet .DestinationClient , packet .Sequence )
266
+ suite .chainB .App .GetIBCKeeper ().ChannelKeeperV2 .SetAsyncPacket (suite .chainB .GetContext (), packet .DestinationClient , packet .Sequence , packet )
263
267
},
264
268
clienttypes .ErrInvalidCounterparty ,
265
269
},
@@ -275,9 +279,17 @@ func (suite *KeeperTestSuite) TestWriteAcknowledgement() {
275
279
"failure: receipt not found for packet" ,
276
280
func () {
277
281
packet .Sequence = 2
282
+ suite .chainB .App .GetIBCKeeper ().ChannelKeeperV2 .SetAsyncPacket (suite .chainB .GetContext (), packet .DestinationClient , packet .Sequence , packet )
278
283
},
279
284
types .ErrInvalidPacket ,
280
285
},
286
+ {
287
+ "failure: async packet not found" ,
288
+ func () {
289
+ suite .chainB .App .GetIBCKeeper ().ChannelKeeperV2 .DeleteAsyncPacket (suite .chainB .GetContext (), packet .DestinationClient , packet .Sequence )
290
+ },
291
+ types .ErrInvalidAcknowledgement ,
292
+ },
281
293
}
282
294
283
295
for _ , tc := range testCases {
@@ -301,11 +313,13 @@ func (suite *KeeperTestSuite) TestWriteAcknowledgement() {
301
313
AppAcknowledgements : [][]byte {mockv2 .MockRecvPacketResult .Acknowledgement },
302
314
}
303
315
316
+ // mock receive with async acknowledgement
304
317
suite .chainB .App .GetIBCKeeper ().ChannelKeeperV2 .SetPacketReceipt (suite .chainB .GetContext (), packet .DestinationClient , packet .Sequence )
318
+ suite .chainB .App .GetIBCKeeper ().ChannelKeeperV2 .SetAsyncPacket (suite .chainB .GetContext (), packet .DestinationClient , packet .Sequence , packet )
305
319
306
320
tc .malleate ()
307
321
308
- err := suite .chainB .App .GetIBCKeeper ().ChannelKeeperV2 .WriteAcknowledgement (suite .chainB .GetContext (), packet , ack )
322
+ err := suite .chainB .App .GetIBCKeeper ().ChannelKeeperV2 .WriteAcknowledgement (suite .chainB .GetContext (), packet . DestinationClient , packet . Sequence , ack )
309
323
310
324
expPass := tc .expError == nil
311
325
if expPass {
0 commit comments