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 get transaction details from Electrum #20

Merged
merged 3 commits into from
Aug 17, 2020
Merged

Conversation

rkalis
Copy link
Contributor

@rkalis rkalis commented Aug 17, 2020

  • Add functions for getting a single transaction details or bulk

  • Add GET and POST routes for these functions

  • Add tests +mock data for these functions

  • Add test helper function for stubbing a method for unit tests

  • Add test helper function for asserting an API error

I didn't update the rest of the tests to use these helper functions cause I figured I'd wait for feedback, but imo it makes the code much DRYer.

closes #5

- Add functions for getting a single transaction details or bulk
- Add GET and POST routes for these functions
- Add tests +mock data for these functions

- Add test helper function for stubbing a method for unit tests
- Add test helper function for asserting an API error
// console.log(`_transactionDetailsFromElectrum(): ${JSON.stringify(electrumResponse, null, 2)}`)

// Pass the error message if ElectrumX reports an error.
if (electrumResponse instanceof Error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I like the use of instanceof here!

@christroutner
Copy link
Contributor

Great work with this! I love the DRY wrappers. They are a great idea.

@christroutner christroutner merged commit 6b00f0f into master Aug 17, 2020
@christroutner christroutner deleted the 5-electrum-tx-data branch August 17, 2020 17:33
@christroutner
Copy link
Contributor

🎉 This PR is included in version 1.17.7 🎉

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add 'get raw transaction data' for Electrumx in bch-api
2 participants