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

gRPC GetTxByHash should return transaction metadata #8056

Closed
4 tasks
jkilpatr opened this issue Dec 1, 2020 · 2 comments
Closed
4 tasks

gRPC GetTxByHash should return transaction metadata #8056

jkilpatr opened this issue Dec 1, 2020 · 2 comments
Labels
C: gRPC Issues and PRs related to the gRPC service and HTTP gateway.

Comments

@jkilpatr
Copy link

jkilpatr commented Dec 1, 2020

Summary

The current implementation of GetTxByHash returns a TX object, which contains no metadata whatsoever about the tx's status on the chain. Is it in the chain? How much gas did it use? What height did it get in at?

All of these questions could be answered by the amino endpoint, currently none of them can be found in the gRPC response.

Problem Definition

Most users who are requesting a transaction by hash do not only want the full transaction but also wish to know it's status on the chain. This is why the same info in amino and on eth returns this info in addition to just the transaction data itself.

Proposal

The endpoint should return a new struct TxInfo (or whatever name best fits convention) that contains metadata about the transaction status and the Tx object itself as a field.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@amaury1093
Copy link
Contributor

amaury1093 commented Dec 1, 2020

We also noticed this, and quickly fixed it. It now returns a TxResponse too:

// GetTxResponse is the response type for the Service.GetTx method.
message GetTxResponse {
// tx is the queried transaction.
cosmos.tx.v1beta1.Tx tx = 1;
// tx_response is the queried TxResponses.
cosmos.base.abci.v1beta1.TxResponse tx_response = 2;
}

Does that work for you? (it's not in rc3/rc4 yet though, but will be in stargate)

@amaury1093 amaury1093 added the C: gRPC Issues and PRs related to the gRPC service and HTTP gateway. label Dec 1, 2020
@jkilpatr
Copy link
Author

jkilpatr commented Dec 2, 2020

yes this works just fine. I thought for sure I was searching on master but I must have had the rc4 tag up, thanks!

@jkilpatr jkilpatr closed this as completed Dec 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: gRPC Issues and PRs related to the gRPC service and HTTP gateway.
Projects
None yet
Development

No branches or pull requests

2 participants