From 201b2b3d1af2a4d44fe32c8b0312d935845cf129 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 2 Mar 2016 01:21:32 +0100 Subject: [PATCH 1/2] make bootstrap executable again --- bootstrap | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 bootstrap diff --git a/bootstrap b/bootstrap old mode 100644 new mode 100755 From 531272a92a5aa08559436138ff5106a6bff1b361 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 2 Mar 2016 21:02:46 +0100 Subject: [PATCH 2/2] towards fixing #4230 --- src/bank-lib/bank_api_admin.c | 13 ++++++++----- src/bank-lib/test_bank_api.c | 15 +++++++++++---- src/include/taler_bank_service.h | 6 ++++-- src/wire/plugin_wire_test.c | 20 ++++++-------------- 4 files changed, 29 insertions(+), 25 deletions(-) diff --git a/src/bank-lib/bank_api_admin.c b/src/bank-lib/bank_api_admin.c index bfcf16a23..5deb4aa72 100644 --- a/src/bank-lib/bank_api_admin.c +++ b/src/bank-lib/bank_api_admin.c @@ -150,7 +150,8 @@ handle_admin_add_incoming_finished (void *cls, * @param reserve_pub public key of the reserve * @param amount amount that was deposited * @param execution_date when did we receive the amount - * @param account_no account number (53 bits at most) + * @param debit_account_no account number to withdraw from (53 bits at most) + * @param credit_account_no account number to deposit into (53 bits at most) * @param res_cb the callback to call when the final result for this request is available * @param res_cb_cls closure for the above callback * @return NULL @@ -161,7 +162,8 @@ struct TALER_BANK_AdminAddIncomingHandle * TALER_BANK_admin_add_incoming (struct TALER_BANK_Context *bank, const struct TALER_WireTransferIdentifierRawP *wtid, const struct TALER_Amount *amount, - uint64_t account_no, + uint64_t debit_account_no, + uint64_t credit_account_no, TALER_BANK_AdminAddIncomingResultCallback res_cb, void *res_cb_cls) { @@ -169,12 +171,13 @@ TALER_BANK_admin_add_incoming (struct TALER_BANK_Context *bank, json_t *admin_obj; CURL *eh; - admin_obj = json_pack ("{s:o, s:o," /* reserve_pub/amount */ - " s:I}", /* execution_Date/wire */ + admin_obj = json_pack ("{s:o, s:o," + " s:I, s:I}", "wtid", TALER_json_from_data (wtid, sizeof (*wtid)), "amount", TALER_json_from_amount (amount), - "account", (json_int_t) account_no); + "debit_account", (json_int_t) debit_account_no, + "credit_account", (json_int_t) credit_account_no); aai = GNUNET_new (struct TALER_BANK_AdminAddIncomingHandle); aai->bank = bank; aai->cb = res_cb; diff --git a/src/bank-lib/test_bank_api.c b/src/bank-lib/test_bank_api.c index b14f523ba..5e38ae2ec 100644 --- a/src/bank-lib/test_bank_api.c +++ b/src/bank-lib/test_bank_api.c @@ -103,9 +103,14 @@ struct Command const char *amount; /** - * Account number. + * Credited account number. */ - uint64_t account_no; + uint64_t credit_account_no; + + /** + * Debited account number. + */ + uint64_t debit_account_no; /** * Wire transfer identifier to use. Initialized to @@ -310,7 +315,8 @@ interpreter_run (void *cls, = TALER_BANK_admin_add_incoming (ctx, &cmd->details.admin_add_incoming.wtid, &amount, - cmd->details.admin_add_incoming.account_no, + cmd->details.admin_add_incoming.debit_account_no, + cmd->details.admin_add_incoming.credit_account_no, &add_incoming_cb, is); if (NULL == cmd->details.admin_add_incoming.aih) @@ -470,7 +476,8 @@ run (void *cls, { .oc = OC_ADMIN_ADD_INCOMING, .label = "deposit-1", .expected_response_code = MHD_HTTP_OK, - .details.admin_add_incoming.account_no = 42, + .details.admin_add_incoming.credit_account_no = 1, + .details.admin_add_incoming.debit_account_no = 2, .details.admin_add_incoming.amount = "EUR:5.01" }, { .oc = OC_END } diff --git a/src/include/taler_bank_service.h b/src/include/taler_bank_service.h index a4f33fc97..508ca714b 100644 --- a/src/include/taler_bank_service.h +++ b/src/include/taler_bank_service.h @@ -133,7 +133,8 @@ typedef void * @param reserve_pub public key of the reserve * @param amount amount that was deposited * @param execution_date when did we receive the amount - * @param account_no account number (53 bits at most) + * @param debit_account_no account number to withdraw from (53 bits at most) + * @param credit_account_no account number to deposit into (53 bits at most) * @param res_cb the callback to call when the final result for this request is available * @param res_cb_cls closure for the above callback * @return NULL @@ -144,7 +145,8 @@ struct TALER_BANK_AdminAddIncomingHandle * TALER_BANK_admin_add_incoming (struct TALER_BANK_Context *bank, const struct TALER_WireTransferIdentifierRawP *wtid, const struct TALER_Amount *amount, - uint64_t account_no, + uint64_t debit_account_no, + uint64_t credit_account_no, TALER_BANK_AdminAddIncomingResultCallback res_cb, void *res_cb_cls); diff --git a/src/wire/plugin_wire_test.c b/src/wire/plugin_wire_test.c index 8a6f98ea2..d6bf411c1 100644 --- a/src/wire/plugin_wire_test.c +++ b/src/wire/plugin_wire_test.c @@ -43,6 +43,11 @@ struct TestClosure */ char *currency; + /** + * Number of the account that the exchange has at the bank. + */ + uint64_t exchange_account_no; + /** * Handle to the bank task, or NULL. */ @@ -482,7 +487,7 @@ test_execute_wire_transfer (void *cls, GNUNET_break (0); return NULL; } - + eh = GNUNET_new (struct TALER_WIRE_ExecuteHandle); eh->cc = cc; eh->cc_cls = cc_cls; @@ -551,19 +556,6 @@ libtaler_plugin_wire_test_init (void *cls) return NULL; } tc = GNUNET_new (struct TestClosure); - if (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_string (cfg, - "mint", - "CURRENCY", - &tc->currency)) - { - GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, - "mint", - "CURRENCY"); - GNUNET_free (uri); - GNUNET_free (tc); - return NULL; - } tc->bank = TALER_BANK_init (uri); if (NULL == tc->bank) {