mirror of
https://github.com/logos-messaging/js-noise.git
synced 2026-01-02 13:43:08 +00:00
fix lint
This commit is contained in:
parent
fa5cc104a1
commit
64e59328fa
12
src/codec.ts
12
src/codec.ts
@ -47,8 +47,7 @@ export class NoiseHandshakeEncoder implements IEncoder {
|
|||||||
public pubsubTopic: string,
|
public pubsubTopic: string,
|
||||||
private hsStepResult: HandshakeStepResult,
|
private hsStepResult: HandshakeStepResult,
|
||||||
public ephemeral: boolean = true
|
public ephemeral: boolean = true
|
||||||
) {
|
) {}
|
||||||
}
|
|
||||||
|
|
||||||
async toWire(message: IMessage): Promise<Uint8Array | undefined> {
|
async toWire(message: IMessage): Promise<Uint8Array | undefined> {
|
||||||
const protoMessage = await this.toProtoObj(message);
|
const protoMessage = await this.toProtoObj(message);
|
||||||
@ -80,8 +79,7 @@ export class NoiseHandshakeDecoder implements IDecoder<NoiseHandshakeMessage> {
|
|||||||
* @param contentTopic content topic on which the encoded WakuMessages were sent
|
* @param contentTopic content topic on which the encoded WakuMessages were sent
|
||||||
*/
|
*/
|
||||||
|
|
||||||
constructor(public contentTopic: string, public pubsubTopic: string) {
|
constructor(public contentTopic: string, public pubsubTopic: string) {}
|
||||||
}
|
|
||||||
|
|
||||||
fromWireToProtoObj(bytes: Uint8Array): Promise<IProtoMessage | undefined> {
|
fromWireToProtoObj(bytes: Uint8Array): Promise<IProtoMessage | undefined> {
|
||||||
const protoMessage = WakuMessage.decode(bytes);
|
const protoMessage = WakuMessage.decode(bytes);
|
||||||
@ -149,8 +147,7 @@ export class NoiseSecureTransferEncoder implements IEncoder {
|
|||||||
private hsResult: HandshakeResult,
|
private hsResult: HandshakeResult,
|
||||||
public ephemeral: boolean = true,
|
public ephemeral: boolean = true,
|
||||||
public metaSetter?: IMetaSetter
|
public metaSetter?: IMetaSetter
|
||||||
) {
|
) {}
|
||||||
}
|
|
||||||
|
|
||||||
async toWire(message: IMessage): Promise<Uint8Array | undefined> {
|
async toWire(message: IMessage): Promise<Uint8Array | undefined> {
|
||||||
const protoMessage = await this.toProtoObj(message);
|
const protoMessage = await this.toProtoObj(message);
|
||||||
@ -201,8 +198,7 @@ export class NoiseSecureTransferDecoder implements IDecoder<NoiseSecureMessage>
|
|||||||
* @param hsResult handshake result obtained after the handshake is successful
|
* @param hsResult handshake result obtained after the handshake is successful
|
||||||
*/
|
*/
|
||||||
|
|
||||||
constructor(public contentTopic: string, public pubsubTopic: string, private hsResult: HandshakeResult) {
|
constructor(public contentTopic: string, public pubsubTopic: string, private hsResult: HandshakeResult) {}
|
||||||
}
|
|
||||||
|
|
||||||
fromWireToProtoObj(bytes: Uint8Array): Promise<IProtoMessage | undefined> {
|
fromWireToProtoObj(bytes: Uint8Array): Promise<IProtoMessage | undefined> {
|
||||||
const protoMessage = WakuMessage.decode(bytes);
|
const protoMessage = WakuMessage.decode(bytes);
|
||||||
|
|||||||
@ -293,7 +293,12 @@ export class WakuPairing {
|
|||||||
|
|
||||||
this.eventEmitter.emit("pairingComplete");
|
this.eventEmitter.emit("pairingComplete");
|
||||||
|
|
||||||
return WakuPairing.getSecureCodec(this.contentTopic, this.pubsubTopic, this.handshakeResult, this.encoderParameters);
|
return WakuPairing.getSecureCodec(
|
||||||
|
this.contentTopic,
|
||||||
|
this.pubsubTopic,
|
||||||
|
this.handshakeResult,
|
||||||
|
this.encoderParameters
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async responderHandshake(): Promise<[NoiseSecureTransferEncoder, NoiseSecureTransferDecoder]> {
|
private async responderHandshake(): Promise<[NoiseSecureTransferEncoder, NoiseSecureTransferDecoder]> {
|
||||||
@ -357,7 +362,12 @@ export class WakuPairing {
|
|||||||
|
|
||||||
this.eventEmitter.emit("pairingComplete");
|
this.eventEmitter.emit("pairingComplete");
|
||||||
|
|
||||||
return WakuPairing.getSecureCodec(this.contentTopic, this.pubsubTopic, this.handshakeResult, this.encoderParameters);
|
return WakuPairing.getSecureCodec(
|
||||||
|
this.contentTopic,
|
||||||
|
this.pubsubTopic,
|
||||||
|
this.handshakeResult,
|
||||||
|
this.encoderParameters
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user