summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-embedded/src/wallet-qjs.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-embedded/src/wallet-qjs.ts')
-rw-r--r--packages/taler-wallet-embedded/src/wallet-qjs.ts34
1 files changed, 10 insertions, 24 deletions
diff --git a/packages/taler-wallet-embedded/src/wallet-qjs.ts b/packages/taler-wallet-embedded/src/wallet-qjs.ts
index 8502c779a..cbda401e9 100644
--- a/packages/taler-wallet-embedded/src/wallet-qjs.ts
+++ b/packages/taler-wallet-embedded/src/wallet-qjs.ts
@@ -98,19 +98,10 @@ class NativeWalletMessageHandler {
const wR = await createNativeWalletHost2(this.walletArgs);
const w = wR.wallet;
this.maybeWallet = w;
- const resp = await w.handleCoreApiRequest(
- "initWallet",
- "native-init",
- {
- config: this.walletConfig
- },
- );
- initResponse = resp.type == "response" ? resp.result : resp.error;
- w.runTaskLoop().catch((e) => {
- logger.error(
- `Error during wallet retry loop: ${e.stack ?? e.toString()}`,
- );
+ const resp = await w.handleCoreApiRequest("initWallet", "native-init", {
+ config: this.walletConfig,
});
+ initResponse = resp.type == "response" ? resp.result : resp.error;
this.wp.resolve(w);
};
@@ -249,8 +240,7 @@ export function installNativeWalletListener(): void {
operation: "testing-dangerously-eval",
id: msg.id,
};
- }
- {
+ } else {
respMsg = await handler.handleMessage(operation, id, msg.args ?? {});
}
} catch (e) {
@@ -296,9 +286,8 @@ export async function testWithGv() {
merchantBaseUrl: "https://backend.demo.taler.net/",
merchantAuthToken: "secret-token:sandbox",
});
- await w.wallet.runTaskLoop({
- stopWhenDone: true,
- });
+ await w.wallet.client.call(WalletApiOperation.TestingWaitTasksDone, {});
+ await w.wallet.client.call(WalletApiOperation.Shutdown, {});
}
export async function testWithFdold() {
@@ -317,9 +306,8 @@ export async function testWithFdold() {
exchangeBaseUrl: "https://exchange.taler.fdold.eu/",
merchantBaseUrl: "https://merchant.taler.fdold.eu/",
});
- await w.wallet.runTaskLoop({
- stopWhenDone: true,
- });
+ await w.wallet.client.call(WalletApiOperation.TestingWaitTasksDone, {});
+ await w.wallet.client.call(WalletApiOperation.Shutdown, {});
}
export async function testWithLocal(path: string) {
@@ -347,11 +335,9 @@ export async function testWithLocal(path: string) {
merchantBaseUrl: "http://localhost:8083/",
});
console.log("started integration test");
- await w.wallet.runTaskLoop({
- stopWhenDone: true,
- });
+ await w.wallet.client.call(WalletApiOperation.TestingWaitTasksDone, {});
console.log("done with task loop");
- w.wallet.stop();
+ await w.wallet.client.call(WalletApiOperation.Shutdown, {});
console.log("DB stats:", j2s(w.getDbStats()));
}