-
Notifications
You must be signed in to change notification settings - Fork 25
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
Augment getTransaction response to include events emitted during the transaction #16
Comments
We'd like to keep this within @tyvdh can you give us some context on how people are typically attempting to use this? |
I would advocate for this. We can even make it a single call if we keep an in-memory index of txHash -> Ledger+tx (which shouldn't be too hard) Then we can simply add |
It would be easier to include the events in the |
I'm actually not sure how painful of an issue this is. With recent improvements to the JS SDK I've been using:
And that works fine. There are other things the getEvents and getTransaction endpoints need but at least for me and the Discord conversations I'm seeing this isn't a pain point. |
I will say it would be nice to be able to call getEvents with a transaction hash to get that transactions events but I'm guessing the indexing overhead wouldn't be worth it |
@tamirms Could the getEvents endpoint when a tx id is passed be backed by the getTransaction? |
@leighmcculloch you are right, we could allow the getEvents endpoint to be called with a tx id. The implementation should be pretty simple as we can lookup the transaction by hash using the in-memory transaction store that backs the getTransaction endpoint. Once we have the transaction, we can decode the events from the tx meta in the transaction |
Posting this questions from my limited understanding :)
|
I think that this issue got side tracked a bit with Events are important in the context of the From an implementation perspective do we really need to use the events backend? Why not decode events from metas on the fly when handling these requests? |
Yep, we can do this. |
What problem does your feature solve?
There is no easy way to get events for a transaction. If you have a failed transaction in particular, it would be nice to be able to debug why the tx failed by viewing the diagnostic events that were emitted during the transaction.
What would you like to see?
Include events in the
getTransaction
response so we can see what events where emitted during the transaction.What alternatives are there?
Manually decoding the tx meta xdr in the
getTransaction
response and then extract the events from the tx meta.You could also find events for a tx using two rpc calls:
getTransaction
to get the ledger and tx index for the transaction in question.getEvents
with the cursor set appropriately so that includes the ledger and tx indexThe text was updated successfully, but these errors were encountered: