Page MenuHomePhabricator

[ecash-opreturn] New npm library for parsing OP_RETURN in ecash app dev
ClosedPublic

Authored by bytesofman on Jun 5 2023, 17:56.

Details

Summary

These functions were developed for correctly parsing the latest alias spec. On completion, realized need basically the same thing to continue progress on ecash-herald. Should be a library.

Test Plan

npm test

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Wouldn't be more sensible to make a script parsing/decoding library (even if not feature complete for now), rather than specializing in OP_RETURN decoding ?
E.g. you probably need to differentiate between p2pkh and p2sh for the herald, that could be a good fit for a script library as well.

Wouldn't be more sensible to make a script parsing/decoding library (even if not feature complete for now), rather than specializing in OP_RETURN decoding ?
E.g. you probably need to differentiate between p2pkh and p2sh for the herald, that could be a good fit for a script library as well.

Yup good point

Generalize library with 1.0.0 having only OP_RETURN parsing methods available

Fabien requested changes to this revision.Jun 6 2023, 07:10
Fabien added inline comments.
modules/ecash-script/.eslintrc.js
28 ↗(On Diff #40615)

No blocker for now, but could this be imported from some common location, maybe using a regex ? There are 2 issues with this:

  1. We have to maintain it at several places
  2. It will stop working on 2024, as some files will have year 2023, some 2024 and some 2023-2024.
modules/ecash-script/README.md
7 ↗(On Diff #40615)
modules/ecash-script/constants/op_return.js
6 ↗(On Diff #40615)

That's wrong, consume doesn't care about the opcodes

This revision now requires changes to proceed.Jun 6 2023, 07:10
bytesofman marked 3 inline comments as done.

Responding to feedback

This revision is now accepted and ready to land.Jun 6 2023, 14:23