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

✨ Added getTransaction function #64

Merged
merged 21 commits into from
Apr 13, 2022
Merged

✨ Added getTransaction function #64

merged 21 commits into from
Apr 13, 2022

Conversation

arimgibson
Copy link
Contributor

Closes #16.

  • Added getTransaction function
  • Added getTransaction inline documentation

To-do before merging (will unmark as draft when ready)

  • Add docs to readme
  • Add testing

@vercel
Copy link

vercel bot commented Apr 5, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/earnifi/essential-eth/5TDFU6qayywWsTQJXQoKg9dVDYkP
✅ Preview: https://essential-eth-git-feature-gettransaction-earnifi.vercel.app

@dawsbot dawsbot changed the title :sparkles2: Added getTransaction function ✨ Added getTransaction function Apr 6, 2022
/**
* Returns information about a specified transaction
* Includes additional information than what is included in the Transaction type
* Similar to `ethers.provider.getTransaction`, some information not included
Copy link
Owner

Choose a reason for hiding this comment

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

I noticed in the diff that data was in the ethers response, but not essential-eth. Do you know how they go that in the response body? Was that two RPC requests that ethers made in-order to give that data back?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's just a single request, but they do some processing after the transaction returns.

https://github.com/ethers-io/ethers.js/blob/ef1b28e958b50cea7ff44da43b3c5ff054e4b483/packages/providers/src.ts/formatter.ts#L318

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I looked into this a little bit more; ethers returns as data while essential-eth returns as input. Both have the same value. Should I alter so that they both call it data?

@arimgibson
Copy link
Contributor Author

Commit 9af489a fails testing locally as well. The testing is currently setup for the Transaction v to be a hex string; ethers currently turns into into a Number. Just wanted to commit what I had, and I'll let @dawsbot decide whether it should be a string or number

@dawsbot dawsbot marked this pull request as ready for review April 13, 2022 22:10
@dawsbot dawsbot merged commit 768625a into master Apr 13, 2022
@dawsbot dawsbot deleted the feature/getTransaction branch April 13, 2022 22:11
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.

Add provider.getTransaction function
2 participants