Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,085 changes: 1,221 additions & 864 deletions package-lock.json

Large diffs are not rendered by default.

31 changes: 18 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,21 @@
"start": "node worker.js --wtype wrk-node-http --env production --port 3000"
},
"dependencies": {
"@fastify/websocket": "8.3.1",
"@fastify/websocket": "11.2.0",
"@bitfinex/bfx-svc-boot-js": "1.2.0",
"@bitfinex/bfx-facs-db-sqlite": "git+https://github.com/bitfinexcom/bfx-facs-db-sqlite.git",
"@bitfinex/bfx-facs-http": "git+https://github.com/bitfinexcom/bfx-facs-http.git",
"@bitfinex/bfx-facs-interval": "git+https://github.com/bitfinexcom/bfx-facs-interval.git",
"@bitfinex/bfx-facs-lru": "git+https://github.com/bitfinexcom/bfx-facs-lru.git",
"@bitfinex/lib-js-util-base": "git+https://github.com/bitfinexcom/lib-js-util-base.git",
"@tetherto/hp-svc-facs-store": "git+https://github.com/tetherto/hp-svc-facs-store.git#v1.0.0",
"@tetherto/svc-facs-auth": "git+https://github.com/tetherto/svc-facs-auth.git#v1.0.0",
"@tetherto/svc-facs-httpd": "git+https://github.com/tetherto/svc-facs-httpd.git#v1.0.0",
"@tetherto/svc-facs-httpd-oauth2": "git+https://github.com/tetherto/svc-facs-httpd-oauth2.git#v1.0.0",
"@tetherto/tether-wrk-base": "git+https://github.com/tetherto/tether-wrk-base.git#v1.0.0",
"async": "3.2.6",
"bfx-facs-db-sqlite": "git+https://github.com/bitfinexcom/bfx-facs-db-sqlite.git",
"bfx-facs-http": "git+https://github.com/bitfinexcom/bfx-facs-http.git",
"bfx-facs-interval": "git+https://github.com/bitfinexcom/bfx-facs-interval.git",
"bfx-facs-lru": "git+https://github.com/bitfinexcom/bfx-facs-lru.git",
"debug": "4.4.1",
"hp-svc-facs-store": "git+https://github.com/tetherto/hp-svc-facs-store.git",
"lib-js-util-base": "git+https://github.com/bitfinexcom/lib-js-util-base.git",
"mingo": "6.4.6",
"svc-facs-auth": "git+https://github.com/tetherto/svc-facs-auth.git",
"svc-facs-httpd": "git+https://github.com/tetherto/svc-facs-httpd.git",
"svc-facs-httpd-oauth2": "git+https://github.com/tetherto/svc-facs-httpd-oauth2.git",
"tether-wrk-base": "git+https://github.com/tetherto/tether-wrk-base.git"
"mingo": "6.4.6"
},
"devDependencies": {
"brittle": "3.18.0",
Expand All @@ -51,6 +52,10 @@
"tether-svc-test-helper": "git+https://github.com/tetherto/tether-svc-test-helper.git"
},
"overrides": {
"tar": ">=7.5.4"
"@tootallnate/once": "3.0.1",
"tar": ">=7.5.4",
"fastify": "5.8.5",
"@fastify/static": "9.1.3",
"@fastify/oauth2": "8.2.0"
}
}
5 changes: 3 additions & 2 deletions tests/integration/api.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const test = require('brittle')
const fs = require('fs')
const { createWorker } = require('tether-svc-test-helper').worker
const { setTimeout: sleep } = require('timers/promises')
const HttpFacility = require('bfx-facs-http')
const HttpFacility = require('@bitfinex/bfx-facs-http')
const { ENDPOINTS } = require('../../workers/lib/constants')
const { MOCK_MINERS: mockMiners } = require('./helpers/mock-data')

Expand Down Expand Up @@ -1007,7 +1007,8 @@ test('Api', { timeout: 90000 }, async (main) => {

await main.test('Api: delete actions/voting/cancel', async (n) => {
const api = `${appNodeBaseUrl}${ENDPOINTS.ACTIONS_CANCEL}?ids=1`
await testDeleteEndpointSecurityWithPermissions(n, httpClient, api, invalidToken, readonlyUser, 'ERR_WRITE_PERM_REQUIRED', siteOperatorUser, {}, encoding)
// Fastify rejects application/json with an empty body; send {} so json encoding is valid
await testDeleteEndpointSecurityWithPermissions(n, httpClient, api, invalidToken, readonlyUser, 'ERR_WRITE_PERM_REQUIRED', siteOperatorUser, { body: {} }, encoding)
})

await main.test('Api: post users', async (n) => {
Expand Down
29 changes: 13 additions & 16 deletions tests/unit/routes/ws.routes.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,24 +94,21 @@ test('ws routes - handler adds client to wsClients', async (t) => {

const wsRoute = routes.find(r => r.websocket === true)
if (wsRoute?.handler) {
const mockConn = {
socket: {
subscriptions: new Set(),
on: function (event, handler) {
if (event === 'close' || event === 'error') {
// Store handlers for testing
this._closeHandler = handler
this._errorHandler = handler
} else if (event === 'message') {
this._messageHandler = handler
}
},
send: function () {}
}
const mockSocket = {
subscriptions: new Set(),
on: function (event, handler) {
if (event === 'close' || event === 'error') {
this._closeHandler = handler
this._errorHandler = handler
} else if (event === 'message') {
this._messageHandler = handler
}
},
send: function () {}
}

await wsRoute.handler(mockConn)
t.ok(mockCtx.wsClients.has(mockConn.socket), 'should add socket to wsClients')
await wsRoute.handler(mockSocket)
t.ok(mockCtx.wsClients.has(mockSocket), 'should add socket to wsClients')
}

t.pass()
Expand Down
Loading
Loading