Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(x/authz): non utf-8 characters in logs #19923

4 changes: 4 additions & 0 deletions x/authz/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Consensus Breaking Changes

* [#19188](https://github.com/cosmos/cosmos-sdk/pull/19188) Remove creation of `BaseAccount` when sending a message to an account that does not exist.

### Bug Fixes

* [#19874](https://github.com/cosmos/cosmos-sdk/pull/19923) Now when querying transaction events (cosmos.tx.v1beta1.Service/GetTxsEvent) the response will contains only UTF-8 characters
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clarify the bug fix entry to specify the method or functionality that was modified.

- * [#19874](https://github.com/cosmos/cosmos-sdk/pull/19923) Now when querying transaction events (cosmos.tx.v1beta1.Service/GetTxsEvent) the response will contains only UTF-8 characters
+ * [#19874](https://github.com/cosmos/cosmos-sdk/pull/19923) Fixed an issue in the `DeleteGrant` function where non-UTF-8 characters in logs could cause parsing errors when querying transaction events (cosmos.tx.v1beta1.Service/GetTxsEvent). Now, the response contains only UTF-8 characters.

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
* [#19874](https://github.com/cosmos/cosmos-sdk/pull/19923) Now when querying transaction events (cosmos.tx.v1beta1.Service/GetTxsEvent) the response will contains only UTF-8 characters
* [#19874](https://github.com/cosmos/cosmos-sdk/pull/19923) Fixed an issue in the `DeleteGrant` function where non-UTF-8 characters in logs could cause parsing errors when querying transaction events (cosmos.tx.v1beta1.Service/GetTxsEvent). Now, the response contains only UTF-8 characters.

3 changes: 2 additions & 1 deletion x/authz/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ func (k Keeper) DeleteGrant(ctx context.Context, grantee, granter sdk.AccAddress
skey := grantStoreKey(grantee, granter, msgType)
grant, found := k.getGrant(ctx, skey)
if !found {
return errorsmod.Wrapf(authz.ErrNoAuthorizationFound, "failed to delete grant with key %s", string(skey))
return errorsmod.Wrapf(authz.ErrNoAuthorizationFound,
sontrinh16 marked this conversation as resolved.
Show resolved Hide resolved
"failed to delete grant with given granter: %s, grantee: %s & msgType: %s ", granter.String(), grantee.String(), msgType)
}

if grant.Expiration != nil {
Expand Down
Loading