From e588660dedce2391c28fb6e779a301cf34cf2723 Mon Sep 17 00:00:00 2001 From: atheesh Date: Fri, 7 Jul 2023 11:12:37 +0530 Subject: [PATCH 1/3] fix(authz): error msg --- x/authz/keeper/keeper.go | 3 ++- x/authz/keeper/msg_server_test.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/x/authz/keeper/keeper.go b/x/authz/keeper/keeper.go index e767c10b7b27..39649ef4ea11 100644 --- a/x/authz/keeper/keeper.go +++ b/x/authz/keeper/keeper.go @@ -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) { diff --git a/x/authz/keeper/msg_server_test.go b/x/authz/keeper/msg_server_test.go index 92e92ad36e1b..d314c4d2ce08 100644 --- a/x/authz/keeper/msg_server_test.go +++ b/x/authz/keeper/msg_server_test.go @@ -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}) }, From 01f132adb3a8d4672827c19bd1e5c7c803f956d7 Mon Sep 17 00:00:00 2001 From: atheesh Date: Fri, 7 Jul 2023 12:07:42 +0530 Subject: [PATCH 2/3] update change log --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e316cd793ca6..d34708fe26e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 imporivised while using the `Exec` command in `x/authz`. ### Bug Fixes From 76a6085e557dbf439c72ca20f886256d2447b245 Mon Sep 17 00:00:00 2001 From: atheeshp <59333759+atheeshp@users.noreply.github.com> Date: Fri, 7 Jul 2023 13:53:35 +0530 Subject: [PATCH 3/3] Update CHANGELOG.md Co-authored-by: Likhita Polavarapu <78951027+likhita-809@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d34708fe26e4..ae45ff3eb830 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,7 +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 imporivised while using the `Exec` command in `x/authz`. +* (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