Page MenuHomePhabricator

[ecash-lib] Add ALP support
ClosedPublic

Authored by tobias_ruck on Wed, Apr 24, 20:57.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Commits
rABC693391e3e5b0: [ecash-lib] Add ALP support
Summary

Add functions for building GENESIS, MINT, SEND, BURN section pushdata, and to build eMPP OP_RETURN Scripts.

It doesn't include any wallet functionality, this is for users of this library to implement (or for a built-in wallet in a future diff).

GenesisInfo is based on the GenesisInfo of chronik-client.

Test Plan

npm run integration-tests

Diff Detail

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

Event Timeline

Failed tests logs:

====== TxBuilder: TxBuilder P2PKH ALP.TxBuilder TxBuilder P2PKH ALP ======
AssertionError: expected { …(4) } to deeply equal { …(4) }
    at Context.<anonymous> (tests/alp.test.ts:258:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

      + expected - actual

           "tokenName": "ALP Token Name"
           "tokenTicker": "ALP TOKEN"
           "url": "https://example.com"
         }
      -  "timeFirstSeen": 1300000000
      +  "timeFirstSeen": "1300000000"
         "tokenId": "c20f732e89be492dfa5f19c3f476fa4dc70ae8d57b1fea7e1c70ca24226e24b1"
         "tokenType": {
           "number": 0
           "protocol": "ALP"

Each failure log is accessible here:
TxBuilder: TxBuilder P2PKH ALP.TxBuilder TxBuilder P2PKH ALP

fix test (used a old chronik-client build)

is there a standard source spec for ALP yet? would be nice to have it in the monorepo under doc/standard -- is the notion site an ok permalink?

I think it would be cool to have it in doc/standards—but yeah the link is a permalink, "owned" by ABC (by Koush), through Notion, so it's fine for the forseeable future. When the doc is moved to the monorepo, we should update all the links in the source, which are easy enough to find.

modules/ecash-lib/tests/alp.test.ts
87 ↗(On Diff #47408)

do we need to repeat all of the testRunner setup code in each test?

e.g. see chronik-client where re-used logic is abstracted into test/setup/testRunner.ts

Is setup expected to differ enough between tests in ecash-lib to skip this abstraction?

modules/ecash-lib/tests/alp.test.ts
87 ↗(On Diff #47408)

I can abstract it out, no problem, should it be in this, a preceeding or a subsequent diff?

bytesofman added inline comments.
modules/ecash-lib/tests/alp.test.ts
87 ↗(On Diff #47408)

your call but it is probably easiest to do it either here or immediately after.

This revision is now accepted and ready to land.Thu, Apr 25, 02:31
This revision was automatically updated to reflect the committed changes.