mirror of
https://github.com/fluencelabs/js-libp2p-noise
synced 2025-04-25 14:12:30 +00:00
Fix test
This commit is contained in:
parent
7625aa8e46
commit
93d6a9a99b
@ -135,7 +135,7 @@ export class IKHandshake implements IHandshake {
|
|||||||
|
|
||||||
private setEarlyData(data: Uint8Array|null|undefined): void {
|
private setEarlyData(data: Uint8Array|null|undefined): void {
|
||||||
if(data){
|
if(data){
|
||||||
this.earlyData = Buffer.from(data.buffer, data.byteOffset, data.length);
|
this.remoteEarlyData = Buffer.from(data.buffer, data.byteOffset, data.length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ export class Noise implements INoiseConnection {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
conn,
|
conn,
|
||||||
earlyData: handshake.earlyData,
|
remoteEarlyData: handshake.remoteEarlyData,
|
||||||
remotePeer: handshake.remotePeer,
|
remotePeer: handshake.remotePeer,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -355,8 +355,8 @@ describe("Noise", () => {
|
|||||||
noiseResp.secureInbound(remotePeer, inboundConnection),
|
noiseResp.secureInbound(remotePeer, inboundConnection),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert(inbound.earlyData.equals(localPeerEarlyData))
|
assert(inbound.remoteEarlyData.equals(localPeerEarlyData))
|
||||||
assert(outbound.earlyData.equals(Buffer.alloc(0)))
|
assert(outbound.remoteEarlyData.equals(Buffer.alloc(0)))
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
assert(false, e.message);
|
assert(false, e.message);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user