[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] branch master updated: adapt tests to do kycauth wire t
From: |
gnunet |
Subject: |
[taler-exchange] branch master updated: adapt tests to do kycauth wire transfers that are now needed |
Date: |
Tue, 01 Oct 2024 20:26:01 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
The following commit(s) were added to refs/heads/master by this push:
new 90d8cb0aa adapt tests to do kycauth wire transfers that are now needed
90d8cb0aa is described below
commit 90d8cb0aa5aacf40cedc0fb17e0db3159c496c97
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Tue Oct 1 20:25:58 2024 +0200
adapt tests to do kycauth wire transfers that are now needed
---
src/exchange/taler-exchange-httpd_batch-deposit.c | 7 +-
src/include/taler_exchange_service.h | 32 +-
src/include/taler_testing_lib.h | 37 +-
src/lib/exchange_api_batch_deposit.c | 86 +-
src/testing/test_exchange_api.c | 1407 +++++++++++----------
src/testing/test_exchange_api_age_restriction.c | 33 +-
src/testing/testing_api_cmd_batch.c | 21 +-
src/testing/testing_api_cmd_batch_deposit.c | 74 +-
src/testing/testing_api_cmd_deposit.c | 68 +-
src/testing/testing_api_cmd_refresh.c | 6 +-
src/testing/testing_api_loop.c | 43 +-
11 files changed, 1079 insertions(+), 735 deletions(-)
diff --git a/src/exchange/taler-exchange-httpd_batch-deposit.c
b/src/exchange/taler-exchange-httpd_batch-deposit.c
index 5901843ec..fdb705e14 100644
--- a/src/exchange/taler-exchange-httpd_batch-deposit.c
+++ b/src/exchange/taler-exchange-httpd_batch-deposit.c
@@ -339,7 +339,7 @@ batch_deposit_transaction (void *cls,
&balance_ok,
&bad_balance_coin_index,
&in_conflict);
- if (qs < 0)
+ if (qs <= 0)
{
if (GNUNET_DB_STATUS_SOFT_ERROR == qs)
return qs;
@@ -352,7 +352,7 @@ batch_deposit_transaction (void *cls,
"batch-deposit");
return qs;
}
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"do_deposit returned: %d / %s[%u] / %s\n",
qs,
balance_ok ? "balance ok" : "balance insufficient",
@@ -945,6 +945,9 @@ bdc_phase_parse (struct BatchDepositContext *bdc,
}
bdc->policy_json
= json_incref ((json_t *) policy_json);
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Batch deposit into contract %s\n",
+ GNUNET_h2s (&bd->h_contract_terms.hash));
/* validate merchant's wire details (as far as we can) */
{
diff --git a/src/include/taler_exchange_service.h
b/src/include/taler_exchange_service.h
index 4e925bfe5..2aaa02d0a 100644
--- a/src/include/taler_exchange_service.h
+++ b/src/include/taler_exchange_service.h
@@ -1347,9 +1347,35 @@ struct TALER_EXCHANGE_BatchDepositResult
struct
{
/**
- * The coin that had a conflict.
- */
- struct TALER_CoinSpendPublicKeyP coin_pub;
+ * Details depending on the @e hr.ec.
+ */
+ union
+ {
+ struct
+ {
+ /**
+ * The coin that had a conflict.
+ */
+ struct TALER_CoinSpendPublicKeyP coin_pub;
+ } insufficient_funds;
+
+ struct
+ {
+ /**
+ * The coin that had a conflict.
+ */
+ struct TALER_CoinSpendPublicKeyP coin_pub;
+ } coin_conflicting_age_hash;
+
+ struct
+ {
+ /**
+ * The coin that had a conflict.
+ */
+ struct TALER_CoinSpendPublicKeyP coin_pub;
+ } coin_conflicting_denomination_key;
+
+ } details;
} conflict;
diff --git a/src/include/taler_testing_lib.h b/src/include/taler_testing_lib.h
index 98a74f39f..6b7ae667d 100644
--- a/src/include/taler_testing_lib.h
+++ b/src/include/taler_testing_lib.h
@@ -315,10 +315,10 @@ struct TALER_TESTING_Command
* @return #GNUNET_OK on success
*/
enum GNUNET_GenericReturnValue
- (*traits)(void *cls,
- const void **ret,
- const char *trait,
- unsigned int index);
+ (*traits)(void *cls,
+ const void **ret,
+ const char *trait,
+ unsigned int index);
/**
* When did the execution of this command start?
@@ -354,8 +354,9 @@ struct TALER_TESTING_Command
* @return the command, if it is found, or NULL.
*/
const struct TALER_TESTING_Command *
-TALER_TESTING_interpreter_lookup_command (struct TALER_TESTING_Interpreter *is,
- const char *label);
+TALER_TESTING_interpreter_lookup_command (
+ struct TALER_TESTING_Interpreter *is,
+ const char *label);
/**
@@ -366,8 +367,9 @@ TALER_TESTING_interpreter_lookup_command (struct
TALER_TESTING_Interpreter *is,
* @return the command, if it is found, or NULL.
*/
const struct TALER_TESTING_Command *
-TALER_TESTING_interpreter_get_command (struct TALER_TESTING_Interpreter *is,
- const char *name);
+TALER_TESTING_interpreter_get_command (
+ struct TALER_TESTING_Interpreter *is,
+ const char *name);
/**
@@ -626,6 +628,19 @@ TALER_TESTING_cmd_set_var (const char *name,
struct TALER_TESTING_Command cmd);
+/**
+ * Update interpeter @a is variable state due to execution of @a cmd.
+ *
+ * @param[in,out] is interpreter to update
+ * @param[in,out] cmd command that we are exeucting and that
+ * needs to be checked for side-effects on the variable state
+ */
+void
+TALER_TESTING_update_variables_ (
+ struct TALER_TESTING_Interpreter *is,
+ struct TALER_TESTING_Command *cmd);
+
+
/**
* Launch GNU Taler setup.
*
@@ -2641,7 +2656,7 @@ TALER_TESTING_get_trait (const struct TALER_TESTING_Trait
*traits,
enum GNUNET_GenericReturnValue \
TALER_TESTING_get_trait_ ## name ( \
const struct TALER_TESTING_Command *cmd, \
- type **ret); \
+ type * *ret); \
struct TALER_TESTING_Trait \
TALER_TESTING_make_trait_ ## name ( \
type * value);
@@ -2684,11 +2699,11 @@ TALER_TESTING_get_trait (const struct
TALER_TESTING_Trait *traits,
TALER_TESTING_get_trait_ ## name ( \
const struct TALER_TESTING_Command *cmd, \
unsigned int index, \
- type **ret); \
+ type * *ret); \
struct TALER_TESTING_Trait \
TALER_TESTING_make_trait_ ## name ( \
unsigned int index, \
- type *value);
+ type * value);
/**
diff --git a/src/lib/exchange_api_batch_deposit.c
b/src/lib/exchange_api_batch_deposit.c
index dd0f09380..1c169495c 100644
--- a/src/lib/exchange_api_batch_deposit.c
+++ b/src/lib/exchange_api_batch_deposit.c
@@ -436,24 +436,82 @@ handle_deposit_finished (void *cls,
break;
case MHD_HTTP_CONFLICT:
{
- struct GNUNET_JSON_Specification spec[] = {
- GNUNET_JSON_spec_fixed_auto ("coin_pub",
- &dr->details.conflict.coin_pub),
- GNUNET_JSON_spec_end ()
- };
-
- if (GNUNET_OK !=
- GNUNET_JSON_parse (j,
- spec,
- NULL, NULL))
+ dr->hr.ec = TALER_JSON_get_error_code (j);
+ dr->hr.hint = TALER_JSON_get_error_hint (j);
+ switch (dr->hr.ec)
{
+ case TALER_EC_EXCHANGE_GENERIC_INSUFFICIENT_FUNDS:
+ {
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_fixed_auto (
+ "coin_pub",
+ &dr->details.conflict.details
+ .insufficient_funds.coin_pub),
+ GNUNET_JSON_spec_end ()
+ };
+
+ if (GNUNET_OK !=
+ GNUNET_JSON_parse (j,
+ spec,
+ NULL, NULL))
+ {
+ GNUNET_break_op (0);
+ dr->hr.http_status = 0;
+ dr->hr.ec = TALER_EC_GENERIC_REPLY_MALFORMED;
+ break;
+ }
+ }
+ break;
+ case TALER_EC_EXCHANGE_GENERIC_COIN_CONFLICTING_AGE_HASH:
+ {
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_fixed_auto (
+ "coin_pub",
+ &dr->details.conflict.details
+ .coin_conflicting_age_hash.coin_pub),
+ GNUNET_JSON_spec_end ()
+ };
+
+ if (GNUNET_OK !=
+ GNUNET_JSON_parse (j,
+ spec,
+ NULL, NULL))
+ {
+ GNUNET_break_op (0);
+ dr->hr.http_status = 0;
+ dr->hr.ec = TALER_EC_GENERIC_REPLY_MALFORMED;
+ break;
+ }
+ }
+ break;
+ case TALER_EC_EXCHANGE_GENERIC_COIN_CONFLICTING_DENOMINATION_KEY:
+ {
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_fixed_auto (
+ "coin_pub",
+ &dr->details.conflict.details
+ .coin_conflicting_denomination_key.coin_pub),
+ GNUNET_JSON_spec_end ()
+ };
+
+ if (GNUNET_OK !=
+ GNUNET_JSON_parse (j,
+ spec,
+ NULL, NULL))
+ {
+ GNUNET_break_op (0);
+ dr->hr.http_status = 0;
+ dr->hr.ec = TALER_EC_GENERIC_REPLY_MALFORMED;
+ break;
+ }
+ }
+ break;
+ case TALER_EC_EXCHANGE_DEPOSIT_CONFLICTING_CONTRACT:
+ break;
+ default:
GNUNET_break_op (0);
- dr->hr.http_status = 0;
- dr->hr.ec = TALER_EC_GENERIC_REPLY_MALFORMED;
break;
}
- dr->hr.ec = TALER_JSON_get_error_code (j);
- dr->hr.hint = TALER_JSON_get_error_hint (j);
}
break;
case MHD_HTTP_GONE:
diff --git a/src/testing/test_exchange_api.c b/src/testing/test_exchange_api.c
index 533995b37..f6c9f1b97 100644
--- a/src/testing/test_exchange_api.c
+++ b/src/testing/test_exchange_api.c
@@ -179,22 +179,40 @@ run (void *cls,
/**
* Spend the coin.
*/
- TALER_TESTING_cmd_deposit ("deposit-simple",
- "withdraw-coin-1",
- 0,
- cred.user42_payto,
- "{\"items\":[{\"name\":\"ice
cream\",\"value\":1}]}",
- GNUNET_TIME_UNIT_ZERO,
- "EUR:5",
- MHD_HTTP_OK),
- TALER_TESTING_cmd_deposit_replay ("deposit-simple-replay-1",
- "deposit-simple",
- MHD_HTTP_OK),
- TALER_TESTING_cmd_sleep ("sleep-before-deposit-replay",
- 1),
- TALER_TESTING_cmd_deposit_replay ("deposit-simple-replay-2",
- "deposit-simple",
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_set_var (
+ "account-priv",
+ TALER_TESTING_cmd_deposit (
+ "deposit-simple-fail-kyc",
+ "withdraw-coin-1",
+ 0,
+ cred.user42_payto,
+ "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}",
+ GNUNET_TIME_UNIT_ZERO,
+ "EUR:5",
+ MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS)),
+ TALER_TESTING_cmd_admin_add_kycauth (
+ "kyc-auth-transfer",
+ "EUR:0.01",
+ &cred.ba,
+ cred.user42_payto,
+ "deposit-simple-fail-kyc"),
+ CMD_EXEC_WIREWATCH (
+ "import-kyc-account-withdraw"),
+ TALER_TESTING_cmd_deposit_replay (
+ "deposit-simple",
+ "deposit-simple-fail-kyc",
+ MHD_HTTP_OK),
+ TALER_TESTING_cmd_deposit_replay (
+ "deposit-simple-replay-1",
+ "deposit-simple",
+ MHD_HTTP_OK),
+ TALER_TESTING_cmd_sleep (
+ "sleep-before-deposit-replay",
+ 1),
+ TALER_TESTING_cmd_deposit_replay (
+ "deposit-simple-replay-2",
+ "deposit-simple",
+ MHD_HTTP_OK),
/* This creates a conflict, as we have the same coin public key (reuse!),
but different denomination public keys (which is not allowed).
However, note that this does NOT work with 'CS', as for a different
@@ -202,52 +220,64 @@ run (void *cls,
thus will generate a different coin private key as R0/R1 are hashed
into the coin priv. So here, we fail to 'reuse' the key due to the
cryptographic construction! */
- TALER_TESTING_cmd_deposit ("deposit-reused-coin-key-failure",
- "withdraw-coin-1x",
- 0,
- cred.user42_payto,
- "{\"items\":[{\"name\":\"ice
cream\",\"value\":1}]}",
- GNUNET_TIME_UNIT_ZERO,
- "EUR:1",
- uses_cs
- ? MHD_HTTP_OK
- : MHD_HTTP_CONFLICT),
+ TALER_TESTING_cmd_deposit (
+ "deposit-reused-coin-key-failure",
+ "withdraw-coin-1x",
+ 0,
+ cred.user42_payto,
+ "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}",
+ GNUNET_TIME_UNIT_ZERO,
+ "EUR:1",
+ uses_cs
+ ? MHD_HTTP_OK
+ : MHD_HTTP_CONFLICT),
/**
* Try to double spend using different wire details.
*/
- TALER_TESTING_cmd_deposit ("deposit-double-1",
- "withdraw-coin-1",
- 0,
- cred.user43_payto,
- "{\"items\":[{\"name\":\"ice
cream\",\"value\":1}]}",
- GNUNET_TIME_UNIT_ZERO,
- "EUR:5",
- MHD_HTTP_CONFLICT),
+ TALER_TESTING_cmd_admin_add_kycauth (
+ "kyc-auth-transfer-2",
+ "EUR:0.01",
+ &cred.ba,
+ cred.user43_payto,
+ "deposit-simple-fail-kyc"),
+ CMD_EXEC_WIREWATCH (
+ "import-kyc-account-1"),
+ TALER_TESTING_cmd_deposit (
+ "deposit-double-1",
+ "withdraw-coin-1",
+ 0,
+ cred.user43_payto,
+ "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}",
+ GNUNET_TIME_UNIT_ZERO,
+ "EUR:5",
+ MHD_HTTP_CONFLICT),
/* Try to double spend using a different transaction id.
* The test needs the contract terms to differ. This
* is currently the case because of the "timestamp" field,
* which is set automatically by #TALER_TESTING_cmd_deposit().
* This could theoretically fail if at some point a deposit
- * command executes in less than 1 ms. *///
- TALER_TESTING_cmd_deposit ("deposit-double-1",
- "withdraw-coin-1",
- 0,
- cred.user43_payto,
- "{\"items\":[{\"name\":\"ice
cream\",\"value\":1}]}",
- GNUNET_TIME_UNIT_ZERO,
- "EUR:5",
- MHD_HTTP_CONFLICT),
+ * command executes in less than 1 ms. */
+ TALER_TESTING_cmd_deposit (
+ "deposit-double-1",
+ "withdraw-coin-1",
+ 0,
+ cred.user43_payto,
+ "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}",
+ GNUNET_TIME_UNIT_ZERO,
+ "EUR:5",
+ MHD_HTTP_CONFLICT),
/**
* Try to double spend with different proposal.
*/
- TALER_TESTING_cmd_deposit ("deposit-double-2",
- "withdraw-coin-1",
- 0,
- cred.user43_payto,
- "{\"items\":[{\"name\":\"ice
cream\",\"value\":2}]}",
- GNUNET_TIME_UNIT_ZERO,
- "EUR:5",
- MHD_HTTP_CONFLICT),
+ TALER_TESTING_cmd_deposit (
+ "deposit-double-2",
+ "withdraw-coin-1",
+ 0,
+ cred.user43_payto,
+ "{\"items\":[{\"name\":\"ice cream\",\"value\":2}]}",
+ GNUNET_TIME_UNIT_ZERO,
+ "EUR:5",
+ MHD_HTTP_CONFLICT),
TALER_TESTING_cmd_end ()
};
@@ -258,19 +288,22 @@ run (void *cls,
* with MHD_HTTP_CONFLICT, but for a different reason: here it
* is not a denomination conflict, but a double-spending conflict.
*/
- TALER_TESTING_cmd_melt ("refresh-melt-reused-coin-key-failure",
- "withdraw-coin-1x",
- MHD_HTTP_CONFLICT,
- NULL),
+ TALER_TESTING_cmd_melt (
+ "refresh-melt-reused-coin-key-failure",
+ "withdraw-coin-1x",
+ MHD_HTTP_CONFLICT,
+ NULL),
/* Fill reserve with EUR:5, 1ct is for fees. */
- CMD_TRANSFER_TO_EXCHANGE ("refresh-create-reserve-1",
- "EUR:5.01"),
- TALER_TESTING_cmd_check_bank_admin_transfer ("ck-refresh-create-reserve-1",
- "EUR:5.01",
- cred.user42_payto,
- cred.exchange_payto,
- "refresh-create-reserve-1"),
+ CMD_TRANSFER_TO_EXCHANGE (
+ "refresh-create-reserve-1",
+ "EUR:5.01"),
+ TALER_TESTING_cmd_check_bank_admin_transfer (
+ "ck-refresh-create-reserve-1",
+ "EUR:5.01",
+ cred.user42_payto,
+ cred.exchange_payto,
+ "refresh-create-reserve-1"),
/**
* Make previous command effective.
*/
@@ -278,83 +311,93 @@ run (void *cls,
/**
* Withdraw EUR:5.
*/
- TALER_TESTING_cmd_withdraw_amount ("refresh-withdraw-coin-1",
- "refresh-create-reserve-1",
- "EUR:5",
- 0, /* age restriction off */
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_withdraw_amount (
+ "refresh-withdraw-coin-1",
+ "refresh-create-reserve-1",
+ "EUR:5",
+ 0, /* age restriction off */
+ MHD_HTTP_OK),
/* Try to partially spend (deposit) 1 EUR of the 5 EUR coin
* (in full) (merchant would receive EUR:0.99 due to 1 ct
* deposit fee)
*/
- TALER_TESTING_cmd_deposit ("refresh-deposit-partial",
- "refresh-withdraw-coin-1",
- 0,
- cred.user42_payto,
- "{\"items\":[{\"name\":\"ice
cream\",\"value\":\"EUR:1\"}]}",
- GNUNET_TIME_UNIT_ZERO,
- "EUR:1",
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_deposit (
+ "refresh-deposit-partial",
+ "refresh-withdraw-coin-1",
+ 0,
+ cred.user42_payto,
+ "{\"items\":[{\"name\":\"ice cream\",\"value\":\"EUR:1\"}]}",
+ GNUNET_TIME_UNIT_ZERO,
+ "EUR:1",
+ MHD_HTTP_OK),
/**
* Melt the rest of the coin's value
* (EUR:4.00 = 3x EUR:1.03 + 7x EUR:0.13) */
- TALER_TESTING_cmd_melt_double ("refresh-melt-1",
- "refresh-withdraw-coin-1",
- MHD_HTTP_OK,
- NULL),
+ TALER_TESTING_cmd_melt_double (
+ "refresh-melt-1",
+ "refresh-withdraw-coin-1",
+ MHD_HTTP_OK,
+ NULL),
/**
* Complete (successful) melt operation, and
* withdraw the coins
*/
- TALER_TESTING_cmd_refresh_reveal ("refresh-reveal-1",
- "refresh-melt-1",
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_refresh_reveal (
+ "refresh-reveal-1",
+ "refresh-melt-1",
+ MHD_HTTP_OK),
/**
* Do it again to check idempotency
*/
- TALER_TESTING_cmd_refresh_reveal ("refresh-reveal-1-idempotency",
- "refresh-melt-1",
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_refresh_reveal (
+ "refresh-reveal-1-idempotency",
+ "refresh-melt-1",
+ MHD_HTTP_OK),
/**
* Test that /refresh/link works
*/
- TALER_TESTING_cmd_refresh_link ("refresh-link-1",
- "refresh-reveal-1",
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_refresh_link (
+ "refresh-link-1",
+ "refresh-reveal-1",
+ MHD_HTTP_OK),
/**
* Try to spend a refreshed EUR:1 coin
*/
- TALER_TESTING_cmd_deposit ("refresh-deposit-refreshed-1a",
- "refresh-reveal-1-idempotency",
- 0,
- cred.user42_payto,
- "{\"items\":[{\"name\":\"ice
cream\",\"value\":3}]}",
- GNUNET_TIME_UNIT_ZERO,
- "EUR:1",
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_deposit (
+ "refresh-deposit-refreshed-1a",
+ "refresh-reveal-1-idempotency",
+ 0,
+ cred.user42_payto,
+ "{\"items\":[{\"name\":\"ice cream\",\"value\":3}]}",
+ GNUNET_TIME_UNIT_ZERO,
+ "EUR:1",
+ MHD_HTTP_OK),
/**
* Try to spend a refreshed EUR:0.1 coin
*/
- TALER_TESTING_cmd_deposit ("refresh-deposit-refreshed-1b",
- "refresh-reveal-1",
- 3,
- cred.user43_payto,
- "{\"items\":[{\"name\":\"ice
cream\",\"value\":3}]}",
- GNUNET_TIME_UNIT_ZERO,
- "EUR:0.1",
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_deposit (
+ "refresh-deposit-refreshed-1b",
+ "refresh-reveal-1",
+ 3,
+ cred.user43_payto,
+ "{\"items\":[{\"name\":\"cheap ice cream\",\"value\":3}]}",
+ GNUNET_TIME_UNIT_ZERO,
+ "EUR:0.1",
+ MHD_HTTP_OK),
/* Test running a failing melt operation (same operation
* again must fail) */
- TALER_TESTING_cmd_melt ("refresh-melt-failing",
- "refresh-withdraw-coin-1",
- MHD_HTTP_CONFLICT,
- NULL),
+ TALER_TESTING_cmd_melt (
+ "refresh-melt-failing",
+ "refresh-withdraw-coin-1",
+ MHD_HTTP_CONFLICT,
+ NULL),
/* Test running a failing melt operation (on a coin that
was itself revealed and subsequently deposited) */
- TALER_TESTING_cmd_melt ("refresh-melt-failing-2",
- "refresh-reveal-1",
- MHD_HTTP_CONFLICT,
- NULL),
+ TALER_TESTING_cmd_melt (
+ "refresh-melt-failing-2",
+ "refresh-reveal-1",
+ MHD_HTTP_CONFLICT,
+ NULL),
TALER_TESTING_cmd_end ()
};
@@ -372,13 +415,15 @@ run (void *cls,
/**
* Move money to the exchange's bank account.
*/
- CMD_TRANSFER_TO_EXCHANGE ("create-reserve-age",
- "EUR:6.01"),
- TALER_TESTING_cmd_check_bank_admin_transfer ("check-create-reserve-age",
- "EUR:6.01",
- cred.user42_payto,
- cred.exchange_payto,
- "create-reserve-age"),
+ CMD_TRANSFER_TO_EXCHANGE (
+ "create-reserve-age",
+ "EUR:6.01"),
+ TALER_TESTING_cmd_check_bank_admin_transfer (
+ "check-create-reserve-age",
+ "EUR:6.01",
+ cred.user42_payto,
+ cred.exchange_payto,
+ "create-reserve-age"),
/**
* Make a reserve exist, according to the previous
* transfer.
@@ -387,11 +432,12 @@ run (void *cls,
/**
* Withdraw EUR:5.
*/
- TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-age-1",
- "create-reserve-age",
- "EUR:5",
- 13,
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_withdraw_amount (
+ "withdraw-coin-age-1",
+ "create-reserve-age",
+ "EUR:5",
+ 13,
+ MHD_HTTP_OK),
TALER_TESTING_cmd_end ()
};
@@ -400,25 +446,30 @@ run (void *cls,
/**
* Spend the coin.
*/
- TALER_TESTING_cmd_deposit ("deposit-simple-age",
- "withdraw-coin-age-1",
- 0,
- cred.user42_payto,
- "{\"items\":[{\"name\":\"ice
cream\",\"value\":1}]}",
- GNUNET_TIME_UNIT_ZERO,
- "EUR:4.99",
- MHD_HTTP_OK),
- TALER_TESTING_cmd_deposit_replay ("deposit-simple-replay-age",
- "deposit-simple-age",
- MHD_HTTP_OK),
- TALER_TESTING_cmd_deposit_replay ("deposit-simple-replay-age-1",
- "deposit-simple-age",
- MHD_HTTP_OK),
- TALER_TESTING_cmd_sleep ("sleep-before-age-deposit-replay",
- 1),
- TALER_TESTING_cmd_deposit_replay ("deposit-simple-replay-age-2",
- "deposit-simple-age",
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_deposit (
+ "deposit-simple-age",
+ "withdraw-coin-age-1",
+ 0,
+ cred.user42_payto,
+ "{\"items\":[{\"name\":\"unique ice cream\",\"value\":1}]}",
+ GNUNET_TIME_UNIT_ZERO,
+ "EUR:4.99",
+ MHD_HTTP_OK),
+ TALER_TESTING_cmd_deposit_replay (
+ "deposit-simple-replay-age",
+ "deposit-simple-age",
+ MHD_HTTP_OK),
+ TALER_TESTING_cmd_deposit_replay (
+ "deposit-simple-replay-age-1",
+ "deposit-simple-age",
+ MHD_HTTP_OK),
+ TALER_TESTING_cmd_sleep (
+ "sleep-before-age-deposit-replay",
+ 1),
+ TALER_TESTING_cmd_deposit_replay (
+ "deposit-simple-replay-age-2",
+ "deposit-simple-age",
+ MHD_HTTP_OK),
TALER_TESTING_cmd_end ()
};
@@ -427,102 +478,78 @@ run (void *cls,
* execution of transactions, the answer should be that
* the exchange knows about the deposit, but has no WTID yet.
*/
- TALER_TESTING_cmd_deposits_get ("deposit-wtid-found",
- "deposit-simple",
- 0,
- MHD_HTTP_ACCEPTED,
- NULL),
+ TALER_TESTING_cmd_deposits_get (
+ "deposit-wtid-found",
+ "deposit-simple",
+ 0,
+ MHD_HTTP_ACCEPTED,
+ NULL),
/* Try resolving a deposit's WTID for a failed deposit.
* As the deposit failed, the answer should be that the
* exchange does NOT know about the deposit.
*/
- TALER_TESTING_cmd_deposits_get ("deposit-wtid-failing",
- "deposit-double-2",
- 0,
- MHD_HTTP_NOT_FOUND,
- NULL),
+ TALER_TESTING_cmd_deposits_get (
+ "deposit-wtid-failing",
+ "deposit-double-2",
+ 0,
+ MHD_HTTP_NOT_FOUND,
+ NULL),
/* Try resolving an undefined (all zeros) WTID; this
* should fail as obviously the exchange didn't use that
* WTID value for any transaction.
*/
- TALER_TESTING_cmd_track_transfer_empty ("wire-deposit-failing",
- NULL,
- MHD_HTTP_NOT_FOUND),
- /* Run transfers. Note that _actual_ aggregation will NOT
- * happen here, as each deposit operation is run with a
- * fresh merchant public key, so the aggregator will treat
- * them as "different" merchants and do the wire transfers
- * individually. */
+ TALER_TESTING_cmd_track_transfer_empty (
+ "wire-deposit-failing",
+ NULL,
+ MHD_HTTP_NOT_FOUND),
+ /* Run transfers. */
CMD_EXEC_AGGREGATOR ("run-aggregator"),
/**
* Check all the transfers took place.
*/
- TALER_TESTING_cmd_check_bank_transfer ("check_bank_transfer-499c",
- cred.exchange_url,
- "EUR:4.98",
- cred.exchange_payto,
- cred.user42_payto),
- TALER_TESTING_cmd_check_bank_transfer ("check_bank_transfer-499c2",
- cred.exchange_url,
- "EUR:4.97",
- cred.exchange_payto,
- cred.user42_payto),
- TALER_TESTING_cmd_check_bank_transfer ("check_bank_transfer-99c1",
- cred.exchange_url,
- "EUR:0.98",
- cred.exchange_payto,
- cred.user42_payto),
- TALER_TESTING_cmd_check_bank_transfer ("check_bank_transfer-99c2",
- cred.exchange_url,
- "EUR:0.98",
- cred.exchange_payto,
- cred.user42_payto),
- TALER_TESTING_cmd_check_bank_transfer ("check_bank_transfer-99c3",
- cred.exchange_url,
- "EUR:0.98",
- cred.exchange_payto,
- cred.user42_payto),
- TALER_TESTING_cmd_check_bank_transfer ("check_bank_transfer-99c4",
- cred.exchange_url,
- "EUR:0.98",
- cred.exchange_payto,
- cred.user42_payto),
- TALER_TESTING_cmd_check_bank_transfer ("check_bank_transfer-08c",
- cred.exchange_url,
- "EUR:0.08",
- cred.exchange_payto,
- cred.user43_payto),
- TALER_TESTING_cmd_check_bank_transfer ("check_bank_transfer-08c2",
- cred.exchange_url,
- "EUR:0.08",
- cred.exchange_payto,
- cred.user43_payto),
+ TALER_TESTING_cmd_check_bank_transfer (
+ "check_bank_transfer-42-aggregate",
+ cred.exchange_url,
+ "EUR:13.92",
+ cred.exchange_payto,
+ cred.user42_payto),
+ TALER_TESTING_cmd_check_bank_transfer (
+ "check_bank_transfer-43-aggregate",
+ cred.exchange_url,
+ "EUR:0.17",
+ cred.exchange_payto,
+ cred.user43_payto),
/* In case of CS, one transaction above succeeded that
failed for RSA, hence we need to check for an extra transfer here */
uses_cs
- ? TALER_TESTING_cmd_check_bank_transfer ("check_bank_transfer-98c",
- cred.exchange_url,
- "EUR:0.98",
- cred.exchange_payto,
- cred.user42_payto)
- : TALER_TESTING_cmd_sleep ("dummy",
- 0),
+ ? TALER_TESTING_cmd_check_bank_transfer (
+ "check_bank_transfer-98c",
+ cred.exchange_url,
+ "EUR:0.98",
+ cred.exchange_payto,
+ cred.user42_payto)
+ : TALER_TESTING_cmd_sleep (
+ "dummy",
+ 0),
TALER_TESTING_cmd_check_bank_empty ("check_bank_empty"),
- TALER_TESTING_cmd_deposits_get ("deposit-wtid-ok",
- "deposit-simple",
- 0,
- MHD_HTTP_OK,
- "check_bank_transfer-499c"),
- TALER_TESTING_cmd_track_transfer ("wire-deposit-success-bank",
- "check_bank_transfer-99c1",
- MHD_HTTP_OK,
- "EUR:0.98",
- "EUR:0.01"),
- TALER_TESTING_cmd_track_transfer ("wire-deposits-success-wtid",
- "deposit-wtid-ok",
- MHD_HTTP_OK,
- "EUR:4.98",
- "EUR:0.01"),
+ TALER_TESTING_cmd_deposits_get (
+ "deposit-wtid-ok",
+ "deposit-simple",
+ 0,
+ MHD_HTTP_OK,
+ "check_bank_transfer-42-aggregate"),
+ TALER_TESTING_cmd_track_transfer (
+ "wire-deposit-success-bank",
+ "check_bank_transfer-42-aggregate",
+ MHD_HTTP_OK,
+ "EUR:13.92",
+ "EUR:0.01"),
+ TALER_TESTING_cmd_track_transfer (
+ "wire-deposits-success-wtid",
+ "check_bank_transfer-43-aggregate",
+ MHD_HTTP_OK,
+ "EUR:0.17",
+ "EUR:0.01"),
TALER_TESTING_cmd_end ()
};
@@ -532,8 +559,9 @@ run (void *cls,
*/
struct TALER_TESTING_Command unaggregation[] = {
TALER_TESTING_cmd_check_bank_empty ("far-future-aggregation-a"),
- CMD_TRANSFER_TO_EXCHANGE ("create-reserve-unaggregated",
- "EUR:5.01"),
+ CMD_TRANSFER_TO_EXCHANGE (
+ "create-reserve-unaggregated",
+ "EUR:5.01"),
/* "consume" reserve creation transfer. */
TALER_TESTING_cmd_check_bank_admin_transfer (
"check-create-reserve-unaggregated",
@@ -542,21 +570,23 @@ run (void *cls,
cred.exchange_payto,
"create-reserve-unaggregated"),
CMD_EXEC_WIREWATCH ("wirewatch-unaggregated"),
- TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-unaggregated",
- "create-reserve-unaggregated",
- "EUR:5",
- 0, /* age restriction off */
- MHD_HTTP_OK),
- TALER_TESTING_cmd_deposit ("deposit-unaggregated",
- "withdraw-coin-unaggregated",
- 0,
- cred.user43_payto,
- "{\"items\":[{\"name\":\"ice
cream\",\"value\":1}]}",
- GNUNET_TIME_relative_multiply (
- GNUNET_TIME_UNIT_YEARS,
- 3000),
- "EUR:5",
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_withdraw_amount (
+ "withdraw-coin-unaggregated",
+ "create-reserve-unaggregated",
+ "EUR:5",
+ 0, /* age restriction off */
+ MHD_HTTP_OK),
+ TALER_TESTING_cmd_deposit (
+ "deposit-unaggregated",
+ "withdraw-coin-unaggregated",
+ 0,
+ cred.user43_payto,
+ "{\"items\":[{\"name\":\"different ice cream\",\"value\":1}]}",
+ GNUNET_TIME_relative_multiply (
+ GNUNET_TIME_UNIT_YEARS,
+ 3000),
+ "EUR:5",
+ MHD_HTTP_OK),
CMD_EXEC_AGGREGATOR ("aggregation-attempt"),
TALER_TESTING_cmd_check_bank_empty (
@@ -567,8 +597,9 @@ run (void *cls,
struct TALER_TESTING_Command refresh_age[] = {
/* Fill reserve with EUR:5, 1ct is for fees. */
- CMD_TRANSFER_TO_EXCHANGE ("refresh-create-reserve-age-1",
- "EUR:6.01"),
+ CMD_TRANSFER_TO_EXCHANGE (
+ "refresh-create-reserve-age-1",
+ "EUR:6.01"),
TALER_TESTING_cmd_check_bank_admin_transfer (
"ck-refresh-create-reserve-age-1",
"EUR:6.01",
@@ -582,83 +613,93 @@ run (void *cls,
/**
* Withdraw EUR:7 with age restriction for age 13.
*/
- TALER_TESTING_cmd_withdraw_amount ("refresh-withdraw-coin-age-1",
- "refresh-create-reserve-age-1",
- "EUR:5",
- 13,
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_withdraw_amount (
+ "refresh-withdraw-coin-age-1",
+ "refresh-create-reserve-age-1",
+ "EUR:5",
+ 13,
+ MHD_HTTP_OK),
/* Try to partially spend (deposit) 1 EUR of the 5 EUR coin
* (in full) (merchant would receive EUR:0.99 due to 1 ct
* deposit fee)
*/
- TALER_TESTING_cmd_deposit ("refresh-deposit-partial-age",
- "refresh-withdraw-coin-age-1",
- 0,
- cred.user42_payto,
- "{\"items\":[{\"name\":\"ice
cream\",\"value\":\"EUR:1\"}]}",
- GNUNET_TIME_UNIT_ZERO,
- "EUR:1",
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_deposit (
+ "refresh-deposit-partial-age",
+ "refresh-withdraw-coin-age-1",
+ 0,
+ cred.user42_payto,
+ "{\"items\":[{\"name\":\"special ice cream\",\"value\":\"EUR:1\"}]}",
+ GNUNET_TIME_UNIT_ZERO,
+ "EUR:1",
+ MHD_HTTP_OK),
/**
* Melt the rest of the coin's value
* (EUR:4.00 = 3x EUR:1.03 + 7x EUR:0.13) */
- TALER_TESTING_cmd_melt_double ("refresh-melt-age-1",
- "refresh-withdraw-coin-age-1",
- MHD_HTTP_OK,
- NULL),
+ TALER_TESTING_cmd_melt_double (
+ "refresh-melt-age-1",
+ "refresh-withdraw-coin-age-1",
+ MHD_HTTP_OK,
+ NULL),
/**
* Complete (successful) melt operation, and
* withdraw the coins
*/
- TALER_TESTING_cmd_refresh_reveal ("refresh-reveal-age-1",
- "refresh-melt-age-1",
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_refresh_reveal (
+ "refresh-reveal-age-1",
+ "refresh-melt-age-1",
+ MHD_HTTP_OK),
/**
* Do it again to check idempotency
*/
- TALER_TESTING_cmd_refresh_reveal ("refresh-reveal-age-1-idempotency",
- "refresh-melt-age-1",
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_refresh_reveal (
+ "refresh-reveal-age-1-idempotency",
+ "refresh-melt-age-1",
+ MHD_HTTP_OK),
/**
* Test that /refresh/link works
*/
- TALER_TESTING_cmd_refresh_link ("refresh-link-age-1",
- "refresh-reveal-age-1",
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_refresh_link (
+ "refresh-link-age-1",
+ "refresh-reveal-age-1",
+ MHD_HTTP_OK),
/**
* Try to spend a refreshed EUR:1 coin
*/
- TALER_TESTING_cmd_deposit ("refresh-deposit-refreshed-age-1a",
- "refresh-reveal-age-1-idempotency",
- 0,
- cred.user42_payto,
- "{\"items\":[{\"name\":\"ice
cream\",\"value\":3}]}",
- GNUNET_TIME_UNIT_ZERO,
- "EUR:1",
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_deposit (
+ "refresh-deposit-refreshed-age-1a",
+ "refresh-reveal-age-1-idempotency",
+ 0,
+ cred.user42_payto,
+ "{\"items\":[{\"name\":\"garlic ice cream\",\"value\":3}]}",
+ GNUNET_TIME_UNIT_ZERO,
+ "EUR:1",
+ MHD_HTTP_OK),
/**
* Try to spend a refreshed EUR:0.1 coin
*/
- TALER_TESTING_cmd_deposit ("refresh-deposit-refreshed-age-1b",
- "refresh-reveal-age-1",
- 3,
- cred.user43_payto,
- "{\"items\":[{\"name\":\"ice
cream\",\"value\":3}]}",
- GNUNET_TIME_UNIT_ZERO,
- "EUR:0.1",
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_deposit (
+ "refresh-deposit-refreshed-age-1b",
+ "refresh-reveal-age-1",
+ 3,
+ cred.user43_payto,
+ "{\"items\":[{\"name\":\"spicy ice cream\",\"value\":3}]}",
+ GNUNET_TIME_UNIT_ZERO,
+ "EUR:0.1",
+ MHD_HTTP_OK),
/* Test running a failing melt operation (same operation
* again must fail) */
- TALER_TESTING_cmd_melt ("refresh-melt-failing-age",
- "refresh-withdraw-coin-age-1",
- MHD_HTTP_CONFLICT,
- NULL),
+ TALER_TESTING_cmd_melt (
+ "refresh-melt-failing-age",
+ "refresh-withdraw-coin-age-1",
+ MHD_HTTP_CONFLICT,
+ NULL),
/* Test running a failing melt operation (on a coin that
was itself revealed and subsequently deposited) */
- TALER_TESTING_cmd_melt ("refresh-melt-failing-age-2",
- "refresh-reveal-age-1",
- MHD_HTTP_CONFLICT,
- NULL),
+ TALER_TESTING_cmd_melt (
+ "refresh-melt-failing-age-2",
+ "refresh-reveal-age-1",
+ MHD_HTTP_CONFLICT,
+ NULL),
TALER_TESTING_cmd_end ()
};
@@ -677,34 +718,38 @@ run (void *cls,
cred.exchange_payto,
"create-reserve-aggtest"),
CMD_EXEC_WIREWATCH ("wirewatch-aggtest"),
- TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-aggtest",
- "create-reserve-aggtest",
- "EUR:5",
- 0, /* age restriction off */
- MHD_HTTP_OK),
- TALER_TESTING_cmd_deposit ("deposit-aggtest-1",
- "withdraw-coin-aggtest",
- 0,
- cred.user43_payto,
- "{\"items\":[{\"name\":\"ice
cream\",\"value\":1}]}",
- GNUNET_TIME_UNIT_ZERO,
- "EUR:2",
- MHD_HTTP_OK),
- TALER_TESTING_cmd_deposit_with_ref ("deposit-aggtest-2",
- "withdraw-coin-aggtest",
- 0,
- cred.user43_payto,
- "{\"items\":[{\"name\":\"foo
bar\",\"value\":1}]}",
- GNUNET_TIME_UNIT_ZERO,
- "EUR:2",
- MHD_HTTP_OK,
- "deposit-aggtest-1"),
+ TALER_TESTING_cmd_withdraw_amount (
+ "withdraw-coin-aggtest",
+ "create-reserve-aggtest",
+ "EUR:5",
+ 0, /* age restriction off */
+ MHD_HTTP_OK),
+ TALER_TESTING_cmd_deposit (
+ "deposit-aggtest-1",
+ "withdraw-coin-aggtest",
+ 0,
+ cred.user43_payto,
+ "{\"items\":[{\"name\":\"cinamon ice cream\",\"value\":1}]}",
+ GNUNET_TIME_UNIT_ZERO,
+ "EUR:2",
+ MHD_HTTP_OK),
+ TALER_TESTING_cmd_deposit_with_ref (
+ "deposit-aggtest-2",
+ "withdraw-coin-aggtest",
+ 0,
+ cred.user43_payto,
+ "{\"items\":[{\"name\":\"foo bar\",\"value\":1}]}",
+ GNUNET_TIME_UNIT_ZERO,
+ "EUR:2",
+ MHD_HTTP_OK,
+ "deposit-aggtest-1"),
CMD_EXEC_AGGREGATOR ("aggregation-aggtest"),
- TALER_TESTING_cmd_check_bank_transfer ("check-bank-transfer-aggtest",
- cred.exchange_url,
- "EUR:3.97",
- cred.exchange_payto,
- cred.user43_payto),
+ TALER_TESTING_cmd_check_bank_transfer (
+ "check-bank-transfer-aggtest",
+ cred.exchange_url,
+ "EUR:3.97",
+ cred.exchange_payto,
+ cred.user43_payto),
TALER_TESTING_cmd_check_bank_empty ("check-bank-empty-aggtest"),
TALER_TESTING_cmd_end ()
};
@@ -714,35 +759,39 @@ run (void *cls,
* Fill reserve with EUR:5.01, as withdraw fee is 1 ct per
* config.
*/
- CMD_TRANSFER_TO_EXCHANGE ("create-reserve-r1",
- "EUR:5.01"),
- TALER_TESTING_cmd_check_bank_admin_transfer ("check-create-reserve-r1",
- "EUR:5.01",
- cred.user42_payto,
- cred.exchange_payto,
- "create-reserve-r1"),
+ CMD_TRANSFER_TO_EXCHANGE (
+ "create-reserve-r1",
+ "EUR:5.01"),
+ TALER_TESTING_cmd_check_bank_admin_transfer (
+ "check-create-reserve-r1",
+ "EUR:5.01",
+ cred.user42_payto,
+ cred.exchange_payto,
+ "create-reserve-r1"),
/**
* Run wire-watch to trigger the reserve creation.
*/
CMD_EXEC_WIREWATCH ("wirewatch-3"),
/* Withdraw a 5 EUR coin, at fee of 1 ct */
- TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-r1",
- "create-reserve-r1",
- "EUR:5",
- 0, /* age restriction off */
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_withdraw_amount (
+ "withdraw-coin-r1",
+ "create-reserve-r1",
+ "EUR:5",
+ 0, /* age restriction off */
+ MHD_HTTP_OK),
/**
* Spend 5 EUR of the 5 EUR coin (in full) (merchant would
* receive EUR:4.99 due to 1 ct deposit fee)
*/
- TALER_TESTING_cmd_deposit ("deposit-refund-1",
- "withdraw-coin-r1",
- 0,
- cred.user42_payto,
- "{\"items\":[{\"name\":\"ice
cream\",\"value\":\"EUR:5\"}]}",
- GNUNET_TIME_UNIT_MINUTES,
- "EUR:5",
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_deposit (
+ "deposit-refund-1",
+ "withdraw-coin-r1",
+ 0,
+ cred.user42_payto,
+ "{\"items\":[{\"name\":\"blue ice cream\",\"value\":\"EUR:5\"}]}",
+ GNUNET_TIME_UNIT_MINUTES,
+ "EUR:5",
+ MHD_HTTP_OK),
/**
* Run transfers. Should do nothing as refund deadline blocks it
*/
@@ -753,47 +802,53 @@ run (void *cls,
* fakebank and the second to actually check there are not
* other transfers around. */
TALER_TESTING_cmd_check_bank_empty ("check_bank_transfer-pre-refund"),
- TALER_TESTING_cmd_refund_with_id ("refund-ok",
- MHD_HTTP_OK,
- "EUR:3",
- "deposit-refund-1",
- 3),
- TALER_TESTING_cmd_refund_with_id ("refund-ok-double",
- MHD_HTTP_OK,
- "EUR:3",
- "deposit-refund-1",
- 3),
+ TALER_TESTING_cmd_refund_with_id (
+ "refund-ok",
+ MHD_HTTP_OK,
+ "EUR:3",
+ "deposit-refund-1",
+ 3),
+ TALER_TESTING_cmd_refund_with_id (
+ "refund-ok-double",
+ MHD_HTTP_OK,
+ "EUR:3",
+ "deposit-refund-1",
+ 3),
/* Previous /refund(s) had id == 0. */
- TALER_TESTING_cmd_refund_with_id ("refund-conflicting",
- MHD_HTTP_CONFLICT,
- "EUR:5",
- "deposit-refund-1",
- 1),
- TALER_TESTING_cmd_deposit ("deposit-refund-insufficient-refund",
- "withdraw-coin-r1",
- 0,
- cred.user42_payto,
- "{\"items\":[{\"name\":\"ice
cream\",\"value\":\"EUR:4\"}]}",
- GNUNET_TIME_UNIT_MINUTES,
- "EUR:4",
- MHD_HTTP_CONFLICT),
- TALER_TESTING_cmd_refund_with_id ("refund-ok-increase",
- MHD_HTTP_OK,
- "EUR:2",
- "deposit-refund-1",
- 2),
+ TALER_TESTING_cmd_refund_with_id (
+ "refund-conflicting",
+ MHD_HTTP_CONFLICT,
+ "EUR:5",
+ "deposit-refund-1",
+ 1),
+ TALER_TESTING_cmd_deposit (
+ "deposit-refund-insufficient-refund",
+ "withdraw-coin-r1",
+ 0,
+ cred.user42_payto,
+ "{\"items\":[{\"name\":\"fruit ice cream\",\"value\":\"EUR:4\"}]}",
+ GNUNET_TIME_UNIT_MINUTES,
+ "EUR:4",
+ MHD_HTTP_CONFLICT),
+ TALER_TESTING_cmd_refund_with_id (
+ "refund-ok-increase",
+ MHD_HTTP_OK,
+ "EUR:2",
+ "deposit-refund-1",
+ 2),
/**
* Spend 4.99 EUR of the refunded 4.99 EUR coin (1ct gone
* due to refund) (merchant would receive EUR:4.98 due to
* 1 ct deposit fee) */
- TALER_TESTING_cmd_deposit ("deposit-refund-2",
- "withdraw-coin-r1",
- 0,
- cred.user42_payto,
- "{\"items\":[{\"name\":\"more ice
cream\",\"value\":\"EUR:5\"}]}",
- GNUNET_TIME_UNIT_ZERO,
- "EUR:4.99",
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_deposit (
+ "deposit-refund-2",
+ "withdraw-coin-r1",
+ 0,
+ cred.user42_payto,
+ "{\"items\":[{\"name\":\"more ice cream\",\"value\":\"EUR:5\"}]}",
+ GNUNET_TIME_UNIT_ZERO,
+ "EUR:4.99",
+ MHD_HTTP_OK),
/**
* Run transfers. This will do the transfer as refund deadline
* was 0
@@ -802,52 +857,59 @@ run (void *cls,
/**
* Check that deposit did run.
*/
- TALER_TESTING_cmd_check_bank_transfer ("check_bank_transfer-pre-refund",
- cred.exchange_url,
- "EUR:4.97",
- cred.exchange_payto,
- cred.user42_payto),
+ TALER_TESTING_cmd_check_bank_transfer (
+ "check_bank_transfer-pre-refund",
+ cred.exchange_url,
+ "EUR:4.97",
+ cred.exchange_payto,
+ cred.user42_payto),
/**
* Run failing refund, as past deadline & aggregation.
*/
- TALER_TESTING_cmd_refund ("refund-fail",
- MHD_HTTP_GONE,
- "EUR:4.99",
- "deposit-refund-2"),
+ TALER_TESTING_cmd_refund (
+ "refund-fail",
+ MHD_HTTP_GONE,
+ "EUR:4.99",
+ "deposit-refund-2"),
TALER_TESTING_cmd_check_bank_empty ("check-empty-after-refund"),
/**
* Test refunded coins are never executed, even past
* refund deadline
*/
- CMD_TRANSFER_TO_EXCHANGE ("create-reserve-rb",
- "EUR:5.01"),
- TALER_TESTING_cmd_check_bank_admin_transfer ("check-create-reserve-rb",
- "EUR:5.01",
- cred.user42_payto,
- cred.exchange_payto,
- "create-reserve-rb"),
+ CMD_TRANSFER_TO_EXCHANGE (
+ "create-reserve-rb",
+ "EUR:5.01"),
+ TALER_TESTING_cmd_check_bank_admin_transfer (
+ "check-create-reserve-rb",
+ "EUR:5.01",
+ cred.user42_payto,
+ cred.exchange_payto,
+ "create-reserve-rb"),
CMD_EXEC_WIREWATCH ("wirewatch-rb"),
- TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-rb",
- "create-reserve-rb",
- "EUR:5",
- 0, /* age restriction off */
- MHD_HTTP_OK),
- TALER_TESTING_cmd_deposit ("deposit-refund-1b",
- "withdraw-coin-rb",
- 0,
- cred.user42_payto,
- "{\"items\":[{\"name\":\"ice
cream\",\"value\":\"EUR:5\"}]}",
- GNUNET_TIME_UNIT_ZERO,
- "EUR:5",
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_withdraw_amount (
+ "withdraw-coin-rb",
+ "create-reserve-rb",
+ "EUR:5",
+ 0, /* age restriction off */
+ MHD_HTTP_OK),
+ TALER_TESTING_cmd_deposit (
+ "deposit-refund-1b",
+ "withdraw-coin-rb",
+ 0,
+ cred.user42_payto,
+ "{\"items\":[{\"name\":\"purple ice cream\",\"value\":\"EUR:5\"}]}",
+ GNUNET_TIME_UNIT_ZERO,
+ "EUR:5",
+ MHD_HTTP_OK),
/**
* Trigger refund (before aggregator had a chance to execute
* deposit, even though refund deadline was zero).
*/
- TALER_TESTING_cmd_refund ("refund-ok-fast",
- MHD_HTTP_OK,
- "EUR:5",
- "deposit-refund-1b"),
+ TALER_TESTING_cmd_refund (
+ "refund-ok-fast",
+ MHD_HTTP_OK,
+ "EUR:5",
+ "deposit-refund-1b"),
/**
* Run transfers. This will do the transfer as refund deadline
* was 0, except of course because the refund succeeded, the
@@ -864,8 +926,9 @@ run (void *cls,
* Fill reserve with EUR:5.01, as withdraw fee is 1 ct per
* config.
*/
- CMD_TRANSFER_TO_EXCHANGE ("recoup-create-reserve-1",
- "EUR:15.02"),
+ CMD_TRANSFER_TO_EXCHANGE (
+ "recoup-create-reserve-1",
+ "EUR:15.02"),
TALER_TESTING_cmd_check_bank_admin_transfer (
"recoup-create-reserve-1-check",
"EUR:15.02",
@@ -877,156 +940,185 @@ run (void *cls,
*/
CMD_EXEC_WIREWATCH ("wirewatch-4"),
/* Withdraw a 5 EUR coin, at fee of 1 ct */
- TALER_TESTING_cmd_withdraw_amount ("recoup-withdraw-coin-1",
- "recoup-create-reserve-1",
- "EUR:5",
- 0, /* age restriction off */
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_withdraw_amount (
+ "recoup-withdraw-coin-1",
+ "recoup-create-reserve-1",
+ "EUR:5",
+ 0, /* age restriction off */
+ MHD_HTTP_OK),
/* Withdraw a 10 EUR coin, at fee of 1 ct */
- TALER_TESTING_cmd_withdraw_amount ("recoup-withdraw-coin-1b",
- "recoup-create-reserve-1",
- "EUR:10",
- 0, /* age restriction off */
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_withdraw_amount (
+ "recoup-withdraw-coin-1b",
+ "recoup-create-reserve-1",
+ "EUR:10",
+ 0, /* age restriction off */
+ MHD_HTTP_OK),
/* melt 10 EUR coin to get 5 EUR refreshed coin */
- TALER_TESTING_cmd_melt ("recoup-melt-coin-1b",
- "recoup-withdraw-coin-1b",
- MHD_HTTP_OK,
- "EUR:5",
- NULL),
- TALER_TESTING_cmd_refresh_reveal ("recoup-reveal-coin-1b",
- "recoup-melt-coin-1b",
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_melt (
+ "recoup-melt-coin-1b",
+ "recoup-withdraw-coin-1b",
+ MHD_HTTP_OK,
+ "EUR:5",
+ NULL),
+ TALER_TESTING_cmd_refresh_reveal (
+ "recoup-reveal-coin-1b",
+ "recoup-melt-coin-1b",
+ MHD_HTTP_OK),
/* Revoke both 5 EUR coins */
- TALER_TESTING_cmd_revoke ("revoke-0-EUR:5",
- MHD_HTTP_OK,
- "recoup-withdraw-coin-1",
- config_file),
+ TALER_TESTING_cmd_revoke (
+ "revoke-0-EUR:5",
+ MHD_HTTP_OK,
+ "recoup-withdraw-coin-1",
+ config_file),
/* Recoup coin to reserve */
- TALER_TESTING_cmd_recoup ("recoup-1",
- MHD_HTTP_OK,
- "recoup-withdraw-coin-1",
- "EUR:5"),
+ TALER_TESTING_cmd_recoup (
+ "recoup-1",
+ MHD_HTTP_OK,
+ "recoup-withdraw-coin-1",
+ "EUR:5"),
/* Check the money is back with the reserve */
- TALER_TESTING_cmd_status ("recoup-reserve-status-1",
- "recoup-create-reserve-1",
- "EUR:5.0",
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_status (
+ "recoup-reserve-status-1",
+ "recoup-create-reserve-1",
+ "EUR:5.0",
+ MHD_HTTP_OK),
/* Recoup-refresh coin to 10 EUR coin */
- TALER_TESTING_cmd_recoup_refresh ("recoup-1b",
- MHD_HTTP_OK,
- "recoup-reveal-coin-1b",
- "recoup-melt-coin-1b",
- "EUR:5"),
+ TALER_TESTING_cmd_recoup_refresh (
+ "recoup-1b",
+ MHD_HTTP_OK,
+ "recoup-reveal-coin-1b",
+ "recoup-melt-coin-1b",
+ "EUR:5"),
/* melt 10 EUR coin *again* to get 1 EUR refreshed coin */
- TALER_TESTING_cmd_melt ("recoup-remelt-coin-1a",
- "recoup-withdraw-coin-1b",
- MHD_HTTP_OK,
- "EUR:1",
- NULL),
- TALER_TESTING_cmd_refresh_reveal ("recoup-reveal-coin-1a",
- "recoup-remelt-coin-1a",
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_melt (
+ "recoup-remelt-coin-1a",
+ "recoup-withdraw-coin-1b",
+ MHD_HTTP_OK,
+ "EUR:1",
+ NULL),
+ TALER_TESTING_cmd_refresh_reveal (
+ "recoup-reveal-coin-1a",
+ "recoup-remelt-coin-1a",
+ MHD_HTTP_OK),
/* Try melting for more than the residual value to provoke an error */
- TALER_TESTING_cmd_melt ("recoup-remelt-coin-1b",
- "recoup-withdraw-coin-1b",
- MHD_HTTP_OK,
- "EUR:1",
- NULL),
- TALER_TESTING_cmd_melt ("recoup-remelt-coin-1c",
- "recoup-withdraw-coin-1b",
- MHD_HTTP_OK,
- "EUR:1",
- NULL),
- TALER_TESTING_cmd_melt ("recoup-remelt-coin-1d",
- "recoup-withdraw-coin-1b",
- MHD_HTTP_OK,
- "EUR:1",
- NULL),
- TALER_TESTING_cmd_melt ("recoup-remelt-coin-1e",
- "recoup-withdraw-coin-1b",
- MHD_HTTP_OK,
- "EUR:1",
- NULL),
- TALER_TESTING_cmd_melt ("recoup-remelt-coin-1f",
- "recoup-withdraw-coin-1b",
- MHD_HTTP_OK,
- "EUR:1",
- NULL),
- TALER_TESTING_cmd_melt ("recoup-remelt-coin-1g",
- "recoup-withdraw-coin-1b",
- MHD_HTTP_OK,
- "EUR:1",
- NULL),
- TALER_TESTING_cmd_melt ("recoup-remelt-coin-1h",
- "recoup-withdraw-coin-1b",
- MHD_HTTP_OK,
- "EUR:1",
- NULL),
- TALER_TESTING_cmd_melt ("recoup-remelt-coin-1i",
- "recoup-withdraw-coin-1b",
- MHD_HTTP_OK,
- "EUR:1",
- NULL),
- TALER_TESTING_cmd_melt ("recoup-remelt-coin-1b-failing",
- "recoup-withdraw-coin-1b",
- MHD_HTTP_CONFLICT,
- "EUR:1",
- NULL),
+ TALER_TESTING_cmd_melt (
+ "recoup-remelt-coin-1b",
+ "recoup-withdraw-coin-1b",
+ MHD_HTTP_OK,
+ "EUR:1",
+ NULL),
+ TALER_TESTING_cmd_melt (
+ "recoup-remelt-coin-1c",
+ "recoup-withdraw-coin-1b",
+ MHD_HTTP_OK,
+ "EUR:1",
+ NULL),
+ TALER_TESTING_cmd_melt (
+ "recoup-remelt-coin-1d",
+ "recoup-withdraw-coin-1b",
+ MHD_HTTP_OK,
+ "EUR:1",
+ NULL),
+ TALER_TESTING_cmd_melt (
+ "recoup-remelt-coin-1e",
+ "recoup-withdraw-coin-1b",
+ MHD_HTTP_OK,
+ "EUR:1",
+ NULL),
+ TALER_TESTING_cmd_melt (
+ "recoup-remelt-coin-1f",
+ "recoup-withdraw-coin-1b",
+ MHD_HTTP_OK,
+ "EUR:1",
+ NULL),
+ TALER_TESTING_cmd_melt (
+ "recoup-remelt-coin-1g",
+ "recoup-withdraw-coin-1b",
+ MHD_HTTP_OK,
+ "EUR:1",
+ NULL),
+ TALER_TESTING_cmd_melt (
+ "recoup-remelt-coin-1h",
+ "recoup-withdraw-coin-1b",
+ MHD_HTTP_OK,
+ "EUR:1",
+ NULL),
+ TALER_TESTING_cmd_melt (
+ "recoup-remelt-coin-1i",
+ "recoup-withdraw-coin-1b",
+ MHD_HTTP_OK,
+ "EUR:1",
+ NULL),
+ TALER_TESTING_cmd_melt (
+ "recoup-remelt-coin-1b-failing",
+ "recoup-withdraw-coin-1b",
+ MHD_HTTP_CONFLICT,
+ "EUR:1",
+ NULL),
/* Re-withdraw from this reserve */
- TALER_TESTING_cmd_withdraw_amount ("recoup-withdraw-coin-2",
- "recoup-create-reserve-1",
- "EUR:1",
- 0, /* age restriction off */
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_withdraw_amount (
+ "recoup-withdraw-coin-2",
+ "recoup-create-reserve-1",
+ "EUR:1",
+ 0, /* age restriction off */
+ MHD_HTTP_OK),
/**
* This withdrawal will test the logic to create a "recoup"
* element to insert into the reserve's history.
*/
- TALER_TESTING_cmd_withdraw_amount ("recoup-withdraw-coin-2-over",
- "recoup-create-reserve-1",
- "EUR:10",
- 0, /* age restriction off */
- MHD_HTTP_CONFLICT),
- TALER_TESTING_cmd_status ("recoup-reserve-status-2",
- "recoup-create-reserve-1",
- "EUR:3.99",
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_withdraw_amount (
+ "recoup-withdraw-coin-2-over",
+ "recoup-create-reserve-1",
+ "EUR:10",
+ 0, /* age restriction off */
+ MHD_HTTP_CONFLICT),
+ TALER_TESTING_cmd_status (
+ "recoup-reserve-status-2",
+ "recoup-create-reserve-1",
+ "EUR:3.99",
+ MHD_HTTP_OK),
/* These commands should close the reserve because
* the aggregator is given a config file that overrides
* the reserve expiration time (making it now-ish) */
CMD_TRANSFER_TO_EXCHANGE ("short-lived-reserve",
"EUR:5.01"),
- TALER_TESTING_cmd_check_bank_admin_transfer ("check-short-lived-reserve",
- "EUR:5.01",
- cred.user42_payto,
- cred.exchange_payto,
- "short-lived-reserve"),
- TALER_TESTING_cmd_exec_wirewatch2 ("short-lived-aggregation",
- config_file_expire_reserve_now,
- "exchange-account-2"),
- TALER_TESTING_cmd_exec_closer ("close-reserves",
- config_file_expire_reserve_now,
- "EUR:5",
- "EUR:0.01",
- "short-lived-reserve"),
- TALER_TESTING_cmd_exec_transfer ("close-reserves-transfer",
- config_file_expire_reserve_now),
+ TALER_TESTING_cmd_check_bank_admin_transfer (
+ "check-short-lived-reserve",
+ "EUR:5.01",
+ cred.user42_payto,
+ cred.exchange_payto,
+ "short-lived-reserve"),
+ TALER_TESTING_cmd_exec_wirewatch2 (
+ "short-lived-aggregation",
+ config_file_expire_reserve_now,
+ "exchange-account-2"),
+ TALER_TESTING_cmd_exec_closer (
+ "close-reserves",
+ config_file_expire_reserve_now,
+ "EUR:5",
+ "EUR:0.01",
+ "short-lived-reserve"),
+ TALER_TESTING_cmd_exec_transfer (
+ "close-reserves-transfer",
+ config_file_expire_reserve_now),
- TALER_TESTING_cmd_status ("short-lived-status",
- "short-lived-reserve",
- "EUR:0",
- MHD_HTTP_OK),
- TALER_TESTING_cmd_withdraw_amount ("expired-withdraw",
- "short-lived-reserve",
- "EUR:1",
- 0, /* age restriction off */
- MHD_HTTP_CONFLICT),
- TALER_TESTING_cmd_check_bank_transfer ("check_bank_short-lived_reimburse",
- cred.exchange_url,
- "EUR:5",
- cred.exchange_payto,
- cred.user42_payto),
+ TALER_TESTING_cmd_status (
+ "short-lived-status",
+ "short-lived-reserve",
+ "EUR:0",
+ MHD_HTTP_OK),
+ TALER_TESTING_cmd_withdraw_amount (
+ "expired-withdraw",
+ "short-lived-reserve",
+ "EUR:1",
+ 0, /* age restriction off */
+ MHD_HTTP_CONFLICT),
+ TALER_TESTING_cmd_check_bank_transfer (
+ "check_bank_short-lived_reimburse",
+ cred.exchange_url,
+ "EUR:5",
+ cred.exchange_payto,
+ cred.user42_payto),
/* Fill reserve with EUR:2.02, as withdraw fee is 1 ct per
* config, then withdraw two coin, partially spend one, and
* then have the rest paid back. Check deposit of other coin
@@ -1034,76 +1126,87 @@ run (void *cls,
* revoked and we did not bother to create a new one... */
CMD_TRANSFER_TO_EXCHANGE ("recoup-create-reserve-2",
"EUR:2.02"),
- TALER_TESTING_cmd_check_bank_admin_transfer ("ck-recoup-create-reserve-2",
- "EUR:2.02",
- cred.user42_payto,
- cred.exchange_payto,
- "recoup-create-reserve-2"),
+ TALER_TESTING_cmd_check_bank_admin_transfer (
+ "ck-recoup-create-reserve-2",
+ "EUR:2.02",
+ cred.user42_payto,
+ cred.exchange_payto,
+ "recoup-create-reserve-2"),
/* Make previous command effective. */
CMD_EXEC_WIREWATCH ("wirewatch-5"),
/* Withdraw a 1 EUR coin, at fee of 1 ct */
- TALER_TESTING_cmd_withdraw_amount ("recoup-withdraw-coin-2a",
- "recoup-create-reserve-2",
- "EUR:1",
- 0, /* age restriction off */
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_withdraw_amount (
+ "recoup-withdraw-coin-2a",
+ "recoup-create-reserve-2",
+ "EUR:1",
+ 0, /* age restriction off */
+ MHD_HTTP_OK),
/* Withdraw a 1 EUR coin, at fee of 1 ct */
- TALER_TESTING_cmd_withdraw_amount ("recoup-withdraw-coin-2b",
- "recoup-create-reserve-2",
- "EUR:1",
- 0, /* age restriction off */
- MHD_HTTP_OK),
- TALER_TESTING_cmd_deposit ("recoup-deposit-partial",
- "recoup-withdraw-coin-2a",
- 0,
- cred.user42_payto,
- "{\"items\":[{\"name\":\"more ice
cream\",\"value\":1}]}",
- GNUNET_TIME_UNIT_ZERO,
- "EUR:0.5",
- MHD_HTTP_OK),
- TALER_TESTING_cmd_revoke ("revoke-1-EUR:1",
- MHD_HTTP_OK,
- "recoup-withdraw-coin-2a",
- config_file),
+ TALER_TESTING_cmd_withdraw_amount (
+ "recoup-withdraw-coin-2b",
+ "recoup-create-reserve-2",
+ "EUR:1",
+ 0, /* age restriction off */
+ MHD_HTTP_OK),
+ TALER_TESTING_cmd_deposit (
+ "recoup-deposit-partial",
+ "recoup-withdraw-coin-2a",
+ 0,
+ cred.user42_payto,
+ "{\"items\":[{\"name\":\"more ice cream\",\"value\":1}]}",
+ GNUNET_TIME_UNIT_ZERO,
+ "EUR:0.5",
+ MHD_HTTP_OK),
+ TALER_TESTING_cmd_revoke (
+ "revoke-1-EUR:1",
+ MHD_HTTP_OK,
+ "recoup-withdraw-coin-2a",
+ config_file),
/* Check recoup is failing for the coin with the reused coin key
(fails either because of denomination conflict (RSA) or
double-spending (CS))*/
- TALER_TESTING_cmd_recoup ("recoup-2x",
- MHD_HTTP_CONFLICT,
- "withdraw-coin-1x",
- "EUR:1"),
- TALER_TESTING_cmd_recoup ("recoup-2",
- MHD_HTTP_OK,
- "recoup-withdraw-coin-2a",
- "EUR:0.5"),
+ TALER_TESTING_cmd_recoup (
+ "recoup-2x",
+ MHD_HTTP_CONFLICT,
+ "withdraw-coin-1x",
+ "EUR:1"),
+ TALER_TESTING_cmd_recoup (
+ "recoup-2",
+ MHD_HTTP_OK,
+ "recoup-withdraw-coin-2a",
+ "EUR:0.5"),
/* Idempotency of recoup (withdrawal variant) */
- TALER_TESTING_cmd_recoup ("recoup-2b",
- MHD_HTTP_OK,
- "recoup-withdraw-coin-2a",
- "EUR:0.5"),
- TALER_TESTING_cmd_deposit ("recoup-deposit-revoked",
- "recoup-withdraw-coin-2b",
- 0,
- cred.user42_payto,
- "{\"items\":[{\"name\":\"more ice
cream\",\"value\":1}]}",
- GNUNET_TIME_UNIT_ZERO,
- "EUR:1",
- MHD_HTTP_GONE),
+ TALER_TESTING_cmd_recoup (
+ "recoup-2b",
+ MHD_HTTP_OK,
+ "recoup-withdraw-coin-2a",
+ "EUR:0.5"),
+ TALER_TESTING_cmd_deposit (
+ "recoup-deposit-revoked",
+ "recoup-withdraw-coin-2b",
+ 0,
+ cred.user42_payto,
+ "{\"items\":[{\"name\":\"gnu ice cream\",\"value\":1}]}",
+ GNUNET_TIME_UNIT_ZERO,
+ "EUR:1",
+ MHD_HTTP_GONE),
/* Test deposit fails after recoup, with proof in recoup */
/* Note that, the exchange will never return the coin's transaction
* history with recoup data, as we get a 410 on the DK! */
- TALER_TESTING_cmd_deposit ("recoup-deposit-partial-after-recoup",
- "recoup-withdraw-coin-2a",
- 0,
- cred.user42_payto,
- "{\"items\":[{\"name\":\"extra ice
cream\",\"value\":1}]}",
- GNUNET_TIME_UNIT_ZERO,
- "EUR:0.5",
- MHD_HTTP_GONE),
+ TALER_TESTING_cmd_deposit (
+ "recoup-deposit-partial-after-recoup",
+ "recoup-withdraw-coin-2a",
+ 0,
+ cred.user42_payto,
+ "{\"items\":[{\"name\":\"extra ice cream\",\"value\":1}]}",
+ GNUNET_TIME_UNIT_ZERO,
+ "EUR:0.5",
+ MHD_HTTP_GONE),
/* Test that revoked coins cannot be withdrawn */
- CMD_TRANSFER_TO_EXCHANGE ("recoup-create-reserve-3",
- "EUR:1.01"),
+ CMD_TRANSFER_TO_EXCHANGE (
+ "recoup-create-reserve-3",
+ "EUR:1.01"),
TALER_TESTING_cmd_check_bank_admin_transfer (
"check-recoup-create-reserve-3",
"EUR:1.01",
@@ -1111,11 +1214,12 @@ run (void *cls,
cred.exchange_payto,
"recoup-create-reserve-3"),
CMD_EXEC_WIREWATCH ("wirewatch-6"),
- TALER_TESTING_cmd_withdraw_amount ("recoup-withdraw-coin-3-revoked",
- "recoup-create-reserve-3",
- "EUR:1",
- 0, /* age restriction off */
- MHD_HTTP_GONE),
+ TALER_TESTING_cmd_withdraw_amount (
+ "recoup-withdraw-coin-3-revoked",
+ "recoup-create-reserve-3",
+ "EUR:1",
+ 0, /* age restriction off */
+ MHD_HTTP_GONE),
/* check that we are empty before the rejection test */
TALER_TESTING_cmd_check_bank_empty ("check-empty-again"),
@@ -1129,64 +1233,73 @@ run (void *cls,
/**
* Move money to the exchange's bank account.
*/
- CMD_TRANSFER_TO_EXCHANGE ("create-batch-reserve-1",
- "EUR:6.03"),
- TALER_TESTING_cmd_reserve_poll ("poll-batch-reserve-1",
- "create-batch-reserve-1",
- "EUR:6.03",
- GNUNET_TIME_UNIT_MINUTES,
- MHD_HTTP_OK),
- TALER_TESTING_cmd_check_bank_admin_transfer
("check-create-batch-reserve-1",
- "EUR:6.03",
- cred.user42_payto,
- cred.exchange_payto,
- "create-batch-reserve-1"),
+ CMD_TRANSFER_TO_EXCHANGE (
+ "create-batch-reserve-1",
+ "EUR:6.03"),
+ TALER_TESTING_cmd_reserve_poll (
+ "poll-batch-reserve-1",
+ "create-batch-reserve-1",
+ "EUR:6.03",
+ GNUNET_TIME_UNIT_MINUTES,
+ MHD_HTTP_OK),
+ TALER_TESTING_cmd_check_bank_admin_transfer (
+ "check-create-batch-reserve-1",
+ "EUR:6.03",
+ cred.user42_payto,
+ cred.exchange_payto,
+ "create-batch-reserve-1"),
/*
* Make a reserve exist, according to the previous
* transfer.
*/
CMD_EXEC_WIREWATCH ("wirewatch-batch-1"),
- TALER_TESTING_cmd_reserve_poll_finish ("finish-poll-batch-reserve-1",
- GNUNET_TIME_UNIT_SECONDS,
- "poll-batch-reserve-1"),
+ TALER_TESTING_cmd_reserve_poll_finish (
+ "finish-poll-batch-reserve-1",
+ GNUNET_TIME_UNIT_SECONDS,
+ "poll-batch-reserve-1"),
/**
* Withdraw EUR:5 AND EUR:1.
*/
- TALER_TESTING_cmd_batch_withdraw ("batch-withdraw-coin-1",
- "create-batch-reserve-1",
- 0, /* age restriction off */
- MHD_HTTP_OK,
- "EUR:5",
- "EUR:1",
- NULL),
+ TALER_TESTING_cmd_batch_withdraw (
+ "batch-withdraw-coin-1",
+ "create-batch-reserve-1",
+ 0, /* age restriction off */
+ MHD_HTTP_OK,
+ "EUR:5",
+ "EUR:1",
+ NULL),
/**
* Check the reserve is (almost) depleted.
*/
- TALER_TESTING_cmd_status ("status-batch-1",
- "create-batch-reserve-1",
- "EUR:0.01",
- MHD_HTTP_OK),
- TALER_TESTING_cmd_reserve_history ("history-batch-1",
- "create-batch-reserve-1",
- "EUR:0.01",
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_status (
+ "status-batch-1",
+ "create-batch-reserve-1",
+ "EUR:0.01",
+ MHD_HTTP_OK),
+ TALER_TESTING_cmd_reserve_history (
+ "history-batch-1",
+ "create-batch-reserve-1",
+ "EUR:0.01",
+ MHD_HTTP_OK),
/**
* Spend the coins.
*/
- TALER_TESTING_cmd_batch_deposit ("batch-deposit-1",
- cred.user42_payto,
- "{\"items\":[{\"name\":\"ice
cream\",\"value\":5}]}",
- GNUNET_TIME_UNIT_ZERO,
- MHD_HTTP_OK,
- "batch-withdraw-coin-1#0",
- "EUR:5",
- "batch-withdraw-coin-1#1",
- "EUR:1",
- NULL),
- TALER_TESTING_cmd_coin_history ("coin-history-batch-1",
- "batch-withdraw-coin-1#0",
- "EUR:0.0",
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_batch_deposit (
+ "batch-deposit-1",
+ cred.user42_payto,
+ "{\"items\":[{\"name\":\"final ice cream\",\"value\":5}]}",
+ GNUNET_TIME_UNIT_ZERO,
+ MHD_HTTP_OK,
+ "batch-withdraw-coin-1#0",
+ "EUR:5",
+ "batch-withdraw-coin-1#1",
+ "EUR:1",
+ NULL),
+ TALER_TESTING_cmd_coin_history (
+ "coin-history-batch-1",
+ "batch-withdraw-coin-1#0",
+ "EUR:0.0",
+ MHD_HTTP_OK),
TALER_TESTING_cmd_end ()
};
diff --git a/src/testing/test_exchange_api_age_restriction.c
b/src/testing/test_exchange_api_age_restriction.c
index 38e536d52..75c3a41f8 100644
--- a/src/testing/test_exchange_api_age_restriction.c
+++ b/src/testing/test_exchange_api_age_restriction.c
@@ -144,12 +144,37 @@ run (void *cls,
/**
* Spend the coin.
*/
+ TALER_TESTING_cmd_set_var (
+ "account-priv",
+ TALER_TESTING_cmd_deposit (
+ "deposit-simple-age-fail-kyc",
+ "withdraw-coin-age-1",
+ 0,
+ cred.user42_payto,
+ "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}",
+ GNUNET_TIME_UNIT_ZERO,
+ "EUR:4.99",
+ MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS)),
+ TALER_TESTING_cmd_admin_add_kycauth (
+ "kyc-auth-transfer",
+ "EUR:0.01",
+ &cred.ba,
+ cred.user42_payto,
+ "deposit-simple-age-fail-kyc"),
+ TALER_TESTING_cmd_admin_add_kycauth (
+ "kyc-auth-transfer",
+ "EUR:0.01",
+ &cred.ba,
+ cred.user43_payto,
+ "deposit-simple-age-fail-kyc"),
+ CMD_EXEC_WIREWATCH (
+ "import-kyc-account-withdraw"),
TALER_TESTING_cmd_deposit (
"deposit-simple-age",
"withdraw-coin-age-1",
0,
cred.user42_payto,
- "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}",
+ "{\"items\":[{\"name\":\"ice cream\",\"value\":2}]}",
GNUNET_TIME_UNIT_ZERO,
"EUR:4.99",
MHD_HTTP_OK),
@@ -194,7 +219,7 @@ run (void *cls,
"refresh-withdraw-coin-age-1",
0,
cred.user42_payto,
- "{\"items\":[{\"name\":\"ice cream\",\"value\":\"EUR:1\"}]}",
+ "{\"items\":[{\"name\":\"ice cream\",\"value\":\"EUR:3\"}]}",
GNUNET_TIME_UNIT_ZERO,
"EUR:1",
MHD_HTTP_OK),
@@ -236,7 +261,7 @@ run (void *cls,
"refresh-reveal-age-1-idempotency",
0,
cred.user42_payto,
- "{\"items\":[{\"name\":\"ice cream\",\"value\":3}]}",
+ "{\"items\":[{\"name\":\"ice cream\",\"value\":4}]}",
GNUNET_TIME_UNIT_ZERO,
"EUR:1",
MHD_HTTP_OK),
@@ -248,7 +273,7 @@ run (void *cls,
"refresh-reveal-age-1",
3,
cred.user43_payto,
- "{\"items\":[{\"name\":\"ice cream\",\"value\":3}]}",
+ "{\"items\":[{\"name\":\"ice cream\",\"value\":5}]}",
GNUNET_TIME_UNIT_ZERO,
"EUR:0.1",
MHD_HTTP_OK),
diff --git a/src/testing/testing_api_cmd_batch.c
b/src/testing/testing_api_cmd_batch.c
index 5bb7b974e..395d92563 100644
--- a/src/testing/testing_api_cmd_batch.c
+++ b/src/testing/testing_api_cmd_batch.c
@@ -62,27 +62,30 @@ batch_run (void *cls,
struct TALER_TESTING_Interpreter *is)
{
struct BatchState *bs = cls;
+ struct TALER_TESTING_Command *bcmd = &bs->batch[bs->batch_ip];
bs->cmd = cmd;
- if (NULL != bs->batch[bs->batch_ip].label)
+ if (NULL != bcmd->label)
TALER_LOG_INFO ("Running batched command: %s\n",
- bs->batch[bs->batch_ip].label);
+ bcmd->label);
/* hit end command, leap to next top-level command. */
- if (NULL == bs->batch[bs->batch_ip].label)
+ if (NULL == bcmd->label)
{
TALER_LOG_INFO ("Exiting from batch: %s\n",
cmd->label);
TALER_TESTING_interpreter_next (is);
return;
}
- bs->batch[bs->batch_ip].start_time
- = bs->batch[bs->batch_ip].last_req_time
+ bcmd->start_time
+ = bcmd->last_req_time
= GNUNET_TIME_absolute_get ();
- bs->batch[bs->batch_ip].num_tries = 1;
- bs->batch[bs->batch_ip].run (bs->batch[bs->batch_ip].cls,
- &bs->batch[bs->batch_ip],
- is);
+ bcmd->num_tries++;
+ TALER_TESTING_update_variables_ (is,
+ bcmd);
+ bcmd->run (bcmd->cls,
+ bcmd,
+ is);
}
diff --git a/src/testing/testing_api_cmd_batch_deposit.c
b/src/testing/testing_api_cmd_batch_deposit.c
index 27a2a1165..199404e1c 100644
--- a/src/testing/testing_api_cmd_batch_deposit.c
+++ b/src/testing/testing_api_cmd_batch_deposit.c
@@ -133,7 +133,13 @@ struct BatchDepositState
* Set (by the interpreter) to a fresh private key. This
* key will be used to sign the deposit request.
*/
- struct TALER_MerchantPrivateKeyP merchant_priv;
+ union TALER_AccountPrivateKeyP account_priv;
+
+ /**
+ * Set (by the interpreter) to the public key
+ * corresponding to @e account_priv.
+ */
+ union TALER_AccountPublicKeyP account_pub;
/**
* Deposit handle while operation is running.
@@ -264,7 +270,6 @@ batch_deposit_run (void *cls,
{
struct BatchDepositState *ds = cls;
const struct TALER_DenominationSignature *denom_pub_sig;
- struct TALER_MerchantPublicKeyP merchant_pub;
struct TALER_PrivateContractHashP h_contract_terms;
enum TALER_ErrorCode ec;
struct TALER_WireSaltP wire_salt;
@@ -304,6 +309,13 @@ batch_deposit_run (void *cls,
TALER_TESTING_interpreter_fail (is);
return;
}
+#if DUMP_CONTRACT
+ fprintf (stderr,
+ "Using contract:\n");
+ json_dumpf (ds->contract_terms,
+ stderr,
+ JSON_INDENT (2));
+#endif
if (GNUNET_OK !=
TALER_JSON_contract_hash (ds->contract_terms,
&h_contract_terms))
@@ -332,9 +344,38 @@ batch_deposit_run (void *cls,
ds->refund_deadline = ds->wallet_timestamp;
ds->wire_deadline = GNUNET_TIME_timestamp_get ();
}
- GNUNET_CRYPTO_eddsa_key_get_public (&ds->merchant_priv.eddsa_priv,
- &merchant_pub.eddsa_pub);
+ {
+ const struct TALER_TESTING_Command *acc_var;
+ if (NULL != (acc_var
+ = TALER_TESTING_interpreter_get_command (
+ is,
+ "account-priv")))
+ {
+ const union TALER_AccountPrivateKeyP *account_priv;
+
+ if ( (GNUNET_OK !=
+ TALER_TESTING_get_trait_account_priv (acc_var,
+ &account_priv)) )
+ {
+ GNUNET_break (0);
+ TALER_TESTING_interpreter_fail (is);
+ return;
+ }
+ ds->account_priv = *account_priv;
+ GNUNET_CRYPTO_eddsa_key_get_public (
+ &ds->account_priv.merchant_priv.eddsa_priv,
+ &ds->account_pub.merchant_pub.eddsa_pub);
+ }
+ else
+ {
+ GNUNET_CRYPTO_eddsa_key_create (
+ &ds->account_priv.merchant_priv.eddsa_priv);
+ GNUNET_CRYPTO_eddsa_key_get_public (
+ &ds->account_priv.merchant_priv.eddsa_priv,
+ &ds->account_pub.merchant_pub.eddsa_pub);
+ }
+ }
for (unsigned int i = 0; i<ds->num_coins; i++)
{
struct Coin *coin = &ds->coins[i];
@@ -395,7 +436,7 @@ batch_deposit_run (void *cls,
NULL, /* hash of extensions */
&coin->denom_pub->h_key,
ds->wallet_timestamp,
- &merchant_pub,
+ &ds->account_pub.merchant_pub,
ds->refund_deadline,
coin_priv,
&cdd->coin_sig);
@@ -407,7 +448,7 @@ batch_deposit_run (void *cls,
coin->che.details.deposit.no_h_policy = true;
coin->che.details.deposit.no_wallet_data_hash = true;
coin->che.details.deposit.wallet_timestamp = ds->wallet_timestamp;
- coin->che.details.deposit.merchant_pub = merchant_pub;
+ coin->che.details.deposit.merchant_pub = ds->account_pub.merchant_pub;
coin->che.details.deposit.refund_deadline = ds->refund_deadline;
coin->che.details.deposit.sig = cdd->coin_sig;
coin->che.details.deposit.no_hac = GNUNET_is_zero (&cdd->h_age_commitment);
@@ -424,7 +465,7 @@ batch_deposit_run (void *cls,
.h_contract_terms = h_contract_terms,
.policy_details = NULL /* FIXME #7270-OEC */,
.wallet_timestamp = ds->wallet_timestamp,
- .merchant_pub = merchant_pub,
+ .merchant_pub = ds->account_pub.merchant_pub,
.refund_deadline = ds->refund_deadline
};
@@ -546,7 +587,10 @@ batch_deposit_traits (void *cls,
/* These traits are always available */
TALER_TESTING_make_trait_wire_details (ds->wire_details),
TALER_TESTING_make_trait_contract_terms (ds->contract_terms),
- TALER_TESTING_make_trait_merchant_priv (&ds->merchant_priv),
+ TALER_TESTING_make_trait_merchant_priv (&ds->account_priv.merchant_priv),
+ TALER_TESTING_make_trait_merchant_pub (&ds->account_pub.merchant_pub),
+ TALER_TESTING_make_trait_account_priv (&ds->account_priv),
+ TALER_TESTING_make_trait_account_pub (&ds->account_pub),
TALER_TESTING_make_trait_age_commitment_proof (index,
age_commitment_proof),
TALER_TESTING_make_trait_coin_history (index,
@@ -585,12 +629,13 @@ batch_deposit_traits (void *cls,
struct TALER_TESTING_Command
-TALER_TESTING_cmd_batch_deposit (const char *label,
- const char *target_account_payto,
- const char *contract_terms,
- struct GNUNET_TIME_Relative refund_deadline,
- unsigned int expected_response_code,
- ...)
+TALER_TESTING_cmd_batch_deposit (
+ const char *label,
+ const char *target_account_payto,
+ const char *contract_terms,
+ struct GNUNET_TIME_Relative refund_deadline,
+ unsigned int expected_response_code,
+ ...)
{
struct BatchDepositState *ds;
va_list ap;
@@ -637,7 +682,6 @@ TALER_TESTING_cmd_batch_deposit (const char *label,
ds->contract_terms = json_loads (contract_terms,
JSON_REJECT_DUPLICATES,
NULL);
- GNUNET_CRYPTO_eddsa_key_create (&ds->merchant_priv.eddsa_priv);
if (NULL == ds->contract_terms)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
diff --git a/src/testing/testing_api_cmd_deposit.c
b/src/testing/testing_api_cmd_deposit.c
index 2467488ea..f45fce133 100644
--- a/src/testing/testing_api_cmd_deposit.c
+++ b/src/testing/testing_api_cmd_deposit.c
@@ -98,7 +98,13 @@ struct DepositState
* Set (by the interpreter) to a fresh private key. This
* key will be used to sign the deposit request.
*/
- struct TALER_MerchantPrivateKeyP merchant_priv;
+ union TALER_AccountPrivateKeyP account_priv;
+
+ /**
+ * Set (by the interpreter) to the public key
+ * corresponding to @e account_priv.
+ */
+ union TALER_AccountPublicKeyP account_pub;
/**
* Deposit handle while operation is running.
@@ -297,11 +303,11 @@ deposit_run (void *cls,
{
struct DepositState *ds = cls;
const struct TALER_TESTING_Command *coin_cmd;
+ const struct TALER_TESTING_Command *acc_var;
const struct TALER_CoinSpendPrivateKeyP *coin_priv;
struct TALER_CoinSpendPublicKeyP coin_pub;
const struct TALER_AgeCommitmentHash *phac;
const struct TALER_DenominationSignature *denom_pub_sig;
- struct TALER_MerchantPublicKeyP merchant_pub;
struct TALER_PrivateContractHashP h_contract_terms;
enum TALER_ErrorCode ec;
struct TALER_WireSaltP wire_salt;
@@ -363,7 +369,8 @@ deposit_run (void *cls,
ds->refund_deadline = ods->refund_deadline;
ds->wire_deadline = ods->wire_deadline;
ds->amount = ods->amount;
- ds->merchant_priv = ods->merchant_priv;
+ ds->account_priv = ods->account_priv;
+ ds->account_pub = ods->account_pub;
ds->command_initialized = true;
}
else if (NULL != ds->merchant_priv_reference)
@@ -389,7 +396,38 @@ deposit_run (void *cls,
TALER_TESTING_interpreter_fail (is);
return;
}
- ds->merchant_priv = *merchant_priv;
+ ds->account_priv.merchant_priv = *merchant_priv;
+ GNUNET_CRYPTO_eddsa_key_get_public (
+ &ds->account_priv.merchant_priv.eddsa_priv,
+ &ds->account_pub.merchant_pub.eddsa_pub);
+ }
+ else if (NULL != (acc_var
+ = TALER_TESTING_interpreter_get_command (
+ is,
+ "account-priv")))
+ {
+ const union TALER_AccountPrivateKeyP *account_priv;
+
+ if ( (GNUNET_OK !=
+ TALER_TESTING_get_trait_account_priv (acc_var,
+ &account_priv)) )
+ {
+ GNUNET_break (0);
+ TALER_TESTING_interpreter_fail (is);
+ return;
+ }
+ ds->account_priv = *account_priv;
+ GNUNET_CRYPTO_eddsa_key_get_public (
+ &ds->account_priv.merchant_priv.eddsa_priv,
+ &ds->account_pub.merchant_pub.eddsa_pub);
+ }
+ else
+ {
+ GNUNET_CRYPTO_eddsa_key_create (
+ &ds->account_priv.merchant_priv.eddsa_priv);
+ GNUNET_CRYPTO_eddsa_key_get_public (
+ &ds->account_priv.merchant_priv.eddsa_priv,
+ &ds->account_pub.merchant_pub.eddsa_pub);
}
GNUNET_assert (NULL != ds->wire_details);
if (GNUNET_OK !=
@@ -413,7 +451,13 @@ deposit_run (void *cls,
TALER_TESTING_interpreter_fail (is);
return;
}
-
+#if DUMP_CONTRACT
+ fprintf (stderr,
+ "Using contract:\n");
+ json_dumpf (ds->contract_terms,
+ stderr,
+ JSON_INDENT (2));
+#endif
if ( (GNUNET_OK !=
TALER_TESTING_get_trait_coin_priv (coin_cmd,
ds->coin_index,
@@ -443,8 +487,6 @@ deposit_run (void *cls,
GNUNET_CRYPTO_eddsa_key_get_public (&coin_priv->eddsa_priv,
&coin_pub.eddsa_pub);
- GNUNET_CRYPTO_eddsa_key_get_public (&ds->merchant_priv.eddsa_priv,
- &merchant_pub.eddsa_pub);
{
struct TALER_MerchantWireHashP h_wire;
@@ -460,7 +502,7 @@ deposit_run (void *cls,
NULL, /* hash of extensions */
&ds->denom_pub->h_key,
ds->wallet_timestamp,
- &merchant_pub,
+ &ds->account_pub.merchant_pub,
ds->refund_deadline,
coin_priv,
&ds->coin_sig);
@@ -471,7 +513,7 @@ deposit_run (void *cls,
ds->che.details.deposit.no_h_policy = true;
ds->che.details.deposit.no_wallet_data_hash = true;
ds->che.details.deposit.wallet_timestamp = ds->wallet_timestamp;
- ds->che.details.deposit.merchant_pub = merchant_pub;
+ ds->che.details.deposit.merchant_pub = ds->account_pub.merchant_pub;
ds->che.details.deposit.refund_deadline = ds->refund_deadline;
ds->che.details.deposit.sig = ds->coin_sig;
ds->che.details.deposit.no_hac = true;
@@ -493,7 +535,7 @@ deposit_run (void *cls,
.wire_salt = wire_salt,
.h_contract_terms = h_contract_terms,
.wallet_timestamp = ds->wallet_timestamp,
- .merchant_pub = merchant_pub,
+ .merchant_pub = ds->account_pub.merchant_pub,
.refund_deadline = ds->refund_deadline
};
@@ -639,7 +681,10 @@ deposit_traits (void *cls,
h_age_commitment),
TALER_TESTING_make_trait_wire_details (ds->wire_details),
TALER_TESTING_make_trait_contract_terms (ds->contract_terms),
- TALER_TESTING_make_trait_merchant_priv (&ds->merchant_priv),
+ TALER_TESTING_make_trait_merchant_priv (&ds->account_priv.merchant_priv),
+ TALER_TESTING_make_trait_merchant_pub (&ds->account_pub.merchant_pub),
+ TALER_TESTING_make_trait_account_priv (&ds->account_priv),
+ TALER_TESTING_make_trait_account_pub (&ds->account_pub),
TALER_TESTING_make_trait_deposit_amount (0,
&ds->amount),
TALER_TESTING_make_trait_deposit_fee_amount (0,
@@ -684,7 +729,6 @@ TALER_TESTING_cmd_deposit (
ds->contract_terms = json_loads (contract_terms,
JSON_REJECT_DUPLICATES,
NULL);
- GNUNET_CRYPTO_eddsa_key_create (&ds->merchant_priv.eddsa_priv);
if (NULL == ds->contract_terms)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
diff --git a/src/testing/testing_api_cmd_refresh.c
b/src/testing/testing_api_cmd_refresh.c
index 9d58422c7..5c45e3a33 100644
--- a/src/testing/testing_api_cmd_refresh.c
+++ b/src/testing/testing_api_cmd_refresh.c
@@ -1021,12 +1021,12 @@ melt_run (void *cls,
const struct TALER_TESTING_Command *cmd,
struct TALER_TESTING_Interpreter *is)
{
- struct RefreshMeltState *rms = cls;
- unsigned int num_fresh_coins;
- const char *default_melt_fresh_amounts[] = {
+ static const char *default_melt_fresh_amounts[] = {
"EUR:1", "EUR:1", "EUR:1", "EUR:0.1",
NULL
};
+ struct RefreshMeltState *rms = cls;
+ unsigned int num_fresh_coins;
const char **melt_fresh_amounts;
rms->cmd = cmd;
diff --git a/src/testing/testing_api_loop.c b/src/testing/testing_api_loop.c
index 00126b3e7..89c966f26 100644
--- a/src/testing/testing_api_loop.c
+++ b/src/testing/testing_api_loop.c
@@ -156,7 +156,7 @@ TALER_TESTING_interpreter_get_command (struct
TALER_TESTING_Interpreter *is,
cmd = GNUNET_CONTAINER_multihashmap_get (is->vars,
&h_name);
if (NULL == cmd)
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Command not found by name: %s\n",
name);
return cmd;
@@ -264,6 +264,30 @@ TALER_TESTING_interpreter_get_current_label (
}
+void
+TALER_TESTING_update_variables_ (
+ struct TALER_TESTING_Interpreter *is,
+ struct TALER_TESTING_Command *cmd)
+{
+ struct GNUNET_HashCode h_name;
+
+ if (NULL == cmd->name)
+ return;
+ GNUNET_CRYPTO_hash (cmd->name,
+ strlen (cmd->name),
+ &h_name);
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Storing command %s under variable `%s'\n",
+ cmd->label,
+ cmd->name);
+ (void) GNUNET_CONTAINER_multihashmap_put (
+ is->vars,
+ &h_name,
+ cmd,
+ GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE);
+}
+
+
static void
interpreter_run (void *cls)
{
@@ -288,20 +312,9 @@ interpreter_run (void *cls)
= GNUNET_TIME_absolute_get ();
if (0 == cmd->num_tries)
cmd->start_time = cmd->last_req_time;
- cmd->num_tries = 1;
- if (NULL != cmd->name)
- {
- struct GNUNET_HashCode h_name;
-
- GNUNET_CRYPTO_hash (cmd->name,
- strlen (cmd->name),
- &h_name);
- (void) GNUNET_CONTAINER_multihashmap_put (
- is->vars,
- &h_name,
- cmd,
- GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE);
- }
+ cmd->num_tries++;
+ TALER_TESTING_update_variables_ (is,
+ cmd);
cmd->run (cmd->cls,
cmd,
is);
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-exchange] branch master updated: adapt tests to do kycauth wire transfers that are now needed,
gnunet <=