summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/host-impl.qtart.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-08-30 16:51:51 +0200
committerFlorian Dold <florian@dold.me>2023-08-30 16:51:51 +0200
commitaba173d8a906fa0ede0c3660bd37b11fb7a6a127 (patch)
tree0957b732b6892236e5ef1fbc9e93cda56b6908e1 /packages/taler-wallet-core/src/host-impl.qtart.ts
parent53613a137df432878d62317e685bd1737dc6a6dc (diff)
downloadwallet-core-aba173d8a906fa0ede0c3660bd37b11fb7a6a127.tar.gz
wallet-core-aba173d8a906fa0ede0c3660bd37b11fb7a6a127.tar.bz2
wallet-core-aba173d8a906fa0ede0c3660bd37b11fb7a6a127.zip
wallet-core: open DB inside wallet handle, back up meta DB as well
Diffstat (limited to 'packages/taler-wallet-core/src/host-impl.qtart.ts')
-rw-r--r--packages/taler-wallet-core/src/host-impl.qtart.ts20
1 files changed, 7 insertions, 13 deletions
diff --git a/packages/taler-wallet-core/src/host-impl.qtart.ts b/packages/taler-wallet-core/src/host-impl.qtart.ts
index 720f5affb..81dbe0acd 100644
--- a/packages/taler-wallet-core/src/host-impl.qtart.ts
+++ b/packages/taler-wallet-core/src/host-impl.qtart.ts
@@ -110,7 +110,7 @@ async function makeSqliteDb(
return {
...myBackend.accessStats,
primitiveStatements: numStmt,
- }
+ };
},
idbFactory: myBridgeIdbFactory,
};
@@ -167,12 +167,15 @@ export async function createNativeWalletHost2(
let dbResp: MakeDbResult;
- if (args.persistentStoragePath && args.persistentStoragePath.endsWith(".json")) {
+ if (
+ args.persistentStoragePath &&
+ args.persistentStoragePath.endsWith(".json")
+ ) {
logger.info("using JSON file DB backend (slow!)");
dbResp = await makeFileDb(args);
} else {
logger.info("using sqlite3 DB backend (experimental!)");
- dbResp = await makeSqliteDb(args)
+ dbResp = await makeSqliteDb(args);
}
const myIdbFactory: IDBFactory = dbResp.idbFactory as any as IDBFactory;
@@ -189,22 +192,13 @@ export async function createNativeWalletHost2(
});
}
- const myVersionChange = (): Promise<void> => {
- logger.error("version change requested, should not happen");
- throw Error(
- "BUG: wallet DB version change event can't happen with memory IDB",
- );
- };
-
- const myDb = await openTalerDatabase(myIdbFactory, myVersionChange);
-
let workerFactory;
workerFactory = new SynchronousCryptoWorkerFactoryPlain();
const timer = new SetTimeoutTimerAPI();
const w = await Wallet.create(
- myDb,
+ myIdbFactory,
myHttpLib,
timer,
workerFactory,