From 23bcf145cb1e1625a259761aa8c075352b6742d8 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Mon, 18 Dec 2023 14:41:14 -0800 Subject: [PATCH] cherry pick: d6115f387ac0 --- x/authz/keeper/msg_server.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/x/authz/keeper/msg_server.go b/x/authz/keeper/msg_server.go index a6c1a13dc44b..a3e1adaa0722 100644 --- a/x/authz/keeper/msg_server.go +++ b/x/authz/keeper/msg_server.go @@ -150,6 +150,10 @@ func (k Keeper) ExecCompat(goCtx context.Context, msg *authz.MsgExecCompat) (*au subMsgs[idx] = iMsg } + if err := validateMsgs(subMsgs); err != nil { + return nil, err + } + results, err := k.DispatchActions(ctx, grantee, subMsgs) if err != nil { return nil, fmt.Errorf("dispatch err: %w", err) @@ -166,7 +170,7 @@ func validateMsgs(msgs []sdk.Msg) error { } if err := m.ValidateBasic(); err != nil { - return errorsmod.Wrapf(err, "msg %d", i) + return errorsmod.Wrapf(err, "validate message at index %d error", i) } }