diff options
Diffstat (limited to 'packages/taler-wallet-core/src/wallet.ts')
-rw-r--r-- | packages/taler-wallet-core/src/wallet.ts | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index ea64ff1aa..005fac3c4 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -46,7 +46,6 @@ import { PrepareWithdrawExchangeRequest, PrepareWithdrawExchangeResponse, RecoverStoredBackupRequest, - ScopeType, StoredBackupList, TalerError, TalerErrorCode, @@ -161,7 +160,6 @@ import { MerchantInfo, NotificationListener, RecoupOperations, - RefreshOperations, } from "./internal-wallet-state.js"; import { getUserAttentions, @@ -262,13 +260,14 @@ import { runIntegrationTest2, testPay, waitTransactionState, + waitUntilAllTransactionsFinal, waitUntilRefreshesDone, waitUntilTasksProcessed, - waitUntilTransactionsFinal, withdrawTestBalance, } from "./operations/testing.js"; import { abortTransaction, + constructTransactionIdentifier, deleteTransaction, failTransaction, getTransactionById, @@ -735,9 +734,9 @@ async function dumpCoins(ws: InternalWalletState): Promise<CoinDumpJson> { ageCommitmentProof: c.ageCommitmentProof, spend_allocation: c.spendAllocation ? { - amount: c.spendAllocation.amount, - id: c.spendAllocation.id, - } + amount: c.spendAllocation.amount, + id: c.spendAllocation.id, + } : undefined, }); } @@ -1125,20 +1124,19 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>( } case WalletApiOperation.ConfirmPay: { const req = codecForConfirmPayRequest().decode(payload); - let proposalId; + let transactionId; if (req.proposalId) { // legacy client support - proposalId = req.proposalId; + transactionId = constructTransactionIdentifier({ + tag: TransactionType.Payment, + proposalId: req.proposalId, + }); } else if (req.transactionId) { - const txIdParsed = parseTransactionIdentifier(req.transactionId); - if (txIdParsed?.tag != TransactionType.Payment) { - throw Error("payment transaction ID required"); - } - proposalId = txIdParsed.proposalId; + transactionId = req.transactionId; } else { throw Error("transactionId or (deprecated) proposalId required"); } - return await confirmPay(ws, proposalId, req.sessionId); + return await confirmPay(ws, transactionId, req.sessionId); } case WalletApiOperation.AbortTransaction: { const req = codecForAbortTransaction().decode(payload); @@ -1491,7 +1489,7 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>( return getVersion(ws); } case WalletApiOperation.TestingWaitTransactionsFinal: - return await waitUntilTransactionsFinal(ws); + return await waitUntilAllTransactionsFinal(ws); case WalletApiOperation.TestingWaitRefreshesFinal: return await waitUntilRefreshesDone(ws); case WalletApiOperation.TestingSetTimetravel: { @@ -1727,10 +1725,6 @@ class InternalWalletStateImpl implements InternalWalletState { createRecoupGroup, }; - refreshOps: RefreshOperations = { - createRefreshGroup, - }; - // FIXME: Use an LRU cache here. private denomCache: Record<string, DenominationInfo> = {}; @@ -1864,6 +1858,8 @@ class InternalWalletStateImpl implements InternalWalletState { } return computeRewardTransactionStatus(rec); } + case TransactionType.Recoup: + throw Error("not yet supported"); default: assertUnreachable(parsedTxId); } |