Page MenuHomePhabricator

[ecashaddrjs] Use b58-ts in ecashaddrjs, add legacy address funcs
DraftPublic

Authored by tobias_ruck on Sat, Nov 30, 15:02.
This is a draft revision that has not yet been submitted for review.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Summary
  • Remove the bs58check dependency, use our own b58-ts module instead. Note: This breaks usage of toLegacy if initWasm of ecash-lib isn't called.
  • Add encodeLegacyAddr and decodeLegacyAddr, with support for BITCOIN (i.e. BTC, BCH, XEC, ...) and DOGECOIN legacy addresses.
Test Plan

npm test

Event Timeline

Tail of the build log:

  npm audit fix

Run `npm audit` for details.

> ecash-lib@1.1.0 build
> tsc && tsc -p ./tsconfig.build.json && cp -r ./src/ffi ./dist

Installing ecash-agora dependencies...
/work/modules/ecash-agora /work/modules/ecash-lib /work/modules/ecash-lib-wasm /work/modules/ecash-script /work/modules/chronik-client /work/modules/mock-chronik-client /work/modules/ecashaddrjs /work/abc-ci-builds/cashtab-tests

added 364 packages, and audited 367 packages in 2s

60 packages are looking for funding
  run `npm fund` for details

2 vulnerabilities (1 moderate, 1 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

> ecash-agora@0.2.0 build
> tsc && tsc -p ./tsconfig.build.json

/work/cashtab /work/modules/ecash-agora /work/modules/ecash-lib /work/modules/ecash-lib-wasm /work/modules/ecash-script /work/modules/chronik-client /work/modules/mock-chronik-client /work/modules/ecashaddrjs /work/abc-ci-builds/cashtab-tests
npm warn deprecated @humanwhocodes/config-array@0.11.14: Use @eslint/config-array instead
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm warn deprecated eslint@8.56.0: This version is no longer supported. Please see https://eslint.org/version-support for other options.

added 1487 packages, and audited 3333 packages in 25s

323 packages are looking for funding
  run `npm fund` for details

4 vulnerabilities (2 moderate, 2 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

> cashtab@3.1.1 build
> node scripts/build.js

Creating an optimized production build...
Failed to compile.

Module parse failed: Unexpected token (5:5)
File was processed with these loaders:
 * ./node_modules/source-map-loader/dist/cjs.js
You may need an additional loader to handle the result of these loaders.
| // file COPYING or http://www.opensource.org/licenses/mit-license.php.
| 
> type HashFn = (data: Uint8Array) => Uint8Array;
| let hashes: { sha256d: undefined | HashFn } = { sha256d: undefined };
|


Build cashtab-tests failed with exit code 1

add diff code, remove extaneous dep

Tail of the build log:

  npm audit fix

Run `npm audit` for details.

> ecash-lib@1.1.0 build
> tsc && tsc -p ./tsconfig.build.json && cp -r ./src/ffi ./dist

Installing ecash-agora dependencies...
/work/modules/ecash-agora /work/modules/ecash-lib /work/modules/ecash-lib-wasm /work/modules/ecash-script /work/modules/chronik-client /work/modules/mock-chronik-client /work/modules/ecashaddrjs /work/abc-ci-builds/cashtab-tests

added 364 packages, and audited 367 packages in 2s

60 packages are looking for funding
  run `npm fund` for details

2 vulnerabilities (1 moderate, 1 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

> ecash-agora@0.2.0 build
> tsc && tsc -p ./tsconfig.build.json

/work/cashtab /work/modules/ecash-agora /work/modules/ecash-lib /work/modules/ecash-lib-wasm /work/modules/ecash-script /work/modules/chronik-client /work/modules/mock-chronik-client /work/modules/ecashaddrjs /work/abc-ci-builds/cashtab-tests
npm warn deprecated @humanwhocodes/config-array@0.11.14: Use @eslint/config-array instead
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm warn deprecated eslint@8.56.0: This version is no longer supported. Please see https://eslint.org/version-support for other options.

added 1487 packages, and audited 3333 packages in 25s

323 packages are looking for funding
  run `npm fund` for details

4 vulnerabilities (2 moderate, 2 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

> cashtab@3.1.1 build
> node scripts/build.js

Creating an optimized production build...
Failed to compile.

Module parse failed: Unexpected token (5:5)
File was processed with these loaders:
 * ./node_modules/source-map-loader/dist/cjs.js
You may need an additional loader to handle the result of these loaders.
| // file COPYING or http://www.opensource.org/licenses/mit-license.php.
| 
> type HashFn = (data: Uint8Array) => Uint8Array;
| let hashes: { sha256d: undefined | HashFn } = { sha256d: undefined };
|


Build cashtab-tests failed with exit code 1