Skip to content

Commit bfb16b6

Browse files
committed
lint
1 parent 01c9918 commit bfb16b6

File tree

3 files changed

+22
-15
lines changed

3 files changed

+22
-15
lines changed

modules/integration-node/src/cli.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,13 @@ const cli = yargs
109109
concurrency
110110
)
111111
} else if (command === 'encrypt') {
112-
const { manifestFile, keyFile, decryptOracle, decryptManifest } = argv as unknown as {
113-
manifestFile: string
114-
keyFile: string
115-
decryptOracle?: string,
116-
decryptManifest?: string,
117-
}
112+
const { manifestFile, keyFile, decryptOracle, decryptManifest } =
113+
argv as unknown as {
114+
manifestFile: string
115+
keyFile: string
116+
decryptOracle?: string
117+
decryptManifest?: string
118+
}
118119
result = await integrationEncryptTestVectors(
119120
manifestFile,
120121
keyFile,

modules/integration-node/src/get_encrypt_test_iterator.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { ZipFile } from 'yazl'
1919
export async function getEncryptTestVectorIterator(
2020
manifestFile: string,
2121
keyFile: string,
22-
manifestZip?: ZipFile,
22+
manifestZip?: ZipFile
2323
) {
2424
const [manifest, keys]: [EncryptManifestList, KeyList] = await Promise.all([
2525
getParsedJSON(manifestFile),
@@ -33,13 +33,15 @@ export async function getEncryptTestVectorIterator(
3333
export function _getEncryptTestVectorIterator(
3434
{ tests, plaintexts }: EncryptManifestList,
3535
keysManifest: KeyList,
36-
manifestZip?: ZipFile,
36+
manifestZip?: ZipFile
3737
) {
38-
3938
if (manifestZip) {
4039
// We assume that the keys manifest given for encrypt
4140
// has all the keys required for decrypt.
42-
manifestZip.addBuffer(Buffer.from(JSON.stringify(keysManifest)), `keys.json`)
41+
manifestZip.addBuffer(
42+
Buffer.from(JSON.stringify(keysManifest)),
43+
`keys.json`
44+
)
4345
}
4446
const { keys } = keysManifest
4547
const plaintextBytes: { [name: string]: Buffer } = {}

modules/integration-node/src/integration_tests.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,9 @@ function composeEncryptResults(
183183
},
184184
manifestZip: manifest.manifestZip,
185185
}
186-
} else if (!!decryptOracle) {
186+
} else if (decryptOracle) {
187187
return decryptOracleEncryptResults(decryptOracle)
188-
} else if (!!decryptManifest) {
188+
} else if (decryptManifest) {
189189
return decryptionManifestEncryptResults(decryptManifest)
190190
}
191191
needs(false, 'unsupported')
@@ -199,7 +199,9 @@ function decryptOracleEncryptResults(
199199
handleEncryptResult,
200200
// There is nothing to do when the oracle is done
201201
// since nothing is saved.
202-
done: () => {},
202+
done: () => {
203+
return null
204+
},
203205
}
204206

205207
async function handleEncryptResult(
@@ -412,8 +414,10 @@ async function parallelTests<
412414
if (!value && done) {
413415
// We are done enqueueing work,
414416
// but we need to wait until all that work is done
415-
Promise.all([...queue]).then(() => _resolve(failureCount))
416-
return
417+
Promise.all([...queue])
418+
.then(() => _resolve(failureCount))
419+
.catch(console.log)
420+
return
417421
}
418422
/* I need to define the work to be enqueue
419423
* and a way to dequeue this work when complete.

0 commit comments

Comments
 (0)