Page MenuHomePhabricator

[Cashtab] [Chronik] [Tx Gen] Generate Tx Input
ClosedPublic

Authored by emack on Jun 21 2022, 07:12.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Commits
rABC18c1f7988aa2: [Cashtab] [Chronik] [Tx Gen] Generate Tx Input
Summary

Supersedes D11639

Updates since D11639:

  • removed '--forceExit' test script flag from package.json
  • removed totalInputUtxoValue (formerly originalAmount) as an input param and instead instantiated as BigNumber 0 within the function and subsequently returned in the response object
  • updated unit tests to reflect variable name change to totalInputUtxoValue

As per T2503, this is part of a series of diffs to refactor the transaction generation process within useBCH.

This diff is a standalone utility function which collates enough utxos for the active wallet to cover the sats being sent in an XEC tx and adds each utxo as an input onto the transaction builder instance and inputUtxos array, including fee calculation.

Test Plan

npm test
observe successful execution of generateTxInput() unit tests

Diff Detail

Repository
rABC Bitcoin ABC
Branch
generateTxInput2
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 19425
Build 38583: Build Diffcashtab-tests
Build 38582: arc lint + arc unit

Event Timeline

emack requested review of this revision.Jun 21 2022, 07:12
bytesofman added inline comments.
web/cashtab/src/hooks/useBCH.js
1794

See updated comment in T2503, please move to cashMethods.js

This revision now requires changes to proceed.Jun 21 2022, 14:47
emack marked an inline comment as done.

Migrated function to cashMethods

This revision is now accepted and ready to land.Jun 22 2022, 18:29