fix(x/group): proper address rendering in error (backport #22425) (#22431)

Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
mergify[bot] 2024-11-05 10:15:30 +01:00 committed by GitHub
parent d67d6a275b
commit a98ac47c84
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -70,7 +70,13 @@ func ensureMsgAuthZ(msgs []sdk.Msg, groupPolicyAcc sdk.AccAddress, cdc codec.Cod
if err != nil {
return errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "msg does not have group policy authorization; error retrieving group policy address")
}
return errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "msg does not have group policy authorization; expected %s, got %s", groupPolicyAddr, acct)
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)
}
}
}