HomePhabricator

[Cashtab] [Chronik] [Tx Gen] Generate encoded OP_RETURN script

Description

[Cashtab] [Chronik] [Tx Gen] Generate encoded OP_RETURN script

Summary:
As per T2503, this is part of a series of diffs to refactor the transaction generation process within useBCH.

This diff is a standalone utility function which generates an encoded OP_RETURN script to reflect the various OP_RETURN powered send XEC permutations involving messaging, encryption, eToken IDs and airdrops.

The existing OP_RETURN script generation logic in sendXec() has a bit of repetition based on the permutations, which this diff seeks to optimize by using a building block approach to the script array rather than rebuilding the entire script for each permutation.

This diff does not change any existing functionality within the codebase.

Test Plan:
npm start
npm test
observe the successful execution of new useBCH.test.js unit tests

Reviewers: bytesofman, #bitcoin_abc

Reviewed By: bytesofman, #bitcoin_abc

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

Details

Provenance
emackAuthored on Jun 14 2022, 12:07
emackPushed on Jul 13 2022, 13:29
Reviewer
Restricted Project
Differential Revision
D11626: [Cashtab] [Chronik] [Tx Gen] Generate encoded OP_RETURN script
Parents
rABC857269848c1e: [Cashtab] [Chronik] [Tx Gen] Get change address from input UTXOs
Branches
Unknown
Tags
Unknown