diff options
Diffstat (limited to 'src/bank-lib/test_bank_interpreter.c')
-rw-r--r-- | src/bank-lib/test_bank_interpreter.c | 40 |
1 files changed, 12 insertions, 28 deletions
diff --git a/src/bank-lib/test_bank_interpreter.c b/src/bank-lib/test_bank_interpreter.c index 40adea54f..e503bd8dc 100644 --- a/src/bank-lib/test_bank_interpreter.c +++ b/src/bank-lib/test_bank_interpreter.c @@ -326,15 +326,10 @@ build_history (struct InterpreterState *is, h[total].direction = TALER_BANK_DIRECTION_CREDIT; if (GNUNET_YES == cancelled) h[total].direction |= TALER_BANK_DIRECTION_CANCEL; - h[total].details.account_details - = json_pack ("{s:s, s:s, s:I}", - "type", - "test", - "bank_url", - "http://localhost:8080", - "account_number", - (json_int_t) pos->details.admin_add_incoming.debit_account_no); - GNUNET_assert (NULL != h[total].details.account_details); + GNUNET_asprintf (&h[total].details.account_url, + "payto://x-taler-bank/%s/%llu", + "http://localhost:8080", + (unsigned long long) pos->details.admin_add_incoming.debit_account_no); } if ( (0 != (cmd->details.history.direction & TALER_BANK_DIRECTION_DEBIT)) && (cmd->details.history.account_number == @@ -343,15 +338,10 @@ build_history (struct InterpreterState *is, h[total].direction = TALER_BANK_DIRECTION_DEBIT; if (GNUNET_YES == cancelled) h[total].direction |= TALER_BANK_DIRECTION_CANCEL; - h[total].details.account_details - = json_pack ("{s:s, s:s, s:I}", - "type", - "test", - "bank_url", - "http://localhost:8080", - "account_number", - (json_int_t) pos->details.admin_add_incoming.credit_account_no); - GNUNET_assert (NULL != h[total].details.account_details); + GNUNET_asprintf (&h[total].details.account_url, + "payto://x-taler-bank/%s/%llu", + "http://localhost:8080", + (unsigned long long) pos->details.admin_add_incoming.credit_account_no); } if ( ( (0 != (cmd->details.history.direction & TALER_BANK_DIRECTION_CREDIT)) && (cmd->details.history.account_number == @@ -398,10 +388,6 @@ print_expected (struct History *h, "Expected history:\n"); for (uint64_t i=0;i<h_len;i++) { - char *acc; - - acc = json_dumps (h[i].details.account_details, - JSON_COMPACT); GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "H(%llu): %s%s (serial: %llu, subject: %s, to: %s)\n", (unsigned long long) i, @@ -409,9 +395,7 @@ print_expected (struct History *h, TALER_amount2s (&h[i].details.amount), (unsigned long long) h[i].row_id, h[i].details.wire_transfer_subject, - acc); - if (NULL != acc) - free (acc); + h[i].details.account_url); } } @@ -429,7 +413,7 @@ free_history (struct History *h, for (uint64_t off = 0;off<h_len;off++) { GNUNET_free (h[off].details.wire_transfer_subject); - json_decref (h[off].details.account_details); + GNUNET_free (h[off].details.account_url); } GNUNET_free_non_null (h); } @@ -500,8 +484,8 @@ check_result (struct InterpreterState *is, details->wire_transfer_subject)) || (0 != TALER_amount_cmp (&h[off].details.amount, &details->amount)) || - (1 != json_equal (h[off].details.account_details, - details->account_details)) ) + (0 != strcasecmp (h[off].details.account_url, + details->account_url)) ) { GNUNET_break (0); print_expected (h, total, off); |