chore: fix tests

This commit is contained in:
fryorcraken.eth 2022-11-04 11:45:15 +11:00
parent e6efd0438c
commit 1a09aa18d5
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
6 changed files with 39 additions and 28 deletions

4
package-lock.json generated
View File

@ -22949,7 +22949,8 @@
"@waku/core": "*",
"@waku/create": "*",
"@waku/enr": "*",
"@waku/interfaces": "*"
"@waku/interfaces": "*",
"@waku/message-encryption": "*"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.8.1",
@ -27702,6 +27703,7 @@
"@waku/create": "*",
"@waku/enr": "*",
"@waku/interfaces": "*",
"@waku/message-encryption": "*",
"cspell": "^5.14.0",
"eslint": "^8.6.0",
"eslint-config-prettier": "^8.3.0",

View File

@ -9,7 +9,14 @@ import type { Decoder, Encoder, Message, ProtoMessage } from "@waku/interfaces";
import debug from "debug";
import { Symmetric } from "./constants.js";
import { keccak256, randomBytes, sign } from "./crypto.js";
import {
generatePrivateKey,
generateSymmetricKey,
getPublicKey,
keccak256,
randomBytes,
sign,
} from "./crypto.js";
import * as ecies from "./ecies.js";
import * as symmetric from "./symmetric.js";
@ -22,6 +29,8 @@ const PaddingTarget = 256;
const SignatureLength = 65;
const OneMillion = BigInt(1_000_000);
export { generatePrivateKey, generateSymmetricKey, getPublicKey };
export const Version = 1;
export type Signature = {

View File

@ -59,7 +59,8 @@
"@waku/enr": "*",
"@waku/create": "*",
"@waku/interfaces": "*",
"@waku/byte-utils": "*"
"@waku/byte-utils": "*",
"@waku/message-encryption": "*"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.8.1",

View File

@ -1,26 +1,24 @@
import { PeerId } from "@libp2p/interface-peer-id";
import { bytesToUtf8, utf8ToBytes } from "@waku/byte-utils";
import {
DefaultPubSubTopic,
generatePrivateKey,
generateSymmetricKey,
getPublicKey,
} from "@waku/core";
import { DefaultPubSubTopic } from "@waku/core";
import { waitForRemotePeer } from "@waku/core/lib/wait_for_remote_peer";
import {
DecoderV0,
EncoderV0,
MessageV0,
} from "@waku/core/lib/waku_message/version_0";
import {
AsymDecoder,
AsymEncoder,
SymDecoder,
SymEncoder,
} from "@waku/core/lib/waku_message/version_1";
import { createPrivacyNode } from "@waku/create";
import type { Message, WakuPrivacy } from "@waku/interfaces";
import { Protocols } from "@waku/interfaces";
import {
AsymDecoder,
AsymEncoder,
generatePrivateKey,
generateSymmetricKey,
getPublicKey,
SymDecoder,
SymEncoder,
} from "@waku/message-encryption";
import { expect } from "chai";
import debug from "debug";

View File

@ -1,21 +1,19 @@
import { bytesToUtf8, utf8ToBytes } from "@waku/byte-utils";
import {
generatePrivateKey,
generateSymmetricKey,
getPublicKey,
} from "@waku/core";
import { PageDirection } from "@waku/core";
import { waitForRemotePeer } from "@waku/core/lib/wait_for_remote_peer";
import { DecoderV0, EncoderV0 } from "@waku/core/lib/waku_message/version_0";
import {
AsymDecoder,
AsymEncoder,
SymDecoder,
SymEncoder,
} from "@waku/core/lib/waku_message/version_1";
import { createFullNode } from "@waku/create";
import type { Message, WakuFull } from "@waku/interfaces";
import { Protocols } from "@waku/interfaces";
import {
AsymDecoder,
AsymEncoder,
generatePrivateKey,
generateSymmetricKey,
getPublicKey,
SymDecoder,
SymEncoder,
} from "@waku/message-encryption";
import { expect } from "chai";
import debug from "debug";

View File

@ -1,12 +1,15 @@
import type { PeerId } from "@libp2p/interface-peer-id";
import { bytesToUtf8, utf8ToBytes } from "@waku/byte-utils";
import { generateSymmetricKey } from "@waku/core";
import { PeerDiscoveryStaticPeers } from "@waku/core/lib/peer_discovery_static_list";
import { waitForRemotePeer } from "@waku/core/lib/wait_for_remote_peer";
import { SymDecoder, SymEncoder } from "@waku/core/lib/waku_message/version_1";
import { createLightNode, createPrivacyNode } from "@waku/create";
import type { Message, Waku, WakuLight, WakuPrivacy } from "@waku/interfaces";
import { Protocols } from "@waku/interfaces";
import {
generateSymmetricKey,
SymDecoder,
SymEncoder,
} from "@waku/message-encryption";
import { expect } from "chai";
import { makeLogFileName, NOISE_KEY_1, NOISE_KEY_2, Nwaku } from "../src/";