Skip to content

Add OP_REVERSEBYTES support to bitcore-lib-cash - #2831

Merged
matiu merged 2 commits into
bitpay:masterfrom
rkalis:feature/update-opcodes
May 21, 2020
Merged

matiu merged 2 commits into
bitpay:masterfrom
rkalis:feature/update-opcodes

Conversation

@rkalis

@rkalis rkalis commented May 21, 2020 •

Copy link
Copy Markdown
Contributor

Fixes #2829

  • Add OP_REVERSEBYTES to opcodes.js.
  • Add tests for Opcode::toString for all opcodes (including OP_REVERSEBYTES).
  • Switch order of OP_NOP2/3 and OP_CHECKSEQUENCE/LOCKTIMEVERIFY.
    • This is arguably a breaking change, but it's expected behaviour that the reverse map of Opcode 177 returns the string OP_CHECKLOCKTIMEVERIFY rather than OP_NOP2.
  • Add OP_REVERSEBYTES to interpreter.js (based on Bitcoin-ABC's implementation).
    • My editor also auto-trimmed trailing whitespace, but I assume that is not a problem.
  • Update script_tests.json based on Bitcoin-ABC's version.

Note: there are quite a few other updates to the script_tests.json file in Bitcoin-ABC. I left these out as this PR i sonly focused on OP_REVERSEBYTES, but it could be a good idea to revisit those changes to make sure the interpreter has full parity.

rkalis added 2 commits May 21, 2020 10:14
- Add OP_REVERSEBYTES (188)
- Add `toString` tests for all opcodes
- Deprioritise OP_NOP{2|3} from opcodes reverseMap
- Implementation of OP_REVERSEBYTES based on Bitcoin-ABC's
- Update scripts_tests.json with REVERSEBYTES tests
@rkalis rkalis changed the title Feature/update opcodes Add OP_REVERSEBYTES support to bitcore-lib-cash May 21, 2020
@matiu

matiu commented May 21, 2020

Copy link
Copy Markdown
Contributor

Great work! Thanks for your contribution.

@matiu
matiu merged commit 7458159 into bitpay:master May 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for OP_REVERSEBYTES to bitcore-lib-cash

2 participants