Page MenuHomePhabricator

[Cashtab] Update sendXec() to broadcast transactions via Chronik
AbandonedPublic

Authored by emack on Apr 29 2022, 12:13.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Summary

Integrated chronik's broadcastTx post method into the sendXec()'s tx broadcasting logic. The transaction builder portion is still using bch-js for now until I review Sam Rock's XEC fork of bch-js that natively supports ecash addresses.

Lessons learnt include:

  • it's not necessary to spin up a https dev instance of cashtab to access chronik post methods, as the network errors encountered to date were just a server side COR policy config, which have now been resolved.
  • no need to convert bitcoincash addresses back into ecash to interact with chronik's broadcastTx method, although we will eventually refactor the useBCH hook to use a fork of bch-js that can take in ecash addresses directly via TransactionBuilder.

TODO: as per telegram, further discussion needed on mocking chronik calls for the following unit tests in useBCH.test.js:

  • sends XEC correctly
  • sends XEC correctly with an encrypted OP_RETURN message
  • sends one to many XEC correctly
  • receives errors from the network and parses it
Test Plan
  • npm start
  • verify successful onchain broadcast of the following:

send a 1-to-1 XEC transaction
send a 1-to-1 XEC transaction with an OP_RETURN msg
send a 1-to-1 encrypted XEC transaction
send a 1-to-many XEC transaction
send a 1-to-many XEC transaction with an OP_RETURN msg

  • verify no cross browser issues across chrome/brave/firefox
  • verify no chronik issues when executing the above in extension plugin mode
  • verify no chronik issues when executing the above on iOS/Android mobile

iOS/Android test build via https://1154.netlify.app

Diff Detail

Repository
rABC Bitcoin ABC
Branch
chronikSend
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 18911
Build 37603: Build Diffcashtab-tests
Build 37602: arc lint + arc unit

Event Timeline

emack requested review of this revision.Apr 29 2022, 12:13

Please abandon -- this has been superseded by other diffs. We can implement your upgraded sendXec functions after they are rebased on top of the chronik utxo handling

This revision now requires changes to proceed.Sep 20 2022, 18:21