diff options
Diffstat (limited to 'packages/taler-wallet-core/src/db.ts')
-rw-r--r-- | packages/taler-wallet-core/src/db.ts | 63 |
1 files changed, 33 insertions, 30 deletions
diff --git a/packages/taler-wallet-core/src/db.ts b/packages/taler-wallet-core/src/db.ts index 6dfb06c15..304efd852 100644 --- a/packages/taler-wallet-core/src/db.ts +++ b/packages/taler-wallet-core/src/db.ts @@ -80,7 +80,7 @@ import { Event, IDBDatabase } from "@gnu-taler/idb-bridge"; * for all previous versions must be written, which should be * avoided. */ -export const TALER_DB_NAME = "taler-wallet-main-v6"; +export const TALER_DB_NAME = "taler-wallet-main-v7"; /** * Name of the metadata database. This database is used @@ -99,7 +99,7 @@ export const CURRENT_DB_CONFIG_KEY = "currentMainDbName"; * backwards-compatible way or object stores and indices * are added. */ -export const WALLET_DB_MINOR_VERSION = 2; +export const WALLET_DB_MINOR_VERSION = 1; /** * Ranges for operation status fields. @@ -451,39 +451,40 @@ export interface ExchangeDetailsRecord { signingKeys: ExchangeSignKeyJson[]; /** - * Terms of service text or undefined if not downloaded yet. - * - * This is just used as a cache of the last downloaded ToS. - * - * FIXME: Put in separate object store! + * Etag of the current ToS of the exchange. */ - termsOfServiceText: string | undefined; + tosCurrentEtag: string; /** - * content-type of the last downloaded termsOfServiceText. - * - * * FIXME: Put in separate object store! + * Information about ToS acceptance from the user. */ - termsOfServiceContentType: string | undefined; + tosAccepted: + | { + etag: string; + timestamp: TalerProtocolTimestamp; + } + | undefined; - /** - * ETag for last terms of service download. - */ - termsOfServiceLastEtag: string | undefined; + wireInfo: WireInfo; +} - /** - * ETag for last terms of service accepted. - */ - termsOfServiceAcceptedEtag: string | undefined; +export interface ExchangeTosRecord { + exchangeBaseUrl: string; + + etag: string; /** - * Timestamp when the ToS was accepted. + * Terms of service text or undefined if not downloaded yet. + * + * This is just used as a cache of the last downloaded ToS. * - * Used during backup merging. */ - termsOfServiceAcceptedTimestamp: TalerProtocolTimestamp | undefined; + termsOfServiceText: string | undefined; - wireInfo: WireInfo; + /** + * Content-type of the last downloaded termsOfServiceText. + */ + termsOfServiceContentType: string | undefined; } export interface ExchangeDetailsPointer { @@ -492,11 +493,6 @@ export interface ExchangeDetailsPointer { currency: string; /** - * Last observed protocol version range offered by the exchange. - */ - protocolVersionRange: string; - - /** * Timestamp when the (masterPublicKey, currency) pointer * has been updated. */ @@ -1899,6 +1895,14 @@ export const WalletStoresV1 = { byReservePub: describeIndex("byReservePub", "reservePub", {}), }, ), + exchangeTos: describeStore( + "exchangeTos", + describeContents<ExchangeTosRecord>({ + keyPath: ["exchangeBaseUrl", "etag"], + autoIncrement: true, + }), + {}, + ), config: describeStore( "config", describeContents<ConfigRecord>({ keyPath: "key" }), @@ -2116,7 +2120,6 @@ export const WalletStoresV1 = { "bankAccounts", describeContents<BankAccountsRecord>({ keyPath: "uri", - versionAdded: 2, }), {}, ), |