diff --git a/x/move/ibc-middleware/util.go b/x/move/ibc-middleware/util.go index 0ceb3820..503dda87 100644 --- a/x/move/ibc-middleware/util.go +++ b/x/move/ibc-middleware/util.go @@ -98,19 +98,10 @@ func jsonStringHasKey(memo, key string) (found bool, jsonObject map[string]inter // newEmitErrorAcknowledgement creates a new error acknowledgement after having emitted an event with the // details of the error. -func newEmitErrorAcknowledgement(ctx sdk.Context, err error, errorContexts ...string) channeltypes.Acknowledgement { - attributes := make([]sdk.Attribute, len(errorContexts)+1) - attributes[0] = sdk.NewAttribute("error", err.Error()) - for i, s := range errorContexts { - attributes[i+1] = sdk.NewAttribute("error-context", s) +func newEmitErrorAcknowledgement(ctx sdk.Context, err error) channeltypes.Acknowledgement { + return channeltypes.Acknowledgement{ + Response: &channeltypes.Acknowledgement_Error{ + Error: fmt.Sprintf("ibc move hook error: %s", err.Error()), + }, } - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - "ibc-acknowledgement-error", - attributes..., - ), - }) - - return channeltypes.NewErrorAcknowledgement(err) }