Remove unnecessary use of Buffer (#548)

This commit is contained in:
Franck R 2022-02-17 13:23:39 +11:00 committed by GitHub
parent d00c858ffe
commit 3a4e98e184
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 5 deletions

View File

@ -180,15 +180,11 @@ export class Waku {
options?.libp2p?.modules
);
const staticNoiseKey = options?.staticNoiseKey
? Buffer.from(options?.staticNoiseKey)
: undefined;
// streamMuxer, connection encryption and pubsub are overridden
// as those are the only ones currently supported by Waku nodes.
libp2pOpts.modules = Object.assign(libp2pOpts.modules, {
streamMuxer: [Mplex],
connEncryption: [new Noise(staticNoiseKey)],
connEncryption: [new Noise(options?.staticNoiseKey)],
pubsub: WakuRelay,
});