Skip to content

Commit

Permalink
update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
prdn committed Mar 18, 2023
1 parent 573e0a9 commit f6715d6
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 24 deletions.
5 changes: 2 additions & 3 deletions lib/Grape.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const async = require('async')
const http = require('http')
const Events = require('events')
const debug = require('debug')('grenache:grape')
const crypto = require('ed25519-supercop')
const getRawBody = require('raw-body')

const noop = () => {}
Expand Down Expand Up @@ -48,7 +47,7 @@ class Grape extends Events {
host: this.conf.host || false,
bootstrap: this.conf.dht_bootstrap,
timeBucketOutdated: this.conf.dht_nodeLiveness,
verify: crypto.verify,
verify: this.conf.verify,
maxAge: this.conf.dht_peer_maxAge
})

Expand Down Expand Up @@ -352,7 +351,7 @@ class Grape extends Events {
async.series([
(cb) => this.node ? this.node.destroy(cb) : cb(),
(cb) => {
let httpsSrv = this._interface.http
const httpsSrv = this._interface.http
if (!httpsSrv) return cb()

httpsSrv.close(cb)
Expand Down
19 changes: 9 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@
"micro-services"
],
"dependencies": {
"async": "^2.6.1",
"bittorrent-dht": "^9.0.0",
"async": "^3.2.4",
"bittorrent-dht": "^10.0.0",
"cbq": "0.0.1",
"debug": "^4.0.1",
"ed25519-supercop": "^2.0.0",
"lodash": "^4.17.11",
"raw-body": "^2.3.2",
"record-cache": "^1.1.0",
"yargs": "^13.3.2"
"lodash": "^4.17.21",
"raw-body": "^2.5.2",
"record-cache": "^1.2.0",
"yargs": "^17.7.1"
},
"engine": {
"node": ">=6.0"
Expand All @@ -28,10 +27,10 @@
},
"main": "index.js",
"devDependencies": {
"chai": "^3.2.0",
"mocha": "^9.0.1",
"chai": "^4.3.7",
"mocha": "^10.2.0",
"request": "^2.88.0",
"standard": "^12.0.1"
"standard": "^17.0.0"
},
"scripts": {
"test": "npm run lint && npm run unit",
Expand Down
8 changes: 4 additions & 4 deletions test/announce.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('service announce', () => {
grape2.on('announce', () => {
grape2.lookup('rest:util:net', (err, res) => {
assert.strictEqual(err, null)
assert.deepStrictEqual(res, [ '127.0.0.1:1337' ])
assert.deepStrictEqual(res, ['127.0.0.1:1337'])
stop(done)
})
})
Expand All @@ -35,7 +35,7 @@ describe('service announce', () => {
grape2.on('announce', () => {
grape2.lookup('rest:util:net', (err, res) => {
assert.strictEqual(err, null)
assert.deepStrictEqual(res, [ '127.0.0.1:1337' ])
assert.deepStrictEqual(res, ['127.0.0.1:1337'])
setTimeout(lookup, 300)
})
})
Expand Down Expand Up @@ -191,7 +191,7 @@ describe('service announce', () => {

function lookup (onlookup) {
let missing = 4
let res = [{}, {}]
const res = [{}, {}]

get(g2, 'A')
get(g2, 'B')
Expand Down Expand Up @@ -260,7 +260,7 @@ describe('service announce', () => {

function lookup (onlookup) {
let missing = 4
let res = [{}, {}]
const res = [{}, {}]

get(g2, 'A')
get(g2, 'B')
Expand Down
2 changes: 1 addition & 1 deletion test/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function createGrapes (n, onstart) {
for (let i = 0; i < n; i++) {
const grape = new Grape({
dht_port: 20001 + i,
dht_bootstrap: [ '127.0.0.1:' + (20001 + (i + 1) % 2) ],
dht_bootstrap: ['127.0.0.1:' + (20001 + (i + 1) % 2)],
api_port: 40001 + i,
dht_peer_maxAge: 200
})
Expand Down
4 changes: 2 additions & 2 deletions test/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ describe('Grape integration', () => {
it('should emit a ready event', (done) => {
const grape1 = new Grape({
dht_port: 20002,
dht_bootstrap: [ '127.0.0.1:20001' ],
dht_bootstrap: ['127.0.0.1:20001'],
api_port: 40001
})

grape1.start(() => {})

const grape2 = new Grape({
dht_port: 20001,
dht_bootstrap: [ '127.0.0.1:20002' ],
dht_bootstrap: ['127.0.0.1:20002'],
api_port: 30002
})

Expand Down
2 changes: 1 addition & 1 deletion test/mininet/helpers/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function bootstrap (tapenet, t) {

const grape = new Grape({
dht_port: 20001,
dht_bootstrap: [ node ],
dht_bootstrap: [node],
api_port: 40001
})

Expand Down
6 changes: 3 additions & 3 deletions test/put-get.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ describe('put-get-bep44', () => {

grape2.on('announce', () => {
const data = {
'v': 'hello world'
v: 'hello world'
}

request.post({
uri: 'http://127.0.0.1:40001/put',
json: true,
body: { rid: 'test', data: data }
body: { rid: 'test', data }
}, (err, res, hash) => {
if (err) throw err

Expand All @@ -46,7 +46,7 @@ describe('put-get-bep44', () => {

assert.strictEqual(res.v, 'hello world')

getValue({ hash: hash }, (err, res) => {
getValue({ hash }, (err, res) => {
if (err) throw err

assert.strictEqual(res.v, 'hello world')
Expand Down

0 comments on commit f6715d6

Please sign in to comment.