> 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: integration #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 1) should get balance for a single address 2) 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 3) should get balance for an array of 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 result: { "success": false, "error": "\r\n502 Bad Gateway\r\n\r\n

502 Bad Gateway

\r\n
nginx/1.18.0 (Ubuntu)
\r\n\r\n\r\n" } 4) should get utxos for a single 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 5) should get utxos for an array of addresses #getTransactionDetails ✓ should throw 400 if tx is empty ✓ should throw 400 on array input Error in elecrumx.js/getUtxos(). Error: Request failed with status code 502 at createError (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/axios/lib/core/createError.js:16:15) at settle (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/axios/lib/core/settle.js:17:12) at IncomingMessage.handleStreamEnd (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/axios/lib/adapters/http.js:269:11)  at IncomingMessage.emit (node:events:531:35)  at endReadableNT (node:internal/streams/readable:1696:12)  at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { [stack]: 'Error: Request failed with status code 502\n' + ' at createError (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/axios/lib/core/createError.js:16:15)\n' + ' at settle (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/axios/lib/core/settle.js:17:12)\n' + ' at IncomingMessage.handleStreamEnd (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/axios/lib/adapters/http.js:269:11)\n' + ' at IncomingMessage.emit (node:events:531:35)\n' + ' at endReadableNT (node:internal/streams/readable:1696:12)\n' + ' at process.processTicksAndRejections (node:internal/process/task_queues:82:21)', [message]: 'Request failed with status code 502', config: { url: 'http://fulcrum-api.fullstackbch.nl/v1/electrumx/utxos/bitcoincash:qp3sn6vlwz28ntmf3wmyra7jqttfx7z6zgtkygjhc7', method: 'get', 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], data: undefined }, request: ClientRequest { _events: [Object: null prototype], _eventsCount: 7, _maxListeners: undefined, outputData: [Array], outputSize: 0, writable: true, destroyed: true, _last: true, chunkedEncoding: false, shouldKeepAlive: true, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: true, socket: [Socket], _header: 'GET /v1/electrumx/utxos/bitcoincash:qp3sn6vlwz28ntmf3wmyra7jqttfx7z6zgtkygjhc7 HTTP/1.1\r\n' + 'Accept: application/json, text/plain, */*\r\n' + 'User-Agent: axios/0.21.4\r\n' + 'Host: fulcrum-api.fullstackbch.nl\r\n' + 'Connection: keep-alive\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function], agent: [Agent], socketPath: undefined, method: 'GET', maxHeaderSize: undefined, insecureHTTPParser: undefined, joinDuplicateHeaders: undefined, path: '/v1/electrumx/utxos/bitcoincash:qp3sn6vlwz28ntmf3wmyra7jqttfx7z6zgtkygjhc7', _ended: true, res: [IncomingMessage], aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, host: 'fulcrum-api.fullstackbch.nl', protocol: 'http:', _redirectable: [Writable], [Symbol(shapeMode)]: false, [Symbol(kCapture)]: false, [Symbol(kBytesWritten)]: 0, [Symbol(kNeedDrain)]: false, [Symbol(corked)]: 0, [Symbol(kOutHeaders)]: [Object: null prototype], [Symbol(errored)]: null, [Symbol(kHighWaterMark)]: 16384, [Symbol(kRejectNonStandardBodyWrites)]: false, [Symbol(kUniqueHeaders)]: null, [errored]: [Getter], [closed]: [Getter], [writableFinished]: [Getter], [writableObjectMode]: [Getter], [writableLength]: [Getter], [writableHighWaterMark]: [Getter], [writableCorked]: [Getter], [_headers]: [Getter/Setter], [connection]: [Getter/Setter], [_headerNames]: [Getter/Setter], headersSent: [Getter], [writableEnded]: [Getter], [writableNeedDrain]: [Getter] }, response: { status: 502, statusText: 'Bad Gateway', headers: [Object], config: [Object], request: [ClientRequest], data: '\r\n' + '502 Bad Gateway\r\n' + '\r\n' + '

502 Bad Gateway

