Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OP_REVERSEBYTES support to bitcore-lib-cash #2831

Merged
merged 2 commits into from May 21, 2020
Merged

Add OP_REVERSEBYTES support to bitcore-lib-cash #2831

merged 2 commits into from May 21, 2020

Conversation

rkalis
Copy link
Contributor

@rkalis rkalis commented May 21, 2020

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.

- 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
Copy link
Contributor

matiu commented May 21, 2020

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