From d8629b7fbc47d8137c6f621376a97c104e91e877 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Tue, 8 Jun 2021 22:02:22 +1000 Subject: [PATCH] Define type for WakuRelay create options --- src/lib/waku_relay/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/waku_relay/index.ts b/src/lib/waku_relay/index.ts index 368e580fda..b11eef2a1d 100644 --- a/src/lib/waku_relay/index.ts +++ b/src/lib/waku_relay/index.ts @@ -36,7 +36,8 @@ interface GossipOptions { doPX: boolean; msgIdFn: MessageIdFunction; messageCache: MessageCache; - globalSignaturePolicy: string; + // This option is always overridden + // globalSignaturePolicy: string; scoreParams: Partial; scoreThresholds: Partial; directPeers: AddrInfo[]; @@ -48,6 +49,8 @@ interface GossipOptions { Dlazy: number; } +export type WakuRelayOptions = GossipOptions; + /** * Implements the [Waku v2 Relay protocol]{@link https://rfc.vac.dev/spec/11/}. * Must be passed as a `pubsub` module to a {Libp2p} instance. @@ -70,7 +73,7 @@ export class WakuRelay extends Gossipsub implements Pubsub { * @param {Libp2p} libp2p * @param {Partial} [options] */ - constructor(libp2p: Libp2p, options?: Partial) { + constructor(libp2p: Libp2p, options?: Partial) { super( libp2p, Object.assign(options, {