diff options
Diffstat (limited to 'packages/taler-wallet-core/src/operations/backup')
-rw-r--r-- | packages/taler-wallet-core/src/operations/backup/export.ts | 5 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/operations/backup/import.ts | 20 |
2 files changed, 14 insertions, 11 deletions
diff --git a/packages/taler-wallet-core/src/operations/backup/export.ts b/packages/taler-wallet-core/src/operations/backup/export.ts index 3ba0d85e6..30e61e382 100644 --- a/packages/taler-wallet-core/src/operations/backup/export.ts +++ b/packages/taler-wallet-core/src/operations/backup/export.ts @@ -298,7 +298,6 @@ export async function exportBackup( currency: dp.currency, master_public_key: dp.masterPublicKey, update_clock: dp.updateClock, - protocol_version_range: dp.protocolVersionRange, }); }); @@ -358,8 +357,8 @@ export async function exportBackup( purseTimeout: x.purseTimeout, startDate: x.startDate, })), - tos_accepted_etag: ex.termsOfServiceAcceptedEtag, - tos_accepted_timestamp: ex.termsOfServiceAcceptedTimestamp, + tos_accepted_etag: ex.tosAccepted?.etag, + tos_accepted_timestamp: ex.tosAccepted?.timestamp, denominations: backupDenominationsByExchange[ex.exchangeBaseUrl] ?? [], }); diff --git a/packages/taler-wallet-core/src/operations/backup/import.ts b/packages/taler-wallet-core/src/operations/backup/import.ts index 59fd3c398..599b02dea 100644 --- a/packages/taler-wallet-core/src/operations/backup/import.ts +++ b/packages/taler-wallet-core/src/operations/backup/import.ts @@ -351,7 +351,6 @@ export async function importBackup( currency: backupExchange.currency, masterPublicKey: backupExchange.master_public_key, updateClock: backupExchange.update_clock, - protocolVersionRange: backupExchange.protocol_version_range, }, permanent: true, lastUpdate: undefined, @@ -388,14 +387,18 @@ export async function importBackup( wadFee: Amounts.parseOrThrow(fee.wad_fee), }); } + let tosAccepted = undefined; + if ( + backupExchangeDetails.tos_accepted_etag && + backupExchangeDetails.tos_accepted_timestamp + ) { + tosAccepted = { + etag: backupExchangeDetails.tos_accepted_etag, + timestamp: backupExchangeDetails.tos_accepted_timestamp, + }; + } await tx.exchangeDetails.put({ exchangeBaseUrl: backupExchangeDetails.base_url, - termsOfServiceAcceptedEtag: backupExchangeDetails.tos_accepted_etag, - termsOfServiceText: undefined, - termsOfServiceLastEtag: undefined, - termsOfServiceContentType: undefined, - termsOfServiceAcceptedTimestamp: - backupExchangeDetails.tos_accepted_timestamp, wireInfo, currency: backupExchangeDetails.currency, auditors: backupExchangeDetails.auditors.map((x) => ({ @@ -406,6 +409,8 @@ export async function importBackup( masterPublicKey: backupExchangeDetails.master_public_key, protocolVersionRange: backupExchangeDetails.protocol_version, reserveClosingDelay: backupExchangeDetails.reserve_closing_delay, + tosCurrentEtag: backupExchangeDetails.tos_accepted_etag || "", + tosAccepted, globalFees: backupExchangeDetails.global_fees.map((x) => ({ accountFee: Amounts.parseOrThrow(x.accountFee), historyFee: Amounts.parseOrThrow(x.historyFee), @@ -419,7 +424,6 @@ export async function importBackup( purseTimeout: x.purseTimeout, startDate: x.startDate, })), - signingKeys: backupExchangeDetails.signing_keys.map((x) => ({ key: x.key, master_sig: x.master_sig, |