diff --git a/package-lock.json b/package-lock.json index cc57bf0cff..b3d5b88ab9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27397,6 +27397,7 @@ "@waku/byte-utils": "*", "@waku/core": "*", "@waku/interfaces": "*", + "@waku/proto": "*", "js-sha3": "^0.8.0" }, "devDependencies": { @@ -31449,6 +31450,7 @@ "@waku/byte-utils": "*", "@waku/core": "*", "@waku/interfaces": "*", + "@waku/proto": "*", "chai": "^4.3.6", "cspell": "^6.17.0", "eslint": "^8.6.0", diff --git a/packages/message-encryption/CHANGELOG.md b/packages/message-encryption/CHANGELOG.md index 356407e4ae..89996bcf66 100644 --- a/packages/message-encryption/CHANGELOG.md +++ b/packages/message-encryption/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Type resolution when using `moduleResolution: node`. +- Incorrect `proto` import. ## [0.0.5] - 2022-12-15 diff --git a/packages/message-encryption/package.json b/packages/message-encryption/package.json index 02ccb5527e..728e8bc283 100644 --- a/packages/message-encryption/package.json +++ b/packages/message-encryption/package.json @@ -75,12 +75,12 @@ "dependencies": { "@noble/secp256k1": "^1.3.4", "@waku/byte-utils": "*", + "@waku/core": "*", "@waku/interfaces": "*", - "js-sha3": "^0.8.0", - "@waku/core": "*" + "@waku/proto": "*", + "js-sha3": "^0.8.0" }, "devDependencies": { - "fast-check": "^2.14.0", "@rollup/plugin-commonjs": "^22.0.0", "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^13.3.0", @@ -94,6 +94,7 @@ "eslint-plugin-functional": "^4.0.2", "eslint-plugin-import": "^2.25.3", "eslint-plugin-prettier": "^4.0.0", + "fast-check": "^2.14.0", "npm-run-all": "^4.1.5", "prettier": "^2.1.1", "rollup": "^2.75.0", diff --git a/packages/message-encryption/src/ecies.ts b/packages/message-encryption/src/ecies.ts index 1d0ac45a8e..f93f6fc38a 100644 --- a/packages/message-encryption/src/ecies.ts +++ b/packages/message-encryption/src/ecies.ts @@ -1,10 +1,11 @@ -import { Decoder as DecoderV0, proto } from "@waku/core/lib/message/version_0"; +import { Decoder as DecoderV0 } from "@waku/core/lib/message/version_0"; import type { IDecoder, IEncoder, IMessage, IProtoMessage, } from "@waku/interfaces"; +import { WakuMessage } from "@waku/proto"; import debug from "debug"; import { @@ -38,7 +39,7 @@ class Encoder implements IEncoder { const protoMessage = await this.toProtoObj(message); if (!protoMessage) return; - return proto.WakuMessage.encode(protoMessage); + return WakuMessage.encode(protoMessage); } async toProtoObj(message: IMessage): Promise { diff --git a/packages/message-encryption/src/symmetric.ts b/packages/message-encryption/src/symmetric.ts index e52d0a1273..3e2981af18 100644 --- a/packages/message-encryption/src/symmetric.ts +++ b/packages/message-encryption/src/symmetric.ts @@ -1,10 +1,11 @@ -import { Decoder as DecoderV0, proto } from "@waku/core/lib/message/version_0"; +import { Decoder as DecoderV0 } from "@waku/core/lib/message/version_0"; import type { IDecoder, IEncoder, IMessage, IProtoMessage, } from "@waku/interfaces"; +import { WakuMessage } from "@waku/proto"; import debug from "debug"; import { @@ -37,7 +38,7 @@ class Encoder implements IEncoder { const protoMessage = await this.toProtoObj(message); if (!protoMessage) return; - return proto.WakuMessage.encode(protoMessage); + return WakuMessage.encode(protoMessage); } async toProtoObj(message: IMessage): Promise {