mirror of
https://github.com/fluencelabs/js-libp2p-noise
synced 2025-07-31 01:21:59 +00:00
Verify peer id
This commit is contained in:
@@ -21,12 +21,12 @@ describe("Handshake", () => {
|
||||
const [peerA, peerB] = await createPeerIds(2);
|
||||
|
||||
const initiatorPrivKey = peerA.privKey.marshal().slice(0, 32);
|
||||
const initiatorPubKey = peerA.pubKey.marshal();
|
||||
const handshakeInitator = new Handshake(true, initiatorPrivKey, initiatorPubKey, prologue, staticKeysInitiator, connectionFrom);
|
||||
const initiatorPubKey = peerA.marshalPubKey();
|
||||
const handshakeInitator = new Handshake(true, initiatorPrivKey, initiatorPubKey, prologue, staticKeysInitiator, connectionFrom, peerB);
|
||||
|
||||
const responderPrivKey = peerB.privKey.marshal().slice(0, 32);
|
||||
const responderPubKey = peerB.pubKey.marshal();
|
||||
const handshakeResponder = new Handshake(false, responderPrivKey, responderPubKey, prologue, staticKeysResponder, connectionTo);
|
||||
const responderPubKey = peerB.marshalPubKey();
|
||||
const handshakeResponder = new Handshake(false, responderPrivKey, responderPubKey, prologue, staticKeysResponder, connectionTo, peerA);
|
||||
|
||||
await handshakeInitator.propose();
|
||||
await handshakeResponder.propose();
|
||||
|
Reference in New Issue
Block a user