> bch-api@2.0.0 test > npm run lint && npm run test-v5 > bch-api@2.0.0 lint > standard --env mocha --fix > bch-api@2.0.0 test-v5 > export NETWORK=mainnet && nyc --reporter=text mocha --exit --timeout 60000 test/v5/ Initializing minimal-slp-wallet routers with this interface: rest-api #Electrumx Testing type is: unit #root ✓ should respond to GET for base route #getBalance ✓ should throw 400 if address is empty ✓ should throw 400 on array input ✓ should throw an error for an invalid address ✓ should detect a network mismatch ✓ should pass errors from electrum-cash to user ✓ should get balance for a single address result: { "success": true, "balance": { "confirmed": 7000, "unconfirmed": 0 } } ✓ should get balance for a single eCash address #balanceBulk ✓ should throw 400 if addresses is empty ✓ should throw 400 if input provided is not array ✓ should throw 400 error if addresses array is too large ✓ should throw an error for an invalid address ✓ should detect a network mismatch ✓ should pass errors from electrum-cash to user ✓ should handle error ✓ should get balance for an array of addresses result: { "success": true, "balances": [ { "balance": { "confirmed": 7000, "unconfirmed": 0 }, "address": "bitcoincash:qp3sn6vlwz28ntmf3wmyra7jqttfx7z6zgtkygjhc7" }, { "balance": { "confirmed": 7000, "unconfirmed": 0 }, "address": "bitcoincash:qrdka2205f4hyukutc2g0s6lykperc8nsu5u2ddpqf" } ] } ✓ should get balance for an array of ecash addresses #getUtxos ✓ should throw 400 if address is empty ✓ should throw 400 on array input Error in elecrumx.js/getUtxos(). Error: Unsupported address format : 02v05l7qs5s24srqju498qu55dwuj0cx5ehjm2c at Address._decode (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/@psf/bch-js/src/address.js:303:11) at Address.toCashAddress (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/@psf/bch-js/src/address.js:116:26) at Electrum.getUtxos (/home/trout/bvt/bvt-bchjs/uut/bch-api/src/routes/v5/electrumx.js:97:252) at Context. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/a01-electrumx.js:444:43) at callFn (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:374:21) at Runnable.run (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:361:7) at Runner.runTest (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:619:10) at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:745:12 at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:536:14) at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:546:7 at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:448:14) at Immediate._onImmediate (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:514:5)  at process.processImmediate (node:internal/timers:483:21) { [stack]: 'Error: Unsupported address format : 02v05l7qs5s24srqju498qu55dwuj0cx5ehjm2c\n' + ' at Address._decode (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/@psf/bch-js/src/address.js:303:11)\n' + ' at Address.toCashAddress (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/@psf/bch-js/src/address.js:116:26)\n' + ' at Electrum.getUtxos (/home/trout/bvt/bvt-bchjs/uut/bch-api/src/routes/v5/electrumx.js:97:252)\n' + ' at Context. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/a01-electrumx.js:444:43)\n' + ' at callFn (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:374:21)\n' + ' at Runnable.run (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:361:7)\n' + ' at Runner.runTest (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:619:10)\n' + ' at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:745:12\n' + ' at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:536:14)\n' + ' at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:546:7\n' + ' at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:448:14)\n' + ' at Immediate._onImmediate (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:514:5)\n' + ' at process.processImmediate (node:internal/timers:483:21)', [message]: 'Unsupported address format : 02v05l7qs5s24srqju498qu55dwuj0cx5ehjm2c' } ✓ should throw an error for an invalid address ✓ should detect a network mismatch Error in elecrumx.js/getUtxos(). Error: Unsupported address format : bitcoincash:qr69kyzha07dcecrsvjwsj4s6slnlq4r8c30lxnur2 at Address._decode (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/@psf/bch-js/src/address.js:303:11) at Address.toCashAddress (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/@psf/bch-js/src/address.js:116:26) at Electrum.getUtxos (/home/trout/bvt/bvt-bchjs/uut/bch-api/src/routes/v5/electrumx.js:97:252) at Context. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/a01-electrumx.js:477:43) at callFn (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:374:21) at Runnable.run (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:361:7) at Runner.runTest (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:619:10) at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:745:12 at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:536:14) at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:546:7 at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:448:14) at Immediate._onImmediate (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:514:5)  at process.processImmediate (node:internal/timers:483:21) { [stack]: 'Error: Unsupported address format : bitcoincash:qr69kyzha07dcecrsvjwsj4s6slnlq4r8c30lxnur2\n' + ' at Address._decode (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/@psf/bch-js/src/address.js:303:11)\n' + ' at Address.toCashAddress (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/@psf/bch-js/src/address.js:116:26)\n' + ' at Electrum.getUtxos (/home/trout/bvt/bvt-bchjs/uut/bch-api/src/routes/v5/electrumx.js:97:252)\n' + ' at Context. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/a01-electrumx.js:477:43)\n' + ' at callFn (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:374:21)\n' + ' at Runnable.run (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:361:7)\n' + ' at Runner.runTest (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:619:10)\n' + ' at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:745:12\n' + ' at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:536:14)\n' + ' at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:546:7\n' + ' at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:448:14)\n' + ' at Immediate._onImmediate (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:514:5)\n' + ' at process.processImmediate (node:internal/timers:483:21)', [message]: 'Unsupported address format : bitcoincash:qr69kyzha07dcecrsvjwsj4s6slnlq4r8c30lxnur2' } ✓ should pass errors from electrum-cash to user ✓ should get utxos for a single address ✓ should get utxos for an ecash address #utxosBulk ✓ should throw 400 if addresses is empty ✓ should throw 400 if input provided is not array ✓ should throw 400 error if addresses array is too large ✓ should throw an error for an invalid address ✓ should detect a network mismatch ✓ should pass errors from electrum-cash to user ✓ should handle error ✓ should get utxos for an array of addresses ✓ should get utxos for an ecash address #getTransactionDetails ✓ should throw 400 if tx is empty ✓ should throw 400 on array input err: { response: { data: [Object] } } ✓ should pass errors from electrum-cash to user ✓ should get details for a single tx #transactionDetailsBulk ✓ should throw 400 if txids is empty ✓ should throw 400 if input provided is not array ✓ should throw 400 error if addresses array is too large ✓ should handle error ✓ should get details for an array of tx #broadcastTransaction ✓ should throw 400 if txHex is empty ✓ should throw 400 on invalid input type ✓ should pass errors from electrum-cash to user ✓ should broadcast transaction #getBlockHeaders ✓ should throw 400 if height is empty ✓ should throw 400 if height is not a number ✓ should throw 400 if height is negative ✓ should throw 400 if count is not a number ✓ should throw 400 if count is negative ✓ should pass errors from electrum-cash to user ✓ should handle error ✓ should get headers for a single block height with count 2 #blockHeadersBulk ✓ should throw 400 for an empty body result: { success: true, headers: [ [Object], [length]: 1 ] } ✓ should NOT throw 400 error for an invalid height ✓ should throw 400 error if heights array is too large ✓ should handle error ✓ should get block heights #getTransactions ✓ should throw 400 if address is empty ✓ should throw 400 on array input ✓ should throw an error for an invalid address ✓ should detect a network mismatch ✓ should pass errors from electrum-cash to user ✓ should get transaction for a single address #transactionsBulk ✓ should throw 400 if addresses is empty ✓ should throw 400 if input provided is not array ✓ should throw 400 error if addresses array is too large ✓ should throw an error for an invalid address ✓ should detect a network mismatch ✓ should pass errors from electrum-cash to user ✓ should handle error result: { "success": true, "transactions": [ { "transactions": [ { "height": 603416, "tx_hash": "eef683d236d88e978bd406419f144057af3fe1b62ef59162941c1a9f05ded62c" }, { "height": 646894, "tx_hash": "4c695fae636f3e8e2edc571d11756b880ccaae744390f3950d798ce7b5e25754" } ], "address": "bitcoincash:qp3sn6vlwz28ntmf3wmyra7jqttfx7z6zgtkygjhc7" }, { "transactions": [ { "height": 603416, "tx_hash": "eef683d236d88e978bd406419f144057af3fe1b62ef59162941c1a9f05ded62c" }, { "height": 646894, "tx_hash": "4c695fae636f3e8e2edc571d11756b880ccaae744390f3950d798ce7b5e25754" } ], "address": "bitcoincash:qp3sn6vlwz28ntmf3wmyra7jqttfx7z6zgtkygjhc7" } ] } ✓ should get transaction for an array of addresses #getMempool ✓ should throw 400 if address is empty ✓ should throw 400 on array input ✓ should throw an error for an invalid address ✓ should detect a network mismatch ✓ should pass errors from electrum-cash to user ✓ should get mempool for a single address #mempoolBulk ✓ should throw 400 if addresses is empty ✓ should throw 400 if input provided is not array ✓ should throw 400 error if addresses array is too large ✓ should throw an error for an invalid address ✓ should detect a network mismatch ✓ should pass errors from electrum-cash to user ✓ should handle error ✓ should get mempool for multiple addresses #bcash-slp Testing type is: unit #root ✓ should respond to GET for base route #getUtxos ✓ should return UTXOs for an address, hydrated with SLP info ✓ should handle error if address is array ✓ should throw error if address has invalid format ✓ should catch axios error #hydrateUTXOS ✓ should hydrate slp utxos Error: UTXOs must be an array of slp utxos at BcashSlp.hydrateUTXOS (/home/trout/bvt/bvt-bchjs/uut/bch-api/src/routes/v5/bcash/slp.js:31:184) at Context. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/bcash-slp.js:181:24) at callFn (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:374:21) at Runnable.run (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:361:7) at Runner.runTest (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:619:10) at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:745:12 at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:536:14) at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:546:7 at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:448:14) at Immediate._onImmediate (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:514:5)  at process.processImmediate (node:internal/timers:483:21) { [stack]: 'Error: UTXOs must be an array of slp utxos\n' + ' at BcashSlp.hydrateUTXOS (/home/trout/bvt/bvt-bchjs/uut/bch-api/src/routes/v5/bcash/slp.js:31:184)\n' + ' at Context. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/bcash-slp.js:181:24)\n' + ' at callFn (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:374:21)\n' + ' at Runnable.run (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:361:7)\n' + ' at Runner.runTest (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:619:10)\n' + ' at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:745:12\n' + ' at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:536:14)\n' + ' at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:546:7\n' + ' at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:448:14)\n' + ' at Immediate._onImmediate (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:514:5)\n' + ' at process.processImmediate (node:internal/timers:483:21)', [message]: 'UTXOs must be an array of slp utxos' } ✓ should throw error if utxos is not provided ✓ should handle error #getTokenInfo ✓ should return SLP info for an token id Error: tokenId must be string at BcashSlp.getTokenInfo (/home/trout/bvt/bvt-bchjs/uut/bch-api/src/routes/v5/bcash/slp.js:33:256) at Context. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/bcash-slp.js:216:24) at callFn (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:374:21) at Runnable.run (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:361:7) at Runner.runTest (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:619:10) at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:745:12 at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:536:14) at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:546:7 at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:448:14) at Immediate._onImmediate (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:514:5)  at process.processImmediate (node:internal/timers:483:21) { [stack]: 'Error: tokenId must be string\n' + ' at BcashSlp.getTokenInfo (/home/trout/bvt/bvt-bchjs/uut/bch-api/src/routes/v5/bcash/slp.js:33:256)\n' + ' at Context. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/bcash-slp.js:216:24)\n' + ' at callFn (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:374:21)\n' + ' at Runnable.run (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:361:7)\n' + ' at Runner.runTest (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:619:10)\n' + ' at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:745:12\n' + ' at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:536:14)\n' + ' at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:546:7\n' + ' at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:448:14)\n' + ' at Immediate._onImmediate (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:514:5)\n' + ' at process.processImmediate (node:internal/timers:483:21)', [message]: 'tokenId must be string' } ✓ should throw error if token id is not provided Error: test error at Context. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/bcash-slp.js:224:52) at callFn (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:374:21) at Runnable.run (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:361:7) at Runner.runTest (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:619:10) at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:745:12 at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:536:14) at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:546:7 at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:448:14) at Immediate._onImmediate (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:514:5)  at process.processImmediate (node:internal/timers:483:21) { [stack]: 'Error: test error\n' + ' at Context. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/bcash-slp.js:224:52)\n' + ' at callFn (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:374:21)\n' + ' at Runnable.run (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:361:7)\n' + ' at Runner.runTest (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:619:10)\n' + ' at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:745:12\n' + ' at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:536:14)\n' + ' at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:546:7\n' + ' at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:448:14)\n' + ' at Immediate._onImmediate (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:514:5)\n' + ' at process.processImmediate (node:internal/timers:483:21)', [message]: 'test error' } ✓ should catch axios error #errorHandler ✓ should handle unexpected errors #BlockchainRouter #root ✓ should respond to GET for base route getBestBlockHash() ✓ should throw 503 when network issues ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should GET /getBestBlockHash getBlockchainInfo() ✓ should throw 503 when network issues ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should GET /getBlockchainInfo getBlockCount() ✓ should throw 503 when network issues ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should GET /getBlockCount getBlockHeaderSingle() ✓ should throw 400 error if hash is missing ✓ should throw 503 when network issues ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should GET block header ✓ should GET verbose block header #getBlockHeaderBulk ✓ should throw an error for an empty body ✓ should error on non-array single hash ✓ should throw 400 error if addresses array is too large ✓ should throw a 400 error for an invalid hash ✓ should throw 500 when network issues ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should get concise block header for a single hash ✓ should get verbose block header for a single hash ✓ should get details for multiple block heights getChainTips() ✓ should throw 503 when network issues ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should GET /getChainTips getDifficulty() ✓ should throw 503 when network issues ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should GET /getDifficulty getMempoolInfo() ✓ should throw 503 when network issues ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should GET /getMempoolInfo getRawMempool() ✓ should throw 503 when network issues ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should GET /getRawMempool getMempoolEntrySingle() ✓ should throw 400 if txid is empty ✓ should throw 503 when network issues ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should GET /getMempoolEntry #getMempoolEntryBulk ✓ should throw an error for an empty body ✓ should error on non-array single txid ✓ should throw 400 error if addresses array is too large ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down getMempoolAncestorsSingle() ✓ should throw 400 if txid is empty ✓ should throw 503 when network issues ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should GET /getMempoolAncestorsSingle getTxOut() ✓ should throw 400 if txid is empty ✓ should throw 400 if n is empty ✓ should throw 503 when network issues ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should GET /getTxOut getTxOutPost() ✓ should throw 400 if txid is empty ✓ should throw 400 if n is empty ✓ should throw 503 when network issues ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should POST /getTxOut getTxOutProofSingle() ✓ should throw 400 if txid is empty ✓ should throw 503 when network issues ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should GET /getTxOutProof #getTxOutProofBulk ✓ should throw an error for an empty body ✓ should error on non-array single txid ✓ should throw 400 error if addresses array is too large ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should GET proof for single txid ✓ should GET proof for multiple txids verifyTxOutProofSingle() ✓ should throw 400 if proof is empty ✓ should throw 503 when network issues ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should GET /verifyTxOutProof #verifyTxOutProofBulk ✓ should throw an error for an empty body ✓ should error on non-array single txid ✓ should throw 400 error if addresses array is too large ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should get single proof ✓ should get multiple proofs #getBlock() ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should throw 400 if blockhash is empty ✓ should return block info with verbosity 0 ✓ should return block info with verbosity 1 ✓ should return block info with verbosity 2 ✓ should return block info without verbosity especified #ControlRouter #root ✓ should respond to GET for base route #GetNetworkInfo ✓ should throw 500 when network issues ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should get info on the full node #DSProof #root ✓ should respond to GET for base route #getDSProof ✓ should throw 400 error if txid is missing ✓ should throw 400 error if txid is invalid ✓ should throw 503 when network issues ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should GET double-spend proof #Encryption Router #root ✓ should respond to GET for base route #getPublicKey ✓ should get public key from blockchain ✓ should return false for address with no send history (40ms) #JWTRouter #root ✓ should respond to GET for base route #jwtInfo result: { error: 'jwt expired' } ✓ should decode the JWT token ✓ should return an error with malformed JWT token #Mining #root ✓ should respond to GET for base route #getMiningInfo ✓ should throw 503 when network issues ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should GET mining information #getNetworkHashPS ✓ should throw 503 when network issues ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should GET Network Hash per second #PriceRouter #root ✓ should respond to GET for base route #getUSD ✓ should throw 500 when network issues ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should get the USD price of BCH #getBCHRate ✓ should throw 500 when network issues ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should get several rates for BCH #errorHandler ✓ should handle unexpected errors #getBCHAUSD ✓ should throw 500 when network issues ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should get the USD price of BCH #getBCHUSD ✓ should throw 500 when network issues ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should get the USD price of BCH #PsfSlpIndexer #root ✓ should respond to GET for base route #getTokenStats ✓ should throw 400 error if tokenId is missing ✓ should throw 503 when network issues ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should GET tokens stats ✓ should GET tokens stats with tx hisroty #getTxid ✓ should throw 400 error if txid is missing ✓ should throw 400 error if txid is invalid format ✓ should throw 503 when network issues ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should GET tx data #getAddress ✓ should throw 400 error if address is missing ✓ should throw 400 error if address is invalid format ✓ should throw 400 error for invalid network address ✓ should throw 503 when network issues ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should GET address data ✓ should GET data for ecash address #getStatus ✓ should throw 503 when network issues ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should GET indexer status #errorHandler ✓ should handle unexpected errors ✓ should handle unknow errors #checkEnvVar ✓ should throw errors if SLP_INDEXER_API env var is not provided #getCIDData Error in getCIDData(): Error: cid must be a string. at PsfSlpIndexer.getCIDData (/home/trout/bvt/bvt-bchjs/uut/bch-api/src/routes/v5/psf-slp-indexer.js:163:249) at Context. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/psf-slp-indexer.js:565:19) at callFn (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:374:21) at Runnable.run (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:361:7) at Runner.runTest (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:619:10) at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:745:12 at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:536:14) at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:546:7 at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:448:14) at Immediate._onImmediate (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:514:5)  at process.processImmediate (node:internal/timers:483:21) { [stack]: 'Error: cid must be a string.\n' + ' at PsfSlpIndexer.getCIDData (/home/trout/bvt/bvt-bchjs/uut/bch-api/src/routes/v5/psf-slp-indexer.js:163:249)\n' + ' at Context. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/psf-slp-indexer.js:565:19)\n' + ' at callFn (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:374:21)\n' + ' at Runnable.run (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:361:7)\n' + ' at Runner.runTest (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:619:10)\n' + ' at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:745:12\n' + ' at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:536:14)\n' + ' at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:546:7\n' + ' at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:448:14)\n' + ' at Immediate._onImmediate (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:514:5)\n' + ' at process.processImmediate (node:internal/timers:483:21)', [message]: 'cid must be a string.' } ✓ should throw errors if cid is not provided dataUrl: https://gp3bfmj6woms7pywb7s7r6npcdudvsabvzne2chyspxtdendrwmy.ipfs.dweb.link/data.json Error in getCIDData(): Error: test error at Context. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/psf-slp-indexer.js:578:47) at callFn (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:374:21) at Runnable.run (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:361:7) at Runner.runTest (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:619:10) at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:745:12 at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:536:14) at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:546:7 at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:448:14) at Immediate._onImmediate (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:514:5)  at process.processImmediate (node:internal/timers:483:21) { [stack]: 'Error: test error\n' + ' at Context. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/psf-slp-indexer.js:578:47)\n' + ' at callFn (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:374:21)\n' + ' at Runnable.run (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:361:7)\n' + ' at Runner.runTest (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:619:10)\n' + ' at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:745:12\n' + ' at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:536:14)\n' + ' at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:546:7\n' + ' at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:448:14)\n' + ' at Immediate._onImmediate (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:514:5)\n' + ' at process.processImmediate (node:internal/timers:483:21)', [message]: 'test error' } ✓ should handle axios error dataUrl: https://gp3bfmj6woms7pywb7s7r6npcdudvsabvzne2chyspxtdendrwmy.ipfs.dweb.link/data.json ✓ should return cid object data #decodeOpReturn Error in decodeOpReturn(). ✓ should throw errors if txid is not provided Error in decodeOpReturn(). ✓ should handle bchjs error ✓ should return data ✓ should return false if data is not found #getTokenData ✓ should throw 400 error if tokenId is missing Error in getTokenData(): Error: getaddrinfo EAI_AGAIN fakeurl  at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:120:26) { [stack]: 'Error: getaddrinfo EAI_AGAIN fakeurl\n' + ' at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:120:26)', [message]: 'getaddrinfo EAI_AGAIN fakeurl', errno: -3001, code: 'EAI_AGAIN', syscall: 'getaddrinfo', hostname: 'fakeurl', config: { url: 'http://fakeurl/api/slp/token/', method: 'post', data: '{"tokenId":"a4fb5c2da1aa064e25018a43f9165040071d9e984ba190c222a7f59053af84b2","withTxHistory":false}', headers: [Object], transformRequest: [Array], transformResponse: [Array], timeout: 0, adapter: [Function], xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, validateStatus: [Function], transitional: [Object] }, request: Writable { _events: [Object], _writableState: [WritableState], _maxListeners: undefined, _options: [Object], _ended: false, _ending: true, _redirectCount: 0, _redirects: [Array], _requestBodyLength: 100, _requestBodyBuffers: [Array], _eventsCount: 2, _onNativeResponse: [Function], _currentRequest: [ClientRequest], _currentUrl: 'http://fakeurl/api/slp/token/', [Symbol(shapeMode)]: true, [Symbol(kCapture)]: false, [aborted]: [Getter], [connection]: [Getter], [socket]: [Getter], _writev: null, [closed]: [Getter], [destroyed]: [Getter/Setter], [writable]: [Getter/Setter], [writableFinished]: [Getter], [writableObjectMode]: [Getter], [writableBuffer]: [Getter], [writableEnded]: [Getter], [writableNeedDrain]: [Getter], [writableHighWaterMark]: [Getter], [writableCorked]: [Getter], [writableLength]: [Getter], [errored]: [Getter], [writableAborted]: [Getter] }, response: undefined, isAxiosError: true, toJSON: [Function: toJSON] { [length]: 0, [name]: 'toJSON', [prototype]: [Object] } } ✓ should throw 503 when network issues Error in getTokenData(): { code: 'ECONNABORTED' } ✓ returns proper error when downstream service stalls Error in getTokenData(): { code: 'ECONNREFUSED' } ✓ returns proper error when downstream service is down getTokenData() mutableData: { tokenIcon: 'https://gateway.ipfs.io/ipfs/bafybeiehitanirn5gmhqjg44xrmdtomn4n5lu5yjoepsvgpswk5mggaw6i/LP_logo-1.png', about: 'Mutable data managed with npm package: https://www.npmjs.com/package/slp-mutable-data' } result: { genesisData: { type: 1, ticker: 'TP03', name: 'Test Plugin 03', tokenId: '13cad617d523c8eb4ab11fff19c010e0e0a4ea4360b58e0c8c955a45a146a669', documentUri: 'fullstack.cash', documentHash: 'i\x04���3��s\x03�tz}�/��P�ǚ�Z>T��)��', decimals: 0, mintBatonIsActive: false, tokensInCirculationBN: '1', tokensInCirculationStr: '1', blockCreated: 722420, totalBurned: '0', totalMinted: '1', txs: [Array] }, immutableData: 'fullstack.cash', mutableData: { tokenIcon: 'https://gateway.ipfs.io/ipfs/bafybeiehitanirn5gmhqjg44xrmdtomn4n5lu5yjoepsvgpswk5mggaw6i/LP_logo-1.png', about: 'Mutable data managed with npm package: https://www.npmjs.com/package/slp-mutable-data' } } ✓ should GET token data getTokenData() mutableData: { tokenIcon: 'https://gateway.ipfs.io/ipfs/bafybeiehitanirn5gmhqjg44xrmdtomn4n5lu5yjoepsvgpswk5mggaw6i/LP_logo-1.png', about: 'Mutable data managed with npm package: https://www.npmjs.com/package/slp-mutable-data' } ✓ should GET tokens data if immutableData data not found ✓ should GET tokens data if mutable data not found #getMutableData Error in getMutableData(): Error: documentHash string required when calling mutableData(). at PsfSlpIndexer.getMutableData (/home/trout/bvt/bvt-bchjs/uut/bch-api/src/routes/v5/psf-slp-indexer.js:137:279) at Context. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/psf-slp-indexer.js:888:19) at callFn (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:374:21) at Runnable.run (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:361:7) at Runner.runTest (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:619:10) at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:745:12 at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:536:14) at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:546:7 at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:448:14) at Immediate._onImmediate (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:514:5)  at process.processImmediate (node:internal/timers:483:21) { [stack]: 'Error: documentHash string required when calling mutableData().\n' + ' at PsfSlpIndexer.getMutableData (/home/trout/bvt/bvt-bchjs/uut/bch-api/src/routes/v5/psf-slp-indexer.js:137:279)\n' + ' at Context. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/psf-slp-indexer.js:888:19)\n' + ' at callFn (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:374:21)\n' + ' at Runnable.run (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:361:7)\n' + ' at Runner.runTest (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:619:10)\n' + ' at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:745:12\n' + ' at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:536:14)\n' + ' at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:546:7\n' + ' at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:448:14)\n' + ' at Immediate._onImmediate (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:514:5)\n' + ' at process.processImmediate (node:internal/timers:483:21)', [message]: 'documentHash string required when calling mutableData().' } ✓ should throw errors if documentHash is not provided jsonData: {} Retrieving and decoding txid 0bd2a8a72108659cd39a59bde89c45fff7d51c334531f036b1e102ab4b62f33f obj: {} Retrieving and decoding txid 4f2837b7fff325c0442b550863de3470e016df234561d9151cbb6949fe43ac17 obj: {} Retrieving and decoding txid 1bfa83355839c0ef0f974463415fa983466e0286d7bcdfdd825f244e357ad1e5 obj: {} Retrieving and decoding txid 6eba09627175af4b50ac75fa8b3a15a9015df8a19b5b28a992f26044f4fd8891 obj: {} Retrieving and decoding txid c37ba29f40ecc61662ea56324fdb72a5f1e66add2078854c2144765b9030358a obj: {} Error in getMutableData(): Error: CID could not be found in OP_RETURN data at PsfSlpIndexer.getMutableData (/home/trout/bvt/bvt-bchjs/uut/bch-api/src/routes/v5/psf-slp-indexer.js:155:192) at async Context. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/psf-slp-indexer.js:906:9) { [stack]: 'Error: CID could not be found in OP_RETURN data\n' + ' at PsfSlpIndexer.getMutableData (/home/trout/bvt/bvt-bchjs/uut/bch-api/src/routes/v5/psf-slp-indexer.js:155:192)\n' + ' at async Context. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/psf-slp-indexer.js:906:9)', [message]: 'CID could not be found in OP_RETURN data' } ✓ should throw errors if cid is not provided in OP Return jsonData: { "mda": "bitcoincash:qrg77j4jf2pl7azgvzrz2z567ls464gkuuhplt30dp", "cid": "bafybeie6t5uyupddc7azms737xg4hxrj7i5t5ov3lb5g2qeehaujj6ak64" } Mutable Data Not found Error in getMutableData(): Error: CID could not be found in OP_RETURN data at PsfSlpIndexer.getMutableData (/home/trout/bvt/bvt-bchjs/uut/bch-api/src/routes/v5/psf-slp-indexer.js:155:192) at async Context. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/psf-slp-indexer.js:924:9) { [stack]: 'Error: CID could not be found in OP_RETURN data\n' + ' at PsfSlpIndexer.getMutableData (/home/trout/bvt/bvt-bchjs/uut/bch-api/src/routes/v5/psf-slp-indexer.js:155:192)\n' + ' at async Context. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/psf-slp-indexer.js:924:9)', [message]: 'CID could not be found in OP_RETURN data' } ✓ should throw errors if data is not found jsonData: { "mda": "bitcoincash:qrg77j4jf2pl7azgvzrz2z567ls464gkuuhplt30dp", "cid": "bafybeie6t5uyupddc7azms737xg4hxrj7i5t5ov3lb5g2qeehaujj6ak64" } Error in getMutableData(): Error: test error at Context. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/psf-slp-indexer.js:938:66) at callFn (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:374:21) at Runnable.run (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:361:7) at Runner.runTest (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:619:10) at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:745:12 at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:536:14) at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:546:7 at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:448:14) at Immediate. (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:514:5)  at process.processImmediate (node:internal/timers:483:21) { [stack]: 'Error: test error\n' + ' at Context. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/psf-slp-indexer.js:938:66)\n' + ' at callFn (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:374:21)\n' + ' at Runnable.run (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runnable.js:361:7)\n' + ' at Runner.runTest (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:619:10)\n' + ' at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:745:12\n' + ' at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:536:14)\n' + ' at /home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:546:7\n' + ' at next (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:448:14)\n' + ' at Immediate. (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/mocha/lib/runner.js:514:5)\n' + ' at process.processImmediate (node:internal/timers:483:21)', [message]: 'test error' } ✓ should handle bchjs error jsonData: { "mda": "bitcoincash:qrg77j4jf2pl7azgvzrz2z567ls464gkuuhplt30dp", "cid": "bafybeie6t5uyupddc7azms737xg4hxrj7i5t5ov3lb5g2qeehaujj6ak64" } Retrieving and decoding txid 0bd2a8a72108659cd39a59bde89c45fff7d51c334531f036b1e102ab4b62f33f obj: { "mda": "bitcoincash:qrg77j4jf2pl7azgvzrz2z567ls464gkuuhplt30dp", "cid": "bafybeie6t5uyupddc7azms737xg4hxrj7i5t5ov3lb5g2qeehaujj6ak64" } Data is not generated by MDA, skipping. Retrieving and decoding txid 4f2837b7fff325c0442b550863de3470e016df234561d9151cbb6949fe43ac17 obj: { "mda": "bitcoincash:qrg77j4jf2pl7azgvzrz2z567ls464gkuuhplt30dp", "cid": "bafybeie6t5uyupddc7azms737xg4hxrj7i5t5ov3lb5g2qeehaujj6ak64" } Data is not generated by MDA, skipping. Retrieving and decoding txid 1bfa83355839c0ef0f974463415fa983466e0286d7bcdfdd825f244e357ad1e5 obj: { "mda": "bitcoincash:qrg77j4jf2pl7azgvzrz2z567ls464gkuuhplt30dp", "cid": "bafybeie6t5uyupddc7azms737xg4hxrj7i5t5ov3lb5g2qeehaujj6ak64" } Data is not generated by MDA, skipping. Retrieving and decoding txid 6eba09627175af4b50ac75fa8b3a15a9015df8a19b5b28a992f26044f4fd8891 obj: { "mda": "bitcoincash:qrg77j4jf2pl7azgvzrz2z567ls464gkuuhplt30dp", "cid": "bafybeie6t5uyupddc7azms737xg4hxrj7i5t5ov3lb5g2qeehaujj6ak64" } Data is not generated by MDA, skipping. Retrieving and decoding txid c37ba29f40ecc61662ea56324fdb72a5f1e66add2078854c2144765b9030358a obj: { "mda": "bitcoincash:qrg77j4jf2pl7azgvzrz2z567ls464gkuuhplt30dp", "cid": "bafybeie6t5uyupddc7azms737xg4hxrj7i5t5ov3lb5g2qeehaujj6ak64" } Data is not generated by MDA, skipping. Mutable Data Not found Error in getMutableData(): Error: CID could not be found in OP_RETURN data at PsfSlpIndexer.getMutableData (/home/trout/bvt/bvt-bchjs/uut/bch-api/src/routes/v5/psf-slp-indexer.js:155:192) at async Context. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/psf-slp-indexer.js:961:9) { [stack]: 'Error: CID could not be found in OP_RETURN data\n' + ' at PsfSlpIndexer.getMutableData (/home/trout/bvt/bvt-bchjs/uut/bch-api/src/routes/v5/psf-slp-indexer.js:155:192)\n' + ' at async Context. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/psf-slp-indexer.js:961:9)', [message]: 'CID could not be found in OP_RETURN data' } ✓ should skip mutable data if was not generated by the MDA private key jsonData: { "mda": "bitcoincash:qrg77j4jf2pl7azgvzrz2z567ls464gkuuhplt30dp", "cid": "bafybeie6t5uyupddc7azms737xg4hxrj7i5t5ov3lb5g2qeehaujj6ak64" } Retrieving and decoding txid 0bd2a8a72108659cd39a59bde89c45fff7d51c334531f036b1e102ab4b62f33f Retrieving and decoding txid 4f2837b7fff325c0442b550863de3470e016df234561d9151cbb6949fe43ac17 obj: { "mda": "bitcoincash:qrg77j4jf2pl7azgvzrz2z567ls464gkuuhplt30dp", "cid": "bafybeie6t5uyupddc7azms737xg4hxrj7i5t5ov3lb5g2qeehaujj6ak64" } ✓ should return mutable data #getTokenData2 updateCache: undefined ✓ should get expanded token data #rate-routelimit #checkInternalIp ✓ should return true for a request from localhost ✓ should return true for a request from a Docker container ✓ should return false for a random ip address ✓ should return false when an error is encountered #isInWhitelist ✓ should return false when no argument is passed in ✓ should return false when origin is not in the whitelist ✓ should return true when origin is in the whitelist #decodeJwtToken ✓ should return the default JWT payload if decoding fails ✓ should return the default JWT payload if no input is given ✓ should correctly decode a JWT token ✓ should return the default payload if there is an unhandled error #trackRateLimits ✓ should apply anonymous rate limits if no JWT token is provided ✓ should apply 100 RPM rate limits when JWT token is provided #applyRateLimits External call, basic auth, skipping rate limits. ✓ should skip rate limits if basic auth token is used ✓ should skip rate limits if internal call passes basic auth token ✓ should apply rate limits to anonymous users ✓ should return 429 error when anonymous users exceed rate limit (47ms) ✓ should apply rate limits when JWT token is provided ✓ should apply internal rate limits to internal calls ✓ should return 429 error when internal calls exceed interal rate limit (1657ms) ✓ should apply JWT rate limits to internal calls when JWT passes through ✓ should return 429 error when internal calls using JWT pass-through exceeds rate limit (135ms) ✓ should move to the next middleware when encountering an unexpected internal error #Raw-Transactions #root ✓ should respond to GET for base route decodeRawTransactionSingle() ✓ should throw error if hex is missing ✓ should throw 503 when network issues ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should GET /decodeRawTransaction decodeRawTransactionBulk() ✓ should throw 400 error if hexes array is missing ✓ should throw 400 error if hexes array is too large ✓ should throw 400 error if hexes is empty ✓ should error on non-array single hex ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should decode an array with a single hex ✓ should decode an array with multiple hexes decodeScriptSingle() ✓ should throw error if hex is missing ✓ should throw 503 when network issues ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down result: { asm: '0 0 -57 OP_NOP6 OP_LSHIFT OP_UNKNOWN OP_UNKNOWN OP_UNKNOWN c486b2b3a3c03c79b5bade6ec9a77ced850515ab5e64edcc21010000006b483045022100a7b1b08956abb8d6f322aa OP_2OVER OP_NUMEQUALVERIFY OP_OR OP_INVERT OP_UNKNOWN OP_UNKNOWN 2ba0585f1a6f4f9983520af74a5a0220411aee4a9a54effab617b0508c504c31681b15f9b187179b4874257badd4139041210360cfc66fdacb650bc4c83b4e351805181ee696b7d5ab 67c57b2786f51c413dffffffff0210270000000000001976a914eb4b180def88e3f5625b2d8ae2c098ff7d85f66488ac786e9800000000001976a914eb4b180def88e3f5625b [error]', type: 'nonstandard', p2sh: 'bchtest:pzy6dwfy6yf373w0dr05a6flfqksurjhwcl3awhdvm' } ✓ should GET /decodeScriptSingle decodeScriptBulk() ✓ should throw 400 error if hexes array is missing ✓ should throw 400 error if hexes array is too large ✓ should throw 400 error if hexes is empty ✓ should error on non-array single hex ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should decode an array with a single hex ✓ should decode an array with a multiple hexes getRawTransactionBulk() ✓ should throw 400 error if txids array is missing ✓ should throw 400 error if txids array is too large ✓ should throw 400 error if txid is empty ✓ should throw 400 error if txid is invalid ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should get concise transaction data ✓ should get verbose transaction data getRawTransactionSingle() ✓ should throw 400 error if txid is missing ✓ should throw 400 error if txid is invalid ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should get concise transaction data ✓ should get verbose transaction data sendRawTransactionBulk() ✓ should throw 400 error if hexs array is missing ✓ should throw 400 error if hexs array is too large ✓ should throw 400 error if hex array element is empty ✓ should throw 400 error if hex is invalid ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should submit hex encoded transaction sendRawTransactionSingle() ✓ should throw an error for an empty hex ✓ should throw an error for a non-string ✓ should throw 500 when network issues ✓ should throw an error for invalid hex ✓ returns proper error when downstream service stalls ✓ returns proper error when downstream service is down ✓ should GET /sendRawTransaction/:hex #route-utils #decodeError decodeError: err: { error: '\r\n' + '429 Too Many Requests\r\n' + '\r\n' + '

