mirror of
https://github.com/fluencelabs/js-libp2p-noise
synced 2025-04-25 01:32: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 {
|
||||
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 {
|
||||
conn,
|
||||
earlyData: handshake.earlyData,
|
||||
remoteEarlyData: handshake.remoteEarlyData,
|
||||
remotePeer: handshake.remotePeer,
|
||||
}
|
||||
}
|
||||
|
@ -355,8 +355,8 @@ describe("Noise", () => {
|
||||
noiseResp.secureInbound(remotePeer, inboundConnection),
|
||||
]);
|
||||
|
||||
assert(inbound.earlyData.equals(localPeerEarlyData))
|
||||
assert(outbound.earlyData.equals(Buffer.alloc(0)))
|
||||
assert(inbound.remoteEarlyData.equals(localPeerEarlyData))
|
||||
assert(outbound.remoteEarlyData.equals(Buffer.alloc(0)))
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
assert(false, e.message);
|
||||
|
Loading…
x
Reference in New Issue
Block a user