fix: transfor from backup proporsal status to purchase status and fix denom query
This commit is contained in:
parent
f4b92578b0
commit
892b3b500a
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user