\r\n' + '
nginx/1.18.0 (Ubuntu)
\r\n' + '\r\n' + '\r\n' }, isAxiosError: true, toJSON: [Function: toJSON] { [length]: 0, [name]: 'toJSON', [prototype]: [Object] } } 6) should pass errors from electrum-cash to user 7) 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 err: Error: Request failed with status code 502 at createError (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/axios/lib/core/createError.js:16:15) at settle (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/axios/lib/core/settle.js:17:12) at IncomingMessage.handleStreamEnd (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/axios/lib/adapters/http.js:269:11)  at IncomingMessage.emit (node:events:531:35)  at endReadableNT (node:internal/streams/readable:1696:12)  at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { [stack]: 'Error: Request failed with status code 502\n' + ' at createError (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/axios/lib/core/createError.js:16:15)\n' + ' at settle (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/axios/lib/core/settle.js:17:12)\n' + ' at IncomingMessage.handleStreamEnd (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/axios/lib/adapters/http.js:269:11)\n' + ' at IncomingMessage.emit (node:events:531:35)\n' + ' at endReadableNT (node:internal/streams/readable:1696:12)\n' + ' at process.processTicksAndRejections (node:internal/process/task_queues:82:21)', [message]: 'Request failed with status code 502', config: { url: 'http://fulcrum-api.fullstackbch.nl/v1/electrumx/tx/data/02v05l7qs5s24srqju498qu55dwuj0cx5ehjm2c', method: 'get', 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], data: undefined }, request: ClientRequest { _events: [Object: null prototype], _eventsCount: 7, _maxListeners: undefined, outputData: [Array], outputSize: 0, writable: true, destroyed: true, _last: true, chunkedEncoding: false, shouldKeepAlive: true, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: true, socket: [Socket], _header: 'GET /v1/electrumx/tx/data/02v05l7qs5s24srqju498qu55dwuj0cx5ehjm2c HTTP/1.1\r\n' + 'Accept: application/json, text/plain, */*\r\n' + 'User-Agent: axios/0.21.4\r\n' + 'Host: fulcrum-api.fullstackbch.nl\r\n' + 'Connection: keep-alive\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function], agent: [Agent], socketPath: undefined, method: 'GET', maxHeaderSize: undefined, insecureHTTPParser: undefined, joinDuplicateHeaders: undefined, path: '/v1/electrumx/tx/data/02v05l7qs5s24srqju498qu55dwuj0cx5ehjm2c', _ended: true, res: [IncomingMessage], aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, host: 'fulcrum-api.fullstackbch.nl', protocol: 'http:', _redirectable: [Writable], [Symbol(shapeMode)]: false, [Symbol(kCapture)]: false, [Symbol(kBytesWritten)]: 0, [Symbol(kNeedDrain)]: false, [Symbol(corked)]: 0, [Symbol(kOutHeaders)]: [Object: null prototype], [Symbol(errored)]: null, [Symbol(kHighWaterMark)]: 16384, [Symbol(kRejectNonStandardBodyWrites)]: false, [Symbol(kUniqueHeaders)]: null, [errored]: [Getter], [closed]: [Getter], [writableFinished]: [Getter], [writableObjectMode]: [Getter], [writableLength]: [Getter], [writableHighWaterMark]: [Getter], [writableCorked]: [Getter], [_headers]: [Getter/Setter], [connection]: [Getter/Setter], [_headerNames]: [Getter/Setter], headersSent: [Getter], [writableEnded]: [Getter], [writableNeedDrain]: [Getter] }, response: { status: 502, statusText: 'Bad Gateway', headers: [Object], config: [Object], request: [ClientRequest], data: '\r\n' + '502 Bad Gateway\r\n' + '\r\n' + '

502 Bad Gateway

