Skip to content

Commit

Permalink
remove unnecessary context branching (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
beer-1 authored Nov 6, 2024
1 parent 97c60ae commit 4de1d33
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions x/ibc-hooks/move-hooks/receive.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 4de1d33

Please sign in to comment.