429 Too Many Requests

\r\n' + '
nginx/1.18.0 (Ubuntu)
\r\n' + '\r\n' + '\r\n', level: 'error', message: 'Error in slp.js/hydrateUtxos().', timestamp: '2021-03-31T04:13:36.662Z' } ✓ should decode a 429 error from nginx #SLP #root ✓ should respond to GET for base route #validate2Single ✓ should throw 400 if txid is empty slp.js/errorHandler msg from decodeError: Network error: Could not communicate with full node or other external service. slp.js/errorHandler status from decodeError: 503 ✓ should cancel if validation takes too long #generateSendOpReturn() ✓ should throw 400 if tokenUtxos is missing ✓ should throw 400 if tokenUtxos is empty ✓ should throw 400 if tokenUtxos is not array ✓ should throw 400 if tokenUtxos is empty array ✓ should throw 400 if sendQty is missing ✓ should throw 400 if sendQty is empty ✓ should throw 400 if sendQty is not a number ✓ should return OP_RETURN script #Util #root ✓ should respond to GET for base route #validateAddressSingle ✓ should throw an error for an empty address ✓ should throw 503 when network issues ✓ should validate address #validateAddressBulk ✓ should throw an error for an empty body ✓ should error on non-array single address ✓ should throw 400 error if addresses array is too large ✓ should error on invalid address ✓ should error on mainnet address when using testnet ✓ should throw 503 when network issues ✓ should validate a single address ✓ should validate a multiple addresses #XPUBRouter #root ✓ should respond to GET for base route #FromXPubSingle ✓ should throw 400 if xpub is empty ✓ should error on an array ✓ should create an address from xpub (120ms) 402 passing (3s) ----------------------------------|---------|----------|---------|---------|------------------------ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------|---------|----------|---------|---------|------------------------ All files | 86.82 | 79.46 | 89.24 | 87.17 | config | 100 | 50 | 100 | 100 | index.js | 100 | 50 | 100 | 100 | 8-33 src/middleware | 87.59 | 78.57 | 75 | 89.34 | route-ratelimit.js | 87.59 | 78.57 | 75 | 89.34 | 181-191,221,444-473 src/routes/v5 | 82.12 | 77.23 | 85.29 | 82.16 | electrumx.js | 96.56 | 90.42 | 100 | 96.79 | ...0-951,962,1160-1167 encryption.js | 75 | 50 | 80 | 73.84 | ...109-110,132,185-187 jwt.js | 78.37 | 50 | 100 | 78.37 | 53-54,78-85 price.js | 90 | 100 | 87.5 | 90 | 209-219 psf-slp-indexer.js | 96.53 | 91.93 | 100 | 96.95 | 45,321,384-385,400-401 slp.js | 38.33 | 38.09 | 38.46 | 38.76 | ...308,336-456,522-533 util.js | 89.74 | 77.77 | 100 | 89.47 | 26,31,93-96,192-195 xpub.js | 79.41 | 70 | 100 | 79.41 | 62-72 src/routes/v5/bcash | 94.8 | 83.33 | 100 | 94.66 | slp.js | 94.8 | 83.33 | 100 | 94.66 | 61,150,186-187 src/routes/v5/full-node | 94.12 | 89.08 | 96.82 | 94.65 | blockchain.js | 92.56 | 87.23 | 93.54 | 92.89 | ...5,908-909,1004-1027 control.js | 93.54 | 50 | 100 | 93.54 | 45-46 dsproof.js | 92.68 | 80 | 100 | 95 | 37-38 mining.js | 91.48 | 50 | 100 | 95.55 | 44-45 rawtransactions.js | 97.42 | 98.38 | 100 | 97.32 | 56-57,315-316,617-618 src/routes/v5/minimal-slp-wallet | 22.22 | 0 | 0 | 22.22 | write-price.js | 22.22 | 0 | 0 | 22.22 | 12-25 src/util | 76.62 | 70.49 | 85.71 | 78.37 | route-utils.js | 74.62 | 71.92 | 100 | 76.56 | ...132,175-182,197-201 winston-logging.js | 90 | 50 | 0 | 90 | 40 ----------------------------------|---------|----------|---------|---------|------------------------