Page MenuHomePhabricator

[alias-server] Add endpoint to get alias info and availability from alias
ClosedPublic

Authored by bytesofman on Jun 27 2023, 16:39.

Details

Summary

T3060

Add new API endpoint to lookup registered alias txs by alias

Test Plan

npm test

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Needs some updating / rebase before ready for review

Adding isRegistered key to README

Tail of the build log:

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

22 vulnerabilities (5 low, 17 moderate)

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

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

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.

> alias-server@1.0.0 test
> mocha --reporter mocha-junit-reporter --reporter-options mochaFile=test_results/alias-server-junit.xml --reporter-options testsuitesTitle=Alias Server Unit Tests --reporter-options rootSuiteTitle=Alias Server

Connected successfully to MongoDB server
Initialized serverState on app startup
Configured connection to database ecashAliases
Connected successfully to MongoDB server
Initialized serverState on app startup
Configured connection to database ecashAliases
------------------------|---------|----------|---------|---------|----------------------------------
File                    | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                
------------------------|---------|----------|---------|---------|----------------------------------
All files               |   85.46 |    88.65 |    82.6 |    85.6 |                                  
 alias-server           |     100 |      100 |     100 |     100 |                                  
  config.js             |     100 |      100 |     100 |     100 |                                  
  secrets.sample.js     |     100 |      100 |     100 |     100 |                                  
 alias-server/constants |     100 |      100 |     100 |     100 |                                  
  alias.js              |     100 |      100 |     100 |     100 |                                  
  op_return.js          |     100 |      100 |     100 |     100 |                                  
 alias-server/src       |   85.31 |    88.65 |    82.6 |   85.45 |                                  
  alias.js              |   97.46 |    97.36 |     100 |   97.36 | 166,180                          
  app.js                |     100 |       80 |     100 |     100 | 34,67                            
  chronik.js            |   53.73 |    83.33 |   28.57 |   53.96 | ...6-102,113-118,126-127,151-196 
  chronikWsHandler.js   |   70.37 |       20 |   66.66 |   70.37 | 23,78-94                         
  db.js                 |   86.44 |    94.44 |     100 |   86.44 | 69-70,111-112,124-125,156-160    
  events.js             |   88.23 |    93.75 |     100 |      88 | 30-35,91-96,112,184              
  main.js               |    90.9 |     62.5 |     100 |    90.9 | 32                               
  rpc.js                |   93.75 |    83.33 |     100 |   93.75 | 36                               
  script.js             |     100 |      100 |     100 |     100 |                                  
  telegram.js           |      80 |      100 |      75 |      80 | 20                               
  utils.js              |     100 |      100 |     100 |     100 |                                  
------------------------|---------|----------|---------|---------|----------------------------------

##teamcity[blockOpened name='Code Coverage Summary']
##teamcity[buildStatisticValue key='CodeCoverageAbsBCovered' value='341']
##teamcity[buildStatisticValue key='CodeCoverageAbsBTotal' value='399']
##teamcity[buildStatisticValue key='CodeCoverageAbsRCovered' value='125']
##teamcity[buildStatisticValue key='CodeCoverageAbsRTotal' value='141']
##teamcity[buildStatisticValue key='CodeCoverageAbsMCovered' value='38']
##teamcity[buildStatisticValue key='CodeCoverageAbsMTotal' value='46']
##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='333']
##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='389']
##teamcity[blockClosed name='Code Coverage Summary']
Build alias-server-tests failed with exit code 1
Fabien added inline comments.
apps/alias-server/README.md
28 ↗(On Diff #41035)

But this one is not valid right ? The fees are too low

apps/alias-server/src/app.js
69 ↗(On Diff #41035)

You should always have this message, then maybe the err.message if it exists.

Remove specifics of invalid alias from README, improve error object at endpoint

This revision is now accepted and ready to land.Jun 28 2023, 17:03