From 02f1d4b08116c24f0af1f32cb6d82be292fa6d10 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 2 Jun 2021 13:23:51 +0200 Subject: support multiple exchange details per base URL --- packages/taler-util/src/backupTypes.ts | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) (limited to 'packages/taler-util/src') diff --git a/packages/taler-util/src/backupTypes.ts b/packages/taler-util/src/backupTypes.ts index ce2eb6b77..dc344ee23 100644 --- a/packages/taler-util/src/backupTypes.ts +++ b/packages/taler-util/src/backupTypes.ts @@ -128,6 +128,8 @@ export interface WalletBackupContentV1 { */ exchanges: BackupExchange[]; + exchange_details: BackupExchangeDetails[]; + /** * Grouped refresh sessions. * @@ -1090,9 +1092,34 @@ export class BackupExchangeAuditor { } /** - * Backup information about an exchange. + * Backup information for an exchange. Serves effectively + * as a pointer to the exchange details identified by + * the base URL, master public key and currency. */ export interface BackupExchange { + base_url: string; + + master_public_key: string; + + currency: string; + + /** + * Time when the pointer to the exchange details + * was last updated. + * + * Used to facilitate automatic merging. + */ + update_clock: Timestamp; +} + +/** + * Backup information about an exchange's details. + * + * Note that one base URL can have multiple exchange + * details. The BackupExchange stores a pointer + * to the current exchange details. + */ +export interface BackupExchangeDetails { /** * Canonicalized base url of the exchange. */ @@ -1158,11 +1185,6 @@ export interface BackupExchange { * ETag for last terms of service download. */ tos_etag_accepted: string | undefined; - - /** - * Should this exchange be considered defective? - */ - defective?: boolean; } export enum BackupProposalStatus { -- cgit v1.2.3