Page MenuHomePhabricator

[Cashtab] Add function to generate an OP_RETURN output for an airdrop tx

Authored by bytesofman on Fri, Nov 3, 20:20.



Per title.

Note: this function is not currently implemented in the app.

Test Plan

npm test

Diff Detail

rABC Bitcoin ABC
Lint Not Applicable
Tests Not Applicable

Event Timeline

15 ↗(On Diff #42947)

this could be done in a separate diff....done here as this is the first diff where adding this function means we don't have to repeat this comment describing specific library behavior of utxolib's op_return parsing, trivial change, and covered by existing unit tests

emack requested changes to this revision.Sat, Nov 4, 02:56
emack added a subscriber: emack.
emack added inline comments.
62 ↗(On Diff #42947)

Airdrop messages can include emojis and non-english characters as per current OP_RETURN messaging designs, so will need to include these in test vectors.

image.png (657×550 px, 64 KB)

68 ↗(On Diff #42947)

isValidTokenId() already checks for tokenId being a non-string so no need to revalidate it again here

82 ↗(On Diff #42947)

Should check for bunch of spaces which we don't want to take up script space. Current sendXec() logic ignores them for OP_RETURN generation.

This revision now requires changes to proceed.Sat, Nov 4, 02:56
bytesofman marked 3 inline comments as done.

Add unit test for non-standard utf8 characters, remove double validation check for tokenId as string, check for multiple blank spaces and add unit test for this case

This revision is now accepted and ready to land.Wed, Nov 8, 23:01