Skip to content

Commit

Permalink
fix check & update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
weboko committed Oct 2, 2024
1 parent 9742d68 commit 0f09905
Show file tree
Hide file tree
Showing 17 changed files with 33 additions and 37 deletions.
5 changes: 3 additions & 2 deletions packages/interfaces/src/light_push.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { IBaseProtocolCore } from "./protocols.js";
import { IBaseProtocolCore, IBaseProtocolSDK } from "./protocols.js";
import type { ISender } from "./sender.js";

export type ILightPush = ISender & { protocol: IBaseProtocolCore };
export type ILightPush = ISender &
IBaseProtocolSDK & { protocol: IBaseProtocolCore };
2 changes: 1 addition & 1 deletion packages/tests/tests/enr.node.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { waitForRemotePeer } from "@waku/core";
import { EnrDecoder } from "@waku/enr";
import type { RelayNode } from "@waku/interfaces";
import { Protocols } from "@waku/interfaces";
import { createRelayNode } from "@waku/relay";
import { waitForRemotePeer } from "@waku/sdk";
import { expect } from "chai";

import {
Expand Down
9 changes: 2 additions & 7 deletions packages/tests/tests/ephemeral.node.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
createDecoder,
createEncoder,
DecodedMessage,
waitForRemotePeer
} from "@waku/core";
import { createDecoder, createEncoder, DecodedMessage } from "@waku/core";
import { Protocols } from "@waku/interfaces";
import type { LightNode } from "@waku/interfaces";
import {
Expand All @@ -19,7 +14,7 @@ import {
createDecoder as createSymDecoder,
createEncoder as createSymEncoder
} from "@waku/message-encryption/symmetric";
import { createLightNode } from "@waku/sdk";
import { createLightNode, waitForRemotePeer } from "@waku/sdk";
import { contentTopicToPubsubTopic, Logger } from "@waku/utils";
import { bytesToUtf8, utf8ToBytes } from "@waku/utils/bytes";
import { expect } from "chai";
Expand Down
3 changes: 1 addition & 2 deletions packages/tests/tests/filter/push.node.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { waitForRemotePeer } from "@waku/core";
import { LightNode, Protocols } from "@waku/interfaces";
import { utf8ToBytes } from "@waku/sdk";
import { utf8ToBytes, waitForRemotePeer } from "@waku/sdk";
import { expect } from "chai";

import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { createDecoder, createEncoder, waitForRemotePeer } from "@waku/core";
import { createDecoder, createEncoder } from "@waku/core";
import type {
ContentTopicInfo,
LightNode,
ShardInfo,
SingleShardInfo
} from "@waku/interfaces";
import { Protocols } from "@waku/interfaces";
import { waitForRemotePeer } from "@waku/sdk";
import {
contentTopicToPubsubTopic,
contentTopicToShardIndex,
Expand Down
3 changes: 1 addition & 2 deletions packages/tests/tests/filter/single_node/push.node.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { waitForRemotePeer } from "@waku/core";
import { LightNode, Protocols } from "@waku/interfaces";
import { utf8ToBytes } from "@waku/sdk";
import { utf8ToBytes, waitForRemotePeer } from "@waku/sdk";
import { expect } from "chai";

import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createDecoder, createEncoder, waitForRemotePeer } from "@waku/core";
import { createDecoder, createEncoder } from "@waku/core";
import { LightNode, Protocols } from "@waku/interfaces";
import {
ecies,
Expand All @@ -7,7 +7,7 @@ import {
getPublicKey,
symmetric
} from "@waku/message-encryption";
import { utf8ToBytes } from "@waku/sdk";
import { utf8ToBytes, waitForRemotePeer } from "@waku/sdk";
import { expect } from "chai";
import type { Context } from "mocha";

Expand Down
4 changes: 2 additions & 2 deletions packages/tests/tests/filter/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createDecoder, createEncoder, waitForRemotePeer } from "@waku/core";
import { createDecoder, createEncoder } from "@waku/core";
import {
DefaultNetworkConfig,
ISubscriptionSDK,
Expand All @@ -8,7 +8,7 @@ import {
Protocols,
Waku
} from "@waku/interfaces";
import { createLightNode } from "@waku/sdk";
import { createLightNode, waitForRemotePeer } from "@waku/sdk";
import {
contentTopicToPubsubTopic,
derivePubsubTopicsFromNetworkConfig,
Expand Down
5 changes: 3 additions & 2 deletions packages/tests/tests/getPeers.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Connection, Peer, PeerStore } from "@libp2p/interface";
import { createSecp256k1PeerId } from "@libp2p/peer-id-factory";
import { LightPushCodec, waitForRemotePeer } from "@waku/core";
import { LightPushCodec } from "@waku/core";
import {
ContentTopicInfo,
createLightNode,
Expand All @@ -9,7 +9,8 @@ import {
Protocols,
ShardInfo,
Tags,
utf8ToBytes
utf8ToBytes,
waitForRemotePeer
} from "@waku/sdk";
import {
encodeRelayShard,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { PeerId } from "@libp2p/interface";
import { createEncoder, waitForRemotePeer } from "@waku/core";
import { createEncoder } from "@waku/core";
import {
ContentTopicInfo,
LightNode,
Expand All @@ -8,6 +8,7 @@ import {
ShardInfo,
SingleShardInfo
} from "@waku/interfaces";
import { waitForRemotePeer } from "@waku/sdk";
import {
contentTopicToPubsubTopic,
contentTopicToShardIndex,
Expand Down
3 changes: 2 additions & 1 deletion packages/tests/tests/relay/interop.node.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type { PeerId } from "@libp2p/interface";
import { DecodedMessage, waitForRemotePeer } from "@waku/core";
import { DecodedMessage } from "@waku/core";
import { Protocols, RelayNode } from "@waku/interfaces";
import { createRelayNode } from "@waku/relay";
import { waitForRemotePeer } from "@waku/sdk";
import { bytesToUtf8, utf8ToBytes } from "@waku/utils/bytes";
import { expect } from "chai";

Expand Down
8 changes: 2 additions & 6 deletions packages/tests/tests/relay/multiple_pubsub.node.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
createDecoder,
createEncoder,
DecodedMessage,
waitForRemotePeer
} from "@waku/core";
import { createDecoder, createEncoder, DecodedMessage } from "@waku/core";
import {
ContentTopicInfo,
RelayNode,
Expand All @@ -12,6 +7,7 @@ import {
} from "@waku/interfaces";
import { Protocols } from "@waku/interfaces";
import { createRelayNode } from "@waku/relay";
import { waitForRemotePeer } from "@waku/sdk";
import {
contentTopicToPubsubTopic,
pubsubTopicToSingleShardInfo,
Expand Down
3 changes: 2 additions & 1 deletion packages/tests/tests/relay/utils.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { createDecoder, createEncoder, waitForRemotePeer } from "@waku/core";
import { createDecoder, createEncoder } from "@waku/core";
import {
NetworkConfig,
Protocols,
RelayNode,
ShardInfo
} from "@waku/interfaces";
import { createRelayNode } from "@waku/relay";
import { waitForRemotePeer } from "@waku/sdk";
import { contentTopicToPubsubTopic, Logger } from "@waku/utils";
import { Context } from "mocha";

Expand Down
3 changes: 2 additions & 1 deletion packages/tests/tests/store/index.node.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createDecoder, DecodedMessage, waitForRemotePeer } from "@waku/core";
import { createDecoder, DecodedMessage } from "@waku/core";
import type { IMessage, LightNode } from "@waku/interfaces";
import { Protocols } from "@waku/interfaces";
import {
Expand All @@ -14,6 +14,7 @@ import {
createDecoder as createSymDecoder,
createEncoder as createSymEncoder
} from "@waku/message-encryption/symmetric";
import { waitForRemotePeer } from "@waku/sdk";
import { bytesToUtf8, utf8ToBytes } from "@waku/utils/bytes";
import { expect } from "chai";
import { equals } from "uint8arrays/equals";
Expand Down
4 changes: 2 additions & 2 deletions packages/tests/tests/store/multiple_pubsub.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createDecoder, waitForRemotePeer } from "@waku/core";
import { createDecoder } from "@waku/core";
import type { ContentTopicInfo, IMessage, LightNode } from "@waku/interfaces";
import { createLightNode, Protocols } from "@waku/sdk";
import { createLightNode, Protocols, waitForRemotePeer } from "@waku/sdk";
import {
contentTopicToPubsubTopic,
pubsubTopicToSingleShardInfo
Expand Down
3 changes: 1 addition & 2 deletions packages/tests/tests/wait_for_remote_peer.node.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { waitForRemotePeer } from "@waku/core";
import type { LightNode, RelayNode } from "@waku/interfaces";
import { Protocols } from "@waku/interfaces";
import { createRelayNode } from "@waku/relay";
import { createLightNode } from "@waku/sdk";
import { createLightNode, waitForRemotePeer } from "@waku/sdk";
import { expect } from "chai";

import {
Expand Down
5 changes: 3 additions & 2 deletions packages/tests/tests/waku.node.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { bootstrap } from "@libp2p/bootstrap";
import type { PeerId } from "@libp2p/interface";
import { DecodedMessage, waitForRemotePeer } from "@waku/core";
import { DecodedMessage } from "@waku/core";
import type { LightNode, RelayNode, Waku } from "@waku/interfaces";
import { Protocols } from "@waku/interfaces";
import { generateSymmetricKey } from "@waku/message-encryption";
Expand All @@ -12,7 +12,8 @@ import { createRelayNode } from "@waku/relay";
import {
createLightNode,
createEncoder as createPlainEncoder,
DefaultUserAgent
DefaultUserAgent,
waitForRemotePeer
} from "@waku/sdk";
import { bytesToUtf8, utf8ToBytes } from "@waku/utils/bytes";
import { expect } from "chai";
Expand Down

0 comments on commit 0f09905

Please sign in to comment.