-
Notifications
You must be signed in to change notification settings - Fork 625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Emit an event to indicate a successful acknowledgement in the ICA module #1466
Changes from 2 commits
5f7aba1
4707987
6702d96
b52209b
94360ae
def3a0d
2987233
c77f3c7
c8ffcb4
997ba57
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,14 @@ func EmitWriteErrorAcknowledgementEvent(ctx sdk.Context, packet exported.PacketI | |
), | ||
) | ||
} | ||
|
||
// EmitSuccessfulAcknowledgementEvent emits an event signalling a successful acknowledgement | ||
func EmitSuccessfulAcknowledgementEvent(ctx sdk.Context, packet exported.PacketI) { | ||
ctx.EventManager().EmitEvent( | ||
sdk.NewEvent( | ||
icatypes.EventTypePacket, | ||
sdk.NewAttribute(sdk.AttributeKeyModule, icatypes.ModuleName), | ||
sdk.NewAttribute(icatypes.AttributeKeyHostChannelID, packet.GetDestChannel()), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would like input on whether or not there are additional fields/attributes that should be included in this event. Please let me know if I've missed anything! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks fine, maybe we could add a But I am also now wondering if we could merge both event functions into one and have something like this:
with the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was actually thinking something very similar with regards to merging the functions. |
||
), | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not saying that you should change it, but just leaving here for your consideration an alternative way of doing this to avoid checking for
err
twice:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My intention was to keep the style similar to what we have here