[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] 05/11: do return fees in history
From: |
gnunet |
Subject: |
[taler-exchange] 05/11: do return fees in history |
Date: |
Sat, 28 Mar 2020 21:57:25 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
commit ae9f751a7cddeeb27fda10921fa47c1fa0260bac
Author: Christian Grothoff <address@hidden>
AuthorDate: Sat Mar 28 20:46:57 2020 +0100
do return fees in history
---
src/include/taler_exchange_service.h | 24 ++++++++++++++++++++----
src/lib/exchange_api_common.c | 10 ++++++----
2 files changed, 26 insertions(+), 8 deletions(-)
diff --git a/src/include/taler_exchange_service.h
b/src/include/taler_exchange_service.h
index 928a808a..e935c919 100644
--- a/src/include/taler_exchange_service.h
+++ b/src/include/taler_exchange_service.h
@@ -946,7 +946,7 @@ enum TALER_EXCHANGE_ReserveTransactionType
/**
* Deposit into the reserve.
*/
- TALER_EXCHANGE_RTT_DEPOSIT,
+ TALER_EXCHANGE_RTT_CREDIT,
/**
* Withdrawal from the reserve.
@@ -990,7 +990,7 @@ struct TALER_EXCHANGE_ReserveHistory
/**
* Information about a deposit that filled this reserve.
- * @e type is #TALER_EXCHANGE_RTT_DEPOSIT.
+ * @e type is #TALER_EXCHANGE_RTT_CREDIT.
*/
struct
{
@@ -1017,10 +1017,21 @@ struct TALER_EXCHANGE_ReserveHistory
} in_details;
/**
- * Signature authorizing the withdrawal for outgoing transaction.
+ * Information about withdraw operation.
* @e type is #TALER_EXCHANGE_RTT_WITHDRAWAL.
*/
- json_t *out_authorization_sig;
+ struct
+ {
+ /**
+ * Signature authorizing the withdrawal for outgoing transaction.
+ */
+ json_t *out_authorization_sig;
+
+ /**
+ * Fee that was charged for the withdrawal.
+ */
+ struct TALER_Amount fee;
+ } withdraw;
/**
* Information provided if the reserve was filled via /recoup.
@@ -1084,6 +1095,11 @@ struct TALER_EXCHANGE_ReserveHistory
*/
struct GNUNET_TIME_Absolute timestamp;
+ /**
+ * Fee that was charged for the closing.
+ */
+ struct TALER_Amount fee;
+
} close_details;
} details;
diff --git a/src/lib/exchange_api_common.c b/src/lib/exchange_api_common.c
index 70d1432f..2748b8fc 100644
--- a/src/lib/exchange_api_common.c
+++ b/src/lib/exchange_api_common.c
@@ -109,7 +109,7 @@ TALER_EXCHANGE_parse_reserve_history (
GNUNET_JSON_spec_end ()
};
- rhistory[off].type = TALER_EXCHANGE_RTT_DEPOSIT;
+ rhistory[off].type = TALER_EXCHANGE_RTT_CREDIT;
if (GNUNET_OK !=
TALER_amount_add (&total_in,
&total_in,
@@ -201,8 +201,9 @@ TALER_EXCHANGE_parse_reserve_history (
GNUNET_JSON_parse_free (withdraw_spec);
return GNUNET_SYSERR;
}
+ rhistory[off].details.withdraw.fee = fee;
}
- rhistory[off].details.out_authorization_sig
+ rhistory[off].details.withdraw.out_authorization_sig
= json_object_get (transaction,
"signature");
/* Check check that the same withdraw transaction
@@ -355,7 +356,8 @@ TALER_EXCHANGE_parse_reserve_history (
rcc.reserve_pub = *reserve_pub;
timestamp = GNUNET_TIME_absolute_ntoh (rcc.timestamp);
rhistory[off].details.close_details.timestamp = timestamp;
-
+ TALER_amount_ntoh (&rhistory[off].details.close_details.fee,
+ &rcc.closing_fee);
key_state = TALER_EXCHANGE_get_keys (exchange);
if (GNUNET_OK !=
TALER_EXCHANGE_test_signing_key (key_state,
@@ -424,7 +426,7 @@ TALER_EXCHANGE_free_reserve_history (
{
switch (rhistory[i].type)
{
- case TALER_EXCHANGE_RTT_DEPOSIT:
+ case TALER_EXCHANGE_RTT_CREDIT:
GNUNET_free_non_null (rhistory[i].details.in_details.wire_reference);
GNUNET_free_non_null (rhistory[i].details.in_details.sender_url);
break;
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [taler-exchange] branch master updated (baaa8832 -> da1df35d), gnunet, 2020/03/28
- [taler-exchange] 04/11: do return correct timestamp also in fakebank implementation, gnunet, 2020/03/28
- [taler-exchange] 07/11: ignore generated config file, gnunet, 2020/03/28
- [taler-exchange] 10/11: lookup in reverse order also inside of batch, gnunet, 2020/03/28
- [taler-exchange] 08/11: permit subtraction to result in zero, gnunet, 2020/03/28
- [taler-exchange] 09/11: do not re-use command label, gnunet, 2020/03/28
- [taler-exchange] 05/11: do return fees in history,
gnunet <=
- [taler-exchange] 02/11: split recoup and revoke commands into two files for better readability, gnunet, 2020/03/28
- [taler-exchange] 01/11: skip tests if ports are unavailable, gnunet, 2020/03/28
- [taler-exchange] 03/11: implement #6049, gnunet, 2020/03/28
- [taler-exchange] 11/11: reserve history amount includes fee, add it, gnunet, 2020/03/28
- [taler-exchange] 06/11: ignore report directories, gnunet, 2020/03/28