[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-exchange] 02/06: fix port numbers, no longer 8081 bu
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-exchange] 02/06: fix port numbers, no longer 8081 but on 8080; and box json array /history response in {data} as required by API |
Date: |
Tue, 16 May 2017 11:05:13 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
commit be3b891dbd9b1532b9dca91629d478cc3933dfdc
Author: Christian Grothoff <address@hidden>
AuthorDate: Mon May 15 10:55:47 2017 +0200
fix port numbers, no longer 8081 but on 8080; and box json array /history
response in {data} as required by API
---
src/bank-lib/fakebank.c | 13 +++++++++++--
src/bank-lib/test_bank_interpreter.c | 6 +++---
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/src/bank-lib/fakebank.c b/src/bank-lib/fakebank.c
index 0359b4a..fb51216 100644
--- a/src/bank-lib/fakebank.c
+++ b/src/bank-lib/fakebank.c
@@ -411,6 +411,7 @@ handle_history (struct TALER_FAKEBANK_Handle *h,
enum TALER_BANK_Direction direction;
struct Transaction *pos;
json_t *history;
+ json_t *jresponse;
int ret;
auth = MHD_lookup_connection_value (connection,
@@ -536,7 +537,6 @@ handle_history (struct TALER_FAKEBANK_Handle *h,
count++;
}
}
-
if (0 == json_array_size (history))
{
struct MHD_Response *resp;
@@ -552,14 +552,23 @@ handle_history (struct TALER_FAKEBANK_Handle *h,
return ret;
}
+ jresponse = json_pack ("{s:o}",
+ "data", history);
+ if (NULL == jresponse)
+ {
+ GNUNET_break (0);
+ return MHD_NO;
+ }
+
/* Finally build response object */
{
struct MHD_Response *resp;
void *json_str;
size_t json_len;
- json_str = json_dumps (history,
+ json_str = json_dumps (jresponse,
JSON_INDENT(2));
+ json_decref (jresponse);
if (NULL == json_str)
{
GNUNET_break (0);
diff --git a/src/bank-lib/test_bank_interpreter.c
b/src/bank-lib/test_bank_interpreter.c
index c53d53a..bfd744a 100644
--- a/src/bank-lib/test_bank_interpreter.c
+++ b/src/bank-lib/test_bank_interpreter.c
@@ -290,7 +290,7 @@ build_history (struct InterpreterState *is,
"type",
"test",
"bank_uri",
- "http://localhost:8081",
+ "http://localhost:8080",
"account_number",
(json_int_t)
pos->details.admin_add_incoming.debit_account_no);
GNUNET_assert (NULL != h[total].details.account_details);
@@ -305,7 +305,7 @@ build_history (struct InterpreterState *is,
"type",
"test",
"bank_uri",
- "http://localhost:8081",
+ "http://localhost:8080",
"account_number",
(json_int_t)
pos->details.admin_add_incoming.credit_account_no);
GNUNET_assert (NULL != h[total].details.account_details);
@@ -853,7 +853,7 @@ TBI_run_interpreter (int *resultp,
is = GNUNET_new (struct InterpreterState);
if (GNUNET_YES == run_bank)
- is->fakebank = TALER_FAKEBANK_start (8081);
+ is->fakebank = TALER_FAKEBANK_start (8080);
is->resultp = resultp;
is->commands = commands;
is->ctx = GNUNET_CURL_init (&GNUNET_CURL_gnunet_scheduler_reschedule,
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [taler-exchange] branch master updated (cddce0f -> 82cec70), gnunet, 2017/05/16
- [GNUnet-SVN] [taler-exchange] 03/06: handle base32-wire transfer subject being followed by space+exchange base url in wire plugin and fakebank, gnunet, 2017/05/16
- [GNUnet-SVN] [taler-exchange] 02/06: fix port numbers, no longer 8081 but on 8080; and box json array /history response in {data} as required by API,
gnunet <=
- [GNUnet-SVN] [taler-exchange] 01/06: take the history array from "data" field returned by the bank, gnunet, 2017/05/16
- [GNUnet-SVN] [taler-exchange] 06/06: nicer error reporting, gnunet, 2017/05/16
- [GNUnet-SVN] [taler-exchange] 05/06: use and purge alternate db when testing against python bank, gnunet, 2017/05/16
- [GNUnet-SVN] [taler-exchange] 04/06: start_row is actually start in the spec, fix naming, gnunet, 2017/05/16