Skip to content

Commit

Permalink
Create separate Write-Ack Event (cosmos#7683)
Browse files Browse the repository at this point in the history
* use separate type for write ack

* change event-type

Co-authored-by: Christopher Goes <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Oct 27, 2020
1 parent 9bd42ac commit 48c7223
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion x/ibc/core/04-channel/keeper/packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,15 @@ func (k Keeper) WriteAcknowledgement(
// emit an event that the relayer can query for
ctx.EventManager().EmitEvents(sdk.Events{
sdk.NewEvent(
types.EventTypeRecvPacket,
types.EventTypeWriteAck,
sdk.NewAttribute(types.AttributeKeyData, string(packet.GetData())),
sdk.NewAttribute(types.AttributeKeyTimeoutHeight, packet.GetTimeoutHeight().String()),
sdk.NewAttribute(types.AttributeKeyTimeoutTimestamp, fmt.Sprintf("%d", packet.GetTimeoutTimestamp())),
sdk.NewAttribute(types.AttributeKeySequence, fmt.Sprintf("%d", packet.GetSequence())),
sdk.NewAttribute(types.AttributeKeySrcPort, packet.GetSourcePort()),
sdk.NewAttribute(types.AttributeKeySrcChannel, packet.GetSourceChannel()),
sdk.NewAttribute(types.AttributeKeyDstPort, packet.GetDestPort()),
sdk.NewAttribute(types.AttributeKeyDstChannel, packet.GetDestChannel()),
sdk.NewAttribute(types.AttributeKeyAck, string(acknowledgement)),
),
sdk.NewEvent(
Expand Down
1 change: 1 addition & 0 deletions x/ibc/core/04-channel/types/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const (

EventTypeSendPacket = "send_packet"
EventTypeRecvPacket = "recv_packet"
EventTypeWriteAck = "write_acknowledgement"
EventTypeAcknowledgePacket = "acknowledge_packet"
EventTypeTimeoutPacket = "timeout_packet"

Expand Down

0 comments on commit 48c7223

Please sign in to comment.