HomePhabricator

[ecash-coinselect] Simplify to match functionality of coinselect library

Description

[ecash-coinselect] Simplify to match functionality of coinselect library

Summary:
Remove chronik utxo mgmt from ecash-coinselect. Focus on functionality of original coinselect library to support transaction building for app developers. Implement accumulative utxo selection algorithm.

Summary of changes from coinselect

  • Use eCash dust threshold
  • Convert input utxos value key from string (given by chronik) to number (used by TransactionBuilder)
  • Remove integer and infinity checks from coinselect (assume input utxos from chronik are not corrupted)
  • Replace var declarations with let
  • Ignore chronik slp utxos
  • Throw errors if inputs and outputs cannot be determined (vs behavior of coinselect, which returns {fee} instead of {inputs, outputs, fee} when this happens

Test Plan: npm test

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien, emack

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

Details

Provenance
bytesofmanAuthored on Sep 22 2023, 22:23
bytesofmanPushed on Sep 27 2023, 12:58
Reviewer
Restricted Project
Differential Revision
D14526: [ecash-coinselect] Simplify to match functionality of coinselect library
Parents
rABCd3cab7ae6e46: [electrum] add a new type of contact for ecash aliases
Branches
Unknown
Tags
Unknown