add timestamp for /reserve/status deposit events

This commit is contained in:
Christian Grothoff 2018-01-15 15:19:31 +01:00
parent 2526143a4f
commit b31d803c16
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
3 changed files with 14 additions and 2 deletions

View File

@ -142,11 +142,14 @@ parse_reserve_history (struct TALER_EXCHANGE_Handle *exchange,
json_t *wire_account;
void *wire_reference;
size_t wire_reference_size;
struct GNUNET_TIME_Absolute timestamp;
struct GNUNET_JSON_Specification withdraw_spec[] = {
GNUNET_JSON_spec_varsize ("wire_reference",
&wire_reference,
&wire_reference_size),
GNUNET_JSON_spec_absolute_time ("timestamp",
&timestamp),
GNUNET_JSON_spec_json ("sender_account_details",
&wire_account),
GNUNET_JSON_spec_end()
@ -173,6 +176,7 @@ parse_reserve_history (struct TALER_EXCHANGE_Handle *exchange,
rhistory[off].details.in_details.sender_account_details = wire_account;
rhistory[off].details.in_details.wire_reference = wire_reference;
rhistory[off].details.in_details.wire_reference_size = wire_reference_size;
rhistory[off].details.in_details.timestamp = timestamp;
/* end type==DEPOSIT */
}
else if (0 == strcasecmp (type,

View File

@ -711,7 +711,9 @@ TEH_RESPONSE_compile_reserve_history (const struct TALER_EXCHANGEDB_ReserveHisto
json_history = json_array ();
ret = 0;
for (const struct TALER_EXCHANGEDB_ReserveHistory *pos = rh; NULL != pos; pos = pos->next)
for (const struct TALER_EXCHANGEDB_ReserveHistory *pos = rh;
NULL != pos;
pos = pos->next)
{
switch (pos->type)
{
@ -731,8 +733,9 @@ TEH_RESPONSE_compile_reserve_history (const struct TALER_EXCHANGEDB_ReserveHisto
ret |= 1;
GNUNET_assert (0 ==
json_array_append_new (json_history,
json_pack ("{s:s, s:O, s:o, s:o}",
json_pack ("{s:s, s:o, s:O, s:o, s:o}",
"type", "DEPOSIT",
"timestamp", GNUNET_JSON_from_time_abs (pos->details.bank->execution_date),
"sender_account_details", pos->details.bank->sender_account_details,
"wire_reference", GNUNET_JSON_from_data (pos->details.bank->wire_reference,
pos->details.bank->wire_reference_size),

View File

@ -845,6 +845,11 @@ struct TALER_EXCHANGE_ReserveHistory
*/
void *wire_reference;
/**
* When did the wire transfer happen?
*/
struct GNUNET_TIME_Absolute timestamp;
/**
* Number of bytes stored in @e wire_reference.
*/