diff options
author | Sebastian <sebasjm@gmail.com> | 2022-09-16 11:06:55 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-09-16 11:13:09 -0300 |
commit | 5d0837913901a2947c66209d64855b324824757d (patch) | |
tree | bff68e1fff6f5833948505849d58f4be4a5e62d1 /packages/taler-wallet-core/src/operations/tip.ts | |
parent | a66b636dee2ed531bb5119feced80d6569d99176 (diff) | |
download | wallet-core-5d0837913901a2947c66209d64855b324824757d.tar.xz |
working on #7357
getTransactionById is introduced:
with that we move all transaction information building into a function
transactionId was added in every response that creates a tx
Diffstat (limited to 'packages/taler-wallet-core/src/operations/tip.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/tip.ts | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/operations/tip.ts b/packages/taler-wallet-core/src/operations/tip.ts index c8f327a56..eef151cf2 100644 --- a/packages/taler-wallet-core/src/operations/tip.ts +++ b/packages/taler-wallet-core/src/operations/tip.ts @@ -18,6 +18,7 @@ * Imports. */ import { + AcceptTipResponse, Amounts, BlindedDenominationSignature, codecForMerchantTipResponseV2, @@ -32,6 +33,7 @@ import { TalerErrorCode, TalerProtocolTimestamp, TipPlanchetDetail, + TransactionType, URL, } from "@gnu-taler/taler-util"; import { DerivedTipPlanchet } from "../crypto/cryptoTypes.js"; @@ -53,6 +55,7 @@ import { import { checkDbInvariant, checkLogicInvariant } from "../util/invariants.js"; import { makeCoinAvailable } from "../wallet.js"; import { updateExchangeFromUrl } from "./exchanges.js"; +import { makeEventId } from "./transactions.js"; import { getCandidateWithdrawalDenoms, getExchangeWithdrawalInfo, @@ -341,7 +344,7 @@ export async function processTip( export async function acceptTip( ws: InternalWalletState, tipId: string, -): Promise<void> { +): Promise<AcceptTipResponse> { const found = await ws.db .mktx((x) => [x.tips]) .runReadWrite(async (tx) => { @@ -357,4 +360,10 @@ export async function acceptTip( if (found) { await processTip(ws, tipId); } + return { + transactionId: makeEventId( + TransactionType.Tip, + tipId + ) + } } |