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

This commit is contained in:
Julien Robert 2024-11-05 13:02:47 +04:00 committed by GitHub
parent 55f7cfceba
commit 8c24b6bef1
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)
}
}
}