diff --git a/packages/core/src/lib/enr/enr.node.spec.ts b/packages/core/src/lib/enr/enr.node.spec.ts index 3753582875..565a6ed805 100644 --- a/packages/core/src/lib/enr/enr.node.spec.ts +++ b/packages/core/src/lib/enr/enr.node.spec.ts @@ -1,10 +1,10 @@ import { createLightNode } from "@waku/create"; +import type { WakuLight } from "@waku/interfaces"; +import { Protocols } from "@waku/interfaces"; import { expect } from "chai"; import { makeLogFileName, NOISE_KEY_1, Nwaku } from "../../test_utils"; -import type { WakuLight } from "../interfaces"; import { waitForRemotePeer } from "../wait_for_remote_peer"; -import { Protocols } from "../waku"; import { ENR } from "./enr"; @@ -92,7 +92,7 @@ describe("ENR Interop: nwaku", function () { }); const multiAddrWithId = await nwaku.getMultiaddrWithId(); - waku = await createWaku({ + waku = await createLightNode({ staticNoiseKey: NOISE_KEY_1, }); await waku.start(); diff --git a/packages/core/src/lib/wait_for_remote_peer.node.spec.ts b/packages/core/src/lib/wait_for_remote_peer.node.spec.ts index 7c22b27d02..25e219b093 100644 --- a/packages/core/src/lib/wait_for_remote_peer.node.spec.ts +++ b/packages/core/src/lib/wait_for_remote_peer.node.spec.ts @@ -1,12 +1,12 @@ import { createLightNode, createPrivacyNode } from "@waku/create"; +import type { WakuLight, WakuPrivacy } from "@waku/interfaces"; +import { Protocols } from "@waku/interfaces"; import { expect } from "chai"; import { makeLogFileName, NOISE_KEY_1, Nwaku } from "../test_utils"; import { delay } from "../test_utils/delay"; -import type { WakuLight, WakuPrivacy } from "./interfaces"; import { waitForRemotePeer } from "./wait_for_remote_peer"; -import { Protocols } from "./waku"; describe("Wait for remote peer", function () { let waku1: WakuPrivacy; diff --git a/packages/core/src/lib/waku.node.spec.ts b/packages/core/src/lib/waku.node.spec.ts index f1de32548d..22187366f5 100644 --- a/packages/core/src/lib/waku.node.spec.ts +++ b/packages/core/src/lib/waku.node.spec.ts @@ -1,5 +1,7 @@ import type { PeerId } from "@libp2p/interface-peer-id"; import { createLightNode, createPrivacyNode } from "@waku/create"; +import type { Message, Waku, WakuLight, WakuPrivacy } from "@waku/interfaces"; +import { Protocols } from "@waku/interfaces"; import { expect } from "chai"; import { @@ -10,11 +12,9 @@ import { } from "../test_utils/"; import { generateSymmetricKey } from "./crypto"; -import type { Message, Waku, WakuLight, WakuPrivacy } from "./interfaces"; import { PeerDiscoveryStaticPeers } from "./peer_discovery_static_list"; import { bytesToUtf8, utf8ToBytes } from "./utils"; import { waitForRemotePeer } from "./wait_for_remote_peer"; -import { Protocols } from "./waku"; import { SymDecoder, SymEncoder } from "./waku_message/version_1.js"; const TestContentTopic = "/test/1/waku/utf8"; diff --git a/packages/core/src/lib/waku.spec.ts b/packages/core/src/lib/waku.spec.ts index cd670ee90d..a55da2c16e 100644 --- a/packages/core/src/lib/waku.spec.ts +++ b/packages/core/src/lib/waku.spec.ts @@ -1,12 +1,11 @@ import type { PeerId } from "@libp2p/interface-peer-id"; -import { createWaku } from "@waku/create"; +import { createLightNode } from "@waku/create"; +import type { WakuLight } from "@waku/interfaces"; import { expect } from "chai"; -import type { Waku } from "./interfaces"; - describe("Waku Dial", function () { describe("Bootstrap [live data]", function () { - let waku: Waku; + let waku: WakuLight; afterEach(function () { !!waku && waku.stop().catch((e) => console.log("Waku failed to stop", e)); @@ -23,7 +22,7 @@ describe("Waku Dial", function () { // This dependence must be removed once DNS discovery is implemented this.timeout(20_000); - waku = await createWaku({ + waku = await createLightNode({ defaultBootstrap: true, }); await waku.start(); diff --git a/packages/core/src/lib/waku_filter/index.node.spec.ts b/packages/core/src/lib/waku_filter/index.node.spec.ts index 205335de36..705a813691 100644 --- a/packages/core/src/lib/waku_filter/index.node.spec.ts +++ b/packages/core/src/lib/waku_filter/index.node.spec.ts @@ -1,13 +1,13 @@ +import { createFullNode } from "@waku/create"; +import type { Message, WakuFull } from "@waku/interfaces"; +import { Protocols } from "@waku/interfaces"; import { expect } from "chai"; import debug from "debug"; import { makeLogFileName, NOISE_KEY_1, Nwaku } from "../../test_utils"; import { delay } from "../../test_utils/delay"; -import { createFullNode } from "../create_waku"; -import type { Message, WakuFull } from "../interfaces"; import { bytesToUtf8, utf8ToBytes } from "../utils"; import { waitForRemotePeer } from "../wait_for_remote_peer"; -import { Protocols } from "../waku"; import { DecoderV0, EncoderV0 } from "../waku_message/version_0"; const log = debug("waku:test"); diff --git a/packages/core/src/lib/waku_filter/index.ts b/packages/core/src/lib/waku_filter/index.ts index 9b526b5d45..a2f9c3c7d6 100644 --- a/packages/core/src/lib/waku_filter/index.ts +++ b/packages/core/src/lib/waku_filter/index.ts @@ -82,7 +82,7 @@ export class WakuFilter implements Filter { callback: Callback, opts?: ProtocolOptions ): Promise { - const topic = opts?.pubsubTopic ?? this.pubSubTopic; + const topic = opts?.pubSubTopic ?? this.pubSubTopic; const groupedDecoders = groupByContentTopic(decoders); const contentTopics = Array.from(groupedDecoders.keys()); diff --git a/packages/core/src/lib/waku_light_push/index.node.spec.ts b/packages/core/src/lib/waku_light_push/index.node.spec.ts index 6a9eeb92f6..f05a0234cb 100644 --- a/packages/core/src/lib/waku_light_push/index.node.spec.ts +++ b/packages/core/src/lib/waku_light_push/index.node.spec.ts @@ -1,3 +1,6 @@ +import { createFullNode } from "@waku/create"; +import type { WakuFull } from "@waku/interfaces"; +import { Protocols } from "@waku/interfaces"; import { expect } from "chai"; import debug from "debug"; @@ -8,11 +11,8 @@ import { Nwaku, } from "../../test_utils"; import { delay } from "../../test_utils/delay"; -import { createFullNode } from "../create_waku"; -import type { WakuFull } from "../interfaces"; import { bytesToUtf8, utf8ToBytes } from "../utils"; import { waitForRemotePeer } from "../wait_for_remote_peer"; -import { Protocols } from "../waku"; import { EncoderV0 } from "../waku_message/version_0"; const log = debug("waku:test:lightpush"); diff --git a/packages/core/src/lib/waku_light_push/index.ts b/packages/core/src/lib/waku_light_push/index.ts index 95ac899349..78600fe9d2 100644 --- a/packages/core/src/lib/waku_light_push/index.ts +++ b/packages/core/src/lib/waku_light_push/index.ts @@ -56,7 +56,7 @@ export class WakuLightPush { message: Partial, opts?: ProtocolOptions ): Promise { - const pubSubTopic = opts?.pubsubTopic ? opts.pubsubTopic : this.pubSubTopic; + const pubSubTopic = opts?.pubSubTopic ? opts.pubSubTopic : this.pubSubTopic; const res = await selectPeerForProtocol( this.libp2p.peerStore, diff --git a/packages/core/src/lib/waku_relay/index.node.spec.ts b/packages/core/src/lib/waku_relay/index.node.spec.ts index 931a2c0e32..7b0af2cdfc 100644 --- a/packages/core/src/lib/waku_relay/index.node.spec.ts +++ b/packages/core/src/lib/waku_relay/index.node.spec.ts @@ -1,4 +1,7 @@ import { PeerId } from "@libp2p/interface-peer-id"; +import { createPrivacyNode } from "@waku/create"; +import type { Message, WakuPrivacy } from "@waku/interfaces"; +import { Protocols } from "@waku/interfaces"; import { expect } from "chai"; import debug from "debug"; @@ -12,16 +15,13 @@ import { } from "../../test_utils"; import { delay } from "../../test_utils/delay"; import { DefaultPubSubTopic } from "../constants"; -import { createPrivacyNode } from "../create_waku"; import { generatePrivateKey, generateSymmetricKey, getPublicKey, } from "../crypto"; -import type { Message, WakuPrivacy } from "../interfaces"; import { bytesToUtf8, utf8ToBytes } from "../utils"; import { waitForRemotePeer } from "../wait_for_remote_peer"; -import { Protocols } from "../waku"; import { DecoderV0, EncoderV0, MessageV0 } from "../waku_message/version_0.js"; import { AsymDecoder, diff --git a/packages/core/src/lib/waku_store/index.node.spec.ts b/packages/core/src/lib/waku_store/index.node.spec.ts index aa841db6e6..5cd8fc39e9 100644 --- a/packages/core/src/lib/waku_store/index.node.spec.ts +++ b/packages/core/src/lib/waku_store/index.node.spec.ts @@ -1,3 +1,6 @@ +import { createFullNode } from "@waku/create"; +import type { Message, WakuFull } from "@waku/interfaces"; +import { Protocols } from "@waku/interfaces"; import { expect } from "chai"; import debug from "debug"; @@ -7,16 +10,13 @@ import { NOISE_KEY_2, Nwaku, } from "../../test_utils"; -import { createFullNode } from "../create_waku"; import { generatePrivateKey, generateSymmetricKey, getPublicKey, } from "../crypto"; -import type { Message, WakuFull } from "../interfaces"; import { bytesToUtf8, utf8ToBytes } from "../utils"; import { waitForRemotePeer } from "../wait_for_remote_peer"; -import { Protocols } from "../waku"; import { DecoderV0, EncoderV0 } from "../waku_message/version_0.js"; import { AsymDecoder, diff --git a/packages/interfaces/src/index.ts b/packages/interfaces/src/index.ts index 105230f424..0538cca2fe 100644 --- a/packages/interfaces/src/index.ts +++ b/packages/interfaces/src/index.ts @@ -18,7 +18,7 @@ export interface PointToPointProtocol { } export type ProtocolOptions = { - pubsubTopic?: string; + pubSubTopic?: string; /** * Optionally specify an PeerId for the protocol request. If not included, will use a random peer. */