Page MenuHomePhabricator

[ecash-herald] Parse agora actions
ClosedPublic

Authored by bytesofman on Sun, Oct 27, 15:28.

Details

Reviewers
emack
Group Reviewers
Restricted Project
Commits
rABCc029196d5004: [ecash-herald] Parse agora actions
Summary

Summarize SLP1 agora partial txs in daily summary

We now use ecash-lib and ecash-agora in ecash-herald, so update CI settings and herald dockerfile

Arguably ecash-agora does not need to be imported to the herald yet, we could do the agora parsing without it. However, we will for sure need it later if we want to add volume metrics, which we do. So might as well add it and update the CI stuff now.

Test Plan

npm test, see screenshot

docker build -f ecash-herald.Dockerfile -t ecash-herald_local . for new docker file

CI tests to confirm ecash-agora change does not impact the lib or other apps using it

last 24 hrs:

image.png (647×382 px, 81 KB)

image.png (647×382 px, 128 KB)

image.png (277×382 px, 41 KB)

Diff Detail

Repository
rABC Bitcoin ABC
Branch
summaries-better-tokens
Lint
Lint Errors
SeverityLocationCodeMessage
Errorcontrib/teamcity/build-configurations.yml:133trailing-spacesyamllint found an issue:
Unit
No Test Coverage
Build Status
Buildable 30865
Build 61243: Build Diffecash-agora-tests · cashtab-tests · ecash-herald-tests · ecash-agora-integration-tests
Build 61242: arc lint + arc unit

Event Timeline

Tail of the build log:

    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/work/apps/ecash-herald/src/chronikWsHandler.js:5:168)
    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._extensions..js (node:internal/modules/cjs/loader:1548:10)
    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 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.js:16:5)
    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._extensions..js (node:internal/modules/cjs/loader:1548:10)
    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 Module._load (node:internal/modules/cjs/loader:1104:12)
    at cjsLoader (node:internal/modules/esm/translators:346:17)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:286:7)
    at ModuleJob.run (node:internal/modules/esm/module_job:234:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:473:24)
    at async formattedImport (/work/apps/ecash-herald/node_modules/mocha/lib/nodejs/esm-utils.js:9:14)
    at async exports.requireOrImport (/work/apps/ecash-herald/node_modules/mocha/lib/nodejs/esm-utils.js:42:28)
    at async 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 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               |    5.12 |     1.93 |    1.31 |    5.15 |                   
 ecash-herald           |     100 |      100 |     100 |     100 |                   
  config.js             |     100 |      100 |     100 |     100 |                   
 ecash-herald/constants |     100 |      100 |     100 |     100 |                   
  addresses.js          |     100 |      100 |     100 |     100 |                   
  lokad.js              |     100 |      100 |     100 |     100 |                   
  miners.js             |     100 |      100 |     100 |     100 |                   
  op_return.js          |     100 |      100 |     100 |     100 |                   
  senders.js            |     100 |      100 |     100 |     100 |                   
  tokens.js             |     100 |      100 |     100 |     100 |                   
 ecash-herald/src       |    3.47 |     1.93 |    1.31 |    3.47 |                   
  chronik.js            |    4.65 |        0 |       0 |     4.7 | 14-249            
  chronikWsHandler.js   |    7.69 |        0 |       0 |    7.69 | 8-78              
  events.js             |    5.35 |        0 |       0 |    5.45 | 19-268            
  parse.js              |    1.56 |        0 |       0 |    1.59 | 31-3277           
  telegram.js           |    6.81 |        0 |       0 |    7.14 | 19-148            
  utils.js              |   11.24 |    14.14 |    5.55 |   10.97 | 15-255,303-441    
------------------------|---------|----------|---------|---------|-------------------

##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='66']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='1287']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='14']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='725']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='1']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='76']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='65']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='1260']
##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 require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/work/apps/ecash-herald/src/chronikWsHandler.js:5:168)
    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._extensions..js (node:internal/modules/cjs/loader:1548:10)
    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 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.js:16:5)
    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._extensions..js (node:internal/modules/cjs/loader:1548:10)
    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 Module._load (node:internal/modules/cjs/loader:1104:12)
    at cjsLoader (node:internal/modules/esm/translators:346:17)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:286:7)
    at ModuleJob.run (node:internal/modules/esm/module_job:234:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:473:24)
    at async formattedImport (/work/apps/ecash-herald/node_modules/mocha/lib/nodejs/esm-utils.js:9:14)
    at async exports.requireOrImport (/work/apps/ecash-herald/node_modules/mocha/lib/nodejs/esm-utils.js:42:28)
    at async 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 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               |    5.12 |     1.93 |    1.31 |    5.15 |                   
 ecash-herald           |     100 |      100 |     100 |     100 |                   
  config.js             |     100 |      100 |     100 |     100 |                   
 ecash-herald/constants |     100 |      100 |     100 |     100 |                   
  addresses.js          |     100 |      100 |     100 |     100 |                   
  lokad.js              |     100 |      100 |     100 |     100 |                   
  miners.js             |     100 |      100 |     100 |     100 |                   
  op_return.js          |     100 |      100 |     100 |     100 |                   
  senders.js            |     100 |      100 |     100 |     100 |                   
  tokens.js             |     100 |      100 |     100 |     100 |                   
 ecash-herald/src       |    3.47 |     1.93 |    1.31 |    3.47 |                   
  chronik.js            |    4.65 |        0 |       0 |     4.7 | 14-249            
  chronikWsHandler.js   |    7.69 |        0 |       0 |    7.69 | 8-78              
  events.js             |    5.35 |        0 |       0 |    5.45 | 19-268            
  parse.js              |    1.56 |        0 |       0 |    1.59 | 31-3275           
  telegram.js           |    6.81 |        0 |       0 |    7.14 | 19-148            
  utils.js              |   11.24 |    14.14 |    5.55 |   10.97 | 15-255,303-441    
------------------------|---------|----------|---------|---------|-------------------

##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='66']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='1287']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='14']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='725']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='1']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='76']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='65']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='1260']
##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

update config yml to install new dependencies for herald

update ecash-agora changelog

bytesofman added inline comments.
contrib/teamcity/build-configurations.yml
126 ↗(On Diff #50476)

we'll probably need this var for token-server soon

modules/ecash-agora/tsconfig.json
8 ↗(On Diff #50476)

I ran into this issue before trying to use ecash-agora in a nodejs typescript app

These compile settings don't let you import it. It works in Cashtab because of Cashtab's webpack settings.

So, we could isolate this change, but this diff is the first where we need it in the monorepo, and the CI here confirms it works as intended

emack requested changes to this revision.Mon, Oct 28, 12:39
emack added a subscriber: emack.
emack added inline comments.
apps/ecash-herald/src/parse.js
2444 ↗(On Diff #50476)

incomplete sentence?

2460–2490 ↗(On Diff #50476)

this block is near identical across list, buy, adprep and sell, with the only difference being the words 'list', 'buy', 'adprep' or 'sell'. Can save about 100 lines of code if you use eval to reference the action for both attribute and string.

This revision now requires changes to proceed.Mon, Oct 28, 12:39
bytesofman marked an inline comment as done.

clean up comments, make map updater portable for count-only actions

This revision is now accepted and ready to land.Tue, Oct 29, 12:26
This revision was automatically updated to reflect the committed changes.