diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-09-08 19:54:23 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-09-08 19:54:30 +0530 |
commit | 043a5f89fe020bbb55170a9fc355c3d699ad8761 (patch) | |
tree | 1c033feecf6b276f8dc69e8ddb70ee260d675bb8 /packages/taler-wallet-core/src/operations/transactions.ts | |
parent | b9e43e652e606706a81f39d4f888477580de79b0 (diff) | |
download | wallet-core-043a5f89fe020bbb55170a9fc355c3d699ad8761.tar.xz |
tipping transaction list entry, integration test and DB simplifications
Diffstat (limited to 'packages/taler-wallet-core/src/operations/transactions.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/transactions.ts | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/operations/transactions.ts b/packages/taler-wallet-core/src/operations/transactions.ts index b5f77a190..026a91ef3 100644 --- a/packages/taler-wallet-core/src/operations/transactions.ts +++ b/packages/taler-wallet-core/src/operations/transactions.ts @@ -38,6 +38,7 @@ import { OrderShortInfo, } from "../types/transactions"; import { getFundingPaytoUris } from "./reserves"; +import { TipResponse } from "../types/talerTypes"; /** * Create an event ID from the type and the primary key for the event. @@ -308,6 +309,29 @@ export async function getTransactions( }); }); }); + + tx.iter(Stores.tips).forEachAsync(async (tipRecord) => { + if ( + shouldSkipCurrency( + transactionsRequest, + tipRecord.tipAmountRaw.currency, + ) + ) { + return; + } + if (!tipRecord.acceptedTimestamp) { + return; + } + transactions.push({ + type: TransactionType.Tip, + amountEffective: Amounts.stringify(tipRecord.tipAmountEffective), + amountRaw: Amounts.stringify(tipRecord.tipAmountRaw), + pending: !tipRecord.pickedUpTimestamp, + timestamp: tipRecord.acceptedTimestamp, + transactionId: makeEventId(TransactionType.Tip, tipRecord.walletTipId), + error: tipRecord.lastError, + }); + }); }, ); |