Page MenuHomePhabricator

[ecash-lib] Implement ecashaddrjs functions in ecash-lib
Needs ReviewPublic

Authored by bytesofman on Sun, Dec 1, 00:47.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

ecashaddrjs has limped and served well despite numerous legacy dependencies and an older structure. Aside from some maintenance headaches, this was acceptable and "good enough."

However, we would like to

  • Add more address lib features
  • Optionally support more address types
  • Reduce the use of third-party dependencies

In starting to reduce the use of third-party dependencies, it was discovered that basic hash methods available in ecash-lib after initWasm were needed to match existing ecashaddrjs functionality without third-party dependencies. It would not make sense to have ecashaddrjs work only if initWasm() were called in ecash-lib -- so we move the address functions to ecash-lib.

The way js deps work, users who need only the address functions from ecash-lib will end up only installing those in the published version of their app. Users who want legacy ecashaddrjs features without dealing with initWasm may use the legacy ecashaddrjs, though it will be deprecated.

What this diff does

  • Match the functionality of ecashaddrjs but with no third-party dependencies (well, one dev-dependency for generating random hashes...we could lose it but it is useful to show we pass the same tests as the old lib)
  • Replace ecashaddrjs with now-local functions in ecash-lib
  • Update ecash-lib dockerfile to account for change
  • Update CI to account for everything that uses ecash-lib now needing b58-ts

Breaking changes when migrating from ecashaddrjs to ecash-lib
When I first started adding functionality to ecashaddrjs, I was hesitant to introduce any breaking changes. This led to a bunch of baggage. In this version,

  • We only support lowercase address types i.e. p2pkh or p2sh, as this is what ChronikClient supports
  • We always return hash as a string. ecash-lib offers fromHex method to trivially convert this to a Uint8Array. But the string is also what ChronikClient expects and what most of my apps expect. Just picking one greatly enhances the effectiveness of typescript with these address methods.
  • We no longer validate against a small whitelist of accepted prefixes. We will encode any prefix.
  • We no longer decode prefixless addresses against a whitelist of accepted prefixes. We decode prefixless addresses against ecash prefix only.

Going forward, will replace ecashaddrjs with ecash-lib methods everywhere.

Test Plan

npm test

docker build -f ecash-lib.Dockerfile -t ecash-lib_local . builds

Diff Detail

Event Timeline

Tail of the build log:

   Compiling syn v2.0.89
   Compiling ecash-secp256k1-sys v0.10.0 (/work/modules/ecash-secp256k1/ecash-secp256k1-sys)
   Compiling crypto-common v0.1.6
   Compiling block-buffer v0.10.4
   Compiling digest v0.10.7
   Compiling ripemd v0.1.3
   Compiling sha2 v0.10.8
   Compiling wasm-bindgen-backend v0.2.92
   Compiling ecash-secp256k1 v0.30.0 (/work/modules/ecash-secp256k1)
   Compiling thiserror-impl v1.0.69
   Compiling wasm-bindgen-macro-support v0.2.92
   Compiling wasm-bindgen-macro v0.2.92
   Compiling ecash-lib-wasm v0.1.0 (/work/modules/ecash-lib-wasm)
    Finished release-wasm [optimized] target(s) in 5.15s
Test depends on chronik-client. Building TypeScript...
/work/modules/chronik-client /work/modules/ecash-lib-wasm /work/modules/ecashaddrjs /work/abc-ci-builds/ecash-agora-tests

> chronik-client@2.0.0 prepublish
> npm run build


> chronik-client@2.0.0 build
> tsc


added 265 packages, and audited 267 packages in 6s

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

