Page MenuHomePhabricator

Add support for AND, OR and XOR opcodes

Authored by deadalnix on Mar 18 2018, 01:13.



These opcodes are gated by a flag and compute what you'd expect for
binary ops. Added cases to the json test cases. In addition, added a
new unit tests that check if the opcodes behave in the expected way
in a large variety of situations.

Co-authored-by: Joshua Yabut <>
Co-authored-by: Marcos Mayorga <>
Co-authored-by: Daniel Connolly <>
Co-authored-by: Shammah Chancellor <>

Test Plan

make check

Diff Detail

rABC Bitcoin ABC
Lint Not Applicable
Tests Not Applicable

Event Timeline

jasonbcox requested changes to this revision.Mar 18 2018, 01:23
jasonbcox added a subscriber: jasonbcox.
jasonbcox added inline comments.
21 ↗(On Diff #3266)

Bitwize -> Bitwise. many instances of this throughout the file.

34 ↗(On Diff #3266)

ar -> are

67 ↗(On Diff #3266)

ar -> are

89 ↗(On Diff #3266)

Thank you for the more comprehensive tests!

This revision now requires changes to proceed.Mar 18 2018, 01:23
239 ↗(On Diff #3266)

TODO: Replace 520 by the constant giving the max element size here.

140 ↗(On Diff #3266)


schancel added a reviewer: deadalnix.

Fix spelling and use MAX_SCRIPT_ELEMENT_SIZE

858 ↗(On Diff #3267)

Anybody know if this is necessary to make these run?

// Uncomment if you want to output updated JSON tests.

This is a really screwy comment to leave for posterity :*(

schancel edited the test plan for this revision. (Show Details)
This revision is now accepted and ready to land.Mar 18 2018, 02:55
deadalnix edited reviewers, added: schancel; removed: deadalnix.
This revision was automatically updated to reflect the committed changes.