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

chore(auth): return accId in error (backport #17903) #17906

Merged
merged 2 commits into from
Sep 27, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
chore(auth): return accId in error (#17903)
(cherry picked from commit 6ac0abd)

# Conflicts:
#	x/auth/keeper/grpc_query.go
  • Loading branch information
tac0turtle authored and mergify[bot] committed Sep 27, 2023
commit 955d8dcdbadb5d4ccb6c3ab926a4a38ec5debdb1
6 changes: 6 additions & 0 deletions x/auth/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,16 @@ func (ak AccountKeeper) AccountAddressByID(c context.Context, req *types.QueryAc

accId := req.AccountId

<<<<<<< HEAD
ctx := sdk.UnwrapSDKContext(c)
address := ak.GetAccountAddressByID(ctx, accId)
if len(address) == 0 {
return nil, status.Errorf(codes.NotFound, "account address not found with account number %d", req.Id)
=======
address, err := s.k.Accounts.Indexes.Number.MatchExact(ctx, accID)
if err != nil {
return nil, status.Errorf(codes.NotFound, "account address not found with account number %d", accID)
>>>>>>> 6ac0abde3 (chore(auth): return accId in error (#17903))
}

return &types.QueryAccountAddressByIDResponse{AccountAddress: address}, nil
Expand Down