fix(authz): error msg (#16869)
Co-authored-by: Likhita Polavarapu <78951027+likhita-809@users.noreply.github.com>
This commit is contained in:
parent
ac6df28bef
commit
bf7a298c2c
@ -43,6 +43,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
|
||||
### Improvements
|
||||
|
||||
* (all) [#16537](https://github.com/cosmos/cosmos-sdk/pull/16537) Properly propagated fmt.Errorf errors + using errors.New where appropriate.
|
||||
* (x/authz) [#16869](https://github.com/cosmos/cosmos-sdk/pull/16869) Error message has been improvised in `Exec` command when grant not found.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
|
||||
@ -118,7 +118,8 @@ func (k Keeper) DispatchActions(ctx context.Context, grantee sdk.AccAddress, msg
|
||||
|
||||
grant, found := k.getGrant(ctx, skey)
|
||||
if !found {
|
||||
return nil, errorsmod.Wrapf(authz.ErrNoAuthorizationFound, "failed to update grant with key %s", string(skey))
|
||||
return nil, errorsmod.Wrapf(authz.ErrNoAuthorizationFound,
|
||||
"failed to get grant with given granter: %s, grantee: %s & msgType: %s ", sdk.AccAddress(granter), grantee, sdk.MsgTypeURL(msg))
|
||||
}
|
||||
|
||||
if grant.Expiration != nil && grant.Expiration.Before(now) {
|
||||
|
||||
@ -331,7 +331,7 @@ func (suite *TestSuite) TestExec() {
|
||||
errMsg: "empty address string is not allowed",
|
||||
},
|
||||
{
|
||||
name: "no existing grant",
|
||||
name: "non existing grant",
|
||||
malleate: func() authz.MsgExec {
|
||||
return authz.NewMsgExec(grantee, []sdk.Msg{msg})
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user