Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
owl352 committed Nov 13, 2024
1 parent 0b8800a commit 848e972
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 86 deletions.
38 changes: 19 additions & 19 deletions packages/api/test/integration/transactions.spec.js
Original file line number Diff line number Diff line change
@@ -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')
Expand Down Expand Up @@ -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, {
Expand All @@ -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, {
Expand All @@ -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++) {
Expand All @@ -77,7 +77,7 @@ describe('Transaction routes', () => {
index: j
})

transactions.push({transaction, block})
transactions.push({ transaction, block })
}
}
})
Expand All @@ -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')

Expand All @@ -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')

Expand Down Expand Up @@ -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')

Expand Down Expand Up @@ -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')

Expand Down Expand Up @@ -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')

Expand Down Expand Up @@ -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')

Expand Down Expand Up @@ -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')

Expand Down Expand Up @@ -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')

Expand Down Expand Up @@ -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')

Expand Down Expand Up @@ -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')

Expand Down Expand Up @@ -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')

Expand Down Expand Up @@ -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')

Expand Down
Loading

0 comments on commit 848e972

Please sign in to comment.