Skip to content

Commit

Permalink
fix(authz): error msg (backport #16869) (#16873)
Browse files Browse the repository at this point in the history
Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
  • Loading branch information
3 people authored Jul 7, 2023
1 parent e141d8e commit 26d3559
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ Ref: https://keepachangelog.com/en/1.0.0/

## [Unreleased]

### Improvements

* (x/authz) [#16869](https://github.com/cosmos/cosmos-sdk/pull/16869) Improve error message when grant not found.

### Bug Fixes

* (x/bank) [#16841](https://github.com/cosmos/cosmos-sdk/pull/16841) Correctly process legacy `DenomAddressIndex` values.
Expand Down
3 changes: 2 additions & 1 deletion x/authz/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion x/authz/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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})
},
Expand Down

0 comments on commit 26d3559

Please sign in to comment.