From bcccdc5057c1aeefdbfd22341f7cf007646462af Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 5 Nov 2024 13:02:47 +0400 Subject: [PATCH] fix(x/group): proper address rendering in error (#22425) (cherry picked from commit 8c24b6bef1f7480314aaade52f6b2154413856f2) # Conflicts: # x/group/keeper/proposal_executor.go --- x/group/keeper/proposal_executor.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/x/group/keeper/proposal_executor.go b/x/group/keeper/proposal_executor.go index 8f2b9165f5aa..aedcbb9f56cd 100644 --- a/x/group/keeper/proposal_executor.go +++ b/x/group/keeper/proposal_executor.go @@ -76,7 +76,21 @@ func ensureMsgAuthZ(msgs []sdk.Msg, groupPolicyAcc sdk.AccAddress, cdc codec.Cod for _, acct := range signers { if !bytes.Equal(groupPolicyAcc, acct) { +<<<<<<< HEAD return errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "msg does not have group policy authorization; expected %s, got %s", groupPolicyAcc.String(), acct) +======= + groupPolicyAddr, err := addressCodec.BytesToString(groupPolicyAcc) + if err != nil { + return errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "msg does not have group policy authorization; error retrieving group policy address") + } + + acctStr, _ := addressCodec.BytesToString(acct) + if acctStr == "" { + acctStr = "unmarshalable address" + } + + return errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "msg does not have group policy authorization; expected %s, got %s", groupPolicyAddr, acctStr) +>>>>>>> 8c24b6bef (fix(x/group): proper address rendering in error (#22425)) } } }