\r\n' + '
nginx/1.18.0 (Ubuntu)
\r\n' + '\r\n' + '\r\n' }, isAxiosError: true, toJSON: [Function: toJSON] { [length]: 0, [name]: 'toJSON', [prototype]: [Object] } } 8) should get details for an array of tx #broadcastTransaction ✓ should throw 400 if txHex is empty ✓ should throw 400 on invalid input type err: Error: Request failed with status code 502 at createError (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/axios/lib/core/createError.js:16:15) at settle (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/axios/lib/core/settle.js:17:12) at IncomingMessage.handleStreamEnd (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/axios/lib/adapters/http.js:269:11)  at IncomingMessage.emit (node:events:531:35)  at endReadableNT (node:internal/streams/readable:1696:12)  at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { [stack]: 'Error: Request failed with status code 502\n' + ' at createError (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/axios/lib/core/createError.js:16:15)\n' + ' at settle (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/axios/lib/core/settle.js:17:12)\n' + ' at IncomingMessage.handleStreamEnd (/home/trout/bvt/bvt-bchjs/uut/bch-api/node_modules/axios/lib/adapters/http.js:269:11)\n' + ' at IncomingMessage.emit (node:events:531:35)\n' + ' at endReadableNT (node:internal/streams/readable:1696:12)\n' + ' at process.processTicksAndRejections (node:internal/process/task_queues:82:21)', [message]: 'Request failed with status code 502', config: { url: 'http://fulcrum-api.fullstackbch.nl/v1/electrumx/tx/data/a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d', method: 'get', 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], data: undefined }, request: ClientRequest { _events: [Object: null prototype], _eventsCount: 7, _maxListeners: undefined, outputData: [Array], outputSize: 0, writable: true, destroyed: true, _last: true, chunkedEncoding: false, shouldKeepAlive: true, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, strictContentLength: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: true, socket: [Socket], _header: 'GET /v1/electrumx/tx/data/a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d HTTP/1.1\r\n' + 'Accept: application/json, text/plain, */*\r\n' + 'User-Agent: axios/0.21.4\r\n' + 'Host: fulcrum-api.fullstackbch.nl\r\n' + 'Connection: keep-alive\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function], agent: [Agent], socketPath: undefined, method: 'GET', maxHeaderSize: undefined, insecureHTTPParser: undefined, joinDuplicateHeaders: undefined, path: '/v1/electrumx/tx/data/a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d', _ended: true, res: [IncomingMessage], aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, host: 'fulcrum-api.fullstackbch.nl', protocol: 'http:', _redirectable: [Writable], [Symbol(shapeMode)]: false, [Symbol(kCapture)]: false, [Symbol(kBytesWritten)]: 0, [Symbol(kNeedDrain)]: false, [Symbol(corked)]: 0, [Symbol(kOutHeaders)]: [Object: null prototype], [Symbol(errored)]: null, [Symbol(kHighWaterMark)]: 16384, [Symbol(kRejectNonStandardBodyWrites)]: false, [Symbol(kUniqueHeaders)]: null, [errored]: [Getter], [closed]: [Getter], [writableFinished]: [Getter], [writableObjectMode]: [Getter], [writableLength]: [Getter], [writableHighWaterMark]: [Getter], [writableCorked]: [Getter], [_headers]: [Getter/Setter], [connection]: [Getter/Setter], [_headerNames]: [Getter/Setter], headersSent: [Getter], [writableEnded]: [Getter], [writableNeedDrain]: [Getter] }, response: { status: 502, statusText: 'Bad Gateway', headers: [Object], config: [Object], request: [ClientRequest], data: '\r\n' + '502 Bad Gateway\r\n' + '\r\n' + '

502 Bad Gateway

\r\n' + '
nginx/1.18.0 (Ubuntu)
\r\n' + '\r\n' + '\r\n' }, isAxiosError: true, toJSON: [Function: toJSON] { [length]: 0, [name]: 'toJSON', [prototype]: [Object] } } 9) 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 10) should pass errors from electrum-cash to user ✓ should handle error 11) should get headers for a single block height with count 2 #blockHeadersBulk ✓ should throw 400 for an empty body 12) should NOT throw 400 error for an invalid height ✓ should throw 400 error if heights array is too large ✓ should handle error 13) 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 result: { success: false, error: '\r\n' + '502 Bad Gateway\r\n' + '\r\n' + '

502 Bad Gateway

\r\n' + '
nginx/1.18.0 (Ubuntu)
\r\n' + '\r\n' + '\r\n' } 14) 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 15) 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 16) 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 result: { "success": false, "error": "\r\n502 Bad Gateway\r\n\r\n

502 Bad Gateway

