diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-08-06 00:30:36 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-08-06 00:30:36 +0530 |
commit | 82a2437c0967871d6b942105c98c3382978cad29 (patch) | |
tree | da803c3d4a58d9c691f5908b379791c8ee55cc37 /packages/taler-wallet-cli/src/index.ts | |
parent | a8f03d3dd1ad04abf7f569cb44933b6dce6713e7 (diff) | |
download | wallet-core-82a2437c0967871d6b942105c98c3382978cad29.tar.xz |
towards integration tests with fault injection
Diffstat (limited to 'packages/taler-wallet-cli/src/index.ts')
-rw-r--r-- | packages/taler-wallet-cli/src/index.ts | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/packages/taler-wallet-cli/src/index.ts b/packages/taler-wallet-cli/src/index.ts index c8e517e53..ae5371ecc 100644 --- a/packages/taler-wallet-cli/src/index.ts +++ b/packages/taler-wallet-cli/src/index.ts @@ -34,6 +34,12 @@ import { NodeHttpLib, } from "taler-wallet-core"; import * as clk from "./clk"; +import { NodeThreadCryptoWorkerFactory } from "taler-wallet-core/lib/crypto/workers/nodeThreadWorker"; +import { CryptoApi } from "taler-wallet-core/lib/crypto/workers/cryptoApi"; + +// This module also serves as the entry point for the crypto +// thread worker, and thus must expose these two handlers. +export { handleWorkerError, handleWorkerMessage } from "taler-wallet-core"; const logger = new Logger("taler-wallet-cli.ts"); @@ -109,7 +115,7 @@ function printVersion(): void { process.exit(0); } -const walletCli = clk +export const walletCli = clk .program("wallet", { help: "Command line interface for the GNU Taler wallet.", }) @@ -637,4 +643,9 @@ testCli.subcommand("vectors", "vectors").action(async (args) => { testvectors.printTestVectors(); }); -walletCli.run(); +testCli.subcommand("cryptoworker", "cryptoworker").action(async (args) => { + const workerFactory = new NodeThreadCryptoWorkerFactory(); + const cryptoApi = new CryptoApi(workerFactory); + const res = await cryptoApi.hashString("foo"); + console.log(res); +}); |