diff --git a/packages/api/test/integration/transactions.spec.js b/packages/api/test/integration/transactions.spec.js index 865f8432..b4874c69 100644 --- a/packages/api/test/integration/transactions.spec.js +++ b/packages/api/test/integration/transactions.spec.js @@ -1,8 +1,8 @@ -const {describe, it, before, after, mock} = require('node:test') +const { describe, it, before, after, mock } = require('node:test') const assert = require('node:assert').strict const supertest = require('supertest') const server = require('../../src/server') -const {getKnex} = require('../../src/utils') +const { getKnex } = require('../../src/utils') const fixtures = require('../utils/fixtures') const StateTransitionEnum = require('../../src/enums/StateTransitionEnum') const tenderdashRpc = require('../../src/tenderdashRpc') @@ -36,9 +36,9 @@ describe('Transaction routes', () => { block = await fixtures.block(knex, { height: 1, timestamp: startDate }) - identity = await fixtures.identity(knex, {block_hash: block.hash}) + identity = await fixtures.identity(knex, { block_hash: block.hash }) - transactions = [{transaction: identity.transaction, block}] + transactions = [{ transaction: identity.transaction, block }] // error tx const errorTx = await fixtures.transaction(knex, { @@ -49,7 +49,7 @@ describe('Transaction routes', () => { error: 'Cannot deserialize', status: 'FAIL' }) - transactions.push({transaction: errorTx, block}) + transactions.push({ transaction: errorTx, block }) for (let i = 2; i < 30; i++) { const block = await fixtures.block(knex, { @@ -60,7 +60,7 @@ describe('Transaction routes', () => { block_hash: block.hash, data: '{}', type: StateTransitionEnum.DATA_CONTRACT_CREATE, owner: identity.identifier }) - transactions.push({transaction, block}) + transactions.push({ transaction, block }) } for (let i = 30; i < 60; i++) { @@ -77,7 +77,7 @@ describe('Transaction routes', () => { index: j }) - transactions.push({transaction, block}) + transactions.push({ transaction, block }) } } }) @@ -90,7 +90,7 @@ describe('Transaction routes', () => { describe('getTransactionByHash()', async () => { it('should return transaction', async () => { const [transaction] = transactions - const {body} = await client.get(`/transaction/${transaction.transaction.hash}`) + const { body } = await client.get(`/transaction/${transaction.transaction.hash}`) .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -112,7 +112,7 @@ describe('Transaction routes', () => { it('should error transaction', async () => { const [, transaction] = transactions - const {body} = await client.get(`/transaction/${transaction.transaction.hash}`) + const { body } = await client.get(`/transaction/${transaction.transaction.hash}`) .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -141,7 +141,7 @@ describe('Transaction routes', () => { describe('getTransactions()', async () => { it('should return default set of transactions', async () => { - const {body} = await client.get('/transactions') + const { body } = await client.get('/transactions') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -169,7 +169,7 @@ describe('Transaction routes', () => { }) it('should return default set of transactions desc', async () => { - const {body} = await client.get('/transactions?order=desc') + const { body } = await client.get('/transactions?order=desc') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -198,7 +198,7 @@ describe('Transaction routes', () => { }) it('should return be able to walk through pages desc', async () => { - const {body} = await client.get('/transactions?page=3&limit=3&order=desc') + const { body } = await client.get('/transactions?page=3&limit=3&order=desc') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -227,7 +227,7 @@ describe('Transaction routes', () => { }) it('should return be able to walk through pages desc', async () => { - const {body} = await client.get('/transactions?page=3&limit=3') + const { body } = await client.get('/transactions?page=3&limit=3') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -258,7 +258,7 @@ describe('Transaction routes', () => { describe('getHistorySeries()', async () => { it('should return default series set', async () => { - const {body} = await client.get('/transactions/history') + const { body } = await client.get('/transactions/history') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -292,7 +292,7 @@ describe('Transaction routes', () => { }) it('should return default series set timespan 2H', async () => { - const {body} = await client.get(`/transactions/history?start=${new Date(new Date().getTime() - 3600000).toISOString()}&end=${new Date(new Date().getTime() + 3600000).toISOString()}`) + const { body } = await client.get(`/transactions/history?start=${new Date(new Date().getTime() - 3600000).toISOString()}&end=${new Date(new Date().getTime() + 3600000).toISOString()}`) .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -326,7 +326,7 @@ describe('Transaction routes', () => { }) it('should return default series set timespan 24h', async () => { - const {body} = await client.get(`/transactions/history?start=${new Date(new Date().getTime() - 43200000).toISOString()}&end=${new Date(new Date().getTime() + 43200000).toISOString()}`) + const { body } = await client.get(`/transactions/history?start=${new Date(new Date().getTime() - 43200000).toISOString()}&end=${new Date(new Date().getTime() + 43200000).toISOString()}`) .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -360,7 +360,7 @@ describe('Transaction routes', () => { }) it('should return default series set timespan 3d', async () => { - const {body} = await client.get(`/transactions/history?start=${new Date(new Date().getTime() - 129600000).toISOString()}&end=${new Date(new Date().getTime() + 129600000).toISOString()}`) + const { body } = await client.get(`/transactions/history?start=${new Date(new Date().getTime() - 129600000).toISOString()}&end=${new Date(new Date().getTime() + 129600000).toISOString()}`) .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -394,7 +394,7 @@ describe('Transaction routes', () => { }) it('should return default series set timespan 1w', async () => { - const {body} = await client.get(`/transactions/history?start=${new Date(new Date().getTime() - 302400000).toISOString()}&end=${new Date(new Date().getTime() + 302400000).toISOString()}`) + const { body } = await client.get(`/transactions/history?start=${new Date(new Date().getTime() - 302400000).toISOString()}&end=${new Date(new Date().getTime() + 302400000).toISOString()}`) .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -430,7 +430,7 @@ describe('Transaction routes', () => { const start = new Date(new Date().getTime()) const end = new Date(start.getTime() + 10800000) - const {body} = await client.get(`/transactions/history?start=${start.toISOString()}&end=${end.toISOString()}&intervalsCount=3`) + const { body } = await client.get(`/transactions/history?start=${start.toISOString()}&end=${end.toISOString()}&intervalsCount=3`) .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') diff --git a/packages/api/test/integration/validators.spec.js b/packages/api/test/integration/validators.spec.js index aa5defd3..c0ae8837 100644 --- a/packages/api/test/integration/validators.spec.js +++ b/packages/api/test/integration/validators.spec.js @@ -1,19 +1,19 @@ process.env.EPOCH_CHANGE_TIME = 3600000 -const {describe, it, before, after, mock} = require('node:test') +const { describe, it, before, after, mock } = require('node:test') const assert = require('node:assert').strict const supertest = require('supertest') const server = require('../../src/server') const fixtures = require('../utils/fixtures') -const {getKnex, checkTcpConnect} = require('../../src/utils') +const { getKnex, checkTcpConnect } = require('../../src/utils') const BlockHeader = require('../../src/models/BlockHeader') const tenderdashRpc = require('../../src/tenderdashRpc') const DashCoreRPC = require('../../src/dashcoreRpc') const ServiceNotAvailableError = require('../../src/errors/ServiceNotAvailableError') const DAPI = require('../../src/DAPI') const Epoch = require('../../src/models/Epoch') -const {base58} = require('@scure/base') -const {IDENTITY_CREDIT_WITHDRAWAL} = require('../../src/enums/StateTransitionEnum') +const { base58 } = require('@scure/base') +const { IDENTITY_CREDIT_WITHDRAWAL } = require('../../src/enums/StateTransitionEnum') describe('Validators routes', () => { let app @@ -158,10 +158,10 @@ describe('Validators routes', () => { type: IDENTITY_CREDIT_WITHDRAWAL, block_hash: blocks[i].hash, owner: base58.encode(Buffer.from(( - (i % 2) - ? inactiveValidators - : activeValidators)[0].pro_tx_hash, - 'hex')) + (i % 2) + ? inactiveValidators + : activeValidators)[0].pro_tx_hash, + 'hex')) } ) @@ -185,7 +185,7 @@ describe('Validators routes', () => { mock.method(tenderdashRpc, 'getValidators', async () => Promise.resolve(activeValidators.map(activeValidator => - ({pro_tx_hash: activeValidator.pro_tx_hash})))) + ({ pro_tx_hash: activeValidator.pro_tx_hash })))) mock.method(DashCoreRPC, 'getProTxInfo', async () => dashCoreRpcResponse) @@ -205,7 +205,7 @@ describe('Validators routes', () => { it('should return inactive validator by proTxHash', async () => { const [validator] = inactiveValidators - const {body} = await client.get(`/validator/${validator.pro_tx_hash}`) + const { body } = await client.get(`/validator/${validator.pro_tx_hash}`) .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -230,7 +230,7 @@ describe('Validators routes', () => { epochReward: 0, identity: identity.identifier, identityBalance: 0, - epochInfo: {...fullEpochInfo}, + epochInfo: { ...fullEpochInfo }, withdrawalsCount: 5, lastWithdrawal: transactions[transactions.length - 1].hash, lastWithdrawalTime: timestamp.toISOString(), @@ -243,7 +243,7 @@ describe('Validators routes', () => { it('should return active validator by proTxHash', async () => { const [validator] = activeValidators - const {body} = await client.get(`/validator/${validator.pro_tx_hash}`) + const { body } = await client.get(`/validator/${validator.pro_tx_hash}`) .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -280,7 +280,7 @@ describe('Validators routes', () => { epochReward: 0, identity: identity.identifier, identityBalance: 0, - epochInfo: {...fullEpochInfo}, + epochInfo: { ...fullEpochInfo }, withdrawalsCount: 5, lastWithdrawal: transactions[transactions.length - 2].hash, lastWithdrawalTime: timestamp.toISOString(), @@ -300,7 +300,7 @@ describe('Validators routes', () => { describe('getValidators()', async () => { describe('no filter', async () => { it('should return default set of validators', async () => { - const {body} = await client.get('/validators') + const { body } = await client.get('/validators') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -344,7 +344,7 @@ describe('Validators routes', () => { epochReward: 0, identity: identity.identifier, identityBalance: 0, - epochInfo: {...fullEpochInfo}, + epochInfo: { ...fullEpochInfo }, withdrawalsCount: null, lastWithdrawal: null, lastWithdrawalTime: null, @@ -356,7 +356,7 @@ describe('Validators routes', () => { }) it('should return all validators', async () => { - const {body} = await client.get('/validators?limit=0') + const { body } = await client.get('/validators?limit=0') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -398,7 +398,7 @@ describe('Validators routes', () => { epochReward: 0, identity: identity.identifier, identityBalance: 0, - epochInfo: {...fullEpochInfo}, + epochInfo: { ...fullEpochInfo }, withdrawalsCount: null, lastWithdrawal: null, lastWithdrawalTime: null, @@ -410,7 +410,7 @@ describe('Validators routes', () => { }) it('should return default set of validators order desc', async () => { - const {body} = await client.get('/validators?order=desc') + const { body } = await client.get('/validators?order=desc') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -455,7 +455,7 @@ describe('Validators routes', () => { epochReward: 0, identity: identity.identifier, identityBalance: 0, - epochInfo: {...fullEpochInfo}, + epochInfo: { ...fullEpochInfo }, withdrawalsCount: null, lastWithdrawal: null, lastWithdrawalTime: null, @@ -467,7 +467,7 @@ describe('Validators routes', () => { }) it('should be able to walk through pages', async () => { - const {body} = await client.get('/validators?page=2') + const { body } = await client.get('/validators?page=2') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -511,7 +511,7 @@ describe('Validators routes', () => { epochReward: 0, identity: identity.identifier, identityBalance: 0, - epochInfo: {...fullEpochInfo}, + epochInfo: { ...fullEpochInfo }, withdrawalsCount: null, lastWithdrawal: null, lastWithdrawalTime: null, @@ -523,7 +523,7 @@ describe('Validators routes', () => { }) it('should return custom page size', async () => { - const {body} = await client.get('/validators?limit=7') + const { body } = await client.get('/validators?limit=7') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -571,7 +571,7 @@ describe('Validators routes', () => { epochReward: 0, identity: identity.identifier, identityBalance: 0, - epochInfo: {...fullEpochInfo}, + epochInfo: { ...fullEpochInfo }, withdrawalsCount: null, lastWithdrawal: null, lastWithdrawalTime: null, @@ -583,7 +583,7 @@ describe('Validators routes', () => { }) it('should allow to walk through pages with custom page size', async () => { - const {body} = await client.get('/validators?limit=7&page=2') + const { body } = await client.get('/validators?limit=7&page=2') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -627,7 +627,7 @@ describe('Validators routes', () => { epochReward: 0, identity: identity.identifier, identityBalance: 0, - epochInfo: {...fullEpochInfo}, + epochInfo: { ...fullEpochInfo }, withdrawalsCount: null, lastWithdrawal: null, lastWithdrawalTime: null, @@ -639,7 +639,7 @@ describe('Validators routes', () => { }) it('should allow to walk through pages with custom page size desc', async () => { - const {body} = await client.get('/validators?limit=5&page=4&order=desc') + const { body } = await client.get('/validators?limit=5&page=4&order=desc') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -685,7 +685,7 @@ describe('Validators routes', () => { epochReward: 0, identity: identity.identifier, identityBalance: 0, - epochInfo: {...fullEpochInfo}, + epochInfo: { ...fullEpochInfo }, withdrawalsCount: null, lastWithdrawal: null, lastWithdrawalTime: null, @@ -697,7 +697,7 @@ describe('Validators routes', () => { }) it('should return less items when when it is out of bounds', async () => { - const {body} = await client.get('/validators?limit=6&page=9') + const { body } = await client.get('/validators?limit=6&page=9') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -741,7 +741,7 @@ describe('Validators routes', () => { epochReward: 0, identity: identity.identifier, identityBalance: 0, - epochInfo: {...fullEpochInfo}, + epochInfo: { ...fullEpochInfo }, withdrawalsCount: null, lastWithdrawal: null, lastWithdrawalTime: null, @@ -753,7 +753,7 @@ describe('Validators routes', () => { }) it('should return less items when there is none on the one bound', async () => { - const {body} = await client.get('/validators?page=6') + const { body } = await client.get('/validators?page=6') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -770,7 +770,7 @@ describe('Validators routes', () => { describe('filter isActive = true', async () => { it('should return default set of validators', async () => { - const {body} = await client.get('/validators?isActive=true') + const { body } = await client.get('/validators?isActive=true') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -814,7 +814,7 @@ describe('Validators routes', () => { epochReward: 0, identity: identity.identifier, identityBalance: 0, - epochInfo: {...fullEpochInfo}, + epochInfo: { ...fullEpochInfo }, withdrawalsCount: null, lastWithdrawal: null, lastWithdrawalTime: null, @@ -826,7 +826,7 @@ describe('Validators routes', () => { }) it('should return all validators', async () => { - const {body} = await client.get('/validators?isActive=true&limit=0') + const { body } = await client.get('/validators?isActive=true&limit=0') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -868,7 +868,7 @@ describe('Validators routes', () => { epochReward: 0, identity: identity.identifier, identityBalance: 0, - epochInfo: {...fullEpochInfo}, + epochInfo: { ...fullEpochInfo }, withdrawalsCount: null, lastWithdrawal: null, lastWithdrawalTime: null, @@ -880,7 +880,7 @@ describe('Validators routes', () => { }) it('should return default set of validators order desc', async () => { - const {body} = await client.get('/validators?order=desc&isActive=true') + const { body } = await client.get('/validators?order=desc&isActive=true') .expect('Content-Type', 'application/json; charset=utf-8') assert.equal(body.pagination.page, 1) @@ -924,7 +924,7 @@ describe('Validators routes', () => { epochReward: 0, identity: identity.identifier, identityBalance: 0, - epochInfo: {...fullEpochInfo}, + epochInfo: { ...fullEpochInfo }, withdrawalsCount: null, lastWithdrawal: null, lastWithdrawalTime: null, @@ -936,7 +936,7 @@ describe('Validators routes', () => { }) it('should be able to walk through pages', async () => { - const {body} = await client.get('/validators?page=2&isActive=true') + const { body } = await client.get('/validators?page=2&isActive=true') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -980,7 +980,7 @@ describe('Validators routes', () => { epochReward: 0, identity: identity.identifier, identityBalance: 0, - epochInfo: {...fullEpochInfo}, + epochInfo: { ...fullEpochInfo }, withdrawalsCount: null, lastWithdrawal: null, lastWithdrawalTime: null, @@ -992,7 +992,7 @@ describe('Validators routes', () => { }) it('should return custom page size', async () => { - const {body} = await client.get('/validators?limit=7&isActive=true') + const { body } = await client.get('/validators?limit=7&isActive=true') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -1036,7 +1036,7 @@ describe('Validators routes', () => { epochReward: 0, identity: identity.identifier, identityBalance: 0, - epochInfo: {...fullEpochInfo}, + epochInfo: { ...fullEpochInfo }, withdrawalsCount: null, lastWithdrawal: null, lastWithdrawalTime: null, @@ -1048,7 +1048,7 @@ describe('Validators routes', () => { }) it('should allow to walk through pages with custom page size', async () => { - const {body} = await client.get('/validators?limit=7&page=2&isActive=true') + const { body } = await client.get('/validators?limit=7&page=2&isActive=true') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -1092,7 +1092,7 @@ describe('Validators routes', () => { epochReward: 0, identity: identity.identifier, identityBalance: 0, - epochInfo: {...fullEpochInfo}, + epochInfo: { ...fullEpochInfo }, withdrawalsCount: null, lastWithdrawal: null, lastWithdrawalTime: null, @@ -1104,7 +1104,7 @@ describe('Validators routes', () => { }) it('should allow to walk through pages with custom page size desc', async () => { - const {body} = await client.get('/validators?limit=5&page=4&order=desc&isActive=true') + const { body } = await client.get('/validators?limit=5&page=4&order=desc&isActive=true') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -1149,7 +1149,7 @@ describe('Validators routes', () => { epochReward: 0, identity: identity.identifier, identityBalance: 0, - epochInfo: {...fullEpochInfo}, + epochInfo: { ...fullEpochInfo }, withdrawalsCount: null, lastWithdrawal: null, lastWithdrawalTime: null, @@ -1161,7 +1161,7 @@ describe('Validators routes', () => { }) it('should return less items when when it is out of bounds', async () => { - const {body} = await client.get('/validators?limit=4&page=8&isActive=true') + const { body } = await client.get('/validators?limit=4&page=8&isActive=true') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -1205,7 +1205,7 @@ describe('Validators routes', () => { epochReward: 0, identity: identity.identifier, identityBalance: 0, - epochInfo: {...fullEpochInfo}, + epochInfo: { ...fullEpochInfo }, withdrawalsCount: null, lastWithdrawal: null, lastWithdrawalTime: null, @@ -1217,7 +1217,7 @@ describe('Validators routes', () => { }) it('should return less items when there is none on the one bound', async () => { - const {body} = await client.get('/validators?page=4&isActive=true') + const { body } = await client.get('/validators?page=4&isActive=true') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -1234,7 +1234,7 @@ describe('Validators routes', () => { describe('filter isActive = false', async () => { it('should return default set of validators', async () => { - const {body} = await client.get('/validators?isActive=false') + const { body } = await client.get('/validators?isActive=false') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -1266,7 +1266,7 @@ describe('Validators routes', () => { epochReward: 0, identity: identity.identifier, identityBalance: 0, - epochInfo: {...fullEpochInfo}, + epochInfo: { ...fullEpochInfo }, withdrawalsCount: null, lastWithdrawal: null, lastWithdrawalTime: null, @@ -1278,7 +1278,7 @@ describe('Validators routes', () => { }) it('should return all validators', async () => { - const {body} = await client.get('/validators?isActive=false&limit=0') + const { body } = await client.get('/validators?isActive=false&limit=0') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -1308,7 +1308,7 @@ describe('Validators routes', () => { epochReward: 0, identity: identity.identifier, identityBalance: 0, - epochInfo: {...fullEpochInfo}, + epochInfo: { ...fullEpochInfo }, withdrawalsCount: null, lastWithdrawal: null, lastWithdrawalTime: null, @@ -1320,7 +1320,7 @@ describe('Validators routes', () => { }) it('should return default set of validators order desc', async () => { - const {body} = await client.get('/validators?order=desc&isActive=false') + const { body } = await client.get('/validators?order=desc&isActive=false') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -1353,7 +1353,7 @@ describe('Validators routes', () => { epochReward: 0, identity: identity.identifier, identityBalance: 0, - epochInfo: {...fullEpochInfo}, + epochInfo: { ...fullEpochInfo }, withdrawalsCount: null, lastWithdrawal: null, lastWithdrawalTime: null, @@ -1365,7 +1365,7 @@ describe('Validators routes', () => { }) it('should be able to walk through pages', async () => { - const {body} = await client.get('/validators?page=2&isActive=false') + const { body } = await client.get('/validators?page=2&isActive=false') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -1397,7 +1397,7 @@ describe('Validators routes', () => { epochReward: 0, identity: identity.identifier, identityBalance: 0, - epochInfo: {...fullEpochInfo}, + epochInfo: { ...fullEpochInfo }, withdrawalsCount: null, lastWithdrawal: null, lastWithdrawalTime: null, @@ -1409,7 +1409,7 @@ describe('Validators routes', () => { }) it('should return custom page size', async () => { - const {body} = await client.get('/validators?limit=7&isActive=false') + const { body } = await client.get('/validators?limit=7&isActive=false') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -1441,7 +1441,7 @@ describe('Validators routes', () => { epochReward: 0, identity: identity.identifier, identityBalance: 0, - epochInfo: {...fullEpochInfo}, + epochInfo: { ...fullEpochInfo }, withdrawalsCount: null, lastWithdrawal: null, lastWithdrawalTime: null, @@ -1453,7 +1453,7 @@ describe('Validators routes', () => { }) it('should allow to walk through pages with custom page size', async () => { - const {body} = await client.get('/validators?limit=7&page=2&isActive=false') + const { body } = await client.get('/validators?limit=7&page=2&isActive=false') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -1485,7 +1485,7 @@ describe('Validators routes', () => { epochReward: 0, identity: identity.identifier, identityBalance: 0, - epochInfo: {...fullEpochInfo}, + epochInfo: { ...fullEpochInfo }, withdrawalsCount: null, lastWithdrawal: null, lastWithdrawalTime: null, @@ -1497,7 +1497,7 @@ describe('Validators routes', () => { }) it('should allow to walk through pages with custom page size desc', async () => { - const {body} = await client.get('/validators?limit=5&page=4&order=desc&isActive=false') + const { body } = await client.get('/validators?limit=5&page=4&order=desc&isActive=false') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -1542,7 +1542,7 @@ describe('Validators routes', () => { epochReward: 0, identity: identity.identifier, identityBalance: 0, - epochInfo: {...fullEpochInfo}, + epochInfo: { ...fullEpochInfo }, withdrawalsCount: null, lastWithdrawal: null, lastWithdrawalTime: null, @@ -1554,7 +1554,7 @@ describe('Validators routes', () => { }) it('should return less items when when it is out of bounds', async () => { - const {body} = await client.get('/validators?limit=3&page=7&isActive=false') + const { body } = await client.get('/validators?limit=3&page=7&isActive=false') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -1598,7 +1598,7 @@ describe('Validators routes', () => { epochReward: 0, identity: identity.identifier, identityBalance: 0, - epochInfo: {...fullEpochInfo}, + epochInfo: { ...fullEpochInfo }, withdrawalsCount: null, lastWithdrawal: null, lastWithdrawalTime: null, @@ -1610,7 +1610,7 @@ describe('Validators routes', () => { }) it('should return less items when there is none on the one bound', async () => { - const {body} = await client.get('/validators?page=4&isActive=false') + const { body } = await client.get('/validators?page=4&isActive=false') .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -1650,7 +1650,7 @@ describe('Validators routes', () => { it('should return stats by proTxHash', async () => { const [, validator] = validators - const {body} = await client.get(`/validator/${validator.pro_tx_hash}/stats`) + const { body } = await client.get(`/validator/${validator.pro_tx_hash}/stats`) .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -1685,7 +1685,7 @@ describe('Validators routes', () => { it('should return stats by proTxHash with custom timespan', async () => { const [, validator] = validators - const {body} = await client.get(`/validator/${validator.pro_tx_hash}/stats?start=${new Date().toISOString()}&end=${new Date(new Date().getTime() + 80600000).toISOString()}`) + const { body } = await client.get(`/validator/${validator.pro_tx_hash}/stats?start=${new Date().toISOString()}&end=${new Date(new Date().getTime() + 80600000).toISOString()}`) .expect(200) .expect('Content-Type', 'application/json; charset=utf-8') @@ -1723,7 +1723,7 @@ describe('Validators routes', () => { const start = new Date() const end = new Date(start.getTime() + 80600000) - const {body} = await client.get(`/validator/${validator.pro_tx_hash}/stats?start=${start.toISOString()}&end=${end.toISOString()}&intervalsCount=3`) + const { body } = await client.get(`/validator/${validator.pro_tx_hash}/stats?start=${start.toISOString()}&end=${end.toISOString()}&intervalsCount=3`) .expect(200) .expect('Content-Type', 'application/json; charset=utf-8')