Page MenuHomePhabricator

[Cashtab] Do not give a change address to opreturn outputs
ClosedPublic

Authored by bytesofman on Dec 8 2023, 00:24.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABCe33666e462ce: [Cashtab] Do not give a change address to opreturn outputs
Summary

Add opreturn support to new sendxec function. Note: this function is still not implemented in the user-facing GUI of the app.

Test Plan

npm test

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

In the summary, you probably meant to say "still not used".

Does the position of the OP_RETURN in the outputs matter (is this going to be used for SLP txs)? I see in the new test that it is put in second position.

Add unit test with OP_RETURN at index 0 of outputs

Does the position of the OP_RETURN in the outputs matter (is this going to be used for SLP txs)? I see in the new test that it is put in second position.

The function takes targetOutputs as a param, so the order depends on how it is called by the user. In the unit test, the order is arbitrary. I've added another test with OP_RETURN at index 0.

The function will probably be used for SLP txs going forward. When this happens, it may require further modification and additional unit tests -- probably, though, there will just need to be some sort of helper function that correctly forms the targetOutputs param before calling this function.

sendXec will initially be implemented only in Send.js, i.e. only to send XEC txs from one-to-one or one-to-many, with or without a Cashtab msg OP_RETURN output.

This revision is now accepted and ready to land.Dec 8 2023, 13:44