Skip to content

Add ElectrumX merkle branch method - #291

Open
JeremyZeng77 wants to merge 1 commit into
Permissionless-Software-Foundation:masterfrom
JeremyZeng77:codex/bch-js-merkle-branch
Open

Add ElectrumX merkle branch method#291
JeremyZeng77 wants to merge 1 commit into
Permissionless-Software-Foundation:masterfrom
JeremyZeng77:codex/bch-js-merkle-branch

Conversation

@JeremyZeng77

Copy link
Copy Markdown

Issue

Fixes #7.

Depends on Permissionless-Software-Foundation/bch-api#236 for the REST endpoint added by Permissionless-Software-Foundation/bch-api#9.

Summary

  • adds Electrumx.merkleBranch(txid, height) for single transaction GET requests
  • supports bulk merkle branch requests via an array of txid/height objects
  • adds api-doc examples for single and bulk usage
  • adds unit mocks, unit tests, and integration coverage

Verification

  • git diff --check
  • node --check src/electrumx.js
  • node --check test/unit/electrumx.js
  • node --check test/integration/electrumx.js
  • node .\node_modules\standard\bin\cmd.cjs --env mocha src\electrumx.js test\unit\electrumx.js test\unit\fixtures\electrumx-mock.js test\integration\electrumx.js
  • RESTURL=http://localhost:5942/v6 node .\node_modules\mocha\bin\mocha.js --timeout 30000 --grep "#merkleBranch" test\unit\electrumx.js: 3 passing
  • RESTURL=http://localhost:5942/v6 node .\node_modules\mocha\bin\mocha.js --timeout 30000 test\unit\electrumx.js: 30 passing

Payout

PayPal: https://paypal.me/Jeremytsangchina
Backup USDT TRC20: TWupTAoFjxR2VmqUUvzhfmUwXVZR6Kvz1Y

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 Electrumx Get Merkle Branch to bch-js

1 participant