3 vulnerabilities (1 moderate, 2 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.
Test depends on ecash-lib. Building TypeScript...
/work/modules/ecash-lib /work/modules/chronik-client /work/modules/ecash-lib-wasm /work/modules/ecashaddrjs /work/abc-ci-builds/ecash-agora-tests

added 363 packages, and audited 366 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-lib@1.1.0 build
> tsc && tsc -p ./tsconfig.build.json && cp -r ./src/ffi ./dist

src/cashaddr/cashaddr.ts(5,25): error TS2307: Cannot find module './io/hex' or its corresponding type declarations.
src/cashaddr/cashaddr.ts(143,34): error TS2339: Property 'and' does not exist on type 'Uint8Array'.
src/cashaddr/cashaddr.ts(144,29): error TS2339: Property 'shiftRight' does not exist on type 'Uint8Array'.
src/cashaddr/cashaddr.ts(181,30): error TS2304: Cannot find name 'polymod'.
src/cashaddr/cashaddr.ts(183,27): error TS2304: Cannot find name 'base32'.
Build ecash-agora-tests failed with exit code 2

Tail of the build log:

   Compiling digest v0.10.7
   Compiling ripemd v0.1.3
   Compiling sha2 v0.10.8
   Compiling wasm-bindgen-backend v0.2.92
   Compiling ecash-secp256k1 v0.30.0 (/work/modules/ecash-secp256k1)
   Compiling thiserror-impl v1.0.69
   Compiling wasm-bindgen-macro-support v0.2.92
   Compiling wasm-bindgen-macro v0.2.92
   Compiling ecash-lib-wasm v0.1.0 (/work/modules/ecash-lib-wasm)
    Finished release-wasm [optimized] target(s) in 8.13s
Test depends on chronik-client. Building TypeScript...
/work/modules/chronik-client /work/modules/ecash-lib-wasm /work/modules/ecashaddrjs /work/abc-ci-builds/ecash-lib-tests

> chronik-client@2.0.0 prepublish
> npm run build


> chronik-client@2.0.0 build
> tsc


added 265 packages, and audited 267 packages in 5s

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

3 vulnerabilities (1 moderate, 2 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.
Test does not depend on ecash-lib
Test does not depend on ecash-agora
Test does not depend on ecash-script, skipping ecash-script dependencies...
Test does not depend on ecash-coinselect, skipping ecash-coinselect dependencies...
/work/modules/ecash-lib /work/modules/chronik-client /work/modules/ecash-lib-wasm /work/modules/ecashaddrjs /work/abc-ci-builds/ecash-lib-tests

added 363 packages, and audited 366 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.
CI configured to test build. Building...

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

src/cashaddr/cashaddr.ts(5,25): error TS2307: Cannot find module './io/hex' or its corresponding type declarations.
src/cashaddr/cashaddr.ts(143,34): error TS2339: Property 'and' does not exist on type 'Uint8Array'.
src/cashaddr/cashaddr.ts(144,29): error TS2339: Property 'shiftRight' does not exist on type 'Uint8Array'.
src/cashaddr/cashaddr.ts(181,30): error TS2304: Cannot find name 'polymod'.
src/cashaddr/cashaddr.ts(183,27): error TS2304: Cannot find name 'base32'.
Build ecash-lib-tests failed with exit code 2

Tail of the build log:

  Downloaded ripemd v0.1.3
  Downloaded generic-array v0.14.7
  Downloaded digest v0.10.7
  Downloaded crypto-common v0.1.6
  Downloaded cpufeatures v0.2.15
  Downloaded cc v1.2.1
  Downloaded block-buffer v0.10.4
   Compiling proc-macro2 v1.0.92
   Compiling unicode-ident v1.0.14
   Compiling typenum v1.17.0
   Compiling version_check v0.9.5
   Compiling wasm-bindgen-shared v0.2.92
   Compiling shlex v1.3.0
   Compiling bumpalo v3.16.0
   Compiling log v0.4.22
   Compiling once_cell v1.20.2
   Compiling wasm-bindgen v0.2.92
   Compiling thiserror v1.0.69
   Compiling cfg-if v1.0.0
   Compiling abc-rust-lint v0.1.0 (/work/chronik/abc-rust-lint)
   Compiling cc v1.2.1
   Compiling generic-array v0.14.7
   Compiling quote v1.0.37
   Compiling syn v2.0.89
   Compiling ecash-secp256k1-sys v0.10.0 (/work/modules/ecash-secp256k1/ecash-secp256k1-sys)
   Compiling block-buffer v0.10.4
   Compiling crypto-common v0.1.6
   Compiling digest v0.10.7
   Compiling sha2 v0.10.8
   Compiling ripemd v0.1.3
   Compiling wasm-bindgen-backend v0.2.92
   Compiling ecash-secp256k1 v0.30.0 (/work/modules/ecash-secp256k1)
   Compiling thiserror-impl v1.0.69
   Compiling wasm-bindgen-macro-support v0.2.92
   Compiling wasm-bindgen-macro v0.2.92
   Compiling ecash-lib-wasm v0.1.0 (/work/modules/ecash-lib-wasm)
    Finished release-wasm [optimized] target(s) in 5.48s
/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 363 packages, and audited 366 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-lib@1.1.0 build
> tsc && tsc -p ./tsconfig.build.json && cp -r ./src/ffi ./dist

src/cashaddr/cashaddr.ts(5,25): error TS2307: Cannot find module './io/hex' or its corresponding type declarations.
src/cashaddr/cashaddr.ts(143,34): error TS2339: Property 'and' does not exist on type 'Uint8Array'.
src/cashaddr/cashaddr.ts(144,29): error TS2339: Property 'shiftRight' does not exist on type 'Uint8Array'.
src/cashaddr/cashaddr.ts(181,30): error TS2304: Cannot find name 'polymod'.
src/cashaddr/cashaddr.ts(183,27): error TS2304: Cannot find name 'base32'.
Build cashtab-tests failed with exit code 2

Tail of the build log:

   Compiling syn v2.0.89
   Compiling ecash-secp256k1-sys v0.10.0 (/work/modules/ecash-secp256k1/ecash-secp256k1-sys)
   Compiling crypto-common v0.1.6
   Compiling block-buffer v0.10.4
   Compiling digest v0.10.7
   Compiling sha2 v0.10.8
   Compiling ripemd v0.1.3
   Compiling wasm-bindgen-backend v0.2.92
   Compiling ecash-secp256k1 v0.30.0 (/work/modules/ecash-secp256k1)
   Compiling thiserror-impl v1.0.69
   Compiling wasm-bindgen-macro-support v0.2.92
   Compiling wasm-bindgen-macro v0.2.92
   Compiling ecash-lib-wasm v0.1.0 (/work/modules/ecash-lib-wasm)
    Finished release-wasm [optimized] target(s) in 4.68s
Test depends on chronik-client. Building TypeScript...
/work/modules/chronik-client /work/modules/ecash-lib-wasm /work/modules/ecashaddrjs /work/abc-ci-builds/ecash-agora-integration-tests

> chronik-client@2.0.0 prepublish
> npm run build


> chronik-client@2.0.0 build
> tsc


added 265 packages, and audited 267 packages in 6s

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

3 vulnerabilities (1 moderate, 2 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.
Test depends on ecash-lib. Building TypeScript...
/work/modules/ecash-lib /work/modules/chronik-client /work/modules/ecash-lib-wasm /work/modules/ecashaddrjs /work/abc-ci-builds/ecash-agora-integration-tests

added 363 packages, and audited 366 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-lib@1.1.0 build
> tsc && tsc -p ./tsconfig.build.json && cp -r ./src/ffi ./dist

src/cashaddr/cashaddr.ts(5,25): error TS2307: Cannot find module './io/hex' or its corresponding type declarations.
src/cashaddr/cashaddr.ts(143,34): error TS2339: Property 'and' does not exist on type 'Uint8Array'.
src/cashaddr/cashaddr.ts(144,29): error TS2339: Property 'shiftRight' does not exist on type 'Uint8Array'.
src/cashaddr/cashaddr.ts(181,30): error TS2304: Cannot find name 'polymod'.
src/cashaddr/cashaddr.ts(183,27): error TS2304: Cannot find name 'base32'.
Build ecash-agora-integration-tests failed with exit code 2

methods and tests thru toLegacy, which needs base58check

working, tests, yml with depends b58, changelog, minor version bump

update yml for integration tests, changelog point to this diff

Tail of the build log:

  npm audit fix

Run `npm audit` for details.

> ecash-lib@1.2.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 24s

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.2.0 build
> node scripts/build.js

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

Module parse failed: Unexpected token (30:34)
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.
| 
| /** Encode the input bytes as base58 string (modeled after base58.cpp) */
> export function encodeBase58(input: Uint8Array): string {
|     // Skip & count leading zeroes.
|     let numZeroes = 0;


Build cashtab-tests failed with exit code 1

Tail of the build log:

  npm audit fix

Run `npm audit` for details.

> ecash-lib@1.2.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.2.0 build
> node scripts/build.js

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

Module parse failed: Unexpected token (30:34)
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.
| 
| /** Encode the input bytes as base58 string (modeled after base58.cpp) */
> export function encodeBase58(input: Uint8Array): string {
|     // Skip & count leading zeroes.
|     let numZeroes = 0;


Build cashtab-tests failed with exit code 1

deprecate ecashaddrjs from ecash-lib

Tail of the build log:

  Downloaded bumpalo v3.16.0
  Downloaded typenum v1.17.0
  Downloaded thiserror-impl v1.0.69
  Downloaded thiserror v1.0.69
  Downloaded sha2 v0.10.8
  Downloaded ripemd v0.1.3
  Downloaded generic-array v0.14.7
  Downloaded digest v0.10.7
  Downloaded crypto-common v0.1.6
  Downloaded cpufeatures v0.2.15
   Compiling proc-macro2 v1.0.92
   Compiling unicode-ident v1.0.14
   Compiling typenum v1.17.0
   Compiling version_check v0.9.5
   Compiling wasm-bindgen-shared v0.2.92
   Compiling shlex v1.3.0
   Compiling once_cell v1.20.2
   Compiling bumpalo v3.16.0
   Compiling log v0.4.22
   Compiling thiserror v1.0.69
   Compiling cfg-if v1.0.0
   Compiling wasm-bindgen v0.2.92
   Compiling abc-rust-lint v0.1.0 (/work/chronik/abc-rust-lint)
   Compiling cc v1.2.1
   Compiling generic-array v0.14.7
   Compiling quote v1.0.37
   Compiling syn v2.0.89
   Compiling ecash-secp256k1-sys v0.10.0 (/work/modules/ecash-secp256k1/ecash-secp256k1-sys)
   Compiling block-buffer v0.10.4
   Compiling crypto-common v0.1.6
   Compiling digest v0.10.7
   Compiling sha2 v0.10.8
   Compiling ripemd v0.1.3
   Compiling wasm-bindgen-backend v0.2.92
   Compiling ecash-secp256k1 v0.30.0 (/work/modules/ecash-secp256k1)
   Compiling thiserror-impl v1.0.69
   Compiling wasm-bindgen-macro-support v0.2.92
   Compiling wasm-bindgen-macro v0.2.92
   Compiling ecash-lib-wasm v0.1.0 (/work/modules/ecash-lib-wasm)
    Finished release-wasm [optimized] target(s) in 6.01s
Test depends on chronik-client. Building TypeScript...
/work/modules/chronik-client /work/modules/ecash-lib-wasm /work/modules/b58-ts /work/abc-ci-builds/ecash-lib-tests

> chronik-client@2.0.0 prepublish
> npm run build


> chronik-client@2.0.0 build
> tsc

src/ChronikClient.ts(5,22): error TS2307: Cannot find module 'ecashaddrjs' or its corresponding type declarations.
test/integration/mempool_conflicts.ts(7,22): error TS2307: Cannot find module 'ecashaddrjs' or its corresponding type declarations.
test/integration/script_endpoints.ts(7,22): error TS2307: Cannot find module 'ecashaddrjs' or its corresponding type declarations.
test/integration/websocket.ts(7,22): error TS2307: Cannot find module 'ecashaddrjs' or its corresponding type declarations.
npm error code 2
npm error path /work/modules/chronik-client
npm error command failed
npm error command sh -c npm run build
npm error A complete log of this run can be found in: /root/.npm/_logs/2024-12-01T05_33_08_300Z-debug-0.log
Build ecash-lib-tests failed with exit code 2

Tail of the build log:

  npm audit fix

Run `npm audit` for details.

> ecash-lib@1.2.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 24s

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.2.0 build
> node scripts/build.js

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

Module parse failed: Unexpected token (30:34)
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.
| 
| /** Encode the input bytes as base58 string (modeled after base58.cpp) */
> export function encodeBase58(input: Uint8Array): string {
|     // Skip & count leading zeroes.
|     let numZeroes = 0;


Build cashtab-tests failed with exit code 1

update ecash-lib dockerfile, update deps in CI

Tail of the build log:

warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions
 Downloading crates ...
  Downloaded wasm-bindgen-macro v0.2.92
  Downloaded wasm-bindgen-macro-support v0.2.92
  Downloaded wasm-bindgen v0.2.92
  Downloaded bumpalo v3.16.0
  Downloaded wasm-bindgen-backend v0.2.92
   Compiling proc-macro2 v1.0.92
   Compiling unicode-ident v1.0.14
   Compiling version_check v0.9.5
   Compiling typenum v1.17.0
   Compiling wasm-bindgen-shared v0.2.92
   Compiling shlex v1.3.0
   Compiling log v0.4.22
   Compiling bumpalo v3.16.0
   Compiling once_cell v1.20.2
   Compiling cfg-if v1.0.0
   Compiling wasm-bindgen v0.2.92
   Compiling thiserror v1.0.69
   Compiling abc-rust-lint v0.1.0 (/work/chronik/abc-rust-lint)
   Compiling cc v1.2.1
   Compiling generic-array v0.14.7
   Compiling quote v1.0.37
   Compiling syn v2.0.89
   Compiling ecash-secp256k1-sys v0.10.0 (/work/modules/ecash-secp256k1/ecash-secp256k1-sys)
   Compiling block-buffer v0.10.4
   Compiling crypto-common v0.1.6
   Compiling digest v0.10.7
   Compiling ripemd v0.1.3
   Compiling sha2 v0.10.8
   Compiling wasm-bindgen-backend v0.2.92
   Compiling ecash-secp256k1 v0.30.0 (/work/modules/ecash-secp256k1)
   Compiling thiserror-impl v1.0.69
   Compiling wasm-bindgen-macro-support v0.2.92
   Compiling wasm-bindgen-macro v0.2.92
   Compiling ecash-lib-wasm v0.1.0 (/work/modules/ecash-lib-wasm)
    Finished release-wasm [optimized] target(s) in 4.37s
Test depends on chronik-client. Building TypeScript...
/work/modules/chronik-client /work/modules/ecash-lib-wasm /work/modules/b58-ts /work/abc-ci-builds/ecash-lib-integration-tests

> chronik-client@2.0.0 prepublish
> npm run build


> chronik-client@2.0.0 build
> tsc

src/ChronikClient.ts(5,22): error TS2307: Cannot find module 'ecashaddrjs' or its corresponding type declarations.
test/integration/mempool_conflicts.ts(7,22): error TS2307: Cannot find module 'ecashaddrjs' or its corresponding type declarations.
test/integration/script_endpoints.ts(7,22): error TS2307: Cannot find module 'ecashaddrjs' or its corresponding type declarations.
test/integration/websocket.ts(7,22): error TS2307: Cannot find module 'ecashaddrjs' or its corresponding type declarations.
npm error code 2
npm error path /work/modules/chronik-client
npm error command failed
npm error command sh -c npm run build
npm error A complete log of this run can be found in: /root/.npm/_logs/2024-12-01T05_35_51_254Z-debug-0.log
Build ecash-lib-integration-tests failed with exit code 2

Tail of the build log:

  Downloaded thiserror-impl v1.0.69
  Downloaded thiserror v1.0.69
  Downloaded syn v2.0.89
  Downloaded sha2 v0.10.8
  Downloaded ripemd v0.1.3
  Downloaded generic-array v0.14.7
  Downloaded digest v0.10.7
  Downloaded crypto-common v0.1.6
  Downloaded bumpalo v3.16.0
  Downloaded block-buffer v0.10.4
   Compiling proc-macro2 v1.0.92
   Compiling unicode-ident v1.0.14
   Compiling typenum v1.17.0
   Compiling version_check v0.9.5
   Compiling wasm-bindgen-shared v0.2.92
   Compiling shlex v1.3.0
   Compiling log v0.4.22
   Compiling once_cell v1.20.2
   Compiling bumpalo v3.16.0
   Compiling cfg-if v1.0.0
   Compiling wasm-bindgen v0.2.92
   Compiling thiserror v1.0.69
   Compiling abc-rust-lint v0.1.0 (/work/chronik/abc-rust-lint)
   Compiling cc v1.2.1
   Compiling generic-array v0.14.7
   Compiling quote v1.0.37
   Compiling syn v2.0.89
   Compiling ecash-secp256k1-sys v0.10.0 (/work/modules/ecash-secp256k1/ecash-secp256k1-sys)
   Compiling block-buffer v0.10.4
   Compiling crypto-common v0.1.6
   Compiling digest v0.10.7
   Compiling ripemd v0.1.3
   Compiling sha2 v0.10.8
   Compiling wasm-bindgen-backend v0.2.92
   Compiling ecash-secp256k1 v0.30.0 (/work/modules/ecash-secp256k1)
   Compiling thiserror-impl v1.0.69
   Compiling wasm-bindgen-macro-support v0.2.92
   Compiling wasm-bindgen-macro v0.2.92
   Compiling ecash-lib-wasm v0.1.0 (/work/modules/ecash-lib-wasm)
    Finished release-wasm [optimized] target(s) in 5.59s
Test depends on chronik-client. Building TypeScript...
/work/modules/chronik-client /work/modules/ecash-lib-wasm /work/modules/b58-ts /work/abc-ci-builds/ecash-lib-tests

> chronik-client@2.0.0 prepublish
> npm run build


> chronik-client@2.0.0 build
> tsc

src/ChronikClient.ts(5,22): error TS2307: Cannot find module 'ecashaddrjs' or its corresponding type declarations.
test/integration/mempool_conflicts.ts(7,22): error TS2307: Cannot find module 'ecashaddrjs' or its corresponding type declarations.
test/integration/script_endpoints.ts(7,22): error TS2307: Cannot find module 'ecashaddrjs' or its corresponding type declarations.
test/integration/websocket.ts(7,22): error TS2307: Cannot find module 'ecashaddrjs' or its corresponding type declarations.
npm error code 2
npm error path /work/modules/chronik-client
npm error command failed
npm error command sh -c npm run build
npm error A complete log of this run can be found in: /root/.npm/_logs/2024-12-01T05_37_44_533Z-debug-0.log
Build ecash-lib-tests failed with exit code 2

Tail of the build log:

warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions
 Downloading crates ...
  Downloaded bumpalo v3.16.0
  Downloaded wasm-bindgen-macro-support v0.2.92
  Downloaded wasm-bindgen-macro v0.2.92
  Downloaded wasm-bindgen-backend v0.2.92
  Downloaded wasm-bindgen v0.2.92
   Compiling proc-macro2 v1.0.92
   Compiling unicode-ident v1.0.14
   Compiling typenum v1.17.0
   Compiling version_check v0.9.5
   Compiling wasm-bindgen-shared v0.2.92
   Compiling shlex v1.3.0
   Compiling bumpalo v3.16.0
   Compiling log v0.4.22
   Compiling once_cell v1.20.2
   Compiling cfg-if v1.0.0
   Compiling wasm-bindgen v0.2.92
   Compiling thiserror v1.0.69
   Compiling abc-rust-lint v0.1.0 (/work/chronik/abc-rust-lint)
   Compiling cc v1.2.1
   Compiling generic-array v0.14.7
   Compiling quote v1.0.37
   Compiling syn v2.0.89
   Compiling ecash-secp256k1-sys v0.10.0 (/work/modules/ecash-secp256k1/ecash-secp256k1-sys)
   Compiling crypto-common v0.1.6
   Compiling block-buffer v0.10.4
   Compiling digest v0.10.7
   Compiling sha2 v0.10.8
   Compiling ripemd v0.1.3
   Compiling wasm-bindgen-backend v0.2.92
   Compiling ecash-secp256k1 v0.30.0 (/work/modules/ecash-secp256k1)
   Compiling thiserror-impl v1.0.69
   Compiling wasm-bindgen-macro-support v0.2.92
   Compiling wasm-bindgen-macro v0.2.92
   Compiling ecash-lib-wasm v0.1.0 (/work/modules/ecash-lib-wasm)
    Finished release-wasm [optimized] target(s) in 4.38s
Test depends on chronik-client. Building TypeScript...
/work/modules/chronik-client /work/modules/ecash-lib-wasm /work/modules/b58-ts /work/abc-ci-builds/ecash-lib-integration-tests

> chronik-client@2.0.0 prepublish
> npm run build


> chronik-client@2.0.0 build
> tsc

src/ChronikClient.ts(5,22): error TS2307: Cannot find module 'ecashaddrjs' or its corresponding type declarations.
test/integration/mempool_conflicts.ts(7,22): error TS2307: Cannot find module 'ecashaddrjs' or its corresponding type declarations.
test/integration/script_endpoints.ts(7,22): error TS2307: Cannot find module 'ecashaddrjs' or its corresponding type declarations.
test/integration/websocket.ts(7,22): error TS2307: Cannot find module 'ecashaddrjs' or its corresponding type declarations.
npm error code 2
npm error path /work/modules/chronik-client
npm error command failed
npm error command sh -c npm run build
npm error A complete log of this run can be found in: /root/.npm/_logs/2024-12-01T05_40_42_129Z-debug-0.log
Build ecash-lib-integration-tests failed with exit code 2

we need to DEPENDS_ECASHADDRJS for ecash-lib because chronik-client still needs it

bytesofman published this revision for review.Sun, Dec 1, 06:06
bytesofman edited the summary of this revision. (Show Details)