From 5a20167c580093a07259a20bc44d1aade3214392 Mon Sep 17 00:00:00 2001 From: Vasco Santos Date: Wed, 21 Apr 2021 17:21:31 +0200 Subject: [PATCH] fix: use dht selectors and validators from interfaces --- package.json | 2 +- src/index.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 843b960..ea65ed3 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "it-pair": "^1.0.0", "libp2p": "^0.30.9", "libp2p-gossipsub": "^0.8.0", - "libp2p-interfaces": "^0.8.3", + "libp2p-interfaces": "libp2p/js-libp2p-interfaces#chore/add-dht-selectors-validators", "libp2p-record": "^0.10.0", "p-wait-for": "^3.1.0", "peer-id": "^0.14.2", diff --git a/src/index.js b/src/index.js index 7c8eda8..b1a3b9b 100644 --- a/src/index.js +++ b/src/index.js @@ -14,7 +14,7 @@ const log = Object.assign(debug('datastore-pubsub:publisher'), { * @typedef {import('peer-id')} PeerId * @typedef {import('./types').Validator} Validator * @typedef {import('./types').SubscriptionKeyFn} SubscriptionKeyFn - * @typedef {import('libp2p-interfaces/src/pubsub/message').Message} PubSubMessage + * @typedef {import('libp2p-interfaces/src/pubsub').InMessage} PubSubMessage */ // DatastorePubsub is responsible for providing an api for pubsub to be used as a datastore with @@ -182,6 +182,7 @@ class DatastorePubsub extends Adapter { */ async _onMessage (msg) { const { data, from, topicIDs } = msg + let key try { key = topicToKey(topicIDs[0])