@@ -91,6 +91,17 @@ func (k Keeper) ChanOpenInit(
91
91
telemetry .IncrCounter (1 , "ibc" , "channel" , "open-init" )
92
92
}()
93
93
94
+ ctx .EventManager ().EmitEvents (sdk.Events {
95
+ sdk .NewEvent (
96
+ types .EventTypeChannelOpenInit ,
97
+ sdk .NewAttribute (types .AttributeKeyPortID , portID ),
98
+ sdk .NewAttribute (types .AttributeKeyChannelID , channelID ),
99
+ sdk .NewAttribute (types .AttributeCounterpartyPortID , counterparty .PortId ),
100
+ sdk .NewAttribute (types .AttributeCounterpartyChannelID , counterparty .ChannelId ),
101
+ sdk .NewAttribute (types .AttributeKeyConnectionID , connectionHops [0 ]),
102
+ ),
103
+ })
104
+
94
105
return channelID , capKey , nil
95
106
}
96
107
@@ -232,6 +243,17 @@ func (k Keeper) ChanOpenTry(
232
243
telemetry .IncrCounter (1 , "ibc" , "channel" , "open-try" )
233
244
}()
234
245
246
+ ctx .EventManager ().EmitEvents (sdk.Events {
247
+ sdk .NewEvent (
248
+ types .EventTypeChannelOpenTry ,
249
+ sdk .NewAttribute (types .AttributeKeyPortID , portID ),
250
+ sdk .NewAttribute (types .AttributeKeyChannelID , channelID ),
251
+ sdk .NewAttribute (types .AttributeCounterpartyPortID , channel .Counterparty .PortId ),
252
+ sdk .NewAttribute (types .AttributeCounterpartyChannelID , channel .Counterparty .ChannelId ),
253
+ sdk .NewAttribute (types .AttributeKeyConnectionID , channel .ConnectionHops [0 ]),
254
+ ),
255
+ })
256
+
235
257
return channelID , capKey , nil
236
258
}
237
259
@@ -307,6 +329,17 @@ func (k Keeper) ChanOpenAck(
307
329
channel .Counterparty .ChannelId = counterpartyChannelID
308
330
k .SetChannel (ctx , portID , channelID , channel )
309
331
332
+ ctx .EventManager ().EmitEvents (sdk.Events {
333
+ sdk .NewEvent (
334
+ types .EventTypeChannelOpenAck ,
335
+ sdk .NewAttribute (types .AttributeKeyPortID , portID ),
336
+ sdk .NewAttribute (types .AttributeKeyChannelID , channelID ),
337
+ sdk .NewAttribute (types .AttributeCounterpartyPortID , channel .Counterparty .PortId ),
338
+ sdk .NewAttribute (types .AttributeCounterpartyChannelID , channel .Counterparty .ChannelId ),
339
+ sdk .NewAttribute (types .AttributeKeyConnectionID , channel .ConnectionHops [0 ]),
340
+ ),
341
+ })
342
+
310
343
return nil
311
344
}
312
345
@@ -375,6 +408,18 @@ func (k Keeper) ChanOpenConfirm(
375
408
defer func () {
376
409
telemetry .IncrCounter (1 , "ibc" , "channel" , "open-confirm" )
377
410
}()
411
+
412
+ ctx .EventManager ().EmitEvents (sdk.Events {
413
+ sdk .NewEvent (
414
+ types .EventTypeChannelOpenConfirm ,
415
+ sdk .NewAttribute (types .AttributeKeyPortID , portID ),
416
+ sdk .NewAttribute (types .AttributeKeyChannelID , channelID ),
417
+ sdk .NewAttribute (types .AttributeCounterpartyPortID , channel .Counterparty .PortId ),
418
+ sdk .NewAttribute (types .AttributeCounterpartyChannelID , channel .Counterparty .ChannelId ),
419
+ sdk .NewAttribute (types .AttributeKeyConnectionID , channel .ConnectionHops [0 ]),
420
+ ),
421
+ })
422
+
378
423
return nil
379
424
}
380
425
@@ -425,6 +470,17 @@ func (k Keeper) ChanCloseInit(
425
470
channel .State = types .CLOSED
426
471
k .SetChannel (ctx , portID , channelID , channel )
427
472
473
+ ctx .EventManager ().EmitEvents (sdk.Events {
474
+ sdk .NewEvent (
475
+ types .EventTypeChannelCloseInit ,
476
+ sdk .NewAttribute (types .AttributeKeyPortID , portID ),
477
+ sdk .NewAttribute (types .AttributeKeyChannelID , channelID ),
478
+ sdk .NewAttribute (types .AttributeCounterpartyPortID , channel .Counterparty .PortId ),
479
+ sdk .NewAttribute (types .AttributeCounterpartyChannelID , channel .Counterparty .ChannelId ),
480
+ sdk .NewAttribute (types .AttributeKeyConnectionID , channel .ConnectionHops [0 ]),
481
+ ),
482
+ })
483
+
428
484
return nil
429
485
}
430
486
@@ -492,5 +548,16 @@ func (k Keeper) ChanCloseConfirm(
492
548
channel .State = types .CLOSED
493
549
k .SetChannel (ctx , portID , channelID , channel )
494
550
551
+ ctx .EventManager ().EmitEvents (sdk.Events {
552
+ sdk .NewEvent (
553
+ types .EventTypeChannelCloseConfirm ,
554
+ sdk .NewAttribute (types .AttributeKeyPortID , portID ),
555
+ sdk .NewAttribute (types .AttributeKeyChannelID , channelID ),
556
+ sdk .NewAttribute (types .AttributeCounterpartyPortID , channel .Counterparty .PortId ),
557
+ sdk .NewAttribute (types .AttributeCounterpartyChannelID , channel .Counterparty .ChannelId ),
558
+ sdk .NewAttribute (types .AttributeKeyConnectionID , channel .ConnectionHops [0 ]),
559
+ ),
560
+ })
561
+
495
562
return nil
496
563
}
0 commit comments