Page MenuHomePhabricator

[Cashtab] Standardize implementation of token dust change outputs
ClosedPublic

Authored by bytesofman on Jul 5 2024, 20:35.

Details

Summary

Have a working implementation of NFT trading in Cashtab now with D16328

Requires a number of new and more complicated transactions. To properly support these transactions, some improvements are required in how transaction inputs and outputs are prepared.

This change improves code readability and ensures consistency with the handling of token dust change outputs, i.e. a targetOutput created by Cashtab as a token UTXO intended to be received by the same wallet that broadcasts the transaction.

Test Plan

npm test

Diff Detail

Repository
rABC Bitcoin ABC
Branch
better-target-outputs
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 29484
Build 58504: Build Diffcashtab-tests · ecash-lib-tests
Build 58503: arc lint + arc unit

Event Timeline

better comments, back out unrelated change

bytesofman published this revision for review.Jul 5 2024, 20:44
Fabien requested changes to this revision.Jul 6 2024, 08:48
Fabien added a subscriber: Fabien.
Fabien added inline comments.
cashtab/src/slpv1/index.js
602

This will work as-is but not guaranteed to work if dustSats is changed due to locale impacting the stringify ouptut.
Since there is a single key/value pair you it's simple enough that you can just test for that directly at almost no cost

This revision now requires changes to proceed.Jul 6 2024, 08:48
bytesofman marked an inline comment as done.

improve isTokenDustChangeOutput logic

This revision is now accepted and ready to land.Jul 6 2024, 18:09