mirror of
https://github.com/fluencelabs/js-libp2p-noise
synced 2025-06-26 21:31:57 +00:00
Fix eslint
This commit is contained in:
@ -1,4 +1,3 @@
|
|||||||
import { Duplex } from "it-pair";
|
|
||||||
import { Handshake } from "./handshake";
|
import { Handshake } from "./handshake";
|
||||||
import { Buffer } from "buffer";
|
import { Buffer } from "buffer";
|
||||||
|
|
||||||
@ -7,7 +6,7 @@ interface ReturnEncryptionWrapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Returns generator that encrypts payload from the user
|
// Returns generator that encrypts payload from the user
|
||||||
export function encryptStream(handshake: Handshake): ReturnEncryptionWrapper {
|
export function encryptStream(handshake: Handshake): ReturnEncryptionWrapper {
|
||||||
return async function * (source) {
|
return async function * (source) {
|
||||||
for await (const chunk of source) {
|
for await (const chunk of source) {
|
||||||
const chunkBuffer = Buffer.from(chunk);
|
const chunkBuffer = Buffer.from(chunk);
|
||||||
|
@ -2,7 +2,7 @@ import { expect, assert } from "chai";
|
|||||||
import DuplexPair from 'it-pair/duplex';
|
import DuplexPair from 'it-pair/duplex';
|
||||||
|
|
||||||
import { Noise } from "../src";
|
import { Noise } from "../src";
|
||||||
import {createPeerIds, createPeerIdsFromFixtures} from "./fixtures/peer";
|
import {createPeerIdsFromFixtures} from "./fixtures/peer";
|
||||||
import Wrap from "it-pb-rpc";
|
import Wrap from "it-pb-rpc";
|
||||||
import {Handshake} from "../src/handshake";
|
import {Handshake} from "../src/handshake";
|
||||||
import {
|
import {
|
||||||
@ -10,7 +10,7 @@ import {
|
|||||||
decodeMessageBuffer,
|
decodeMessageBuffer,
|
||||||
encodeMessageBuffer,
|
encodeMessageBuffer,
|
||||||
generateKeypair,
|
generateKeypair,
|
||||||
getHandshakePayload, signEarlyDataPayload,
|
getHandshakePayload,
|
||||||
signPayload
|
signPayload
|
||||||
} from "../src/utils";
|
} from "../src/utils";
|
||||||
import {XXHandshake} from "../src/xx";
|
import {XXHandshake} from "../src/xx";
|
||||||
@ -20,7 +20,7 @@ describe("Noise", () => {
|
|||||||
let remotePeer, localPeer;
|
let remotePeer, localPeer;
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
[localPeer, remotePeer] = await createPeerIds(2);
|
[localPeer, remotePeer] = await createPeerIdsFromFixtures(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should communicate through encrypted streams", async() => {
|
it("should communicate through encrypted streams", async() => {
|
||||||
|
Reference in New Issue
Block a user