diff options
author | Florian Dold <florian@dold.me> | 2021-12-01 18:16:40 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-12-01 18:16:47 +0100 |
commit | 668ffa7302d9f1629848c250904fd269979bb8b0 (patch) | |
tree | 4a32d212d1146383bb4bd16132dec4fa09845f73 /packages/taler-wallet-core/src/wallet.ts | |
parent | b0c2a73146907b2edeb1d2c97536478c995eb73b (diff) | |
download | wallet-core-668ffa7302d9f1629848c250904fd269979bb8b0.tar.xz |
wallet-core: implement exportDb API call
Diffstat (limited to 'packages/taler-wallet-core/src/wallet.ts')
-rw-r--r-- | packages/taler-wallet-core/src/wallet.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index 7233af3af..04213ddc9 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -123,6 +123,7 @@ import { import { AuditorTrustRecord, CoinSourceType, + exportDb, ReserveRecordStatus, WalletStoresV1, } from "./db.js"; @@ -183,6 +184,7 @@ import { readSuccessResponseJsonOrThrow, } from "./util/http.js"; import { getMerchantInfo } from "./operations/merchants.js"; +import { Event, IDBDatabase } from "@gnu-taler/idb-bridge"; const builtinAuditors: AuditorTrustRecord[] = [ { @@ -953,6 +955,10 @@ async function dispatchRequestInternal( logger.info(`started fakebank withdrawal: ${j2s(fbResp)}`); return {}; } + case "exportDb": { + const dbDump = await exportDb(ws.db.idbHandle()); + return dbDump; + } } throw OperationFailedError.fromCode( TalerErrorCode.WALLET_CORE_API_OPERATION_UNKNOWN, @@ -997,7 +1003,7 @@ export async function handleCoreApiRequest( try { logger.error("Caught unexpected exception:"); logger.error(e.stack); - } catch (e) { } + } catch (e) {} return { type: "error", operation, |