\r\n
nginx/1.18.0 (Ubuntu)
\r\n\r\n\r\n" } 17) should get mempool for multiple addresses #bcash-slp Testing type is: integration #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 (266ms) 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 ✓ should retrieve single mempool entry ✓ should retrieve multiple mempool entries 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 (346ms) #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 (359ms) ✓ should GET proof for multiple txids (630ms) 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 (91ms) ✓ 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 (3181ms) ✓ should return false for address with no send history (3098ms) #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 (98ms) #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 (40ms) #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 (256ms) #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 (239ms) #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 - should GET token data jsonData: { "mda": "bitcoincash:qpxf0hdk6yv6kjvv8dnnqxhr7uckcn7tvc0y6j32sp" } Retrieving and decoding txid eabc577544c1daaa40cb43c927ca4add6200c31c36be682bdf372980a5db6067 obj: { "cid": "ipfs://bafybeihg4yyoqfcu4i7t6hpouwbulfzyrfxi2rd5oygtd6clvbkp2s7abi", "ts": 1670180735931 } getTokenData() mutableData: ipfs://bafybeihg4yyoqfcu4i7t6hpouwbulfzyrfxi2rd5oygtd6clvbkp2s7abi result: { genesisData: { type: 65, ticker: 'PSFG', name: 'PSF Governance', tokenId: '5f31905f335fa932879c5aabfd1c14ac748f6696148bd300f845ea5016ad573e', documentUri: 'ipfs://bafybeibpc7yblwf3lobuxwru74rc447pqagmsgxs7lcdi4exq56xmijz6y', documentHash: '908e0ea3e255cc0aee8d517b41bcd79c574d9dad310dec87c34c3520b9ef000a', decimals: 0, mintBatonIsActive: false, tokensInCirculationBN: '1', tokensInCirculationStr: '1', blockCreated: 769548, totalBurned: '0', totalMinted: '1', parentGroupId: '5c8cb997cce61426b7149a74a3997443ec7eb738c5c246d9cfe70185a6911476' }, immutableData: 'ipfs://bafybeibpc7yblwf3lobuxwru74rc447pqagmsgxs7lcdi4exq56xmijz6y', mutableData: 'ipfs://bafybeihg4yyoqfcu4i7t6hpouwbulfzyrfxi2rd5oygtd6clvbkp2s7abi' } ✓ should get token data for problematic token (3238ms) - should GET tokens data if immutableData data not found - should GET tokens data if mutable data not found jsonData: { "mda": "bitcoincash:qrd60ncrw834crh3p6z83k89ed0ns6v9hs8xmwsvdv" } Retrieving and decoding txid a1f16f24e572205a988a376480302200f8cec2bb22aba8088bfdc641fcd79c9d obj: { "cid": "ipfs://bafybeiajjdndwtvlw6xxlk5vldxo4wsabc6x4xg73vqegytltch2ryhsna" } getTokenData() mutableData: ipfs://bafybeiajjdndwtvlw6xxlk5vldxo4wsabc6x4xg73vqegytltch2ryhsna result: { "genesisData": { "type": 1, "ticker": "Payload 1", "name": "Payload 1", "tokenId": "43eddfb11c9941edffb8c8815574bb0a43969a7b1de39ad14cd043eaa24fd38d", "documentUri": "ipfs://bafybeicp4n4jxm6z6yuftlqvkrgxj3elzctnjn2ufmwz7ivijfowleg6j4", "documentHash": "99b9f3833309f08fa262aa7ce796aed5e610a4c0c0329794ea1a86cc6a343624", "decimals": 0, "mintBatonIsActive": false, "tokensInCirculationBN": "1", "tokensInCirculationStr": "1", "blockCreated": 748446, "totalBurned": "0", "totalMinted": "1", "txs": [ { "txid": "43eddfb11c9941edffb8c8815574bb0a43969a7b1de39ad14cd043eaa24fd38d", "height": 748446, "type": "GENESIS", "qty": "1" } ] }, "immutableData": "ipfs://bafybeicp4n4jxm6z6yuftlqvkrgxj3elzctnjn2ufmwz7ivijfowleg6j4", "mutableData": "ipfs://bafybeiajjdndwtvlw6xxlk5vldxo4wsabc6x4xg73vqegytltch2ryhsna" } ✓ should GET token data with transaction history (3227ms) #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 (60ms) ✓ 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 (1682ms) ✓ 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 (142ms) ✓ 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_OUTPOINTTXHASH OP_UNKNOWN 2ba0585f1a6f4f9983520af74a5a0220411aee4a9a54effab617b0508c504c31681b15f9b187179b4874257badd4139041210360cfc66fdacb650bc4c83b4e351805181ee696b7d5ab 67c57b2786f51c413dffffffff0210270000000000001976a914eb4b180def88e3f5625b2d8ae2c098ff7d85f66488ac786e9800000000001976a914eb4b180def88e3f5625b [error]', type: 'nonstandard', p2sh: 'bitcoincash:pzy6dwfy6yf373w0dr05a6flfqksurjhwcmref46t8', p2sh_32: 'bitcoincash:pwywjz77v99gn6d8sncv46uscggpd65v8jhwrv838f229qnayve2xffvqzf02' } ✓ 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 #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 (107ms) 374 passing (17m) 11 pending 17 failing 1) #Electrumx #getBalance should get balance for a single address: Error: Timeout of 60000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/a01-electrumx.js) at listOnTimeout (node:internal/timers:581:17) at process.processTimers (node:internal/timers:519:7) 2) #Electrumx #getBalance should get balance for a single eCash address: Error: Timeout of 60000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/a01-electrumx.js) at listOnTimeout (node:internal/timers:581:17) at process.processTimers (node:internal/timers:519:7) 3) #Electrumx #balanceBulk should get balance for an array of addresses: Error: Timeout of 60000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/a01-electrumx.js) at listOnTimeout (node:internal/timers:581:17) at process.processTimers (node:internal/timers:519:7) 4) #Electrumx #getUtxos should get utxos for a single address: Error: Timeout of 60000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/a01-electrumx.js) at listOnTimeout (node:internal/timers:581:17) at process.processTimers (node:internal/timers:519:7) 5) #Electrumx #utxosBulk should get utxos for an array of addresses: Error: Timeout of 60000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/a01-electrumx.js) at listOnTimeout (node:internal/timers:581:17) at process.processTimers (node:internal/timers:519:7) 6) #Electrumx #getTransactionDetails should pass errors from electrum-cash to user: Error: Timeout of 60000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/a01-electrumx.js) at listOnTimeout (node:internal/timers:581:17) at process.processTimers (node:internal/timers:519:7) 7) #Electrumx #getTransactionDetails should get details for a single tx: Error: Timeout of 60000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/a01-electrumx.js) at listOnTimeout (node:internal/timers:581:17) at process.processTimers (node:internal/timers:519:7) 8) #Electrumx #transactionDetailsBulk should get details for an array of tx: Error: Timeout of 60000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/a01-electrumx.js) at listOnTimeout (node:internal/timers:581:17) at process.processTimers (node:internal/timers:519:7) 9) #Electrumx #broadcastTransaction should pass errors from electrum-cash to user: Error: Timeout of 60000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/a01-electrumx.js) at listOnTimeout (node:internal/timers:581:17) at process.processTimers (node:internal/timers:519:7) 10) #Electrumx #getBlockHeaders should pass errors from electrum-cash to user: Error: Timeout of 60000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/a01-electrumx.js) at listOnTimeout (node:internal/timers:581:17) at process.processTimers (node:internal/timers:519:7) 11) #Electrumx #getBlockHeaders should get headers for a single block height with count 2: Error: Timeout of 60000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/a01-electrumx.js) at listOnTimeout (node:internal/timers:581:17) at process.processTimers (node:internal/timers:519:7) 12) #Electrumx #blockHeadersBulk should NOT throw 400 error for an invalid height: Error: Timeout of 60000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/a01-electrumx.js) at listOnTimeout (node:internal/timers:581:17) at process.processTimers (node:internal/timers:519:7) 13) #Electrumx #blockHeadersBulk should get block heights: Error: Timeout of 60000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/a01-electrumx.js) at listOnTimeout (node:internal/timers:581:17) at process.processTimers (node:internal/timers:519:7) 14) #Electrumx #getTransactions should get transaction for a single address: Error: Timeout of 60000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/a01-electrumx.js) at listOnTimeout (node:internal/timers:581:17) at process.processTimers (node:internal/timers:519:7) 15) #Electrumx #transactionsBulk should get transaction for an array of addresses: Error: Timeout of 60000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/a01-electrumx.js) at listOnTimeout (node:internal/timers:581:17) at process.processTimers (node:internal/timers:519:7) 16) #Electrumx #getMempool should get mempool for a single address: Error: Timeout of 60000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/a01-electrumx.js) at listOnTimeout (node:internal/timers:581:17) at process.processTimers (node:internal/timers:519:7) 17) #Electrumx #mempoolBulk should get mempool for multiple addresses: Error: Timeout of 60000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/trout/bvt/bvt-bchjs/uut/bch-api/test/v5/a01-electrumx.js) at listOnTimeout (node:internal/timers:581:17) at process.processTimers (node:internal/timers:519:7) ----------------------------------|---------|----------|---------|---------|------------------------ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s ----------------------------------|---------|----------|---------|---------|------------------------ All files | 83.19 | 78.03 | 88.6 | 83.6 | 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 | 75.48 | 73.17 | 83.82 | 75.7 | electrumx.js | 82.81 | 84.04 | 100 | 83.65 | ...1138-1139,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 | 92.07 | 90.32 | 100 | 92.38 | ...330,384-385,400-401 slp.js | 31.66 | 30.95 | 30.76 | 32.02 | ...253,281-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 | 93 | 89.08 | 96.82 | 93.49 | blockchain.js | 92.28 | 87.23 | 93.54 | 92.61 | ...4,907-908,1003-1026 control.js | 93.54 | 50 | 100 | 93.54 | 45-46 dsproof.js | 90.24 | 80 | 100 | 92.5 | 37-38,86 mining.js | 91.48 | 50 | 100 | 95.55 | 44-45 rawtransactions.js | 94.84 | 98.38 | 100 | 94.64 | ...533,584-587,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 | 77.92 | 73.77 | 85.71 | 79.72 | route-utils.js | 76.11 | 75.43 | 100 | 78.12 | ...132,175-182,197-201 winston-logging.js | 90 | 50 | 0 | 90 | 40 ----------------------------------|---------|----------|---------|---------|------------------------