From aa55e5056f2d1b783674f86a5c1956556926ac9a Mon Sep 17 00:00:00 2001 From: beer-1 <147697694+beer-1@users.noreply.github.com> Date: Tue, 23 Apr 2024 13:18:15 +0900 Subject: [PATCH] add error handling --- x/ophost/keeper/msg_server.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/x/ophost/keeper/msg_server.go b/x/ophost/keeper/msg_server.go index 11e38022..bd08182c 100644 --- a/x/ophost/keeper/msg_server.go +++ b/x/ophost/keeper/msg_server.go @@ -196,7 +196,9 @@ func (ms MsgServer) DeleteOutput(ctx context.Context, req *types.MsgDeleteOutput } // rollback next output index to the deleted output index - ms.NextOutputIndexes.Set(ctx, bridgeId, outputIndex) + if err := ms.NextOutputIndexes.Set(ctx, bridgeId, outputIndex); err != nil { + return nil, err + } sdk.UnwrapSDKContext(ctx).EventManager().EmitEvent(sdk.NewEvent( types.EventTypeDeleteOutput,