aboutsummaryrefslogtreecommitdiff
path: root/src/crypto
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-08-28 02:49:27 +0200
committerFlorian Dold <florian.dold@gmail.com>2019-08-28 02:49:27 +0200
commit1390175a9afc53948dd1d6f8a2f88e51c1bf53cc (patch)
tree1e65581f11354ec61532dbbf3174e9bd26b515c4 /src/crypto
parent70c0a557f9c89a2a0006f74bd8b361b62660bde2 (diff)
downloadwallet-core-1390175a9afc53948dd1d6f8a2f88e51c1bf53cc.tar.xz
rudimentary taler://withdraw support
Diffstat (limited to 'src/crypto')
-rw-r--r--src/crypto/cryptoApi-test.ts2
-rw-r--r--src/crypto/synchronousWorker.ts10
2 files changed, 10 insertions, 2 deletions
diff --git a/src/crypto/cryptoApi-test.ts b/src/crypto/cryptoApi-test.ts
index 48231e5ff..39f46c5c3 100644
--- a/src/crypto/cryptoApi-test.ts
+++ b/src/crypto/cryptoApi-test.ts
@@ -96,6 +96,8 @@ test("precoin creation", async t => {
reserve_pub: pub,
timestamp_confirmed: 0,
timestamp_depleted: 0,
+ timestamp_reserve_info_posted: 0,
+ exchangeWire: "payto://foo"
};
const precoin = await crypto.createPreCoin(denomValid1, r);
diff --git a/src/crypto/synchronousWorker.ts b/src/crypto/synchronousWorker.ts
index b697c8e16..41ebee4f3 100644
--- a/src/crypto/synchronousWorker.ts
+++ b/src/crypto/synchronousWorker.ts
@@ -93,13 +93,19 @@ export class SynchronousCryptoWorker {
return;
}
+ let result: any;
try {
- const result = (impl as any)[operation](...args);
- this.dispatchMessage({ result, id });
+ result = (impl as any)[operation](...args);
} catch (e) {
console.log("error during operation", e);
return;
}
+
+ try {
+ setImmediate(() => this.dispatchMessage({ result, id }));
+ } catch (e) {
+ console.log("got error during dispatch", e);
+ }
}
/**