@@ -117,6 +117,10 @@ func (chain *WasmTestChain) CaptureIBCEvents(result *abci.ExecTxResult) {
117
117
// IBCv1 and IBCv2 `EventTypeSendPacket` are the same
118
118
// and the [`ParsePacketsFromEvents`] parses both of them as they were IBCv1
119
119
// so we have to filter them here.
120
+ //
121
+ // While parsing IBC2 events in IBC1 context the only overlapping event is the
122
+ // `AttributeKeyTimeoutTimestamp` so to determine if the wrong set of events was parsed
123
+ // we should be able to check if any other field in the packet is not set.
120
124
var toSendFiltered []channeltypes.Packet
121
125
for _ , packet := range toSend {
122
126
if packet .SourcePort != "" {
@@ -361,7 +365,7 @@ func RelayPacketWithoutAck(path *ibctesting.Path, packet channeltypes.Packet) er
361
365
// if a relay step fails or the packet commitment does not exist on either endpoint.
362
366
// In contrast to RelayPacket, this function does not acknowledge the packet and expects it to have no acknowledgement yet.
363
367
// It is useful for testing async acknowledgement.
364
- func RelayPacketV2 (path * WasmPath , packet channeltypesv2.Packet ) error {
368
+ func RelayPacketWithoutAckV2 (path * WasmPath , packet channeltypesv2.Packet ) error {
365
369
pc := path .EndpointA .Chain .App .GetIBCKeeper ().ChannelKeeperV2 .GetPacketCommitment (path .EndpointA .Chain .GetContext (), packet .GetSourceClient (), packet .GetSequence ())
366
370
if bytes .Equal (pc , channeltypesv2 .CommitPacket (packet )) {
367
371
// packet found, relay from A to B
@@ -443,7 +447,7 @@ func RelayPendingPacketsV2(path *WasmPath) error {
443
447
require .NoError (path .chainA , src .UpdateClient ())
444
448
path .chainA .Logf ("Relay: %d PacketsV2 A->B, %d PacketsV2 B->A\n " , len (* path .chainA .PendingSendPacketsV2 ), len (* path .chainB .PendingSendPacketsV2 ))
445
449
for _ , v := range * path .chainA .PendingSendPacketsV2 {
446
- err := RelayPacketV2 (path , v )
450
+ err := RelayPacketWithoutAckV2 (path , v )
447
451
if err != nil {
448
452
return err
449
453
}
@@ -454,7 +458,7 @@ func RelayPendingPacketsV2(path *WasmPath) error {
454
458
src = path .EndpointB
455
459
require .NoError (path .chainB , src .UpdateClient ())
456
460
for _ , v := range * path .chainB .PendingSendPacketsV2 {
457
- err := RelayPacketV2 (path , v )
461
+ err := RelayPacketWithoutAckV2 (path , v )
458
462
if err != nil {
459
463
return err
460
464
}
0 commit comments