diff options
author | Florian Dold <florian@dold.me> | 2022-09-23 21:47:38 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-09-23 21:47:38 +0200 |
commit | 2337ddab6126722b46a0ea0b6e244955a38b09df (patch) | |
tree | e814990f2ca19970561eb31a297be77f6fe36245 /packages/taler-wallet-core/src/operations/withdraw.ts | |
parent | 8d19b801538e2be842ebe2d03ca464f72bb95edb (diff) | |
download | wallet-core-2337ddab6126722b46a0ea0b6e244955a38b09df.tar.xz |
wallet-core: fix withdrawal state machine
Diffstat (limited to 'packages/taler-wallet-core/src/operations/withdraw.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/withdraw.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts b/packages/taler-wallet-core/src/operations/withdraw.ts index 4901fdc86..461b96079 100644 --- a/packages/taler-wallet-core/src/operations/withdraw.ts +++ b/packages/taler-wallet-core/src/operations/withdraw.ts @@ -1023,7 +1023,7 @@ async function queryReserve( logger.warn(`withdrawal group ${withdrawalGroupId} not found`); return; } - wg.status = WithdrawalGroupStatus.Finished; + wg.status = WithdrawalGroupStatus.Ready; await tx.withdrawalGroups.put(wg); }); @@ -1138,6 +1138,9 @@ export async function processWithdrawalGroup( case WithdrawalGroupStatus.Finished: // We can try to withdraw, nothing needs to be done with the reserve. break; + case WithdrawalGroupStatus.Ready: + // Continue with the actual withdrawal! + break; default: throw new InvariantViolatedError( `unknown reserve record status: ${withdrawalGroup.status}`, |