diff options
author | Florian Dold <florian@dold.me> | 2021-08-24 14:25:46 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-08-24 14:30:33 +0200 |
commit | 408d8e9fc896193fbcff1afd12aa04ab6d513798 (patch) | |
tree | a117a3c5d9130ea9b18c4198d3978f38dbd2f101 /packages/taler-wallet-core/src/operations/backup | |
parent | 7553ae7c74bc04c268b77d010fb2f5b5eacad460 (diff) | |
download | wallet-core-408d8e9fc896193fbcff1afd12aa04ab6d513798.tar.xz |
towards handling frozen refreshes
Diffstat (limited to 'packages/taler-wallet-core/src/operations/backup')
-rw-r--r-- | packages/taler-wallet-core/src/operations/backup/export.ts | 3 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/operations/backup/import.ts | 7 |
2 files changed, 7 insertions, 3 deletions
diff --git a/packages/taler-wallet-core/src/operations/backup/export.ts b/packages/taler-wallet-core/src/operations/backup/export.ts index 4d9ca6697..0410ab3af 100644 --- a/packages/taler-wallet-core/src/operations/backup/export.ts +++ b/packages/taler-wallet-core/src/operations/backup/export.ts @@ -66,6 +66,7 @@ import { CoinSourceType, CoinStatus, ProposalStatus, + RefreshCoinStatus, RefundState, WALLET_BACKUP_STATE_KEY, } from "../../db.js"; @@ -440,7 +441,7 @@ export async function exportBackup( estimated_output_amount: Amounts.stringify( rg.estimatedOutputPerCoin[i], ), - finished: rg.finishedPerCoin[i], + finished: rg.statusPerCoin[i] === RefreshCoinStatus.Finished, input_amount: Amounts.stringify(rg.inputPerCoin[i]), refresh_session: refreshSession, }); diff --git a/packages/taler-wallet-core/src/operations/backup/import.ts b/packages/taler-wallet-core/src/operations/backup/import.ts index 8ba4e4db3..a694d9f4d 100644 --- a/packages/taler-wallet-core/src/operations/backup/import.ts +++ b/packages/taler-wallet-core/src/operations/backup/import.ts @@ -45,6 +45,7 @@ import { RefreshSessionRecord, WireInfo, WalletStoresV1, + RefreshCoinStatus, } from "../../db.js"; import { PayCoinSelection } from "../../util/coinSelection.js"; import { j2s } from "@gnu-taler/taler-util"; @@ -831,8 +832,10 @@ export async function importBackup( lastError: undefined, lastErrorPerCoin: {}, oldCoinPubs: backupRefreshGroup.old_coins.map((x) => x.coin_pub), - finishedPerCoin: backupRefreshGroup.old_coins.map( - (x) => x.finished, + statusPerCoin: backupRefreshGroup.old_coins.map((x) => + x.finished + ? RefreshCoinStatus.Finished + : RefreshCoinStatus.Pending, ), inputPerCoin: backupRefreshGroup.old_coins.map((x) => Amounts.parseOrThrow(x.input_amount), |