aboutsummaryrefslogtreecommitdiff
path: root/src/bank-lib/bank_api_admin.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-05-07 21:11:56 +0200
committerChristian Grothoff <christian@grothoff.org>2017-05-07 21:11:56 +0200
commit18a020dd0241fbb7deead15b96d5f5fed9f1b9b5 (patch)
treef3a1173c4df79750330148f466e53134e08b9d79 /src/bank-lib/bank_api_admin.c
parent56786aea5a4dbdc80f257539e801176fc0697a3b (diff)
implement fakebank support (incl. tests) for #5005/#4964/4959
Diffstat (limited to 'src/bank-lib/bank_api_admin.c')
-rw-r--r--src/bank-lib/bank_api_admin.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/bank-lib/bank_api_admin.c b/src/bank-lib/bank_api_admin.c
index 9aa37c478..af23c5791 100644
--- a/src/bank-lib/bank_api_admin.c
+++ b/src/bank-lib/bank_api_admin.c
@@ -78,6 +78,7 @@ handle_admin_add_incoming_finished (void *cls,
const json_t *json)
{
struct TALER_BANK_AdminAddIncomingHandle *aai = cls;
+ uint64_t serial_id = UINT64_MAX;
aai->job = NULL;
switch (response_code)
@@ -85,6 +86,23 @@ handle_admin_add_incoming_finished (void *cls,
case 0:
break;
case MHD_HTTP_OK:
+ {
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_uint64 ("serial_id",
+ &serial_id),
+ GNUNET_JSON_spec_end()
+ };
+
+ if (GNUNET_OK !=
+ GNUNET_JSON_parse (json,
+ spec,
+ NULL, NULL))
+ {
+ GNUNET_break_op (0);
+ response_code = 0;
+ break;
+ }
+ }
break;
case MHD_HTTP_BAD_REQUEST:
/* This should never happen, either us or the bank is buggy
@@ -117,6 +135,7 @@ handle_admin_add_incoming_finished (void *cls,
}
aai->cb (aai->cb_cls,
response_code,
+ serial_id,
json);
TALER_BANK_admin_add_incoming_cancel (aai);
}