Page MenuHomePhabricator

[ecash-lib, cashtab] Expand parsing functions of ecash-lib
AbandonedPublic

Authored by bytesofman on Sep 24 2025, 03:32.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Summary

Right now, we have cashtab-specific parsing of OP_RETURN in cashtab.

Desired end state is generic parsing of OP_RETURN for all spec'd OP_RETURN use on the eCash network, also with a standard way of handling unknown spec or off-spec usage.

Cashtab has the most mature parsing, so we use it as a starting point.

Add OP_RETURN and EMPP parsing to ecash-lib. Suggest an interface for ParsedOpReturn, a general type for parsing a string OP_RETURN as returned in a chronik Tx

We intentionally do not bump the version of ecash-lib, as this is still WIP. Will hold off until we have a portable and useful full parseOpReturn function.

Test Plan

npm test, CI

Diff Detail

Event Timeline

lint, clean up tests, better organization, remove tests from cashtab for fns tested in ecash-lib

bytesofman edited the summary of this revision. (Show Details)

OK, I checked that the getEmppAppAction, getEmppAppActions & getXecxAppAction related changes are move-only (with some blank line changes and some const renaming, eg opReturn.appPrefixesHex.xecx -> EMPP_APP_PREFIXES.XECX).
The API of the new stuff (ParsedOpReturn, parseOpReturn) makes senses to me.

This revision is now accepted and ready to land.Sep 26 2025, 06:28

dropped the ball on this. now i have some more actions to add if I keep it this way. But, imo, the API needs some more thought....will revisit this after getting ecash-wallet into Cashtab