fix port numbers, no longer 8081 but on 8080; and box json array /history response in {data} as required by API
This commit is contained in:
parent
d3fac18562
commit
be3b891dbd
@ -411,6 +411,7 @@ handle_history (struct TALER_FAKEBANK_Handle *h,
|
|||||||
enum TALER_BANK_Direction direction;
|
enum TALER_BANK_Direction direction;
|
||||||
struct Transaction *pos;
|
struct Transaction *pos;
|
||||||
json_t *history;
|
json_t *history;
|
||||||
|
json_t *jresponse;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
auth = MHD_lookup_connection_value (connection,
|
auth = MHD_lookup_connection_value (connection,
|
||||||
@ -536,7 +537,6 @@ handle_history (struct TALER_FAKEBANK_Handle *h,
|
|||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 == json_array_size (history))
|
if (0 == json_array_size (history))
|
||||||
{
|
{
|
||||||
struct MHD_Response *resp;
|
struct MHD_Response *resp;
|
||||||
@ -552,14 +552,23 @@ handle_history (struct TALER_FAKEBANK_Handle *h,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
jresponse = json_pack ("{s:o}",
|
||||||
|
"data", history);
|
||||||
|
if (NULL == jresponse)
|
||||||
|
{
|
||||||
|
GNUNET_break (0);
|
||||||
|
return MHD_NO;
|
||||||
|
}
|
||||||
|
|
||||||
/* Finally build response object */
|
/* Finally build response object */
|
||||||
{
|
{
|
||||||
struct MHD_Response *resp;
|
struct MHD_Response *resp;
|
||||||
void *json_str;
|
void *json_str;
|
||||||
size_t json_len;
|
size_t json_len;
|
||||||
|
|
||||||
json_str = json_dumps (history,
|
json_str = json_dumps (jresponse,
|
||||||
JSON_INDENT(2));
|
JSON_INDENT(2));
|
||||||
|
json_decref (jresponse);
|
||||||
if (NULL == json_str)
|
if (NULL == json_str)
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
|
@ -290,7 +290,7 @@ build_history (struct InterpreterState *is,
|
|||||||
"type",
|
"type",
|
||||||
"test",
|
"test",
|
||||||
"bank_uri",
|
"bank_uri",
|
||||||
"http://localhost:8081",
|
"http://localhost:8080",
|
||||||
"account_number",
|
"account_number",
|
||||||
(json_int_t) pos->details.admin_add_incoming.debit_account_no);
|
(json_int_t) pos->details.admin_add_incoming.debit_account_no);
|
||||||
GNUNET_assert (NULL != h[total].details.account_details);
|
GNUNET_assert (NULL != h[total].details.account_details);
|
||||||
@ -305,7 +305,7 @@ build_history (struct InterpreterState *is,
|
|||||||
"type",
|
"type",
|
||||||
"test",
|
"test",
|
||||||
"bank_uri",
|
"bank_uri",
|
||||||
"http://localhost:8081",
|
"http://localhost:8080",
|
||||||
"account_number",
|
"account_number",
|
||||||
(json_int_t) pos->details.admin_add_incoming.credit_account_no);
|
(json_int_t) pos->details.admin_add_incoming.credit_account_no);
|
||||||
GNUNET_assert (NULL != h[total].details.account_details);
|
GNUNET_assert (NULL != h[total].details.account_details);
|
||||||
@ -853,7 +853,7 @@ TBI_run_interpreter (int *resultp,
|
|||||||
|
|
||||||
is = GNUNET_new (struct InterpreterState);
|
is = GNUNET_new (struct InterpreterState);
|
||||||
if (GNUNET_YES == run_bank)
|
if (GNUNET_YES == run_bank)
|
||||||
is->fakebank = TALER_FAKEBANK_start (8081);
|
is->fakebank = TALER_FAKEBANK_start (8080);
|
||||||
is->resultp = resultp;
|
is->resultp = resultp;
|
||||||
is->commands = commands;
|
is->commands = commands;
|
||||||
is->ctx = GNUNET_CURL_init (&GNUNET_CURL_gnunet_scheduler_reschedule,
|
is->ctx = GNUNET_CURL_init (&GNUNET_CURL_gnunet_scheduler_reschedule,
|
||||||
|
Loading…
Reference in New Issue
Block a user