Page MenuHomePhabricator

[ecash-lib] Add support for LEGACY sighash
Changes PlannedPublic

Authored by tobias_ruck on Nov 23 2024, 18:50.

Details

Reviewers
bytesofman
Fabien
Group Reviewers
Restricted Project
Summary

This is the OG pre-UAHF sighash from Bitcoin, which is invalid on eCash, but still can be used on Bitcoin, Dogecoin and others.

We download the doged binary and use it to run the legacy tests.

This is a forwardport of https://github.com/doged-io/doged/pull/80.

Test Plan
  1. Download the latest doged version from https://download.doged.io
  2. Unzip, replace bitcoind in the build dir with doged (renamed to bitcoind)
  3. Within modules/ecash-lib, run IS_LEGACY_MODE=true npm run integration-tests

Event Timeline

Tail of the build log:

FAIL src/components/App/fixtures/__tests__/CashtabTestWrapper.test.js
  ● Test suite failed to run

    Jest encountered an unexpected token

    Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.

    Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.

    By default "node_modules" folder is ignored by transformers.

    Here's what you can do:
     • If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.
     • If you are trying to use TypeScript, see https://jestjs.io/docs/getting-started#using-typescript
     • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
     • If you need a custom transformation specify a "transform" option in your config.
     • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

    You'll find more details and examples of these config options in the docs:
    https://jestjs.io/docs/configuration
    For information about custom transformations, see:
    https://jestjs.io/docs/code-transformation

    Details:

    /work/modules/ecash-lib/dist/ffi/ecash_lib_wasm_browser.js:307
        input = new URL('ecash_lib_wasm_bg_browser.wasm', import.meta.url);
                                                                 ^^^^

    SyntaxError: Cannot use 'import.meta' outside a module

      4 |
      5 | import { __setEcc } from './ecc.js';
    > 6 | import __wbg_init, * as ffi from './ffi/ecash_lib_wasm_browser.js';
        | ^
      7 | import { __setHashes } from './hash.js';
      8 |
      9 | /** Load and initialize the WASM module for Web */

      at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1505:14)
      at Object.require (../modules/ecash-lib/src/initBrowser.ts:6:1)
      at Object.require (../modules/ecash-lib/src/indexBrowser.ts:6:1)
      at Object.require (../modules/ecash-lib/src/unsignedTx.ts:6:1)
      at Object.require (../modules/ecash-lib/src/txBuilder.ts:19:1)
      at Object.require (../modules/ecash-lib/src/index.ts:13:1)
      at Object.require (../modules/ecash-lib/src/indexNodeJs.ts:5:1)
      at Object.require (src/wallet/index.ts:11:1)
      at Object.require (src/validation/index.ts:6:1)
      at Object.require (src/wallet/useWallet.ts:6:1)
      at Object.require (src/wallet/context.js:7:1)
      at Object.require (src/components/App/fixtures/CashtabTestWrapper.js:9:1)
      at Object.require (src/components/App/fixtures/__tests__/CashtabTestWrapper.test.js:12:1)


Test Suites: 36 failed, 4 passed, 40 total
Tests:       17 passed, 17 total
Snapshots:   0 total
Time:        10.591 s
Ran all test suites.
Build cashtab-tests failed with exit code 1

Failed tests logs:

====== Ecash Lib: UnsignedTxInput.sigHashPreimage failure ======
AssertionError: expected [Function] to throw an error
    at Context.<anonymous> (src/unsignedTx.test.ts:444:14)
    at process.processImmediate (node:internal/timers:483:21)

      + expected - actual:  failed to generate Mocha diff

Each failure log is accessible here:
Ecash Lib: UnsignedTxInput.sigHashPreimage failure

Tail of the build log:

FAIL src/helpers/__tests__/index.test.js
  ● Test suite failed to run

    Jest encountered an unexpected token

    Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.

    Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.

    By default "node_modules" folder is ignored by transformers.

    Here's what you can do:
     • If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.
     • If you are trying to use TypeScript, see https://jestjs.io/docs/getting-started#using-typescript
     • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
     • If you need a custom transformation specify a "transform" option in your config.
     • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

    You'll find more details and examples of these config options in the docs:
    https://jestjs.io/docs/configuration
    For information about custom transformations, see:
    https://jestjs.io/docs/code-transformation

    Details:

    /work/modules/ecash-lib/dist/ffi/ecash_lib_wasm_browser.js:307
        input = new URL('ecash_lib_wasm_bg_browser.wasm', import.meta.url);
                                                                 ^^^^

    SyntaxError: Cannot use 'import.meta' outside a module

      4 |
      5 | import { __setEcc } from './ecc.js';
    > 6 | import __wbg_init, * as ffi from './ffi/ecash_lib_wasm_browser.js';
        | ^
      7 | import { __setHashes } from './hash.js';
      8 |
      9 | /** Load and initialize the WASM module for Web */

      at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1505:14)
      at Object.require (../modules/ecash-lib/src/initBrowser.ts:6:1)
      at Object.require (../modules/ecash-lib/src/indexBrowser.ts:6:1)
      at Object.require (../modules/ecash-lib/src/unsignedTx.ts:6:1)
      at Object.require (../modules/ecash-lib/src/txBuilder.ts:19:1)
      at Object.require (../modules/ecash-lib/src/index.ts:13:1)
      at Object.require (../modules/ecash-lib/src/indexNodeJs.ts:5:1)
      at Object.require (src/wallet/index.ts:11:1)
      at Object.require (src/chronik/index.ts:9:1)
      at Object.require (src/components/App/fixtures/mocks.ts:14:1)
      at Object.require (src/helpers/fixtures/vectors.js:16:1)
      at Object.require (src/helpers/__tests__/index.test.js:15:1)


Test Suites: 36 failed, 4 passed, 40 total
Tests:       17 passed, 17 total
Snapshots:   0 total
Time:        11.184 s
Ran all test suites.
Build cashtab-tests failed with exit code 1
Fabien requested changes to this revision.Nov 25 2024, 07:41
Fabien added a subscriber: Fabien.

clearing my queue

This revision now requires changes to proceed.Nov 25 2024, 07:41

bump ecash-lib version to 1.1.0

Tail of the build log:

FAIL src/components/App/fixtures/__tests__/CashtabTestWrapper.test.js
  ● Test suite failed to run

    Jest encountered an unexpected token

    Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.

    Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.

    By default "node_modules" folder is ignored by transformers.

    Here's what you can do:
     • If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.
     • If you are trying to use TypeScript, see https://jestjs.io/docs/getting-started#using-typescript
     • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
     • If you need a custom transformation specify a "transform" option in your config.
     • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

    You'll find more details and examples of these config options in the docs:
    https://jestjs.io/docs/configuration
    For information about custom transformations, see:
    https://jestjs.io/docs/code-transformation

    Details:

    /work/modules/ecash-lib/dist/ffi/ecash_lib_wasm_browser.js:307
        input = new URL('ecash_lib_wasm_bg_browser.wasm', import.meta.url);
                                                                 ^^^^

    SyntaxError: Cannot use 'import.meta' outside a module

      4 |
      5 | import { __setEcc } from './ecc.js';
    > 6 | import __wbg_init, * as ffi from './ffi/ecash_lib_wasm_browser.js';
        | ^
      7 | import { __setHashes } from './hash.js';
      8 |
      9 | /** Load and initialize the WASM module for Web */

      at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1505:14)
      at Object.require (../modules/ecash-lib/src/initBrowser.ts:6:1)
      at Object.require (../modules/ecash-lib/src/indexBrowser.ts:6:1)
      at Object.require (../modules/ecash-lib/src/unsignedTx.ts:6:1)
      at Object.require (../modules/ecash-lib/src/txBuilder.ts:19:1)
      at Object.require (../modules/ecash-lib/src/index.ts:13:1)
      at Object.require (../modules/ecash-lib/src/indexNodeJs.ts:5:1)
      at Object.require (src/wallet/index.ts:11:1)
      at Object.require (src/validation/index.ts:6:1)
      at Object.require (src/wallet/useWallet.ts:6:1)
      at Object.require (src/wallet/context.js:7:1)
      at Object.require (src/components/App/fixtures/CashtabTestWrapper.js:9:1)
      at Object.require (src/components/App/fixtures/__tests__/CashtabTestWrapper.test.js:12:1)


Test Suites: 36 failed, 4 passed, 40 total
Tests:       17 passed, 17 total
Snapshots:   0 total
Time:        10.705 s
Ran all test suites.
Build cashtab-tests failed with exit code 1

Tail of the build log:

FAIL src/components/OnBoarding/__tests__/index.test.js
  ● Test suite failed to run

    Jest encountered an unexpected token

    Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.

    Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.

    By default "node_modules" folder is ignored by transformers.

    Here's what you can do:
     • If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.
     • If you are trying to use TypeScript, see https://jestjs.io/docs/getting-started#using-typescript
     • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
     • If you need a custom transformation specify a "transform" option in your config.
     • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

    You'll find more details and examples of these config options in the docs:
    https://jestjs.io/docs/configuration
    For information about custom transformations, see:
    https://jestjs.io/docs/code-transformation

    Details:

    /work/modules/ecash-lib/dist/ffi/ecash_lib_wasm_browser.js:307
        input = new URL('ecash_lib_wasm_bg_browser.wasm', import.meta.url);
                                                                 ^^^^

    SyntaxError: Cannot use 'import.meta' outside a module

      4 |
      5 | import { __setEcc } from './ecc.js';
    > 6 | import __wbg_init, * as ffi from './ffi/ecash_lib_wasm_browser.js';
        | ^
      7 | import { __setHashes } from './hash.js';
      8 |
      9 | /** Load and initialize the WASM module for Web */

      at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1505:14)
      at Object.require (../modules/ecash-lib/src/initBrowser.ts:6:1)
      at Object.require (../modules/ecash-lib/src/indexBrowser.ts:6:1)
      at Object.require (../modules/ecash-lib/src/unsignedTx.ts:6:1)
      at Object.require (../modules/ecash-lib/src/txBuilder.ts:19:1)
      at Object.require (../modules/ecash-lib/src/index.ts:13:1)
      at Object.require (../modules/ecash-lib/src/indexNodeJs.ts:5:1)
      at Object.require (src/wallet/index.ts:11:1)
      at Object.require (src/validation/index.ts:6:1)
      at Object.require (src/wallet/useWallet.ts:6:1)
      at Object.require (src/wallet/context.js:7:1)
      at Object.require (src/components/App/fixtures/CashtabTestWrapper.js:9:1)
      at Object.require (src/components/OnBoarding/__tests__/index.test.js:17:1)


Test Suites: 36 failed, 4 passed, 40 total
Tests:       17 passed, 17 total
Snapshots:   0 total
Time:        10.62 s
Ran all test suites.
Build cashtab-tests failed with exit code 1

Tail of the build log:

    at /usr/lib/node_modules/nyc/node_modules/append-transform/index.js:64:4
    at require.extensions.<computed> (/work/apps/ecash-herald/node_modules/ts-node/src/index.ts:1621:12)
    at Object.<anonymous> (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:64:4)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Function.Module._load (node:internal/modules/cjs/loader:1104:12)
    at Module.require (node:internal/modules/cjs/loader:1311:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/work/apps/ecash-herald/test/chronikWsHandler.test.ts:12:1)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module.replacementCompile (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:60:13)
    at Module.m._compile (/work/apps/ecash-herald/node_modules/ts-node/src/index.ts:1618:23)
    at module.exports (/usr/lib/node_modules/nyc/node_modules/default-require-extensions/js.js:7:9)
    at /usr/lib/node_modules/nyc/node_modules/append-transform/index.js:64:4
    at require.extensions.<computed> (/work/apps/ecash-herald/node_modules/ts-node/src/index.ts:1621:12)
    at Object.<anonymous> (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:64:4)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Function.Module._load (node:internal/modules/cjs/loader:1104:12)
    at Module.require (node:internal/modules/cjs/loader:1311:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.exports.requireOrImport (/work/apps/ecash-herald/node_modules/mocha/lib/nodejs/esm-utils.js:53:16)
    at async Object.exports.loadFilesAsync (/work/apps/ecash-herald/node_modules/mocha/lib/nodejs/esm-utils.js:100:20)
    at async singleRun (/work/apps/ecash-herald/node_modules/mocha/lib/cli/run-helpers.js:125:3)
    at async Object.exports.handler (/work/apps/ecash-herald/node_modules/mocha/lib/cli/run.js:370:5)
------------------------|---------|----------|---------|---------|----------------------------------
File                    | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                
------------------------|---------|----------|---------|---------|----------------------------------
All files               |    6.41 |     0.14 |       0 |    5.35 |                                  
 ecash-herald           |     100 |      100 |     100 |     100 |                                  
  config.ts             |     100 |      100 |     100 |     100 |                                  
  secrets.ts            |     100 |      100 |     100 |     100 |                                  
 ecash-herald/constants |     100 |      100 |     100 |     100 |                                  
  addresses.ts          |     100 |      100 |     100 |     100 |                                  
  lokad.ts              |     100 |      100 |     100 |     100 |                                  
  miners.ts             |     100 |      100 |     100 |     100 |                                  
  op_return.ts          |     100 |      100 |     100 |     100 |                                  
  senders.ts            |     100 |      100 |     100 |     100 |                                  
  tokens.ts             |     100 |      100 |     100 |     100 |                                  
 ecash-herald/scripts   |      80 |       50 |     100 |      80 |                                  
  prepSecrets.ts        |      80 |       50 |     100 |      80 | 15                               
 ecash-herald/src       |    4.53 |        0 |       0 |    3.35 |                                  
  chronik.ts            |   11.82 |        0 |       0 |    7.95 | 23-64,82-141,155-182,198-265     
  chronikWsHandler.ts   |    4.76 |        0 |       0 |    5.26 | 11-86                            
  events.ts             |    6.32 |        0 |       0 |    6.66 | 18-370                           
  parse.ts              |    1.14 |        0 |       0 |    1.17 | 33-3904                          
  telegram.ts           |   16.66 |        0 |       0 |   11.62 | 23-29,44-82,108-154              
  utils.ts              |   16.34 |        0 |       0 |   10.58 | ...8-398,408-430,450-489,499-513 
------------------------|---------|----------|---------|---------|----------------------------------

##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='104']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='1622']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='1']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='690']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='0']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='87']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='83']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='1551']
##teamcity[blockClosed name='Code Coverage Summary']
mv: cannot stat 'test_results/ecash-herald-junit.xml': No such file or directory
Build ecash-herald-tests failed with exit code 1

Tail of the build log:

    at Module.replacementCompile (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:60:13)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
    at /usr/lib/node_modules/nyc/node_modules/append-transform/index.js:64:4
    at require.extensions.<computed> (/work/apps/token-server/node_modules/ts-node/src/index.ts:1608:43)
    at Object.<anonymous> (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:64:4)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Function.Module._load (node:internal/modules/cjs/loader:1104:12)
    at Module.require (node:internal/modules/cjs/loader:1311:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/work/apps/token-server/test/vectors.ts:21:1)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module.replacementCompile (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:60:13)
    at Module.m._compile (/work/apps/token-server/node_modules/ts-node/src/index.ts:1618:23)
    at module.exports (/usr/lib/node_modules/nyc/node_modules/default-require-extensions/js.js:7:9)
    at /usr/lib/node_modules/nyc/node_modules/append-transform/index.js:64:4
    at require.extensions.<computed> (/work/apps/token-server/node_modules/ts-node/src/index.ts:1621:12)
    at Object.<anonymous> (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:64:4)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Function.Module._load (node:internal/modules/cjs/loader:1104:12)
    at Module.require (node:internal/modules/cjs/loader:1311:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/work/apps/token-server/src/chronik/clientHandler.test.ts:8:1)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module.replacementCompile (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:60:13)
    at Module.m._compile (/work/apps/token-server/node_modules/ts-node/src/index.ts:1618:23)
    at module.exports (/usr/lib/node_modules/nyc/node_modules/default-require-extensions/js.js:7:9)
    at /usr/lib/node_modules/nyc/node_modules/append-transform/index.js:64:4
    at require.extensions.<computed> (/work/apps/token-server/node_modules/ts-node/src/index.ts:1621:12)
    at Object.<anonymous> (/usr/lib/node_modules/nyc/node_modules/append-transform/index.js:64:4)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Function.Module._load (node:internal/modules/cjs/loader:1104:12)
    at Module.require (node:internal/modules/cjs/loader:1311:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.exports.requireOrImport (/work/apps/token-server/node_modules/mocha/lib/nodejs/esm-utils.js:53:16)
    at async Object.exports.loadFilesAsync (/work/apps/token-server/node_modules/mocha/lib/nodejs/esm-utils.js:100:20)
    at async singleRun (/work/apps/token-server/node_modules/mocha/lib/cli/run-helpers.js:125:3)
    at async Object.exports.handler (/work/apps/token-server/node_modules/mocha/lib/cli/run.js:370:5)
-------------------|---------|----------|---------|---------|-------------------
File               | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
-------------------|---------|----------|---------|---------|-------------------
All files          |   20.45 |     5.88 |       0 |   20.93 |                   
 scripts           |      60 |       50 |     100 |      60 |                   
  prepSecrets.ts   |      60 |       50 |     100 |      60 | 17-18             
 src/chronik       |   15.38 |        0 |       0 |   15.78 |                   
  clientHandler.ts |   11.76 |        0 |       0 |    12.5 | 27-85             
  parse.ts         |   18.18 |        0 |       0 |   18.18 | 26-32,47-69,78-93 
-------------------|---------|----------|---------|---------|-------------------

##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='9']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='44']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='1']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='17']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='0']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='5']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='9']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='43']
##teamcity[blockClosed name='Code Coverage Summary']
mv: cannot stat 'test_results/token-server-junit.xml': No such file or directory
Build token-server-tests failed with exit code 1

fix imports (don't use indexBrowser...)

since CI tests build all dependencies before they run, it's not necessary to version bump the install in cashtab, token-server, ecash-herald, faucet, or ecash-agora -- they use relative installs and will build this version.

Arguably we "should" include these version bumps, since it would rebuild these apps with this latest version of ecash-lib. But for the purposes of this diff, implementing and showing that it does not break them is enough.

Upgrading Cashtab to use this no-change diff is a separate change, no need to do it here. imo these changes are artifacts of working through the CI issues -- they can be backed out.

This revision now requires changes to proceed.Nov 26 2024, 17:09
bytesofman added inline comments.
modules/ecash-lib/src/txBuilder.ts
227–231 ↗(On Diff #51112)

because we return in the if, the else isn't doing anything

modules/ecash-lib/tests/txBuilder.test.ts
211 ↗(On Diff #51112)

is this try...catch from debugging? Is there a good reason to keep it here?

test/functional/setup_scripts/ecash-lib_base.py
18 ↗(On Diff #51112)

what's this new flag for?

This revision now requires changes to proceed.Nov 26 2024, 18:57
bytesofman added inline comments.
modules/ecash-lib/package.json
3 ↗(On Diff #51128)

want to do minor version bumps with

npm version minor

run from modules/ecash-lib

This command will update it everywhere -- in this case, this line of package.json, and also in two places in package-lock.json

If we update without using this command, we get weird situations in future diffs where package-lock.json seems to be skipping versions.

... as a heads up, I don't know if the command is smart enough to get it right if the version has been manually updated in 1 of the 3 spots.

modules/ecash-lib/src/unsignedTx.ts
90 ↗(On Diff #51128)

imo british spellings are traitorous to our economic mission but no blocker

modules/ecash-lib/tests/txBuilder.test.ts
66–67 ↗(On Diff #51128)

Please expand this comment

imo including the whole test plan of this diff here would appropriate. This is a sui generis thing in the monorepo. Including some backstory is appropriate.

test/functional/setup_scripts/ecash-lib_legacy.py
5 ↗(On Diff #51128)

expand comment here in line with the test file that is (never?) expected to use this

This revision now requires changes to proceed.Nov 27 2024, 13:41

use doged to test legacy signatures

tobias_ruck edited the summary of this revision. (Show Details)
tobias_ruck edited the test plan for this revision. (Show Details)
tobias_ruck edited the summary of this revision. (Show Details)

Tail of the build log:

setup_scripts/ecash-agora_base.py passed, Duration: 4 s

TEST                              | STATUS    | DURATION

setup_scripts/ecash-agora_base.py | ✓ Passed  | 4 s

ALL                               | ✓ Passed  | 4 s (accumulated) 
Runtime: 4 s

Setting chronik url to  http://127.0.0.1:28001
2024-11-29T12:06:54.834000Z TestFramework (INFO): Passed test setup data to mocha
2024-11-29T12:06:58.008000Z TestFramework (INFO): Received a stop message, exiting
2024-11-29T12:06:58.059000Z TestFramework (INFO): Stopping nodes
2024-11-29T12:06:58.261000Z TestFramework (INFO): Cleaning up /work/abc-ci-builds/ecash-agora-integration-tests/test/tmp/test_runner_₿₵_🏃_20241129_120653/setup_scripts/ecash-agora_base_0 on exit
2024-11-29T12:06:58.261000Z TestFramework (INFO): Tests successful
Running Unit Tests for Test Framework Modules
setup_scripts/ecash-agora_base.py started
setup_scripts/ecash-agora_base.py passed, Duration: 5 s

TEST                              | STATUS    | DURATION

setup_scripts/ecash-agora_base.py | ✓ Passed  | 5 s

ALL                               | ✓ Passed  | 5 s (accumulated) 
Runtime: 5 s

------------|---------|----------|---------|---------|----------------------------------------------
File        | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                            
------------|---------|----------|---------|---------|----------------------------------------------
All files   |   89.59 |    66.31 |   98.78 |   89.51 |                                              
 ad.ts      |   77.77 |    36.84 |     100 |   77.77 | 34,37,40,45,59,64,78,91,94,132,137,141       
 agora.ts   |   88.94 |       70 |   96.96 |   88.94 | ...7-658,712,750,754,763,774,795,828,843,865 
 consts.ts  |     100 |    83.33 |     100 |     100 | 1                                            
 index.ts   |       0 |        0 |       0 |       0 |                                              
 oneshot.ts |   89.87 |    35.71 |     100 |   89.61 | 155,158,162,165,168,172,175,179              
 partial.ts |   93.06 |       75 |     100 |      93 | ...339,422-423,429,466,471,535,669,1046,1296 
------------|---------|----------|---------|---------|----------------------------------------------

##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='482']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='538']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='124']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='187']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='81']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='82']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='478']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='534']
##teamcity[blockClosed name='Code Coverage Summary']
/work/modules/ecash-agora/coverage/lcov-report /work/modules/ecash-agora /work/modules/ecash-lib /work/modules/chronik-client /work/modules/ecash-lib-wasm /work/modules/ecashaddrjs /work/abc-ci-builds/ecash-agora-integration-tests
/work/modules/ecash-agora /work/modules/ecash-lib /work/modules/chronik-client /work/modules/ecash-lib-wasm /work/modules/ecashaddrjs /work/abc-ci-builds/ecash-agora-integration-tests
Run tests in legacy mode using doged...

> ecash-agora@0.1.1 integration-tests
> mocha --import=tsx ./tests/*.test.ts --timeout 60000



  SLP
Test runner error, aborting: Error: spawn python3 ENOENT
Build ecash-agora-integration-tests failed with exit code 255

fix "Oi, you got a loicense fo that, mate?" spelling, fix build

tobias_ruck edited the test plan for this revision. (Show Details)

Tail of the build log:

2024-11-29T16:29:57.549000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/ecash-agora-integration-tests/test/tmp/test_runner_₿₵_🏃_20241129_162957/setup_scripts/ecash-agora_base_0
2024-11-29T16:29:57.589000Z TestFramework (INFO): Cleaning up /work/abc-ci-builds/ecash-agora-integration-tests/test/tmp/test_runner_₿₵_🏃_20241129_162954/setup_scripts/ecash-agora_base_0 on exit
2024-11-29T16:29:57.589000Z TestFramework (INFO): Tests successful
WARNING! There is already a bitcoind process running on this system. Tests may fail unexpectedly due to resource contention!
Running Unit Tests for Test Framework Modules
setup_scripts/ecash-agora_base.py started
setup_scripts/ecash-agora_base.py passed, Duration: 3 s

TEST                              | STATUS    | DURATION

setup_scripts/ecash-agora_base.py | ✓ Passed  | 3 s

ALL                               | ✓ Passed  | 3 s (accumulated) 
Runtime: 3 s

Setting chronik url to  http://127.0.0.1:28001
2024-11-29T16:29:58.927000Z TestFramework (INFO): Passed test setup data to mocha
2024-11-29T16:30:02.194000Z TestFramework (INFO): Received a stop message, exiting
2024-11-29T16:30:02.244000Z TestFramework (INFO): Stopping nodes
2024-11-29T16:30:02.396000Z TestFramework (INFO): Cleaning up /work/abc-ci-builds/ecash-agora-integration-tests/test/tmp/test_runner_₿₵_🏃_20241129_162957/setup_scripts/ecash-agora_base_0 on exit
2024-11-29T16:30:02.397000Z TestFramework (INFO): Tests successful
WARNING! There is already a bitcoind process running on this system. Tests may fail unexpectedly due to resource contention!
Running Unit Tests for Test Framework Modules
setup_scripts/ecash-agora_base.py started
setup_scripts/ecash-agora_base.py passed, Duration: 5 s

TEST                              | STATUS    | DURATION

setup_scripts/ecash-agora_base.py | ✓ Passed  | 5 s

ALL                               | ✓ Passed  | 5 s (accumulated) 
Runtime: 5 s

------------|---------|----------|---------|---------|----------------------------------------------
File        | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                            
------------|---------|----------|---------|---------|----------------------------------------------
All files   |   89.59 |    66.31 |   98.78 |   89.51 |                                              
 ad.ts      |   77.77 |    36.84 |     100 |   77.77 | 34,37,40,45,59,64,78,91,94,132,137,141       
 agora.ts   |   88.94 |       70 |   96.96 |   88.94 | ...7-658,712,750,754,763,774,795,828,843,865 
 consts.ts  |     100 |    83.33 |     100 |     100 | 1                                            
 index.ts   |       0 |        0 |       0 |       0 |                                              
 oneshot.ts |   89.87 |    35.71 |     100 |   89.61 | 155,158,162,165,168,172,175,179              
 partial.ts |   93.06 |       75 |     100 |      93 | ...339,422-423,429,466,471,535,669,1046,1296 
------------|---------|----------|---------|---------|----------------------------------------------

##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='482']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='538']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='124']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='187']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='81']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='82']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='478']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='534']
##teamcity[blockClosed name='Code Coverage Summary']
/work/modules/ecash-agora/coverage/lcov-report /work/modules/ecash-agora /work/modules/ecash-lib /work/modules/chronik-client /work/modules/ecash-lib-wasm /work/modules/ecashaddrjs /work/abc-ci-builds/ecash-agora-integration-tests
/work/modules/ecash-agora /work/modules/ecash-lib /work/modules/chronik-client /work/modules/ecash-lib-wasm /work/modules/ecashaddrjs /work/abc-ci-builds/ecash-agora-integration-tests
Prepare build dir with doged...
cp: cannot stat '/root/doged-node/bin/doged': No such file or directory
Build ecash-agora-integration-tests failed with exit code 1

move doged download into the functional test

test/functional/setup_scripts/ecash-lib_base.py
21 ↗(On Diff #51234)

isn't 223 the default -datacarriersize?

Is this a higher OP_RETURN limit?

Tail of the build log:

2024-11-29T17:39:19.014000Z TestFramework (INFO): Cleaning up /work/abc-ci-builds/ecash-agora-integration-tests/test/tmp/test_runner_₿₵_🏃_20241129_173914/setup_scripts/ecash-agora_base_0 on exit
2024-11-29T17:39:19.014000Z TestFramework (INFO): Tests successful
2024-11-29T17:39:19.019000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/ecash-agora-integration-tests/test/tmp/test_runner_₿₵_🏃_20241129_173918/setup_scripts/ecash-agora_base_0
WARNING! There is already a bitcoind process running on this system. Tests may fail unexpectedly due to resource contention!
Running Unit Tests for Test Framework Modules
setup_scripts/ecash-agora_base.py started
setup_scripts/ecash-agora_base.py passed, Duration: 4 s

TEST                              | STATUS    | DURATION

setup_scripts/ecash-agora_base.py | ✓ Passed  | 4 s

ALL                               | ✓ Passed  | 4 s (accumulated) 
Runtime: 4 s

Setting chronik url to  http://127.0.0.1:28001
2024-11-29T17:39:20.711000Z TestFramework (INFO): Passed test setup data to mocha
2024-11-29T17:39:24.191000Z TestFramework (INFO): Received a stop message, exiting
2024-11-29T17:39:24.242000Z TestFramework (INFO): Stopping nodes
2024-11-29T17:39:24.444000Z TestFramework (INFO): Cleaning up /work/abc-ci-builds/ecash-agora-integration-tests/test/tmp/test_runner_₿₵_🏃_20241129_173918/setup_scripts/ecash-agora_base_0 on exit
2024-11-29T17:39:24.445000Z TestFramework (INFO): Tests successful
Running Unit Tests for Test Framework Modules
setup_scripts/ecash-agora_base.py started
setup_scripts/ecash-agora_base.py passed, Duration: 6 s

TEST                              | STATUS    | DURATION

setup_scripts/ecash-agora_base.py | ✓ Passed  | 6 s

ALL                               | ✓ Passed  | 6 s (accumulated) 
Runtime: 6 s

------------|---------|----------|---------|---------|----------------------------------------------
File        | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                            
------------|---------|----------|---------|---------|----------------------------------------------
All files   |   89.59 |    66.31 |   98.78 |   89.51 |                                              
 ad.ts      |   77.77 |    36.84 |     100 |   77.77 | 34,37,40,45,59,64,78,91,94,132,137,141       
 agora.ts   |   88.94 |       70 |   96.96 |   88.94 | ...7-658,712,750,754,763,774,795,828,843,865 
 consts.ts  |     100 |    83.33 |     100 |     100 | 1                                            
 index.ts   |       0 |        0 |       0 |       0 |                                              
 oneshot.ts |   89.87 |    35.71 |     100 |   89.61 | 155,158,162,165,168,172,175,179              
 partial.ts |   93.06 |       75 |     100 |      93 | ...339,422-423,429,466,471,535,669,1046,1296 
------------|---------|----------|---------|---------|----------------------------------------------

##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='482']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='538']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='124']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='187']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='81']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='82']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='478']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='534']
##teamcity[blockClosed name='Code Coverage Summary']
/work/modules/ecash-agora/coverage/lcov-report /work/modules/ecash-agora /work/modules/ecash-lib /work/modules/chronik-client /work/modules/ecash-lib-wasm /work/modules/ecashaddrjs /work/abc-ci-builds/ecash-agora-integration-tests
/work/modules/ecash-agora /work/modules/ecash-lib /work/modules/chronik-client /work/modules/ecash-lib-wasm /work/modules/ecashaddrjs /work/abc-ci-builds/ecash-agora-integration-tests
sha256sum: doged-node-x86_64-linux-gnu.tar.gz: No such file or directory
doged-node-x86_64-linux-gnu.tar.gz: FAILED open or read
sha256sum: WARNING: 1 listed file could not be read
Build ecash-agora-integration-tests failed with exit code 1

Tail of the build log:

Starting Bitcoin ABC functional tests
Temporary test directory at /work/abc-ci-builds/ecash-agora-integration-tests/test/tmp/test_runner_₿₵_🏃_20241129_182734
...........
----------------------------------------------------------------------
Ran 11 tests in 0.060s

OK
2024-11-29T18:27:34.867000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/ecash-agora-integration-tests/test/tmp/test_runner_₿₵_🏃_20241129_182734/setup_scripts/ecash-agora_base_0
2024-11-29T18:27:35.429000Z TestFramework (ERROR): JSONRPC error
Traceback (most recent call last):
  File "/work/test/functional/setup_scripts/../test_framework/test_framework.py", line 147, in main
    self.setup()
  File "/work/test/functional/setup_scripts/../test_framework/test_framework.py", line 382, in setup
    self.setup_network()
  File "/work/test/functional/setup_scripts/../test_framework/test_framework.py", line 506, in setup_network
    self.sync_all()
  File "/work/test/functional/setup_scripts/../test_framework/test_framework.py", line 827, in sync_all
    self.sync_proofs(nodes)
  File "/work/test/functional/setup_scripts/../test_framework/test_framework.py", line 813, in sync_proofs
    nodes_proofs = [set(format_ids(get_proof_ids(r))) for r in rpc_connections]
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/test/functional/setup_scripts/../test_framework/test_framework.py", line 813, in <listcomp>
    nodes_proofs = [set(format_ids(get_proof_ids(r))) for r in rpc_connections]
                                   ^^^^^^^^^^^^^^^^
  File "/work/test/functional/setup_scripts/../test_framework/avatools.py", line 161, in get_proof_ids
    return [int(peer["proofid"], 16) for peer in node.getavalanchepeerinfo()]
                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/test/functional/setup_scripts/../test_framework/coverage.py", line 46, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/test/functional/setup_scripts/../test_framework/authproxy.py", line 180, in __call__
    raise JSONRPCException(response["error"], status)
test_framework.authproxy.JSONRPCException: Error: Avalanche processor missing or disabled (-32603)
2024-11-29T18:27:35.484000Z TestFramework (INFO): Stopping nodes
2024-11-29T18:27:35.637000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/ecash-agora-integration-tests/test/tmp/test_runner_₿₵_🏃_20241129_182734/setup_scripts/ecash-agora_base_0
2024-11-29T18:27:35.637000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/ecash-agora-integration-tests/test/tmp/test_runner_₿₵_🏃_20241129_182734/setup_scripts/ecash-agora_base_0/test_framework.log
2024-11-29T18:27:35.637000Z TestFramework (ERROR): 
2024-11-29T18:27:35.638000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/ecash-agora-integration-tests/test/tmp/test_runner_₿₵_🏃_20241129_182734/setup_scripts/ecash-agora_base_0' to consolidate all logs
2024-11-29T18:27:35.638000Z TestFramework (ERROR): 
2024-11-29T18:27:35.638000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2024-11-29T18:27:35.638000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2024-11-29T18:27:35.639000Z TestFramework (ERROR): 
Running Unit Tests for Test Framework Modules
setup_scripts/ecash-agora_base.py started
setup_scripts/ecash-agora_base.py failed, Duration: 1 s

stdout:

stderr:


TEST                              | STATUS    | DURATION

setup_scripts/ecash-agora_base.py | ✖ Failed  | 1 s

ALL                               | ✖ Failed  | 1 s (accumulated) 
Runtime: 1 s

Test runner completed with code 1
Build ecash-agora-integration-tests failed with exit code 1

Tail of the build log:

Starting Bitcoin ABC functional tests
Temporary test directory at /work/abc-ci-builds/ecash-agora-integration-tests/test/tmp/test_runner_₿₵_🏃_20241129_185216
...........
----------------------------------------------------------------------
Ran 11 tests in 0.060s

OK
2024-11-29T18:52:16.823000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/ecash-agora-integration-tests/test/tmp/test_runner_₿₵_🏃_20241129_185216/setup_scripts/ecash-agora_base_0
2024-11-29T18:52:17.390000Z TestFramework (ERROR): JSONRPC error
Traceback (most recent call last):
  File "/work/test/functional/setup_scripts/../test_framework/test_framework.py", line 147, in main
    self.setup()
  File "/work/test/functional/setup_scripts/../test_framework/test_framework.py", line 382, in setup
    self.setup_network()
  File "/work/test/functional/setup_scripts/../test_framework/test_framework.py", line 506, in setup_network
    self.sync_all()
  File "/work/test/functional/setup_scripts/../test_framework/test_framework.py", line 827, in sync_all
    self.sync_proofs(nodes)
  File "/work/test/functional/setup_scripts/../test_framework/test_framework.py", line 813, in sync_proofs
    nodes_proofs = [set(format_ids(get_proof_ids(r))) for r in rpc_connections]
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/test/functional/setup_scripts/../test_framework/test_framework.py", line 813, in <listcomp>
    nodes_proofs = [set(format_ids(get_proof_ids(r))) for r in rpc_connections]
                                   ^^^^^^^^^^^^^^^^
  File "/work/test/functional/setup_scripts/../test_framework/avatools.py", line 161, in get_proof_ids
    return [int(peer["proofid"], 16) for peer in node.getavalanchepeerinfo()]
                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/test/functional/setup_scripts/../test_framework/coverage.py", line 46, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/work/test/functional/setup_scripts/../test_framework/authproxy.py", line 180, in __call__
    raise JSONRPCException(response["error"], status)
test_framework.authproxy.JSONRPCException: Error: Avalanche processor missing or disabled (-32603)
2024-11-29T18:52:17.443000Z TestFramework (INFO): Stopping nodes
2024-11-29T18:52:17.546000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/ecash-agora-integration-tests/test/tmp/test_runner_₿₵_🏃_20241129_185216/setup_scripts/ecash-agora_base_0
2024-11-29T18:52:17.546000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/ecash-agora-integration-tests/test/tmp/test_runner_₿₵_🏃_20241129_185216/setup_scripts/ecash-agora_base_0/test_framework.log
2024-11-29T18:52:17.546000Z TestFramework (ERROR): 
2024-11-29T18:52:17.547000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/ecash-agora-integration-tests/test/tmp/test_runner_₿₵_🏃_20241129_185216/setup_scripts/ecash-agora_base_0' to consolidate all logs
2024-11-29T18:52:17.547000Z TestFramework (ERROR): 
2024-11-29T18:52:17.548000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2024-11-29T18:52:17.548000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2024-11-29T18:52:17.548000Z TestFramework (ERROR): 
Running Unit Tests for Test Framework Modules
setup_scripts/ecash-agora_base.py started
setup_scripts/ecash-agora_base.py failed, Duration: 1 s

stdout:

stderr:


TEST                              | STATUS    | DURATION

setup_scripts/ecash-agora_base.py | ✖ Failed  | 1 s

ALL                               | ✖ Failed  | 1 s (accumulated) 
Runtime: 1 s

Test runner completed with code 1
Build ecash-agora-integration-tests failed with exit code 1

wait for the avalanche fix