aboutsummaryrefslogtreecommitdiff
path: root/src/crypto/nodeWorkerEntry.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-11-28 00:46:34 +0100
committerFlorian Dold <florian.dold@gmail.com>2019-11-28 00:46:34 +0100
commit706c07fa1d069290992bd31d53b0c89324992f9c (patch)
tree8114c23cda7547f8475c7d8d579f51f968a97f9d /src/crypto/nodeWorkerEntry.ts
parentc3ca556affe2f514aeb7fd052fe6d626d9319e99 (diff)
downloadwallet-core-706c07fa1d069290992bd31d53b0c89324992f9c.tar.xz
implement JS-only Taler, remove emscripten
Diffstat (limited to 'src/crypto/nodeWorkerEntry.ts')
-rw-r--r--src/crypto/nodeWorkerEntry.ts17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/crypto/nodeWorkerEntry.ts b/src/crypto/nodeWorkerEntry.ts
index 1ed16f870..1e088d987 100644
--- a/src/crypto/nodeWorkerEntry.ts
+++ b/src/crypto/nodeWorkerEntry.ts
@@ -14,20 +14,13 @@
TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
-
// tslint:disable:no-var-requires
-import fs = require("fs");
-import vm = require("vm");
-import { NodeEmscriptenLoader } from "./nodeEmscriptenLoader";
import { CryptoImplementation } from "./cryptoImplementation";
-const loader = new NodeEmscriptenLoader();
-
async function handleRequest(operation: string, id: number, args: string[]) {
- let emsc = await loader.getEmscriptenEnvironment();
- const impl = new CryptoImplementation(emsc);
+ const impl = new CryptoImplementation();
if (!(operation in impl)) {
console.error(`crypto operation '${operation}' not found`);
@@ -42,16 +35,12 @@ async function handleRequest(operation: string, id: number, args: string[]) {
console.error("process.send not available");
}
} catch (e) {
- console.log("error during operation", e);
+ console.error("error during operation", e);
return;
}
}
process.on("message", (msgStr: any) => {
- console.log("got message in node worker entry", msgStr);
-
- console.log("typeof msg", typeof msgStr);
-
const msg = JSON.parse(msgStr);
const args = msg.data.args;
@@ -76,5 +65,5 @@ process.on("message", (msgStr: any) => {
});
process.on("uncaughtException", (err: any) => {
- console.log("uncaught exception in node worker entry", err);
+ console.error("uncaught exception in node worker entry", err);
});