diff options
-rw-r--r-- | packages/taler-wallet-core/src/operations/backup/import.ts | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/packages/taler-wallet-core/src/operations/backup/import.ts b/packages/taler-wallet-core/src/operations/backup/import.ts index 6ec541edc..ad3676ef8 100644 --- a/packages/taler-wallet-core/src/operations/backup/import.ts +++ b/packages/taler-wallet-core/src/operations/backup/import.ts @@ -588,8 +588,22 @@ export async function importBackup( case BackupProposalStatus.Paid: proposalStatus = PurchaseStatus.Paid; break; - default: - throw Error(); + case BackupProposalStatus.Proposed: + proposalStatus = PurchaseStatus.Proposed; + break; + case BackupProposalStatus.PermanentlyFailed: + proposalStatus = PurchaseStatus.PaymentAbortFinished; + break; + case BackupProposalStatus.Refused: + proposalStatus = PurchaseStatus.ProposalRefused; + break; + case BackupProposalStatus.Repurchase: + proposalStatus = PurchaseStatus.RepurchaseDetected; + break; + default: { + const error: never = backupPurchase.proposal_status; + throw Error(`backup status ${error} is not handled`); + } } if (!existingPurchase) { const refunds: { [refundKey: string]: WalletRefundItem } = {}; @@ -744,7 +758,10 @@ export async function importBackup( for (const oldCoin of backupRefreshGroup.old_coins) { const c = await tx.coins.get(oldCoin.coin_pub); checkBackupInvariant(!!c); - const d = await tx.denominations.get(c.denomPubHash); + const d = await tx.denominations.get([ + c.exchangeBaseUrl, + c.denomPubHash, + ]); checkBackupInvariant(!!d); if (oldCoin.refresh_session) { |