Page MenuHomePhabricator

[Cashtab] Special handling for tx inputs that are required and do not require wallet signature
ClosedPublic

Authored by bytesofman on Jul 12 2024, 21:18.

Details

Summary

Another special case uncovered in developing NFT trading.

Some txs may have requiredInputs. Some special cases of these txs may have requiredInputs that do not need a "normal" p2pkh signature from the wallet.

It is impractical to store all Cashtab utxos as "pre-signed" (well...we could do this? Seems like a bad idea. No guarantee the user is expected to always spend all his inputs).

So, we need some way of distinguishing between "inputs that need to be signed" (like required SLP inputs) and "inputs that are completely ready for ecash-lib tx builder" (for now, only found in ecash-agora).

Note that we do not yet test the case of a requiredInput that is pre-signed in the sendXec function because we do not yet have the ecash-agora dependency or any ecash-agora txs in Cashtab. However, we do test that this change does not break any existing tx building, and that the new function meets expected behavior.

Test Plan

npm test

Diff Detail

Repository
rABC Bitcoin ABC
Branch
handle-signed-inputs
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 29548
Build 58631: Build Diffcashtab-tests · ecash-lib-tests
Build 58630: arc lint + arc unit

Event Timeline

bytesofman added inline comments.
cashtab/src/transactions/index.js
95 ↗(On Diff #48617)

comment change should have gone in the diff that changed tokenInput to requiredInput, but this is also related to this change and not the kind of thing that is worth its own diff

This revision is now accepted and ready to land.Jul 13 2024, 07:15