From 88b04156bf614650c2b14d49b12e969c5eecf04d Mon Sep 17 00:00:00 2001 From: Vasco Santos Date: Thu, 22 Apr 2021 09:53:55 +0200 Subject: [PATCH] fix: keychain optional pw and use interfaces for validators and selectors instead (#924) --- package.json | 2 +- src/index.js | 7 ++----- src/keychain/index.js | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 2c8cb55ac5..ed0662c6f7 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "it-pipe": "^1.1.0", "it-take": "1.0.0", "libp2p-crypto": "^0.19.0", - "libp2p-interfaces": "^0.10.1", + "libp2p-interfaces": "^0.10.3", "libp2p-utils": "^0.3.1", "mafmt": "^9.0.0", "merge-options": "^3.0.4", diff --git a/src/index.js b/src/index.js index 5e573b2577..deccf80aaf 100644 --- a/src/index.js +++ b/src/index.js @@ -56,9 +56,6 @@ const { updateSelfPeerRecord } = require('./record/utils') * @property {MuxedStream} stream * @property {string} protocol * - * @typedef {{ [key: string]: function (Uint8Array, Uint8Array[]): number }} DhtSelectors - * @typedef {{ [key: string]: { func: (key: Uint8Array, value: Uint8Array) => Promise }}} DhtValidators - * * @typedef {Object} RandomWalkOptions * @property {boolean} [enabled = false] * @property {number} [queriesPerPeriod = 1] @@ -70,8 +67,8 @@ const { updateSelfPeerRecord } = require('./record/utils') * @property {number} [kBucketSize = 20] * @property {RandomWalkOptions} [randomWalk] * @property {boolean} [clientMode] - * @property {DhtSelectors} [selectors] - * @property {DhtValidators} [validators] + * @property {import('libp2p-interfaces/src/types').DhtSelectors} [selectors] + * @property {import('libp2p-interfaces/src/types').DhtValidators} [validators] * * @typedef {Object} KeychainOptions * @property {Datastore} [datastore] diff --git a/src/keychain/index.js b/src/keychain/index.js index 0cf13d0515..05c187a412 100644 --- a/src/keychain/index.js +++ b/src/keychain/index.js @@ -26,7 +26,7 @@ require('node-forge/lib/sha512') * @property {number} keyLength * * @typedef {Object} KeychainOptions - * @property {string} pass + * @property {string} [pass] * @property {DekOptions} [dek] */