Fix eslint

This commit is contained in:
morrigan
2019-11-28 17:53:27 +01:00
parent 91af449231
commit 6dc8e8288d
7 changed files with 32 additions and 32 deletions

View File

@ -14,7 +14,7 @@ export async function loadPayloadProto () {
return payloadProtoBuf.lookupType("pb.NoiseHandshakePayload");
}
export function generateKeypair() : KeyPair {
export function generateKeypair(): KeyPair {
const privateKey = x25519.privateKeyGenerate();
const publicKey = x25519.publicKeyCreate(privateKey);
@ -29,7 +29,7 @@ export async function createHandshakePayload(
libp2pPrivateKey: bytes,
signedPayload: bytes,
signedEarlyData?: EarlyDataPayload,
) : Promise<bytes> {
): Promise<bytes> {
const NoiseHandshakePayload = await loadPayloadProto();
const earlyDataPayload = signedEarlyData ?
{
@ -56,7 +56,7 @@ type EarlyDataPayload = {
libp2pDataSignature: bytes;
}
export function signEarlyDataPayload(libp2pPrivateKey: bytes, earlyData: bytes) : EarlyDataPayload {
export function signEarlyDataPayload(libp2pPrivateKey: bytes, earlyData: bytes): EarlyDataPayload {
const payload = getEarlyDataPayload(earlyData);
const signedPayload = signPayload(libp2pPrivateKey, payload);
@ -70,11 +70,11 @@ export const getHandshakePayload = (publicKey: bytes ) => Buffer.concat([Buffer.
export const getEarlyDataPayload = (earlyData: bytes) => Buffer.concat([Buffer.from("noise-libp2p-early-data:"), earlyData]);
export function encodeMessageBuffer(message: MessageBuffer) : bytes {
export function encodeMessageBuffer(message: MessageBuffer): bytes {
return Buffer.concat([message.ne, message.ns, message.ciphertext]);
}
export function decodeMessageBuffer(message: bytes) : MessageBuffer {
export function decodeMessageBuffer(message: bytes): MessageBuffer {
return {
ne: message.slice(0, 32),
ns: message.slice(32, 64),