Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
hoanguyenkh committed Apr 25, 2024
1 parent 78386da commit 754bab8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions x/authz/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,15 +267,15 @@ func (k Keeper) DeleteAllGrants(ctx context.Context, granter sdk.AccAddress) err
if err != nil {
return err
}
if len(keysToDelete) == 0 {
return errorsmod.Wrapf(authz.ErrNoAuthorizationFound, "no grants found for granter %s", granter)
}
for _, key := range keysToDelete {
_, granteeAddr, msgType := parseGrantStoreKey([]byte(key))
if err := k.DeleteGrant(ctx, granteeAddr, granter, msgType); err != nil {
return err
}
}
if len(keysToDelete) == 0 {
return errorsmod.Wrapf(authz.ErrNoAuthorizationFound, "no grants found for granter %s", granter)
}
return k.EventService.EventManager(ctx).Emit(&authz.EventRevokeAll{
Granter: granter.String(),
})
Expand Down

0 comments on commit 754bab8

Please sign in to comment.