Skip to content

Add get transaction details from Electrum#20

Merged
christroutner merged 3 commits into
masterfrom
5-electrum-tx-data
Aug 17, 2020
Merged

Add get transaction details from Electrum#20
christroutner merged 3 commits into
masterfrom
5-electrum-tx-data

Conversation

@rkalis

@rkalis rkalis commented Aug 17, 2020

Copy link
Copy Markdown
Contributor
  • 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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