diff options
author | Florian Dold <florian@dold.me> | 2023-09-06 18:43:37 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-09-06 18:43:37 +0200 |
commit | 1fcb55c84dc541e64ebbb2d16156bab275ff16c4 (patch) | |
tree | 2e0b3e3604cf70989b34c1b34f77ccf0e08d2060 /packages/taler-wallet-core/src/operations | |
parent | cd9c3a143bc1ad88ce77d53c212a90f60660069a (diff) | |
download | wallet-core-1fcb55c84dc541e64ebbb2d16156bab275ff16c4.tar.xz |
remove ToS storage
Diffstat (limited to 'packages/taler-wallet-core/src/operations')
-rw-r--r-- | packages/taler-wallet-core/src/operations/exchanges.ts | 45 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/operations/withdraw.ts | 1 |
2 files changed, 0 insertions, 46 deletions
diff --git a/packages/taler-wallet-core/src/operations/exchanges.ts b/packages/taler-wallet-core/src/operations/exchanges.ts index 690bc3cec..13e89b16c 100644 --- a/packages/taler-wallet-core/src/operations/exchanges.ts +++ b/packages/taler-wallet-core/src/operations/exchanges.ts @@ -158,35 +158,6 @@ getExchangeDetails.makeContext = (db: DbAccess<typeof WalletStoresV1>) => db.mktx((x) => [x.exchanges, x.exchangeDetails]); /** - * Update the database based on the download of the terms of service. - */ -export async function updateExchangeTermsOfService( - ws: InternalWalletState, - exchangeBaseUrl: string, - tos: ExchangeTosDownloadResult, -): Promise<void> { - await ws.db - .mktx((x) => [x.exchanges, x.exchangeTos, x.exchangeDetails]) - .runReadWrite(async (tx) => { - const d = await getExchangeDetails(tx, exchangeBaseUrl); - let tosRecord = await tx.exchangeTos.get([exchangeBaseUrl, tos.tosEtag]); - if (!tosRecord) { - tosRecord = { - etag: tos.tosEtag, - exchangeBaseUrl, - termsOfServiceContentType: tos.tosContentType, - termsOfServiceText: tos.tosText, - }; - await tx.exchangeTos.put(tosRecord); - } - if (d) { - d.tosCurrentEtag = tos.tosEtag; - await tx.exchangeDetails.put(d); - } - }); -} - -/** * Mark a ToS version as accepted by the user. * * @param etag version of the ToS to accept, or current ToS version of not given @@ -740,7 +711,6 @@ export async function updateExchangeFromUrlHandler( const updated = await ws.db .mktx((x) => [ x.exchanges, - x.exchangeTos, x.exchangeDetails, x.exchangeSignKeys, x.denominations, @@ -801,21 +771,6 @@ export async function updateExchangeFromUrlHandler( const drRowId = await tx.exchangeDetails.put(newDetails); checkDbInvariant(typeof drRowId.key === "number"); - let tosRecord = await tx.exchangeTos.get([ - exchangeBaseUrl, - tosDownload.tosEtag, - ]); - - if (!tosRecord || tosRecord.etag !== existingTosAccepted?.etag) { - tosRecord = { - etag: tosDownload.tosEtag, - exchangeBaseUrl, - termsOfServiceContentType: tosDownload.tosContentType, - termsOfServiceText: tosDownload.tosText, - }; - await tx.exchangeTos.put(tosRecord); - } - for (const sk of keysInfo.signingKeys) { // FIXME: validate signing keys before inserting them await tx.exchangeSignKeys.put({ diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts b/packages/taler-wallet-core/src/operations/withdraw.ts index 2b76613e7..b2b25144d 100644 --- a/packages/taler-wallet-core/src/operations/withdraw.ts +++ b/packages/taler-wallet-core/src/operations/withdraw.ts @@ -1856,7 +1856,6 @@ export async function getWithdrawalDetailsForUri( .mktx((x) => [ x.exchanges, x.exchangeDetails, - x.exchangeTos, x.denominations, x.operationRetries, ]) |