aboutsummaryrefslogtreecommitdiff
path: root/src/operations/pending.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/pending.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/pending.ts')
-rw-r--r--src/operations/pending.ts18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/operations/pending.ts b/src/operations/pending.ts
index b9b2c664e..252c9e98a 100644
--- a/src/operations/pending.ts
+++ b/src/operations/pending.ts
@@ -54,7 +54,7 @@ async function gatherExchangePending(
}
await tx.iter(Stores.exchanges).forEach(e => {
switch (e.updateStatus) {
- case ExchangeUpdateStatus.FINISHED:
+ case ExchangeUpdateStatus.Finished:
if (e.lastError) {
resp.pendingOperations.push({
type: PendingOperationType.Bug,
@@ -89,7 +89,7 @@ async function gatherExchangePending(
});
}
break;
- case ExchangeUpdateStatus.FETCH_KEYS:
+ case ExchangeUpdateStatus.FetchKeys:
resp.pendingOperations.push({
type: PendingOperationType.ExchangeUpdate,
givesLifeness: false,
@@ -99,7 +99,7 @@ async function gatherExchangePending(
reason: e.updateReason || "unknown",
});
break;
- case ExchangeUpdateStatus.FETCH_WIRE:
+ case ExchangeUpdateStatus.FetchWire:
resp.pendingOperations.push({
type: PendingOperationType.ExchangeUpdate,
givesLifeness: false,
@@ -109,6 +109,16 @@ async function gatherExchangePending(
reason: e.updateReason || "unknown",
});
break;
+ case ExchangeUpdateStatus.FinalizeUpdate:
+ resp.pendingOperations.push({
+ type: PendingOperationType.ExchangeUpdate,
+ givesLifeness: false,
+ stage: "finalize-update",
+ exchangeBaseUrl: e.baseUrl,
+ lastError: e.lastError,
+ reason: e.updateReason || "unknown",
+ });
+ break;
default:
resp.pendingOperations.push({
type: PendingOperationType.Bug,
@@ -311,7 +321,7 @@ async function gatherTipPending(
if (onlyDue && tip.retryInfo.nextRetry.t_ms > now.t_ms) {
return;
}
- if (tip.accepted) {
+ if (tip.acceptedTimestamp) {
resp.pendingOperations.push({
type: PendingOperationType.TipPickup,
givesLifeness: true,