aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2022-10-05 12:52:49 +0200
committerFlorian Dold <florian@dold.me>2022-10-05 12:52:49 +0200
commitdd14e67c70cd7b5b6891295759cb08aa2f94f180 (patch)
tree296b07938b676d21ba9f75196cae621e292fc714 /packages/taler-wallet-webextension
parent4d232fd56510ae69b76fef4f4ecade1e0d4b230d (diff)
wallet-core: improve crypto worker code duplication
Also add new testCrypto call for later testing
Diffstat (limited to 'packages/taler-wallet-webextension')
-rw-r--r--packages/taler-wallet-webextension/src/browserCryptoWorkerFactory.ts2
-rw-r--r--packages/taler-wallet-webextension/src/wxBackend.ts2
2 files changed, 4 insertions, 0 deletions
diff --git a/packages/taler-wallet-webextension/src/browserCryptoWorkerFactory.ts b/packages/taler-wallet-webextension/src/browserCryptoWorkerFactory.ts
index 75ec0906c..c93097da8 100644
--- a/packages/taler-wallet-webextension/src/browserCryptoWorkerFactory.ts
+++ b/packages/taler-wallet-webextension/src/browserCryptoWorkerFactory.ts
@@ -28,6 +28,8 @@ export class BrowserCryptoWorkerFactory implements CryptoWorkerFactory {
startWorker(): CryptoWorker {
const workerCtor = Worker;
const workerPath = "/dist/browserWorkerEntry.js";
+ // FIXME: This is not really the same interface as the crypto worker!
+ // We need to wrap it.
return new workerCtor(workerPath) as CryptoWorker;
}
diff --git a/packages/taler-wallet-webextension/src/wxBackend.ts b/packages/taler-wallet-webextension/src/wxBackend.ts
index 9581abc56..68ec15591 100644
--- a/packages/taler-wallet-webextension/src/wxBackend.ts
+++ b/packages/taler-wallet-webextension/src/wxBackend.ts
@@ -217,6 +217,8 @@ async function reinitWallet(): Promise<void> {
timer = new SetTimeoutTimerAPI();
} else {
httpLib = new BrowserHttpLib();
+ // We could (should?) use the BrowserCryptoWorkerFactory here,
+ // but right now we don't, to have less platform differences.
cryptoWorker = new SynchronousCryptoWorkerFactory();
timer = new SetTimeoutTimerAPI();
}