gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated: cosmetics and comments


From: gnunet
Subject: [taler-wallet-core] branch master updated: cosmetics and comments
Date: Thu, 02 Apr 2020 17:14:16 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new 95e638f5 cosmetics and comments
95e638f5 is described below

commit 95e638f513c6e8e5b4ab32981a1f8900b43700c7
Author: Florian Dold <address@hidden>
AuthorDate: Thu Apr 2 20:44:12 2020 +0530

    cosmetics and comments
---
 src/operations/history.ts      |  5 ++++-
 src/operations/reserves.ts     |  5 ++++-
 src/operations/tip.ts          |  1 -
 src/operations/withdraw.ts     | 34 +++++++++++++++++-----------------
 src/types/dbTypes.ts           |  4 ++--
 src/util/amounts.ts            |  2 +-
 src/util/reserveHistoryUtil.ts |  8 +++++++-
 7 files changed, 35 insertions(+), 24 deletions(-)

diff --git a/src/operations/history.ts b/src/operations/history.ts
index 84873933..edb4d9f2 100644
--- a/src/operations/history.ts
+++ b/src/operations/history.ts
@@ -404,7 +404,10 @@ export async function getHistory(
             type: ReserveType.Manual,
           };
         }
-        const s = summarizeReserveHistory(reserve.reserveTransactions, 
reserve.currency);
+        const s = summarizeReserveHistory(
+          reserve.reserveTransactions,
+          reserve.currency,
+        );
         history.push({
           type: HistoryEventType.ReserveBalanceUpdated,
           eventId: makeEventId(
diff --git a/src/operations/reserves.ts b/src/operations/reserves.ts
index 2ef902ef..5c299d11 100644
--- a/src/operations/reserves.ts
+++ b/src/operations/reserves.ts
@@ -492,7 +492,10 @@ async function updateReserve(
         reserveInfo.history,
       );
 
-      console.log("reconciled history:", JSON.stringify(reconciled, undefined, 
2));
+      console.log(
+        "reconciled history:",
+        JSON.stringify(reconciled, undefined, 2),
+      );
 
       const summary = summarizeReserveHistory(
         reconciled.updatedLocalHistory,
diff --git a/src/operations/tip.ts b/src/operations/tip.ts
index d3c98d28..7bfbddb6 100644
--- a/src/operations/tip.ts
+++ b/src/operations/tip.ts
@@ -247,7 +247,6 @@ async function processTipImpl(
 
   const planchets: PlanchetRecord[] = [];
 
-
   for (let i = 0; i < tipRecord.planchets.length; i++) {
     const tipPlanchet = tipRecord.planchets[i];
     const coinEvHash = await ws.cryptoApi.hashEncoded(tipPlanchet.coinEv);
diff --git a/src/operations/withdraw.ts b/src/operations/withdraw.ts
index 48d70db2..fcd9d70c 100644
--- a/src/operations/withdraw.ts
+++ b/src/operations/withdraw.ts
@@ -52,7 +52,10 @@ import {
   timestampCmp,
   timestampSubtractDuraction,
 } from "../util/time";
-import { summarizeReserveHistory, ReserveHistorySummary } from 
"../util/reserveHistoryUtil";
+import {
+  summarizeReserveHistory,
+  ReserveHistorySummary,
+} from "../util/reserveHistoryUtil";
 
 const logger = new Logger("withdraw.ts");
 
@@ -372,22 +375,19 @@ async function incrementWithdrawalRetry(
   withdrawalGroupId: string,
   err: OperationError | undefined,
 ): Promise<void> {
-  await ws.db.runWithWriteTransaction(
-    [Stores.withdrawalGroups],
-    async (tx) => {
-      const wsr = await tx.get(Stores.withdrawalGroups, withdrawalGroupId);
-      if (!wsr) {
-        return;
-      }
-      if (!wsr.retryInfo) {
-        return;
-      }
-      wsr.retryInfo.retryCounter++;
-      updateRetryInfoTimeout(wsr.retryInfo);
-      wsr.lastError = err;
-      await tx.put(Stores.withdrawalGroups, wsr);
-    },
-  );
+  await ws.db.runWithWriteTransaction([Stores.withdrawalGroups], async (tx) => 
{
+    const wsr = await tx.get(Stores.withdrawalGroups, withdrawalGroupId);
+    if (!wsr) {
+      return;
+    }
+    if (!wsr.retryInfo) {
+      return;
+    }
+    wsr.retryInfo.retryCounter++;
+    updateRetryInfoTimeout(wsr.retryInfo);
+    wsr.lastError = err;
+    await tx.put(Stores.withdrawalGroups, wsr);
+  });
   ws.notify({ type: NotificationType.WithdrawOperationError });
 }
 
diff --git a/src/types/dbTypes.ts b/src/types/dbTypes.ts
index b87ada11..f94fb6c6 100644
--- a/src/types/dbTypes.ts
+++ b/src/types/dbTypes.ts
@@ -165,9 +165,9 @@ export interface WalletReserveHistoryWithdrawItem {
 
   /**
    * Hash of the blinded coin.
-   * 
+   *
    * When this value is set, it indicates that a withdrawal is active
-   * in the wallet for the 
+   * in the wallet for the
    */
   expectedCoinEvHash?: string;
 
diff --git a/src/util/amounts.ts b/src/util/amounts.ts
index aee7b12b..f9946393 100644
--- a/src/util/amounts.ts
+++ b/src/util/amounts.ts
@@ -348,4 +348,4 @@ export const Amounts = {
   isZero: isZero,
   maxAmountValue: maxAmountValue,
   fromFloat: fromFloat,
-};
\ No newline at end of file
+};
diff --git a/src/util/reserveHistoryUtil.ts b/src/util/reserveHistoryUtil.ts
index 03322187..855b71a3 100644
--- a/src/util/reserveHistoryUtil.ts
+++ b/src/util/reserveHistoryUtil.ts
@@ -28,7 +28,6 @@ import {
 import * as Amounts from "../util/amounts";
 import { timestampCmp } from "./time";
 import { deepCopy } from "./helpers";
-import { AmountString } from "../types/talerTypes";
 import { AmountJson } from "../util/amounts";
 
 /**
@@ -143,6 +142,9 @@ export function isLocalRemoteHistoryMatch(
   return false;
 }
 
+/**
+ * Compute totals for the wallet's view of the reserve history.
+ */
 export function summarizeReserveHistory(
   localHistory: WalletReserveHistoryItem[],
   currency: string,
@@ -231,6 +233,10 @@ export function summarizeReserveHistory(
   };
 }
 
+/**
+ * Reconcile the wallet's local model of the reserve history
+ * with the reserve history of the exchange.
+ */
 export function reconcileReserveHistory(
   localHistory: WalletReserveHistoryItem[],
   remoteHistory: ReserveTransaction[],

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]