summaryrefslogtreecommitdiff
path: root/src/bank-lib/bank_api_history.c
diff options
context:
space:
mode:
authorMarcello Stanisci <marcello.stanisci@inria.fr>2017-05-11 16:24:41 +0200
committerChristian Grothoff <christian@grothoff.org>2017-05-16 11:04:59 +0200
commitd3fac1856277e6a832c261f1820ed34a95301e1d (patch)
treef18367d47b38c2b28639f9e97edc237689913a92 /src/bank-lib/bank_api_history.c
parentcddce0fd6fd3b9870ea230c1cb659a866cac1205 (diff)
downloadexchange-d3fac1856277e6a832c261f1820ed34a95301e1d.tar.gz
exchange-d3fac1856277e6a832c261f1820ed34a95301e1d.tar.bz2
exchange-d3fac1856277e6a832c261f1820ed34a95301e1d.zip
take the history array from "data" field returned by the bank
Diffstat (limited to 'src/bank-lib/bank_api_history.c')
-rw-r--r--src/bank-lib/bank_api_history.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/bank-lib/bank_api_history.c b/src/bank-lib/bank_api_history.c
index ecb3561d2..87619e786 100644
--- a/src/bank-lib/bank_api_history.c
+++ b/src/bank-lib/bank_api_history.c
@@ -77,7 +77,14 @@ static int
parse_account_history (struct TALER_BANK_HistoryHandle *hh,
const json_t *history)
{
- for (unsigned int i=0;i<json_array_size (history);i++)
+ json_t *history_array;
+
+ if (NULL == (history_array = json_object_get (history, "data")))
+ {
+ GNUNET_break_op (0);
+ return GNUNET_SYSERR;
+ }
+ for (unsigned int i=0;i<json_array_size (history_array);i++)
{
struct TALER_BANK_TransferDetails td;
const char *sign;
@@ -99,7 +106,7 @@ parse_account_history (struct TALER_BANK_HistoryHandle *hh,
&other_account),
GNUNET_JSON_spec_end()
};
- json_t *transaction = json_array_get (history,
+ json_t *transaction = json_array_get (history_array,
i);
if (GNUNET_OK !=
@@ -110,6 +117,7 @@ parse_account_history (struct TALER_BANK_HistoryHandle *hh,
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
+
td.account_details = json_pack ("{s:s, s:s, s:I}",
"type", "test",
"bank_uri", hh->bank_base_url,