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

Add transaction hash field (txHash) to each item in RPC's getEvents response #507

Merged
merged 5 commits into from
Apr 19, 2024

Conversation

Shaptic
Copy link
Contributor

@Shaptic Shaptic commented Apr 18, 2024

See stellar/js-stellar-sdk#938 and the actual proof here:

curl -s --location 'https://soroban-testnet.stellar.org/' \
  --header 'Content-Type: application/json' \
  --data '{
    "jsonrpc": "2.0",
    "id": 10235,
    "method": "getEvents", "params": {"startLedger": 1184000, "endLedger": 1185072, "filters": [{"topics": []}]}
}' | jq '.result.events[0]'

returns the following:

{
  "type": "diagnostic",
  "ledger": 1184016,
  "ledgerClosedAt": "2024-04-18T18:05:21Z",
  "contractId": "",
  "id": "0005085309997948928-0000000000",
  "pagingToken": "0005085309997948928-0000000000",
  "topic": [
    "AAAADwAAAAdmbl9jYWxsAA==",
    "AAAADQAAACBVkqNeeMWaJ6fGFVD0NhNxSTQdXVfI6TONZODy5H/xvg==",
    "AAAADwAAAAlzZXRfcHJpY2UAAAA="
  ],
  "value": "AAAAEAAAAAEAAAADAAAAEgAAAAAAAAAA858ZjeNabvXLtYtAqjhYbr6rR/MbcXLFLbxWY8fGUAgAAAAQAAAAAQAAABAAAAAKAAAAAAAAAABXRvHCbwj65AAAAAoAAAAAAAAAAAQ4yO9TO7OMAAAACgAAAAAAAAAAAABbAB765A8AAAAKAAAAAAAAAAAAAC1H3/aULQAAAAoAAAAAAAAAAAAwtqc4+tCOAAAACgAAAAAAAAAAAABa8z3hydQAAAAKAAAAAAAAAAAAACi/bpIDegAAAAoAAAAAAAAAAAAMPLqqRGApAAAACgAAAAAAAAAAAAJfPnxcwZMAAAAKAAAAAAAAAAAAADzKIUClLQAAAAoAAAAAAAAAAAAEy7aTOEj9AAAACgAAAAAAAAAAAABa9SV9s+sAAAAKAAAAAAAAAAAAAuc8SPdVrQAAAAoAAAAAAAAAAAAACd2C0+nNAAAACgAAAAAAAAAAAAKHGLRYXagAAAAKAAAAAAAAAAAAAGCj0K+BMAAAAAUAAAGO8mIc4A==",
  "inSuccessfulContractCall": true,
  "txHash": "95b874e9462e2b69fa5150e11025d3bb1bc54c4d86ba67ad8eb114ce41269478"
}

as you can see, there is an undocumented txHash field.

@Shaptic Shaptic requested review from ElliotFriend and a team April 18, 2024 19:46
@Shaptic Shaptic changed the title Add txHash field to getEvents response items: Add transaction hash field (txHash) to each item in RPC's getEvents response Apr 18, 2024
@stellar-jenkins
Copy link

@ElliotFriend
Copy link
Contributor

ElliotFriend commented Apr 18, 2024

@Shaptic Will you run yarn rpcspec:build to generate a new openrpc.json file in the PR?

Edit: I don't know much about git hooks, but if anybody knows how we can "force" any commits with changes to the /openrpc/src/* files to run that yarn command, that would be super awesome!

@Shaptic
Copy link
Contributor Author

Shaptic commented Apr 18, 2024

@ElliotFriend guess I fail at avoiding running yarn in the stellar-docs repo hehe 🙃 fixed!

@stellar-jenkins
Copy link

1 similar comment
@stellar-jenkins
Copy link

@Shaptic
Copy link
Contributor Author

Shaptic commented Apr 18, 2024

confirmed that it renders here 👍

@stellar-jenkins
Copy link

@ElliotFriend
Copy link
Contributor

@Shaptic I pushed a commit with updated examples. I also noticed the returned value field is no longer an object, but is a string now. So, I updated that as well while I was working in the vicinity (although there are other updates/changes to the spec that are likely needed anyway, see #467).

As soon as it builds/previews, I'll be happy to approve/merge. Thanks for the help keeping things updated!!

@stellar-jenkins
Copy link

Copy link
Contributor

@ElliotFriend ElliotFriend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great addition. thanks!

@ElliotFriend ElliotFriend merged commit 914792d into main Apr 19, 2024
2 checks passed
@ElliotFriend ElliotFriend deleted the addTxHash-getEvents branch April 19, 2024 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants