Page MenuHomePhabricator

[ecash-lib] Add `parseSlp`
ClosedPublic

Authored by tobias_ruck on Fri, Mar 28, 16:21.

Details

Reviewers
Fabien
bytesofman
Group Reviewers
Restricted Project
Commits
rABC447376b4a64e: [ecash-lib] Add `parseSlp`
Summary

Parses an SLP OP_RETURN Script.

See doc comment of parseSlp for details.

Test Plan

npm test

Event Timeline

Tail of the build log:

  hdwallet.ts                  |   41.13 |    39.47 |   48.27 |   81.69 | ...02,106-112,126,137,171 
  hmac.ts                      |   50.63 |       75 |   57.14 |     100 | 1-19                      
  index.ts                     |       0 |        0 |       0 |       0 |                           
  indexBrowser.ts              |       0 |        0 |       0 |       0 |                           
  indexNodeJs.ts               |       0 |        0 |       0 |       0 |                           
  initBrowser.ts               |       0 |      100 |       0 |       0 | 11-17                     
  initNodeJs.ts                |   54.54 |      100 |     100 |      80 | 10                        
  messages.ts                  |   48.68 |     37.5 |     100 |   97.22 | 67                        
  mnemonic.ts                  |   50.65 |       50 |   53.33 |   98.71 | 96                        
  op.ts                        |   48.99 |       50 |   54.54 |   96.05 | 7,76,124                  
  opcode.ts                    |    50.2 |    83.33 |     100 |     100 | 1                         
  pbkdf2.ts                    |   50.87 |    83.33 |   66.66 |     100 | 1                         
  script.ts                    |   46.78 |    52.94 |   45.16 |   85.96 | 11,36,41-42,50,55,74,88   
  sigHashType.ts               |   50.66 |    54.54 |   53.84 |     100 | 1-79                      
  tx.ts                        |   45.05 |    45.23 |   38.09 |   82.97 | ...14,123-125,144,156,176 
  txBuilder.ts                 |   11.11 |     12.5 |   13.63 |   22.82 | ...07,214,251-255,261-265 
  unsignedTx.ts                |    51.3 |       49 |   51.28 |    91.6 | ...73,262,266,289,345,357 
 src/address                   |   48.47 |    51.51 |   53.84 |   94.82 |                           
  address.ts                   |      50 |    52.27 |   51.61 |   94.73 | 5,12,36,60                
  legacyaddr.ts                |   45.78 |       50 |    62.5 |      95 | 73,105                    
 src/ffi                       |   43.26 |    25.74 |   34.86 |   43.63 |                           
  ecash_lib_wasm_bg_browser.js |       0 |      100 |     100 |       0 | 1                         
  ecash_lib_wasm_browser.js    |       0 |        0 |       0 |       0 | 3-681                     
  ecash_lib_wasm_nodejs.js     |   90.03 |    72.22 |    74.5 |   90.28 | ...48,364-382,454,526,602 
 src/io                        |   48.55 |     54.9 |   54.68 |   94.85 |                           
  bytes.ts                     |   50.81 |       70 |   52.94 |     100 | 1-73                      
  hex.ts                       |   48.05 |       50 |   55.55 |   94.11 | 50,58                     
  int.ts                       |       0 |        0 |       0 |       0 |                           
  str.ts                       |   53.84 |    83.33 |      60 |     100 | 1                         
  varsize.ts                   |   48.97 |    52.63 |      60 |      96 | 24                        
  writer.ts                    |       0 |        0 |       0 |       0 |                           
  writerbytes.ts               |   44.26 |    43.75 |   53.33 |   87.09 | 34,44,54,64               
  writerlength.ts              |   53.33 |    83.33 |   53.84 |     100 | 1                         
 src/payment                   |    44.9 |    37.03 |   53.48 |   85.91 |                           
  asn1.ts                      |    44.3 |     30.2 |   51.21 |   84.92 | ...10,316,322,348,379,433 
  index.ts                     |      60 |      100 |     100 |     100 |                           
  x509.ts                      |   52.38 |    83.33 |     100 |     100 | 1                         
 src/test                      |       0 |        0 |       0 |       0 |                           
  testRunner.ts                |       0 |        0 |       0 |       0 | 16-201                    
 src/token                     |   39.32 |    39.89 |   41.26 |   65.77 |                           
  alp.ts                       |       0 |        0 |       0 |       0 | 13-145                    
  common.ts                    |   52.63 |    83.33 |     100 |     100 | 1                         
  empp.ts                      |       0 |        0 |       0 |       0 | 11-28                     
  slp.parse.ts                 |   52.15 |    51.88 |   52.17 |    98.5 | 10,17                     
  slp.ts                       |   35.76 |    27.94 |      52 |   68.35 | 41-66,206,213-220         
-------------------------------|---------|----------|---------|---------|---------------------------

##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='1694']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='4571']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='490']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='1245']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='267']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='709']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='1664']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='3035']
##teamcity[blockClosed name='Code Coverage Summary']
/work/modules/ecash-lib/coverage/lcov-report /work/modules/ecash-lib /work/abc-ci-builds/ecash-lib-tests
/work/modules/ecash-lib /work/abc-ci-builds/ecash-lib-tests
Build ecash-lib-tests completed successfully

Tail of the build log:

  hdwallet.ts                  |   41.13 |    39.47 |   48.27 |   81.69 | ...02,106-112,126,137,171 
  hmac.ts                      |   50.63 |       75 |   57.14 |     100 | 1-19                      
  index.ts                     |       0 |        0 |       0 |       0 |                           
  indexBrowser.ts              |       0 |        0 |       0 |       0 |                           
  indexNodeJs.ts               |       0 |        0 |       0 |       0 |                           
  initBrowser.ts               |       0 |      100 |       0 |       0 | 11-17                     
  initNodeJs.ts                |   54.54 |      100 |     100 |      80 | 10                        
  messages.ts                  |   48.68 |     37.5 |     100 |   97.22 | 67                        
  mnemonic.ts                  |   50.65 |       50 |   53.33 |   98.71 | 96                        
  op.ts                        |   48.99 |       50 |   54.54 |   96.05 | 7,76,124                  
  opcode.ts                    |    50.2 |    83.33 |     100 |     100 | 1                         
  pbkdf2.ts                    |   50.87 |    83.33 |   66.66 |     100 | 1                         
  script.ts                    |   46.78 |    52.94 |   45.16 |   85.96 | 11,36,41-42,50,55,74,88   
  sigHashType.ts               |   50.66 |    54.54 |   53.84 |     100 | 1-79                      
  tx.ts                        |   45.05 |    45.23 |   38.09 |   82.97 | ...14,123-125,144,156,176 
  txBuilder.ts                 |   11.11 |     12.5 |   13.63 |   22.82 | ...07,214,251-255,261-265 
  unsignedTx.ts                |    51.3 |       49 |   51.28 |    91.6 | ...73,262,266,289,345,357 
 src/address                   |   48.47 |    51.51 |   53.84 |   94.82 |                           
  address.ts                   |      50 |    52.27 |   51.61 |   94.73 | 5,12,36,60                
  legacyaddr.ts                |   45.78 |       50 |    62.5 |      95 | 73,105                    
 src/ffi                       |   43.26 |    25.74 |   34.86 |   43.63 |                           
  ecash_lib_wasm_bg_browser.js |       0 |      100 |     100 |       0 | 1                         
  ecash_lib_wasm_browser.js    |       0 |        0 |       0 |       0 | 3-681                     
  ecash_lib_wasm_nodejs.js     |   90.03 |    72.22 |    74.5 |   90.28 | ...48,364-382,454,526,602 
 src/io                        |   48.55 |     54.9 |   54.68 |   94.85 |                           
  bytes.ts                     |   50.81 |       70 |   52.94 |     100 | 1-73                      
  hex.ts                       |   48.05 |       50 |   55.55 |   94.11 | 50,58                     
  int.ts                       |       0 |        0 |       0 |       0 |                           
  str.ts                       |   53.84 |    83.33 |      60 |     100 | 1                         
  varsize.ts                   |   48.97 |    52.63 |      60 |      96 | 24                        
  writer.ts                    |       0 |        0 |       0 |       0 |                           
  writerbytes.ts               |   44.26 |    43.75 |   53.33 |   87.09 | 34,44,54,64               
  writerlength.ts              |   53.33 |    83.33 |   53.84 |     100 | 1                         
 src/payment                   |    44.9 |    37.03 |   53.48 |   85.91 |                           
  asn1.ts                      |    44.3 |     30.2 |   51.21 |   84.92 | ...10,316,322,348,379,433 
  index.ts                     |      60 |      100 |     100 |     100 |                           
  x509.ts                      |   52.38 |    83.33 |     100 |     100 | 1                         
 src/test                      |       0 |        0 |       0 |       0 |                           
  testRunner.ts                |       0 |        0 |       0 |       0 | 16-201                    
 src/token                     |   39.32 |    39.89 |   41.26 |   65.77 |                           
  alp.ts                       |       0 |        0 |       0 |       0 | 13-145                    
  common.ts                    |   52.63 |    83.33 |     100 |     100 | 1                         
  empp.ts                      |       0 |        0 |       0 |       0 | 11-28                     
  slp.parse.ts                 |   52.15 |    51.88 |   52.17 |    98.5 | 10,17                     
  slp.ts                       |   35.76 |    27.94 |      52 |   68.35 | 41-66,206,213-220         
-------------------------------|---------|----------|---------|---------|---------------------------

##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='1694']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='4571']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='490']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='1245']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='267']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='709']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='1664']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='3035']
##teamcity[blockClosed name='Code Coverage Summary']
/work/modules/ecash-lib/coverage/lcov-report /work/modules/ecash-lib /work/abc-ci-builds/ecash-lib-tests
/work/modules/ecash-lib /work/abc-ci-builds/ecash-lib-tests
Build ecash-lib-tests completed successfully

Failed tests logs:

====== CashTab Unit Tests: <SendXec /> rendered with params in URL Legacy params are not parsed as bip21 even if the bip21 param appears in the string ======
Error: expect(received).toHaveProperty(path, value)

Expected path: "disabled"

Expected value: true
Received value: false
    at Object.toHaveProperty (/work/cashtab/src/components/Send/__tests__/SendByUrlParams.test.js:461:55)
    at runNextTicks (node:internal/process/task_queues:60:5)
    at listOnTimeout (node:internal/timers:545:9)
    at processTimers (node:internal/timers:519:7)

Each failure log is accessible here:
CashTab Unit Tests: <SendXec /> rendered with params in URL Legacy params are not parsed as bip21 even if the bip21 param appears in the string

bytesofman added a subscriber: bytesofman.

How is this function expected to be used? For the most part, correctly parsing an SLP OP_RETURN is often irrelevant, since we lack the indexer data (e.g. a well-formed SEND OP_RETURN could be a burn; validity in general depends on the indexer).

modules/ecash-lib/src/token/slp.parse.ts
29 ↗(On Diff #53300)

see other typeof comment

46 ↗(On Diff #53300)

why typeof MINT_STR and not just MINT_STR ?

I think you can set constant values this way if that is what is expected. otherwise typeof MINT_STR would just be string right?

48 ↗(On Diff #53300)

same

60 ↗(On Diff #53300)

same

62 ↗(On Diff #53300)

same

87 ↗(On Diff #53300)

confirm typeof use

99 ↗(On Diff #53300)

i.e. here we are just using the constant, seems like this would also be what we want to do above

133 ↗(On Diff #53300)

mint vault has a different lokad right?

oh nm just a different type

modules/ecash-lib/src/token/slp.test.ts
174 ↗(On Diff #53300)

is this actually out of spec?

it's possible to mint tokens without a ticker -- but in this case, there's supposed to be a placeholder?

202 ↗(On Diff #53300)

same question as above -- what is the spec on hash in a genesis tx?

This revision now requires changes to proceed.Fri, Mar 28, 17:29
tobias_ruck added inline comments.
modules/ecash-lib/src/token/slp.parse.ts
46 ↗(On Diff #53300)

why typeof MINT_STR and not just MINT_STR ?

'MINT_STR' refers to a value, but is being used as a type here. Did you mean 'typeof MINT_STR'?ts(2749)

otherwise typeof MINT_STR would just be string right?

typeof MINT_STR is the string literal type "MINT"

48 ↗(On Diff #53300)

'SLP_FUNGIBLE' refers to a value, but is being used as a type here. Did you mean 'typeof SLP_FUNGIBLE'?ts(2749)

99 ↗(On Diff #53300)

isn't it better to define the type once and then refer to it? this way we know for sure it's all the same type instead of me relying on my hands typing BURN instead of BRUN

modules/ecash-lib/src/token/slp.test.ts
174 ↗(On Diff #53300)

Ticker can be the empty string, yes, but it must be there in some way

202 ↗(On Diff #53300)

can either be empty or 32 bytes, but not missing entirely

Is it possible to have a "valid" SLP OP_RETURN string that exceeds the OP_RETURN byte limit?

modules/ecash-lib/src/token/slp.parse.ts
46 ↗(On Diff #53300)

ok nice, TIL

99 ↗(On Diff #53300)

yeah, issue is my misinterpretation of typescript, i thought typeof BURN_STR was 'string' and not BURN

so here -- should we also define an UNKNOWN?

192 ↗(On Diff #53300)

spec-related magic number

200 ↗(On Diff #53300)

spec-related magic number, use a const or reference the spec

In Cashtab I went as far as to specifically define an SlpDecimals type for integers 0-9 inclusive but imo that was a mistake...functions need to handle arbitrary number input and validate, as here.

209 ↗(On Diff #53300)

spec-related const should have spec reference or be a defined const

330 ↗(On Diff #53300)

potentially some value in keeping this as a const? it's basically second-nature to "know" txids are 32 bytes / 64 chars long but I'm not sure that is clear to people not in the weeds of crypto dev

345 ↗(On Diff #53300)

I can see this being a useful const for ecash-lib to export (e.g. SLP_MAX_OUTPUTS = 19), will need to be re-defined otherwise in ecash-wallet

add consts to address review; also factor out nextMintOutIdx

modules/ecash-lib/src/token/slp.ts
27 ↗(On Diff #53305)

for the particular case of these constants ... i dunno if we can use _LEN when we mean bytecount. in JS it's particularly confusing since sometimes we are checking tokenId strings, and the length then would be 64 (or 40 for address hashes).

mb _BYTES

Fabien added inline comments.
modules/ecash-lib/src/token/slp.parse.ts
105 ↗(On Diff #53300)

What about SlpScript? OP_RETURN is a technical detail

rename:

  • SLP_GENESIS_HASH_LEN -> SLP_NUM_GENESIS_HASH_BYTES
  • SlpOpreturn -> SlpData

Tail of the build log:

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

7 vulnerabilities (6 moderate, 1 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

> ecashaddrjs@2.0.0 build
> tsc

/work/modules/chronik-client /work/abc-ci-builds/ecash-agora-tests

> chronik-client@3.0.1 prepublish
> npm run build


> chronik-client@3.0.1 build
> tsc


added 170 packages, and audited 172 packages in 5s

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

4 vulnerabilities (3 moderate, 1 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

> chronik-client@3.0.1 build
> tsc

/work/modules/ecash-lib /work/abc-ci-builds/ecash-agora-tests

added 271 packages, and audited 275 packages in 2s

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

6 vulnerabilities (5 moderate, 1 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

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

src/token/slp.test.ts(24,5): error TS2305: Module '"./slp.parse.js"' has no exported member 'SlpOpreturn'.
Build ecash-agora-tests failed with exit code 2

Tail of the build log:

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

7 vulnerabilities (6 moderate, 1 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

> ecashaddrjs@2.0.0 build
> tsc

/work/modules/chronik-client /work/abc-ci-builds/cashtab-tests

> chronik-client@3.0.1 prepublish
> npm run build


> chronik-client@3.0.1 build
> tsc


added 170 packages, and audited 172 packages in 4s

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

4 vulnerabilities (3 moderate, 1 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

> chronik-client@3.0.1 build
> tsc

/work/modules/ecash-lib /work/abc-ci-builds/cashtab-tests

added 271 packages, and audited 275 packages in 2s

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

6 vulnerabilities (5 moderate, 1 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

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

src/token/slp.test.ts(24,5): error TS2305: Module '"./slp.parse.js"' has no exported member 'SlpOpreturn'.
Build cashtab-tests failed with exit code 2

Tail of the build log:

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

7 vulnerabilities (6 moderate, 1 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

> ecashaddrjs@2.0.0 build
> tsc

/work/modules/chronik-client /work/abc-ci-builds/ecash-agora-integration-tests

> chronik-client@3.0.1 prepublish
> npm run build


> chronik-client@3.0.1 build
> tsc


added 170 packages, and audited 172 packages in 4s

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

4 vulnerabilities (3 moderate, 1 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

> chronik-client@3.0.1 build
> tsc

/work/modules/ecash-lib /work/abc-ci-builds/ecash-agora-integration-tests

added 271 packages, and audited 275 packages in 2s

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

6 vulnerabilities (5 moderate, 1 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

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

src/token/slp.test.ts(24,5): error TS2305: Module '"./slp.parse.js"' has no exported member 'SlpOpreturn'.
Build ecash-agora-integration-tests failed with exit code 2

Tail of the build log:

  run `npm fund` for details

7 vulnerabilities (6 moderate, 1 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

> ecashaddrjs@2.0.0 build
> tsc

/work/modules/chronik-client /work/abc-ci-builds/ecash-lib-tests

> chronik-client@3.0.1 prepublish
> npm run build


> chronik-client@3.0.1 build
> tsc


added 170 packages, and audited 172 packages in 5s

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

4 vulnerabilities (3 moderate, 1 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

> chronik-client@3.0.1 build
> tsc

/work/modules/ecash-lib /work/abc-ci-builds/ecash-lib-tests

added 271 packages, and audited 275 packages in 2s

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

6 vulnerabilities (5 moderate, 1 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.
CI configured to test build. Building...

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

src/token/slp.test.ts(24,5): error TS2305: Module '"./slp.parse.js"' has no exported member 'SlpOpreturn'.
Build ecash-lib-tests failed with exit code 2

Tail of the build log:

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

7 vulnerabilities (6 moderate, 1 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

> ecashaddrjs@2.0.0 build
> tsc

/work/modules/chronik-client /work/abc-ci-builds/ecash-wallet-tests

> chronik-client@3.0.1 prepublish
> npm run build


> chronik-client@3.0.1 build
> tsc


added 170 packages, and audited 172 packages in 4s

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

4 vulnerabilities (3 moderate, 1 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

> chronik-client@3.0.1 build
> tsc

/work/modules/ecash-lib /work/abc-ci-builds/ecash-wallet-tests

added 271 packages, and audited 275 packages in 2s

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

6 vulnerabilities (5 moderate, 1 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

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

src/token/slp.test.ts(24,5): error TS2305: Module '"./slp.parse.js"' has no exported member 'SlpOpreturn'.
Build ecash-wallet-tests failed with exit code 2

Tail of the build log:

[551/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/trafficgraphwidget.cpp.o
[552/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/utilitydialog.cpp.o
[553/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/qrc_bitcoin_locale.cpp.o
[554/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/addressbookpage.cpp.o
[555/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/rpcconsole.cpp.o
[556/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/splashscreen.cpp.o
[557/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/askpassphrasedialog.cpp.o
[558/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/coincontroltreewidget.cpp.o
[559/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/createwalletdialog.cpp.o
[560/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/addresstablemodel.cpp.o
[561/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/editaddressdialog.cpp.o
[562/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/openuridialog.cpp.o
[563/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/coincontroldialog.cpp.o
[564/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/qrimagewidget.cpp.o
[565/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/overviewpage.cpp.o
[566/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/receiverequestdialog.cpp.o
[567/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/transactionfilterproxy.cpp.o
[568/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/recentrequeststablemodel.cpp.o
[569/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/receivecoinsdialog.cpp.o
[570/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/transactiondescdialog.cpp.o
[571/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/sendcoinsentry.cpp.o
[572/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/paymentserver.cpp.o
[573/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/signverifymessagedialog.cpp.o
[574/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/transactionrecord.cpp.o
[575/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/transactiondesc.cpp.o
[576/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/transactionview.cpp.o
[577/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/walletmodeltransaction.cpp.o
[578/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/walletframe.cpp.o
[579/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/sendcoinsdialog.cpp.o
[580/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/walletcontroller.cpp.o
[581/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/transactiontablemodel.cpp.o
[582/591] Linking CXX executable src/bench/bitcoin-bench
[583/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/walletmodel.cpp.o
[584/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/paymentrequestplus.cpp.o
[585/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/walletview.cpp.o
[586/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt-base.dir/qrc_bitcoin.cpp.o
[587/591] Linking CXX static library src/qt/libbitcoin-qt-base.a
[588/591] Automatic MOC for target bitcoin-qt
[589/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt.dir/bitcoin-qt_autogen/mocs_compilation.cpp.o
[590/591] Building CXX object src/qt/CMakeFiles/bitcoin-qt.dir/main.cpp.o
[591/591] Linking CXX executable src/qt/bitcoin-qt
/work/modules/ecash-lib /work/abc-ci-builds/ecash-lib-integration-tests

added 271 packages, and audited 275 packages in 2s

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

6 vulnerabilities (5 moderate, 1 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

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

src/token/slp.test.ts(24,5): error TS2305: Module '"./slp.parse.js"' has no exported member 'SlpOpreturn'.
Build ecash-lib-integration-tests failed with exit code 2

Tail of the build log:

  hash.ts                      |   41.46 |    83.33 |   26.66 |   80.95 | 26,35,38,41               
  hdwallet.ts                  |       0 |        0 |       0 |       0 | 12-176                    
  hmac.ts                      |       0 |        0 |       0 |       0 | 16-73                     
  index.ts                     |       0 |        0 |       0 |       0 |                           
  indexBrowser.ts              |       0 |        0 |       0 |       0 |                           
  indexNodeJs.ts               |       0 |        0 |       0 |       0 |                           
  initBrowser.ts               |       0 |      100 |       0 |       0 | 11-17                     
  initNodeJs.ts                |   54.54 |      100 |     100 |      80 | 10                        
  messages.ts                  |       0 |        0 |       0 |       0 | 18-123                    
  mnemonic.ts                  |       0 |        0 |       0 |       0 | 9-144                     
  op.ts                        |   20.13 |    23.33 |   36.36 |   39.47 | ...09,111,119-124,135-163 
  opcode.ts                    |    50.2 |    83.33 |     100 |     100 | 1                         
  pbkdf2.ts                    |       0 |      100 |       0 |       0 | 17-51                     
  script.ts                    |   28.44 |    20.58 |   29.03 |   50.87 | ...33-144,150,160,182-193 
  sigHashType.ts               |      40 |       25 |   46.15 |   78.94 | 26-38                     
  tx.ts                        |   47.25 |    45.23 |   47.61 |   87.23 | 110,114,123-125,144       
  txBuilder.ts                 |   40.74 |    33.92 |   54.54 |   80.43 | ...62,181-186,191,261-265 
  unsignedTx.ts                |   25.27 |       16 |   30.76 |   46.15 | ...12,320,326-329,345,357 
 src/address                   |   11.35 |    15.15 |    5.12 |   22.41 |                           
  address.ts                   |   10.95 |    11.36 |    3.22 |   21.05 | ...39-240,255-256,266-344 
  legacyaddr.ts                |   12.04 |    22.72 |    12.5 |      25 | ...9,23-38,70-111,124-128 
 src/ffi                       |   14.37 |    12.87 |    8.25 |   14.54 |                           
  ecash_lib_wasm_bg_browser.js |       0 |      100 |     100 |       0 | 1                         
  ecash_lib_wasm_browser.js    |       0 |        0 |       0 |       0 | 3-681                     
  ecash_lib_wasm_nodejs.js     |    29.9 |    36.11 |   17.64 |   30.09 | ...19,526-591,597-598,602 
 src/io                        |   30.79 |    41.17 |   39.06 |   59.55 |                           
  bytes.ts                     |    8.19 |       60 |   11.76 |   16.12 | 12,23-74                  
  hex.ts                       |   41.55 |       50 |   44.44 |   82.35 | 41-45,50,58               
  int.ts                       |       0 |        0 |       0 |       0 |                           
  str.ts                       |   46.15 |    83.33 |      40 |   85.71 | 15                        
  varsize.ts                   |   16.32 |    21.05 |      40 |      32 | 14-24,40-47               
  writer.ts                    |       0 |        0 |       0 |       0 |                           
  writerbytes.ts               |   42.62 |    40.62 |   53.33 |   83.87 | 34,44,54,64,80            
  writerlength.ts              |   53.33 |    83.33 |   53.84 |     100 | 1                         
 src/payment                   |       0 |        0 |       0 |       0 |                           
  asn1.ts                      |       0 |        0 |       0 |       0 | 77-439                    
  index.ts                     |       0 |        0 |       0 |       0 |                           
  x509.ts                      |       0 |      100 |     100 |       0 | 5-15                      
 src/test                      |   46.05 |    37.68 |      50 |   89.04 |                           
  testRunner.ts                |   46.05 |    37.68 |      50 |   89.04 | 66-68,81-82,105,114,157   
 src/token                     |   35.14 |    27.41 |   41.17 |   55.66 |                           
  alp.ts                       |    42.5 |    53.12 |   43.47 |   82.92 | 110-123,142               
  common.ts                    |      52 |    83.33 |     100 |     100 | 1                         
  empp.ts                      |   52.17 |       60 |   57.14 |   91.66 | 12                        
  slp.parse.ts                 |       0 |        0 |       0 |       0 | 128-379                   
  slp.ts                       |   47.16 |    33.82 |      52 |   90.36 | ...82,188,196,199,218,223 
-------------------------------|---------|----------|---------|---------|---------------------------

##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='877']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='4129']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='263']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='1172']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='144']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='677']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='856']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='2988']
##teamcity[blockClosed name='Code Coverage Summary']
mv: cannot stat 'test_results/ecash-lib-integration-tests-junit.xml': No such file or directory
Build ecash-lib-integration-tests failed with exit code 1

green w/ nits on remaining _LEN constants

modules/ecash-lib/src/token/common.ts
31 ↗(On Diff #53315)

_LEN to _BYTES

modules/ecash-lib/src/token/slp.ts
30 ↗(On Diff #53315)

same thing re: _LEN

36 ↗(On Diff #53315)

ditto

This revision is now accepted and ready to land.Tue, Apr 1, 13:22
This revision was automatically updated to reflect the committed changes.