summaryrefslogtreecommitdiff
path: root/src/operations/tip.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-12-16 12:53:22 +0100
committerFlorian Dold <florian.dold@gmail.com>2019-12-16 12:53:22 +0100
commitfa4621e70c48500a372504eb8ae9b9481531c555 (patch)
tree50c457c8c2133dfec32cb465e1b3902ce88fb209 /src/operations/tip.ts
parent1b9c5855a8afb6833ff7a706f5bed5650e1191ad (diff)
downloadwallet-core-fa4621e70c48500a372504eb8ae9b9481531c555.tar.gz
wallet-core-fa4621e70c48500a372504eb8ae9b9481531c555.tar.bz2
wallet-core-fa4621e70c48500a372504eb8ae9b9481531c555.zip
history events WIP
Diffstat (limited to 'src/operations/tip.ts')
-rw-r--r--src/operations/tip.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/operations/tip.ts b/src/operations/tip.ts
index f9953b513..ba4b80974 100644
--- a/src/operations/tip.ts
+++ b/src/operations/tip.ts
@@ -68,7 +68,8 @@ export async function getTipStatus(
tipRecord = {
tipId,
- accepted: false,
+ acceptedTimestamp: undefined,
+ rejectedTimestamp: undefined,
amount,
deadline: extractTalerStampOrThrow(tipPickupStatus.stamp_expire),
exchangeUrl: tipPickupStatus.exchange_url,
@@ -90,7 +91,7 @@ export async function getTipStatus(
}
const tipStatus: TipStatus = {
- accepted: !!tipRecord && tipRecord.accepted,
+ accepted: !!tipRecord && !!tipRecord.acceptedTimestamp,
amount: Amounts.parseOrThrow(tipPickupStatus.amount),
amountLeft: Amounts.parseOrThrow(tipPickupStatus.amount_left),
exchangeUrl: tipPickupStatus.exchange_url,
@@ -259,7 +260,7 @@ async function processTipImpl(
rawWithdrawalAmount: tipRecord.amount,
withdrawn: planchets.map((x) => false),
totalCoinValue: Amounts.sum(planchets.map((p) => p.coinValue)).amount,
- lastCoinErrors: planchets.map((x) => undefined),
+ lastErrorPerCoin: {},
retryInfo: initRetryInfo(),
finishTimestamp: undefined,
lastError: undefined,
@@ -296,7 +297,7 @@ export async function acceptTip(
return;
}
- tipRecord.accepted = true;
+ tipRecord.acceptedTimestamp = getTimestampNow();
await ws.db.put(Stores.tips, tipRecord);
await processTip(ws, tipId);