From 14849fe62f5eb6636c218159a930060c3554cd13 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Thu, 23 Sep 2021 15:47:21 +1000 Subject: [PATCH] Add signature to Waku messages --- packages/status-communities/src/identity.ts | 2 +- packages/status-communities/src/messenger.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/status-communities/src/identity.ts b/packages/status-communities/src/identity.ts index fd66568e..2d4c4ae7 100644 --- a/packages/status-communities/src/identity.ts +++ b/packages/status-communities/src/identity.ts @@ -6,7 +6,7 @@ import { utils } from "js-waku"; import * as secp256k1 from "secp256k1"; export class Identity { - public constructor(private privateKey: Uint8Array) {} + public constructor(public privateKey: Uint8Array) {} public static generate(): Identity { const privateKey = generatePrivateKey(); diff --git a/packages/status-communities/src/messenger.ts b/packages/status-communities/src/messenger.ts index 05cfbb89..6e65d2c3 100644 --- a/packages/status-communities/src/messenger.ts +++ b/packages/status-communities/src/messenger.ts @@ -84,11 +84,10 @@ export class Messenger { this.identity ); - // TODO: Add signature const wakuMessage = await WakuMessage.fromBytes( appMetadataMessage.encode(), chat.contentTopic, - { symKey: chat.symKey } + { symKey: chat.symKey, sigPrivKey: this.identity.privateKey } ); await this.waku.relay.send(wakuMessage);