-
Notifications
You must be signed in to change notification settings - Fork 629
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove error from ics27 channel ack (#751)
* removing error from channel ack in favour of event emission * applying suggestions from PR * Update modules/apps/27-interchain-accounts/host/keeper/events.go Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * Update modules/apps/27-interchain-accounts/types/errors.go Co-authored-by: Carlos Rodriguez <carlos@interchain.io> * Update modules/apps/27-interchain-accounts/host/keeper/events.go Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> Co-authored-by: Carlos Rodriguez <carlos@interchain.io> Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
- Loading branch information
1 parent
89ffaaf
commit 4fb75e8
Showing
4 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package keeper | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
|
||
"github.com/cosmos/ibc-go/v3/modules/core/exported" | ||
icatypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/types" | ||
) | ||
|
||
// EmitWriteErrorAcknowledgementEvent emits an event signalling an error acknowledgement and including the error details | ||
func EmitWriteErrorAcknowledgementEvent(ctx sdk.Context, packet exported.PacketI, err error) { | ||
ctx.EventManager().EmitEvent( | ||
sdk.NewEvent( | ||
icatypes.EventTypePacket, | ||
sdk.NewAttribute(sdk.AttributeKeyModule, icatypes.ModuleName), | ||
sdk.NewAttribute(icatypes.AttributeKeyAckError, err.Error()), | ||
sdk.NewAttribute(icatypes.AttributeKeyHostChannelID, packet.GetDestChannel()), | ||
), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package types | ||
|
||
// ICS27 Interchain Accounts events | ||
const ( | ||
EventTypePacket = "ics27_packet" | ||
|
||
AttributeKeyAckError = "error" | ||
AttributeKeyHostChannelID = "host_channel_id" | ||
) |