mirror of
https://github.com/fullstack-cash/bch-api.git
synced 2026-09-21 16:52:04 -07:00
fix(linting): Updating linting dependencies and fixing linting issues
This commit is contained in:
Generated
+10763
-11619
File diff suppressed because it is too large
Load Diff
+7
-7
@@ -62,19 +62,19 @@
|
||||
"bignumber.js": "^9.0.0",
|
||||
"chai": "^4.1.2",
|
||||
"coveralls": "^3.0.2",
|
||||
"eslint": "5.16.0",
|
||||
"eslint-config-prettier": "^6.0.0",
|
||||
"eslint-config-standard": "^13.0.1",
|
||||
"eslint-plugin-prettier": "^3.1.0",
|
||||
"eslint-plugin-standard": "^4.0.0",
|
||||
"eslint": "7.17.0",
|
||||
"eslint-config-prettier": "7.1.0",
|
||||
"eslint-config-standard": "16.0.2",
|
||||
"eslint-plugin-node": "11.1.0",
|
||||
"eslint-plugin-prettier": "3.3.1",
|
||||
"eslint-plugin-standard": "4.0.0",
|
||||
"fs-extra": "^9.0.0",
|
||||
"lodash.clonedeep": "^4.5.0",
|
||||
"nock": "^13.0.5",
|
||||
"nyc": "^15.0.0",
|
||||
"prettier": "^2.0.0",
|
||||
"semantic-release": "^17.4.2",
|
||||
"sinon": "^9.0.0",
|
||||
"standard": "^14.3.1"
|
||||
"standard": "^16.0.4"
|
||||
},
|
||||
"release": {
|
||||
"publish": [
|
||||
|
||||
+3
-3
@@ -100,7 +100,7 @@ app.set('views', path.join(__dirname, 'views'))
|
||||
app.set('view engine', 'jade')
|
||||
|
||||
// Mount the docs
|
||||
app.use('/docs', express.static(`${__dirname}/../docs`))
|
||||
app.use('/docs', express.static(`${__dirname.toString()}/../docs`))
|
||||
|
||||
// Log each request to the console with IP addresses.
|
||||
// app.use(logger("dev"))
|
||||
@@ -285,11 +285,11 @@ function onError (error) {
|
||||
case 'EACCES':
|
||||
console.error(`${bind} requires elevated privileges`)
|
||||
process.exit(1)
|
||||
// break
|
||||
break
|
||||
case 'EADDRINUSE':
|
||||
console.error(`${bind} is already in use`)
|
||||
process.exit(1)
|
||||
// break
|
||||
break
|
||||
default:
|
||||
throw error
|
||||
}
|
||||
|
||||
@@ -105,8 +105,8 @@ class Slpdb {
|
||||
const username = 'BITBOX'
|
||||
const password = SLPDB_PASS
|
||||
const combined = `${username}:${password}`
|
||||
var base64Credential = Buffer.from(combined).toString('base64')
|
||||
var readyCredential = `Basic ${base64Credential}`
|
||||
const base64Credential = Buffer.from(combined).toString('base64')
|
||||
const readyCredential = `Basic ${base64Credential}`
|
||||
|
||||
const options = {
|
||||
headers: {
|
||||
|
||||
+10
-14
@@ -79,10 +79,7 @@ class Slp {
|
||||
_this.router.post('/list', _this.listBulkToken)
|
||||
_this.router.get('/balancesForAddress/:address', _this.balancesForAddress)
|
||||
_this.router.post('/balancesForAddress', _this.balancesForAddressBulk)
|
||||
_this.router.get(
|
||||
'/balancesForToken/:tokenId',
|
||||
_this.balancesForTokenSingle
|
||||
)
|
||||
_this.router.get('/balancesForToken/:tokenId', _this.balancesForTokenSingle)
|
||||
_this.router.get('/convert/:address', _this.convertAddressSingle)
|
||||
_this.router.post('/convert', _this.convertAddressBulk)
|
||||
_this.router.post('/validateTxid', _this.validateBulk)
|
||||
@@ -421,9 +418,8 @@ class Slp {
|
||||
},
|
||||
{
|
||||
$match: {
|
||||
'graphTxn.outputs.address': _this.bchjs.SLP.Address.toSLPAddress(
|
||||
address
|
||||
),
|
||||
'graphTxn.outputs.address':
|
||||
_this.bchjs.SLP.Address.toSLPAddress(address),
|
||||
'graphTxn.outputs.status': 'UNSPENT',
|
||||
'graphTxn.outputs.slpAmount': { $gte: 0 }
|
||||
}
|
||||
@@ -634,9 +630,8 @@ class Slp {
|
||||
},
|
||||
{
|
||||
$match: {
|
||||
'graphTxn.outputs.address': _this.bchjs.SLP.Address.toSLPAddress(
|
||||
address
|
||||
),
|
||||
'graphTxn.outputs.address':
|
||||
_this.bchjs.SLP.Address.toSLPAddress(address),
|
||||
'graphTxn.outputs.status': 'UNSPENT',
|
||||
'graphTxn.outputs.slpAmount': { $gte: 0 }
|
||||
}
|
||||
@@ -1756,8 +1751,8 @@ class Slp {
|
||||
const password = SLPDB_PASS_GP
|
||||
const combined = `${username}:${password}`
|
||||
// console.log(`combined: ${combined}`)
|
||||
var base64Credential = Buffer.from(combined).toString('base64')
|
||||
var readyCredential = `Basic ${base64Credential}`
|
||||
const base64Credential = Buffer.from(combined).toString('base64')
|
||||
const readyCredential = `Basic ${base64Credential}`
|
||||
|
||||
const options = {
|
||||
headers: {
|
||||
@@ -1776,8 +1771,8 @@ class Slp {
|
||||
const password = SLPDB_PASS_WL
|
||||
const combined = `${username}:${password}`
|
||||
// console.log(`combined: ${combined}`)
|
||||
var base64Credential = Buffer.from(combined).toString('base64')
|
||||
var readyCredential = `Basic ${base64Credential}`
|
||||
const base64Credential = Buffer.from(combined).toString('base64')
|
||||
const readyCredential = `Basic ${base64Credential}`
|
||||
|
||||
const options = {
|
||||
headers: {
|
||||
@@ -1806,6 +1801,7 @@ class Slp {
|
||||
tokenOutputs.map((x) => {
|
||||
const string = parseFloat(x.amount) * 100000000
|
||||
sendOutputs.push(string.toString())
|
||||
return 1 // Making the linter happy
|
||||
})
|
||||
|
||||
// Because you are not using Insight API indexer, you do not get the
|
||||
|
||||
@@ -433,7 +433,7 @@ class UtilRoute {
|
||||
|
||||
// Loop through each input and sign
|
||||
let redeemScript
|
||||
for (var i = 0; i < utxos.length; i++) {
|
||||
for (let i = 0; i < utxos.length; i++) {
|
||||
const utxo = utxos[i]
|
||||
|
||||
transactionBuilder.sign(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Electrum API route
|
||||
bcash node routes for working with SLP tokens.
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
Routes for interacting with the psf-slp-indexer
|
||||
*/
|
||||
|
||||
// Public npm libraries
|
||||
// const express = require('express')
|
||||
// const router = express.Router()
|
||||
// const axios = require('axios')
|
||||
//
|
||||
// // Local libraries
|
||||
// const wlogger = require('../../../util/winston-logging')
|
||||
// const config = require('../../../../config')
|
||||
@@ -105,8 +105,8 @@ class Slpdb {
|
||||
const username = 'BITBOX'
|
||||
const password = SLPDB_PASS
|
||||
const combined = `${username}:${password}`
|
||||
var base64Credential = Buffer.from(combined).toString('base64')
|
||||
var readyCredential = `Basic ${base64Credential}`
|
||||
const base64Credential = Buffer.from(combined).toString('base64')
|
||||
const readyCredential = `Basic ${base64Credential}`
|
||||
|
||||
const options = {
|
||||
headers: {
|
||||
|
||||
+10
-14
@@ -79,10 +79,7 @@ class Slp {
|
||||
_this.router.post('/list', _this.listBulkToken)
|
||||
_this.router.get('/balancesForAddress/:address', _this.balancesForAddress)
|
||||
_this.router.post('/balancesForAddress', _this.balancesForAddressBulk)
|
||||
_this.router.get(
|
||||
'/balancesForToken/:tokenId',
|
||||
_this.balancesForTokenSingle
|
||||
)
|
||||
_this.router.get('/balancesForToken/:tokenId', _this.balancesForTokenSingle)
|
||||
_this.router.get('/convert/:address', _this.convertAddressSingle)
|
||||
_this.router.post('/convert', _this.convertAddressBulk)
|
||||
_this.router.post('/validateTxid', _this.validateBulk)
|
||||
@@ -421,9 +418,8 @@ class Slp {
|
||||
},
|
||||
{
|
||||
$match: {
|
||||
'graphTxn.outputs.address': _this.bchjs.SLP.Address.toSLPAddress(
|
||||
address
|
||||
),
|
||||
'graphTxn.outputs.address':
|
||||
_this.bchjs.SLP.Address.toSLPAddress(address),
|
||||
'graphTxn.outputs.status': 'UNSPENT',
|
||||
'graphTxn.outputs.slpAmount': { $gte: 0 }
|
||||
}
|
||||
@@ -634,9 +630,8 @@ class Slp {
|
||||
},
|
||||
{
|
||||
$match: {
|
||||
'graphTxn.outputs.address': _this.bchjs.SLP.Address.toSLPAddress(
|
||||
address
|
||||
),
|
||||
'graphTxn.outputs.address':
|
||||
_this.bchjs.SLP.Address.toSLPAddress(address),
|
||||
'graphTxn.outputs.status': 'UNSPENT',
|
||||
'graphTxn.outputs.slpAmount': { $gte: 0 }
|
||||
}
|
||||
@@ -1756,8 +1751,8 @@ class Slp {
|
||||
const password = SLPDB_PASS_GP
|
||||
const combined = `${username}:${password}`
|
||||
// console.log(`combined: ${combined}`)
|
||||
var base64Credential = Buffer.from(combined).toString('base64')
|
||||
var readyCredential = `Basic ${base64Credential}`
|
||||
const base64Credential = Buffer.from(combined).toString('base64')
|
||||
const readyCredential = `Basic ${base64Credential}`
|
||||
|
||||
const options = {
|
||||
headers: {
|
||||
@@ -1776,8 +1771,8 @@ class Slp {
|
||||
const password = SLPDB_PASS_WL
|
||||
const combined = `${username}:${password}`
|
||||
// console.log(`combined: ${combined}`)
|
||||
var base64Credential = Buffer.from(combined).toString('base64')
|
||||
var readyCredential = `Basic ${base64Credential}`
|
||||
const base64Credential = Buffer.from(combined).toString('base64')
|
||||
const readyCredential = `Basic ${base64Credential}`
|
||||
|
||||
const options = {
|
||||
headers: {
|
||||
@@ -1806,6 +1801,7 @@ class Slp {
|
||||
tokenOutputs.map((x) => {
|
||||
const string = parseFloat(x.amount) * 100000000
|
||||
sendOutputs.push(string.toString())
|
||||
return 1 // Making the linter happy
|
||||
})
|
||||
|
||||
// Because you are not using Insight API indexer, you do not get the
|
||||
|
||||
@@ -6,24 +6,26 @@
|
||||
|
||||
'use strict'
|
||||
|
||||
var winston = require('winston')
|
||||
const winston = require('winston')
|
||||
require('winston-daily-rotate-file')
|
||||
|
||||
var NETWORK = process.env.NETWORK
|
||||
const NETWORK = process.env.NETWORK
|
||||
|
||||
// Default 1 Megabyte
|
||||
var LOG_MAX_SIZE = process.env.LOG_MAX_SIZE ? process.env.LOG_MAX_SIZE : '1m'
|
||||
const LOG_MAX_SIZE = process.env.LOG_MAX_SIZE ? process.env.LOG_MAX_SIZE : '1m'
|
||||
|
||||
// Default 5 days.
|
||||
// This was causing a problem with popularity. Creating over a gigabyte of files.
|
||||
// var LOG_MAX_FILES = process.env.LOG_MAX_FILES ? process.env.LOG_MAX_FILES : '5d'
|
||||
|
||||
// 250 files @ 1Meg each = 250 megs
|
||||
var LOG_MAX_FILES = process.env.LOG_MAX_FILES ? process.env.LOG_MAX_FILES : '250'
|
||||
const LOG_MAX_FILES = process.env.LOG_MAX_FILES
|
||||
? process.env.LOG_MAX_FILES
|
||||
: '250'
|
||||
|
||||
// Configure daily-rotation transport.
|
||||
var transport = new winston.transports.DailyRotateFile({
|
||||
filename: `${__dirname}/../../logs/rest-${NETWORK}-%DATE%.log`,
|
||||
const transport = new winston.transports.DailyRotateFile({
|
||||
filename: `${__dirname.toString()}/../../logs/rest-${NETWORK}-%DATE%.log`,
|
||||
datePattern: 'YYYY-MM-DD',
|
||||
zippedArchive: false,
|
||||
maxSize: LOG_MAX_SIZE,
|
||||
@@ -39,7 +41,7 @@ transport.on('rotate', function (oldFilename, newFilename) {
|
||||
})
|
||||
|
||||
// This controls what goes into the log FILES
|
||||
var wlogger = winston.createLogger({
|
||||
const wlogger = winston.createLogger({
|
||||
level: 'verbose',
|
||||
format: winston.format.json(),
|
||||
transports: [
|
||||
|
||||
@@ -359,7 +359,7 @@ describe('#Electrumx', () => {
|
||||
|
||||
it('should throw 400 error if addresses array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.addresses = testArray
|
||||
|
||||
@@ -596,7 +596,7 @@ describe('#Electrumx', () => {
|
||||
|
||||
it('should throw 400 error if txid array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.txids = testArray
|
||||
|
||||
@@ -843,7 +843,7 @@ describe('#Electrumx', () => {
|
||||
|
||||
it('should throw 400 error if heights array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.heights = testArray
|
||||
|
||||
@@ -1206,7 +1206,7 @@ describe('#Electrumx', () => {
|
||||
|
||||
it('should throw 400 error if addresses array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.addresses = testArray
|
||||
|
||||
@@ -1494,7 +1494,7 @@ describe('#Electrumx', () => {
|
||||
|
||||
it('should throw 400 error if addresses array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.addresses = testArray
|
||||
|
||||
@@ -1781,7 +1781,7 @@ describe('#Electrumx', () => {
|
||||
|
||||
it('should throw 400 error if addresses array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.addresses = testArray
|
||||
|
||||
|
||||
@@ -456,7 +456,7 @@ describe('#BlockchainRouter', () => {
|
||||
|
||||
it('should throw 400 error if addresses array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.hashes = testArray
|
||||
|
||||
@@ -1006,7 +1006,7 @@ describe('#BlockchainRouter', () => {
|
||||
|
||||
it('should throw 400 error if addresses array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.txids = testArray
|
||||
|
||||
@@ -1525,7 +1525,7 @@ describe('#BlockchainRouter', () => {
|
||||
|
||||
it('should throw 400 error if addresses array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.txids = testArray
|
||||
|
||||
@@ -1729,7 +1729,7 @@ describe('#BlockchainRouter', () => {
|
||||
|
||||
it('should throw 400 error if addresses array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.proofs = testArray
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@ describe('#Raw-Transactions', () => {
|
||||
|
||||
it('should throw 400 error if hexes array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.hexes = testArray
|
||||
|
||||
@@ -459,7 +459,7 @@ describe('#Raw-Transactions', () => {
|
||||
|
||||
it('should throw 400 error if hexes array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.hexes = testArray
|
||||
|
||||
@@ -599,7 +599,7 @@ describe('#Raw-Transactions', () => {
|
||||
|
||||
it('should throw 400 error if txids array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.txids = testArray
|
||||
|
||||
@@ -885,7 +885,7 @@ describe('#Raw-Transactions', () => {
|
||||
|
||||
it('should throw 400 error if hexs array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.hexes = testArray
|
||||
|
||||
|
||||
+13
-23
@@ -36,7 +36,7 @@ if (process.env.TEST === 'unit') {
|
||||
process.env.BITDB_URL = 'http://fakeurl/'
|
||||
process.env.BITCOINCOM_BASEURL = 'http://fakeurl/'
|
||||
process.env.SLPDB_URL = 'http://fakeurl/'
|
||||
mockServerUrl = 'http://fakeurl'
|
||||
// mockServerUrl = 'http://fakeurl'
|
||||
}
|
||||
|
||||
// Prepare the slpRoute for stubbing dependcies on slpjs.
|
||||
@@ -577,7 +577,7 @@ describe('#SLP', () => {
|
||||
|
||||
it('should throw 400 error if array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.txids = testArray
|
||||
|
||||
@@ -787,7 +787,7 @@ describe('#SLP', () => {
|
||||
|
||||
it('should throw 400 error if array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.txids = testArray
|
||||
|
||||
@@ -1406,8 +1406,7 @@ describe('#SLP', () => {
|
||||
|
||||
it('should throw error if Array is too long', async () => {
|
||||
const utxo = {
|
||||
txid:
|
||||
'bd158c564dd4ef54305b14f44f8e94c44b649f246dab14bcb42fb0d0078b8a90',
|
||||
txid: 'bd158c564dd4ef54305b14f44f8e94c44b649f246dab14bcb42fb0d0078b8a90',
|
||||
vout: 3,
|
||||
amount: 0.00002015,
|
||||
satoshis: 2015,
|
||||
@@ -1435,8 +1434,7 @@ describe('#SLP', () => {
|
||||
{
|
||||
utxos: [
|
||||
{
|
||||
txid:
|
||||
'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
txid: 'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
vout: 3,
|
||||
value: '6816',
|
||||
height: 606848,
|
||||
@@ -1444,8 +1442,7 @@ describe('#SLP', () => {
|
||||
satoshis: 6816
|
||||
},
|
||||
{
|
||||
txid:
|
||||
'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
txid: 'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
vout: 2,
|
||||
value: '546',
|
||||
height: 606848,
|
||||
@@ -1459,8 +1456,7 @@ describe('#SLP', () => {
|
||||
// Mock the external network call.
|
||||
sandbox.stub(slpRoute.bchjs.SLP.Utils, 'tokenUtxoDetails').resolves([
|
||||
{
|
||||
txid:
|
||||
'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
txid: 'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
vout: 3,
|
||||
value: '6816',
|
||||
height: 606848,
|
||||
@@ -1469,8 +1465,7 @@ describe('#SLP', () => {
|
||||
isValid: false
|
||||
},
|
||||
{
|
||||
txid:
|
||||
'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
txid: 'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
vout: 2,
|
||||
value: '546',
|
||||
height: 606848,
|
||||
@@ -1581,8 +1576,7 @@ describe('#SLP', () => {
|
||||
|
||||
it('should throw error if Array is too long', async () => {
|
||||
const utxo = {
|
||||
txid:
|
||||
'bd158c564dd4ef54305b14f44f8e94c44b649f246dab14bcb42fb0d0078b8a90',
|
||||
txid: 'bd158c564dd4ef54305b14f44f8e94c44b649f246dab14bcb42fb0d0078b8a90',
|
||||
vout: 3,
|
||||
amount: 0.00002015,
|
||||
satoshis: 2015,
|
||||
@@ -1610,8 +1604,7 @@ describe('#SLP', () => {
|
||||
{
|
||||
utxos: [
|
||||
{
|
||||
txid:
|
||||
'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
txid: 'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
vout: 3,
|
||||
value: '6816',
|
||||
height: 606848,
|
||||
@@ -1619,8 +1612,7 @@ describe('#SLP', () => {
|
||||
satoshis: 6816
|
||||
},
|
||||
{
|
||||
txid:
|
||||
'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
txid: 'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
vout: 2,
|
||||
value: '546',
|
||||
height: 606848,
|
||||
@@ -1634,8 +1626,7 @@ describe('#SLP', () => {
|
||||
// Mock the external network call.
|
||||
sandbox.stub(slpRoute.bchjs.SLP.Utils, 'tokenUtxoDetailsWL').resolves([
|
||||
{
|
||||
txid:
|
||||
'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
txid: 'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
vout: 3,
|
||||
value: '6816',
|
||||
height: 606848,
|
||||
@@ -1644,8 +1635,7 @@ describe('#SLP', () => {
|
||||
isValid: false
|
||||
},
|
||||
{
|
||||
txid:
|
||||
'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
txid: 'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
vout: 2,
|
||||
value: '546',
|
||||
height: 606848,
|
||||
|
||||
+1
-1
@@ -203,7 +203,7 @@ describe('#Util', () => {
|
||||
|
||||
it('should throw 400 error if addresses array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.addresses = testArray
|
||||
|
||||
|
||||
@@ -239,7 +239,7 @@ describe('#Electrumx', () => {
|
||||
|
||||
it('should throw 400 error if addresses array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.addresses = testArray
|
||||
|
||||
@@ -485,7 +485,7 @@ describe('#Electrumx', () => {
|
||||
|
||||
it('should throw 400 error if addresses array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.addresses = testArray
|
||||
|
||||
@@ -729,7 +729,7 @@ describe('#Electrumx', () => {
|
||||
|
||||
it('should throw 400 error if addresses array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.txids = testArray
|
||||
|
||||
@@ -1065,7 +1065,7 @@ describe('#Electrumx', () => {
|
||||
|
||||
it('should throw 400 error if heights array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.heights = testArray
|
||||
|
||||
@@ -1261,7 +1261,7 @@ describe('#Electrumx', () => {
|
||||
|
||||
it('should throw 400 error if addresses array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.addresses = testArray
|
||||
|
||||
@@ -1503,7 +1503,7 @@ describe('#Electrumx', () => {
|
||||
|
||||
it('should throw 400 error if addresses array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.addresses = testArray
|
||||
|
||||
|
||||
@@ -456,7 +456,7 @@ describe('#BlockchainRouter', () => {
|
||||
|
||||
it('should throw 400 error if addresses array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.hashes = testArray
|
||||
|
||||
@@ -1006,7 +1006,7 @@ describe('#BlockchainRouter', () => {
|
||||
|
||||
it('should throw 400 error if addresses array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.txids = testArray
|
||||
|
||||
@@ -1525,7 +1525,7 @@ describe('#BlockchainRouter', () => {
|
||||
|
||||
it('should throw 400 error if addresses array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.txids = testArray
|
||||
|
||||
@@ -1729,7 +1729,7 @@ describe('#BlockchainRouter', () => {
|
||||
|
||||
it('should throw 400 error if addresses array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.proofs = testArray
|
||||
|
||||
|
||||
@@ -216,7 +216,7 @@ describe('#Raw-Transactions', () => {
|
||||
|
||||
it('should throw 400 error if hexes array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.hexes = testArray
|
||||
|
||||
@@ -459,7 +459,7 @@ describe('#Raw-Transactions', () => {
|
||||
|
||||
it('should throw 400 error if hexes array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.hexes = testArray
|
||||
|
||||
@@ -599,7 +599,7 @@ describe('#Raw-Transactions', () => {
|
||||
|
||||
it('should throw 400 error if txids array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.txids = testArray
|
||||
|
||||
@@ -885,7 +885,7 @@ describe('#Raw-Transactions', () => {
|
||||
|
||||
it('should throw 400 error if hexs array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.hexes = testArray
|
||||
|
||||
|
||||
+13
-23
@@ -36,7 +36,7 @@ if (process.env.TEST === 'unit') {
|
||||
process.env.BITDB_URL = 'http://fakeurl/'
|
||||
process.env.BITCOINCOM_BASEURL = 'http://fakeurl/'
|
||||
process.env.SLPDB_URL = 'http://fakeurl/'
|
||||
mockServerUrl = 'http://fakeurl'
|
||||
// mockServerUrl = 'http://fakeurl'
|
||||
}
|
||||
|
||||
// Prepare the slpRoute for stubbing dependcies on slpjs.
|
||||
@@ -577,7 +577,7 @@ describe('#SLP', () => {
|
||||
|
||||
it('should throw 400 error if array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.txids = testArray
|
||||
|
||||
@@ -787,7 +787,7 @@ describe('#SLP', () => {
|
||||
|
||||
it('should throw 400 error if array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.txids = testArray
|
||||
|
||||
@@ -1406,8 +1406,7 @@ describe('#SLP', () => {
|
||||
|
||||
it('should throw error if Array is too long', async () => {
|
||||
const utxo = {
|
||||
txid:
|
||||
'bd158c564dd4ef54305b14f44f8e94c44b649f246dab14bcb42fb0d0078b8a90',
|
||||
txid: 'bd158c564dd4ef54305b14f44f8e94c44b649f246dab14bcb42fb0d0078b8a90',
|
||||
vout: 3,
|
||||
amount: 0.00002015,
|
||||
satoshis: 2015,
|
||||
@@ -1435,8 +1434,7 @@ describe('#SLP', () => {
|
||||
{
|
||||
utxos: [
|
||||
{
|
||||
txid:
|
||||
'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
txid: 'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
vout: 3,
|
||||
value: '6816',
|
||||
height: 606848,
|
||||
@@ -1444,8 +1442,7 @@ describe('#SLP', () => {
|
||||
satoshis: 6816
|
||||
},
|
||||
{
|
||||
txid:
|
||||
'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
txid: 'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
vout: 2,
|
||||
value: '546',
|
||||
height: 606848,
|
||||
@@ -1459,8 +1456,7 @@ describe('#SLP', () => {
|
||||
// Mock the external network call.
|
||||
sandbox.stub(slpRoute.bchjs.SLP.Utils, 'tokenUtxoDetails').resolves([
|
||||
{
|
||||
txid:
|
||||
'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
txid: 'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
vout: 3,
|
||||
value: '6816',
|
||||
height: 606848,
|
||||
@@ -1469,8 +1465,7 @@ describe('#SLP', () => {
|
||||
isValid: false
|
||||
},
|
||||
{
|
||||
txid:
|
||||
'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
txid: 'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
vout: 2,
|
||||
value: '546',
|
||||
height: 606848,
|
||||
@@ -1581,8 +1576,7 @@ describe('#SLP', () => {
|
||||
|
||||
it('should throw error if Array is too long', async () => {
|
||||
const utxo = {
|
||||
txid:
|
||||
'bd158c564dd4ef54305b14f44f8e94c44b649f246dab14bcb42fb0d0078b8a90',
|
||||
txid: 'bd158c564dd4ef54305b14f44f8e94c44b649f246dab14bcb42fb0d0078b8a90',
|
||||
vout: 3,
|
||||
amount: 0.00002015,
|
||||
satoshis: 2015,
|
||||
@@ -1610,8 +1604,7 @@ describe('#SLP', () => {
|
||||
{
|
||||
utxos: [
|
||||
{
|
||||
txid:
|
||||
'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
txid: 'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
vout: 3,
|
||||
value: '6816',
|
||||
height: 606848,
|
||||
@@ -1619,8 +1612,7 @@ describe('#SLP', () => {
|
||||
satoshis: 6816
|
||||
},
|
||||
{
|
||||
txid:
|
||||
'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
txid: 'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
vout: 2,
|
||||
value: '546',
|
||||
height: 606848,
|
||||
@@ -1634,8 +1626,7 @@ describe('#SLP', () => {
|
||||
// Mock the external network call.
|
||||
sandbox.stub(slpRoute.bchjs.SLP.Utils, 'tokenUtxoDetailsWL').resolves([
|
||||
{
|
||||
txid:
|
||||
'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
txid: 'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
vout: 3,
|
||||
value: '6816',
|
||||
height: 606848,
|
||||
@@ -1644,8 +1635,7 @@ describe('#SLP', () => {
|
||||
isValid: false
|
||||
},
|
||||
{
|
||||
txid:
|
||||
'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
txid: 'd56a2b446d8149c39ca7e06163fe8097168c3604915f631bc58777d669135a56',
|
||||
vout: 2,
|
||||
value: '546',
|
||||
height: 606848,
|
||||
|
||||
+1
-1
@@ -203,7 +203,7 @@ describe('#Util', () => {
|
||||
|
||||
it('should throw 400 error if addresses array is too large', async () => {
|
||||
const testArray = []
|
||||
for (var i = 0; i < 25; i++) testArray.push('')
|
||||
for (let i = 0; i < 25; i++) testArray.push('')
|
||||
|
||||
req.body.addresses = testArray
|
||||
|
||||
|
||||
Reference in New Issue
Block a user