[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
Reviewers: bytesofman, #bitcoin_abc
Reviewed By: bytesofman, #bitcoin_abc
Differential Revision: https://reviews.bitcoinabc.org/D11645