HomePhabricator

[Cashtab] [BCH deprecation] [TxBuilder] Pt 1/8 - Localize Transaction Building…

Description

[Cashtab] [BCH deprecation] [TxBuilder] Pt 1/8 - Localize Transaction Building module

Summary:
T2730

This diff creates a local transaction builder module to localize the bch-js portion of the transaction building process.

Temporary comparison checks have been added to sendXec which verifies that the txBuilder object matches after each stage of adding input, output and signing/building tx.

Relies on bitcoincashjs-lib for the eventual transaction building, and bip66 and bc-bip68 as per bch-js.

Pt 1/8 - Localize Transaction Builder module
Pt 2/8 - Deprecate BCH.TransactionBuilder in sendXec
Pt 3/8 - Add local TxBuilder to createToken
Pt 4/8 - Deprecate BCH.TransactionBuilder in createToken
Pt 5/8 - Add local TxBuilder to sendToken
Pt 6/8 - Deprecate BCH.TransactionBuilder in sendToken
Pt 7/8 - Add local TxBuilder to burnToken
Pt 8/8 - Deprecate BCH.TransactionBuilder in burnToken

Test Plan:

  • npm ci
  • npm test and ensure no errors with txBuilder.test.js
  • npm start
  • send a one to one XEC tx and ensure the post-generateTxInput() output matches, post-generateTxOutput() output matches & post-signAndBuildTx() output matches console log messages are displayed
  • send a one to one XEC tx with an unencrypted message and ensure the same 3 console logs from above are displayed
  • send a one to one XEC tx with an encrypted message and ensure the same 3 console logs are displayed, and the message is decrypted on the receiver side
  • send a one to many XEC tx and ensure the same 3 console logs are displayed
  • send a one to many XEC tx with an unencrypted message and ensure the same 3 console logs are displayed
  • send an airdrop one to many XEC tx and ensure the same 3 console logs are displayed
  • send an airdrop one to many XEC tx with an unencrypted message and ensure the same 3 console logs are displayed
  • do a sanity check on the above transactions via the explorer (fee, inputs, outputs)

Reviewers: bytesofman, #bitcoin_abc

Reviewed By: bytesofman, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D12541

Details

Provenance
emackAuthored on Nov 20 2022, 04:54
emackPushed on Nov 25 2022, 11:23
Reviewer
Restricted Project
Differential Revision
D12541: [Cashtab] [BCH deprecation] [TxBuilder] Pt 1/8 - Localize Transaction Building module
Parents
rABC921fe3f989c5: Mempool Update Cut-Through Optimization
Branches
Unknown
Tags
Unknown