diff options
author | Sebastian <sebasjm@gmail.com> | 2023-05-22 13:13:40 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-05-22 13:13:40 -0300 |
commit | 708cf016e4ab1e749b86151aa2a9cc548675d63c (patch) | |
tree | 54c5bc6de7a62a6088383fafc8e3970979b1603e /packages/taler-wallet-core/src/operations/withdraw.ts | |
parent | 76d2524b8b59ca52477f4b0686ccdcee371ecb9e (diff) |
nominal typing for taskId, also fixing transactionId reference
Diffstat (limited to 'packages/taler-wallet-core/src/operations/withdraw.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/withdraw.ts | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts b/packages/taler-wallet-core/src/operations/withdraw.ts index d0c4d453f..ba154d05c 100644 --- a/packages/taler-wallet-core/src/operations/withdraw.ts +++ b/packages/taler-wallet-core/src/operations/withdraw.ts @@ -482,7 +482,7 @@ export function computeWithdrawalTransactionStatus( return { major: TransactionMajorState.Aborted, minor: TransactionMinorState.Exchange, - } + }; } } @@ -1997,7 +1997,7 @@ async function processReserveBankStatus( return { oldTxState, newTxState, - } + }; }); notifyTransition(ws, transactionId, transitionInfo); return { @@ -2059,7 +2059,7 @@ async function processReserveBankStatus( return { oldTxState, newTxState, - } + }; }); notifyTransition(ws, transactionId, transitionInfo); @@ -2208,12 +2208,12 @@ export async function internalCreateWithdrawalGroup( const oldTxState = { major: TransactionMajorState.None, - } + }; const newTxState = computeWithdrawalTransactionStatus(withdrawalGroup); return { oldTxState, newTxState, - } + }; }); notifyTransition(ws, transactionId, transitionInfo); @@ -2253,10 +2253,10 @@ export async function acceptWithdrawalFromUri( return { reservePub: existingWithdrawalGroup.reservePub, confirmTransferUrl: url, - transactionId: makeTransactionId( - TransactionType.Withdrawal, - existingWithdrawalGroup.withdrawalGroupId, - ), + transactionId: constructTransactionIdentifier({ + tag: TransactionType.Withdrawal, + withdrawalGroupId: existingWithdrawalGroup.withdrawalGroupId, + }), }; } @@ -2290,8 +2290,8 @@ export async function acceptWithdrawalFromUri( }); const withdrawalGroupId = withdrawalGroup.withdrawalGroupId; - const transactionId = constructTaskIdentifier({ - tag: PendingTaskType.Withdraw, + const transactionId = constructTransactionIdentifier({ + tag: TransactionType.Withdrawal, withdrawalGroupId, }); @@ -2301,7 +2301,9 @@ export async function acceptWithdrawalFromUri( const processedWithdrawalGroup = await getWithdrawalGroupRecordTx(ws.db, { withdrawalGroupId, }); - if (processedWithdrawalGroup?.status === WithdrawalGroupStatus.FailedBankAborted) { + if ( + processedWithdrawalGroup?.status === WithdrawalGroupStatus.FailedBankAborted + ) { throw TalerError.fromDetail( TalerErrorCode.WALLET_WITHDRAWAL_OPERATION_ABORTED_BY_BANK, {}, @@ -2346,8 +2348,8 @@ export async function createManualWithdrawal( }); const withdrawalGroupId = withdrawalGroup.withdrawalGroupId; - const transactionId = constructTaskIdentifier({ - tag: PendingTaskType.Withdraw, + const transactionId = constructTransactionIdentifier({ + tag: TransactionType.Withdrawal, withdrawalGroupId, }); |