diff options
author | Florian Dold <florian@dold.me> | 2022-09-13 13:25:41 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-09-13 16:10:42 +0200 |
commit | 48540f62644b4c2e4e96095b11e202cb62e3e93d (patch) | |
tree | 0f1214f9b3e8d63a81b52b794bf44f9eb2a61dfc /packages/taler-wallet-core/src/operations/backup/state.ts | |
parent | 13e7a674778754c0ed641dfd428e3d6b2b71ab2d (diff) | |
download | wallet-core-48540f62644b4c2e4e96095b11e202cb62e3e93d.tar.xz |
wallet-core: introduce easier syntax for transactions
Diffstat (limited to 'packages/taler-wallet-core/src/operations/backup/state.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/backup/state.ts | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/packages/taler-wallet-core/src/operations/backup/state.ts b/packages/taler-wallet-core/src/operations/backup/state.ts index 293f56137..2efd9be8e 100644 --- a/packages/taler-wallet-core/src/operations/backup/state.ts +++ b/packages/taler-wallet-core/src/operations/backup/state.ts @@ -29,9 +29,7 @@ export async function provideBackupState( ws: InternalWalletState, ): Promise<WalletBackupConfState> { const bs: ConfigRecord | undefined = await ws.db - .mktx((x) => ({ - config: x.config, - })) + .mktx((stores) => [stores.config]) .runReadOnly(async (tx) => { return await tx.config.get(WALLET_BACKUP_STATE_KEY); }); @@ -47,9 +45,7 @@ export async function provideBackupState( // and be based on hostname const deviceId = `wallet-core-${encodeCrock(d)}`; return await ws.db - .mktx((x) => ({ - config: x.config, - })) + .mktx((x) => [x.config]) .runReadWrite(async (tx) => { let backupStateEntry: ConfigRecord | undefined = await tx.config.get( WALLET_BACKUP_STATE_KEY, @@ -87,9 +83,7 @@ export async function setWalletDeviceId( ): Promise<void> { await provideBackupState(ws); await ws.db - .mktx((x) => ({ - config: x.config, - })) + .mktx((x) => [x.config]) .runReadWrite(async (tx) => { let backupStateEntry: ConfigRecord | undefined = await tx.config.get( WALLET_BACKUP_STATE_KEY, |