-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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: return 404 on non-existing tx #10992
Conversation
@@ -135,6 +135,10 @@ func (s txServer) GetTx(ctx context.Context, req *txtypes.GetTxRequest) (*txtype | |||
// 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") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked and I don't think TM returns a typed error here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
want to open an issue in tendermint for this? or you may have already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If yes, let's link that issue in an inline comment here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a test?
@@ -135,6 +135,10 @@ func (s txServer) GetTx(ctx context.Context, req *txtypes.GetTxRequest) (*txtype | |||
// 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") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If yes, let's link that issue in an inline comment here
We already have tests testing this case...sort-of. I just updated them to check for the correct error messages. |
(cherry picked from commit 1581289) # Conflicts: # CHANGELOG.md
(cherry picked from commit 1581289) # Conflicts: # CHANGELOG.md
) * fix: return 404 on non-existing tx (cosmos#10992) (cherry picked from commit 1581289) # Conflicts: # CHANGELOG.md * fix cl Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: Aleksandr Bezobchuk <aleks.bezobchuk@gmail.com>
) * fix: return 404 on non-existing tx (cosmos#10992) (cherry picked from commit 1581289) # Conflicts: # CHANGELOG.md * fix cl Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: Aleksandr Bezobchuk <aleks.bezobchuk@gmail.com>
) * fix: return 404 on non-existing tx (cosmos#10992) (cherry picked from commit 1581289) # Conflicts: # CHANGELOG.md * fix cl Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: Aleksandr Bezobchuk <aleks.bezobchuk@gmail.com>
) * fix: return 404 on non-existing tx (cosmos#10992) (cherry picked from commit 1581289) * fix cl Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: Aleksandr Bezobchuk <aleks.bezobchuk@gmail.com>
) * fix: return 404 on non-existing tx (cosmos#10992) (cherry picked from commit 1581289) # Conflicts: # CHANGELOG.md * fix cl Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: Aleksandr Bezobchuk <aleks.bezobchuk@gmail.com>
) * fix: return 404 on non-existing tx (cosmos#10992) (cherry picked from commit 1581289) # Conflicts: # CHANGELOG.md * fix cl Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: Aleksandr Bezobchuk <aleks.bezobchuk@gmail.com>
) * fix: return 404 on non-existing tx (cosmos#10992) (cherry picked from commit 1581289) # Conflicts: # CHANGELOG.md * fix cl Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: Aleksandr Bezobchuk <aleks.bezobchuk@gmail.com>
Description
Closes: #10985
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change