gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] branch master updated: be verbose for refreshes too


From: gnunet
Subject: [taler-wallet-core] branch master updated: be verbose for refreshes too
Date: Mon, 20 Jan 2020 12:01:00 +0100

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 b837fd7f be verbose for refreshes too
b837fd7f is described below

commit b837fd7f53d885601a8c5f668da233b240387638
Author: Florian Dold <address@hidden>
AuthorDate: Mon Jan 20 12:00:57 2020 +0100

    be verbose for refreshes too
---
 src/operations/history.ts | 27 +++++++++++++++++++++++++++
 src/types/history.ts      | 20 ++++++++++++++------
 2 files changed, 41 insertions(+), 6 deletions(-)

diff --git a/src/operations/history.ts b/src/operations/history.ts
index 54874f64..97e3269e 100644
--- a/src/operations/history.ts
+++ b/src/operations/history.ts
@@ -37,6 +37,7 @@ import {
   ReserveCreationDetail,
   VerbosePayCoinDetails,
   VerboseWithdrawDetails,
+  VerboseRefreshDetails,
 } from "../types/history";
 import { assertUnreachable } from "../util/assertUnreachable";
 import { TransactionHandle, Store } from "../util/query";
@@ -329,6 +330,31 @@ export async function getHistory(
         } else {
           amountRefreshedEffective = Amounts.sum(amountsEffective).amount;
         }
+        const outputCoins: {
+          value: string;
+          denomPub: string,
+        }[] = [];
+        for (const rs of rg.refreshSessionPerCoin) {
+          if (!rs) {
+            continue;
+          }
+          for (const nd of rs.newDenoms) {
+            if (!nd) {
+              continue;
+            }
+            const d = await tx.get(Stores.denominations, [rs.exchangeBaseUrl, 
nd]);
+            if (!d) {
+              continue;
+            }
+            outputCoins.push({
+              denomPub: d.denomPub,
+              value: Amounts.toString(d.value),
+            });
+          }
+        }
+        const verboseDetails: VerboseRefreshDetails = {
+          outputCoins: outputCoins,
+        }
         history.push({
           type: HistoryEventType.Refreshed,
           refreshGroupId: rg.refreshGroupId,
@@ -340,6 +366,7 @@ export async function getHistory(
           numInputCoins,
           numOutputCoins,
           numRefreshedInputCoins,
+          verboseDetails,
         });
       });
 
diff --git a/src/types/history.ts b/src/types/history.ts
index 7acf84dc..ad7d98df 100644
--- a/src/types/history.ts
+++ b/src/types/history.ts
@@ -466,12 +466,11 @@ export interface HistoryPaymentAbortedEvent {
 }
 
 export interface VerbosePayCoinDetails {
-  coins:
-    {
-      value: string,
-      contribution: string;
-      denomPub: string;
-    }[],
+  coins: {
+    value: string;
+    contribution: string;
+    denomPub: string;
+  }[];
 }
 
 /**
@@ -549,6 +548,13 @@ export interface HistoryRefunded {
   amountRefundedEffective: string;
 }
 
+export interface VerboseRefreshDetails {
+  outputCoins: {
+    denomPub: string;
+    value: string;
+  }[];
+}
+
 /**
  * Event to indicate that a group of refresh sessions has completed.
  */
@@ -583,6 +589,8 @@ export interface HistoryRefreshedEvent {
    * more refresh session IDs.
    */
   refreshGroupId: string;
+
+  verboseDetails: VerboseRefreshDetails;
 }
 
 export interface VerboseWithdrawDetails {

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



reply via email to

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