From 4de1d3350145d8336e393003c314ec0e963e9cdd Mon Sep 17 00:00:00 2001 From: beer-1 <147697694+beer-1@users.noreply.github.com> Date: Wed, 6 Nov 2024 15:01:19 +0900 Subject: [PATCH] remove unnecessary context branching (#294) --- x/ibc-hooks/move-hooks/receive.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/x/ibc-hooks/move-hooks/receive.go b/x/ibc-hooks/move-hooks/receive.go index 335314ce..5d18b9d0 100644 --- a/x/ibc-hooks/move-hooks/receive.go +++ b/x/ibc-hooks/move-hooks/receive.go @@ -124,16 +124,10 @@ func (h MoveHooks) execMsg(ctx sdk.Context, msg *movetypes.MsgExecute) (*movetyp } moveMsgServer := movekeeper.NewMsgServerImpl(h.moveKeeper) - - // use cache context to prevent state changes if the message execution fails - cacheCtx, write := ctx.CacheContext() - res, err := moveMsgServer.Execute(cacheCtx, msg) + res, err := moveMsgServer.Execute(ctx, msg) if err != nil { return nil, err } - // write the cache context only if the message execution was successful - write() - return res, nil }