diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-05-15 15:53:21 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-05-16 11:05:00 +0200 |
commit | 7c28823cafa0692849deae506e81efdbc07f2ed3 (patch) | |
tree | ae955b26766f21370e1da7d7c367c25bc9dec422 /src/bank-lib | |
parent | be3b891dbd9b1532b9dca91629d478cc3933dfdc (diff) |
handle base32-wire transfer subject being followed by space+exchange base url in wire plugin and fakebank
Diffstat (limited to 'src/bank-lib')
-rw-r--r-- | src/bank-lib/fakebank.c | 13 | ||||
-rw-r--r-- | src/bank-lib/test_bank_api.c | 4 | ||||
-rw-r--r-- | src/bank-lib/test_bank_api_with_fakebank.c | 6 | ||||
-rw-r--r-- | src/bank-lib/test_bank_interpreter.c | 14 |
4 files changed, 27 insertions, 10 deletions
diff --git a/src/bank-lib/fakebank.c b/src/bank-lib/fakebank.c index fb5121687..8d16567fb 100644 --- a/src/bank-lib/fakebank.c +++ b/src/bank-lib/fakebank.c @@ -512,8 +512,17 @@ handle_history (struct TALER_FAKEBANK_Handle *h, continue; } - subject = GNUNET_STRINGS_data_to_string_alloc (&pos->wtid, - sizeof (pos->wtid)); + { + char *ws; + + ws = GNUNET_STRINGS_data_to_string_alloc (&pos->wtid, + sizeof (pos->wtid)); + GNUNET_asprintf (&subject, + "%s %s", + ws, + pos->exchange_base_url); + GNUNET_free (ws); + } trans = json_pack ("{s:I, s:o, s:o, s:s, s:I, s:s}", "row_id", (json_int_t) pos->serial_id, "date", GNUNET_JSON_from_time_abs (pos->date), diff --git a/src/bank-lib/test_bank_api.c b/src/bank-lib/test_bank_api.c index 800dc56a0..9904f3718 100644 --- a/src/bank-lib/test_bank_api.c +++ b/src/bank-lib/test_bank_api.c @@ -53,7 +53,7 @@ run (void *cls) .details.admin_add_incoming.expected_response_code = MHD_HTTP_OK, .details.admin_add_incoming.credit_account_no = 1, .details.admin_add_incoming.debit_account_no = 2, /* Ignored */ - .details.admin_add_incoming.amount = "PUDOS:5.01" }, + .details.admin_add_incoming.amount = "KUDOS:5.01" }, /* Move money from Exchange to Bank */ { .oc = TBI_OC_ADMIN_ADD_INCOMING, .label = "deposit-2", @@ -61,7 +61,7 @@ run (void *cls) .details.admin_add_incoming.expected_response_code = MHD_HTTP_OK, .details.admin_add_incoming.credit_account_no = 1, .details.admin_add_incoming.debit_account_no = 2, /* Ignored */ - .details.admin_add_incoming.amount = "PUDOS:5.01" }, + .details.admin_add_incoming.amount = "KUDOS:5.01" }, #if 0 /* Ask Exchange's incoming history */ { .oc = TBI_OC_HISTORY, diff --git a/src/bank-lib/test_bank_api_with_fakebank.c b/src/bank-lib/test_bank_api_with_fakebank.c index 01ab30cd9..e16c3a915 100644 --- a/src/bank-lib/test_bank_api_with_fakebank.c +++ b/src/bank-lib/test_bank_api_with_fakebank.c @@ -52,7 +52,7 @@ run (void *cls) .details.admin_add_incoming.credit_account_no = 1, .details.admin_add_incoming.debit_account_no = 2, .details.admin_add_incoming.exchange_base_url = "https://exchange.net/", - .details.admin_add_incoming.amount = "PUDOS:5.01" }, + .details.admin_add_incoming.amount = "KUDOS:5.01" }, /* Add EUR:3.21 to account 3 */ { .oc = TBI_OC_HISTORY, .label = "history-1c", @@ -72,14 +72,14 @@ run (void *cls) .details.admin_add_incoming.credit_account_no = 3, .details.admin_add_incoming.debit_account_no = 2, .details.admin_add_incoming.exchange_base_url = "https://exchange.org/", - .details.admin_add_incoming.amount = "PUDOS:3.21" }, + .details.admin_add_incoming.amount = "KUDOS:3.21" }, { .oc = TBI_OC_ADMIN_ADD_INCOMING, .label = "credit-2", .details.admin_add_incoming.expected_response_code = MHD_HTTP_OK, .details.admin_add_incoming.credit_account_no = 2, .details.admin_add_incoming.debit_account_no = 3, .details.admin_add_incoming.exchange_base_url = "https://exchange.org/", - .details.admin_add_incoming.amount = "PUDOS:3.22" }, + .details.admin_add_incoming.amount = "KUDOS:3.22" }, { .oc = TBI_OC_HISTORY, .label = "history-2b", .details.history.account_number = 2, diff --git a/src/bank-lib/test_bank_interpreter.c b/src/bank-lib/test_bank_interpreter.c index bfd744a0b..94b3b0e51 100644 --- a/src/bank-lib/test_bank_interpreter.c +++ b/src/bank-lib/test_bank_interpreter.c @@ -323,9 +323,17 @@ build_history (struct InterpreterState *is, /* h[total].execution_date; // unknown here */ h[total].serial_id = pos->details.admin_add_incoming.serial_id; - h[total].details.wire_transfer_subject - = GNUNET_STRINGS_data_to_string_alloc (&pos->details.admin_add_incoming.wtid, - sizeof (struct TALER_WireTransferIdentifierRawP)); + { + char *ws; + + ws = GNUNET_STRINGS_data_to_string_alloc (&pos->details.admin_add_incoming.wtid, + sizeof (struct TALER_WireTransferIdentifierRawP)); + GNUNET_asprintf (&h[total].details.wire_transfer_subject, + "%s %s", + ws, + pos->details.admin_add_incoming.exchange_base_url); + GNUNET_free (ws); + } total++; } } |