Skip to content

Commit

Permalink
fix: return 404 on non-existing tx (backport cosmos#10992) (cosmos#11014
Browse files Browse the repository at this point in the history
)

* fix: return 404 on non-existing tx (cosmos#10992)

(cherry picked from commit 1581289)

# Conflicts:
#	CHANGELOG.md

* fix cl

Co-authored-by: Aleksandr Bezobchuk <[email protected]>
Co-authored-by: Aleksandr Bezobchuk <[email protected]>
  • Loading branch information
3 people authored and JeancarloBarrios committed Sep 28, 2024
1 parent 1cf6ee5 commit 429b7d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 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]

### Bug Fixes

* (grpc) [\#10985](https://github.com/cosmos/cosmos-sdk/pull/10992) The `/cosmos/tx/v1beta1/txs/{hash}` endpoint returns a 404 when a tx does not exist.

## [v0.45.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.0) - 2022-01-18

### State Machine Breaking
Expand Down
2 changes: 2 additions & 0 deletions x/auth/tx/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ func (s txServer) GetTx(ctx context.Context, req *txtypes.GetTxRequest) (*txtype
return nil, status.Error(codes.InvalidArgument, "tx hash cannot be empty")
}

// TODO We should also check the proof flag in gRPC header.
// https://github.com/cosmos/cosmos-sdk/issues/7036.
result, err := QueryTx(s.clientCtx, req.Hash)
if err != nil {
if strings.Contains(err.Error(), "not found") {
Expand Down

0 comments on commit 429b7d1

Please sign in to comment.