aboutsummaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/Makefile.am2
-rw-r--r--src/testing/test_bank_api.c9
-rw-r--r--src/testing/test_bank_api_twisted.c6
-rw-r--r--src/testing/test_exchange_api-twisted.conf (renamed from src/testing/test_exchange_api_twisted.conf)4
-rw-r--r--src/testing/test_exchange_api_twisted.c166
-rw-r--r--src/testing/testing_api_cmd_bank_history_credit.c4
-rw-r--r--src/testing/testing_api_cmd_bank_history_debit.c4
-rw-r--r--src/testing/testing_api_cmd_batch.c6
-rw-r--r--src/testing/testing_api_cmd_batch_deposit.c10
-rw-r--r--src/testing/testing_api_cmd_batch_withdraw.c2
-rw-r--r--src/testing/testing_api_cmd_check_aml_decision.c4
-rw-r--r--src/testing/testing_api_cmd_contract_get.c10
-rw-r--r--src/testing/testing_api_cmd_deposit.c6
-rw-r--r--src/testing/testing_api_cmd_deposits_get.c5
-rw-r--r--src/testing/testing_api_cmd_exec_wget.c158
-rw-r--r--src/testing/testing_api_cmd_nexus_fetch_transactions.c187
-rw-r--r--src/testing/testing_api_cmd_oauth.c1
-rw-r--r--src/testing/testing_api_cmd_purse_create_deposit.c4
-rw-r--r--src/testing/testing_api_cmd_purse_deposit.c10
-rw-r--r--src/testing/testing_api_cmd_purse_get.c4
-rw-r--r--src/testing/testing_api_cmd_recoup.c17
-rw-r--r--src/testing/testing_api_cmd_recoup_refresh.c9
-rw-r--r--src/testing/testing_api_cmd_refresh.c40
-rw-r--r--src/testing/testing_api_cmd_refund.c13
-rw-r--r--src/testing/testing_api_cmd_revoke_denom_key.c5
-rw-r--r--src/testing/testing_api_cmd_revoke_sign_key.c7
-rw-r--r--src/testing/testing_api_cmd_set_officer.c6
-rw-r--r--src/testing/testing_api_cmd_transfer_get.c223
-rw-r--r--src/testing/testing_api_cmd_wire.c75
-rw-r--r--src/testing/testing_api_cmd_wire_add.c22
-rw-r--r--src/testing/testing_api_cmd_wire_del.c7
-rw-r--r--src/testing/testing_api_cmd_withdraw.c8
-rw-r--r--src/testing/testing_api_helpers_bank.c23
-rw-r--r--src/testing/testing_api_loop.c63
34 files changed, 768 insertions, 352 deletions
diff --git a/src/testing/Makefile.am b/src/testing/Makefile.am
index f0dcecc9e..86cb029c7 100644
--- a/src/testing/Makefile.am
+++ b/src/testing/Makefile.am
@@ -68,11 +68,13 @@ libtalertesting_la_SOURCES = \
testing_api_cmd_exec_expire.c \
testing_api_cmd_exec_router.c \
testing_api_cmd_exec_transfer.c \
+ testing_api_cmd_exec_wget.c \
testing_api_cmd_exec_wirewatch.c \
testing_api_cmd_insert_deposit.c \
testing_api_cmd_kyc_check_get.c \
testing_api_cmd_kyc_proof.c \
testing_api_cmd_kyc_wallet_get.c \
+ testing_api_cmd_nexus_fetch_transactions.c \
testing_api_cmd_oauth.c \
testing_api_cmd_offline_sign_global_fees.c \
testing_api_cmd_offline_sign_wire_fees.c \
diff --git a/src/testing/test_bank_api.c b/src/testing/test_bank_api.c
index 8cd1ca319..ed2d00353 100644
--- a/src/testing/test_bank_api.c
+++ b/src/testing/test_bank_api.c
@@ -129,6 +129,15 @@ run (void *cls,
TALER_TESTING_cmd_sleep ("Waiting 5s for 'debit-1' to settle",
5),
+ with_libeufin
+ ? TALER_TESTING_cmd_nexus_fetch_transactions (
+ "fetch-transactions-at-nexus",
+ "exchange", /* from taler-nexus-prepare */
+ "x", /* from taler-nexus-prepare */
+ "http://localhost:5001",
+ "my-bank-account") /* from taler-nexus-prepare */
+ : TALER_TESTING_cmd_sleep ("nop",
+ 0),
TALER_TESTING_cmd_bank_debits ("history-2b",
&bc.exchange_auth,
NULL,
diff --git a/src/testing/test_bank_api_twisted.c b/src/testing/test_bank_api_twisted.c
index 80629b6f9..84379ad1f 100644
--- a/src/testing/test_bank_api_twisted.c
+++ b/src/testing/test_bank_api_twisted.c
@@ -85,9 +85,9 @@ run (void *cls,
memset (&wtid,
0x5a,
sizeof (wtid));
- memcpy (&exchange_auth_twisted,
- &bc.exchange_auth,
- sizeof (struct TALER_BANK_AuthenticationData));
+ GNUNET_memcpy (&exchange_auth_twisted,
+ &bc.exchange_auth,
+ sizeof (struct TALER_BANK_AuthenticationData));
if (with_fakebank)
exchange_auth_twisted.wire_gateway_url =
"http://localhost:8888/2/";
diff --git a/src/testing/test_exchange_api_twisted.conf b/src/testing/test_exchange_api-twisted.conf
index 17f8833e7..536d36ee4 100644
--- a/src/testing/test_exchange_api_twisted.conf
+++ b/src/testing/test_exchange_api-twisted.conf
@@ -8,9 +8,6 @@
# only seeks the exchange/BASE_URL URL to connect to the exchange.
BASE_URL = "http://localhost:8888/"
-[bank]
-HTTP_PORT = 8082
-
[twister]
# HTTP listen port for twister
HTTP_PORT = 8888
@@ -30,4 +27,3 @@ ACCEPT_FROM6 = ::1;
UNIXPATH = /tmp/taler-service-twister.sock
UNIX_MATCH_UID = NO
UNIX_MATCH_GID = YES
-
diff --git a/src/testing/test_exchange_api_twisted.c b/src/testing/test_exchange_api_twisted.c
index e89df4647..388c064aa 100644
--- a/src/testing/test_exchange_api_twisted.c
+++ b/src/testing/test_exchange_api_twisted.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2014-2020 Taler Systems SA
+ Copyright (C) 2014-2023 Taler Systems SA
TALER is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as
@@ -112,8 +112,9 @@ run (void *cls,
* response from a refresh-reveal operation.
*/
struct TALER_TESTING_Command refresh_409_conflict[] = {
- CMD_TRANSFER_TO_EXCHANGE ("refresh-create-reserve",
- "EUR:5.01"),
+ CMD_TRANSFER_TO_EXCHANGE (
+ "refresh-create-reserve",
+ "EUR:5.01"),
/**
* Make previous command effective.
*/
@@ -121,34 +122,38 @@ run (void *cls,
/**
* Withdraw EUR:5.
*/
- TALER_TESTING_cmd_withdraw_amount ("refresh-withdraw-coin",
- "refresh-create-reserve",
- "EUR:5",
- 0, /* age restriction off */
- MHD_HTTP_OK),
- TALER_TESTING_cmd_deposit ("refresh-deposit-partial",
- "refresh-withdraw-coin",
- 0,
- bc.user42_payto,
- "{\"items\":[{\"name\":\"ice cream\",\
- \"value\":\"EUR:1\"}]}",
- GNUNET_TIME_UNIT_ZERO,
- "EUR:1",
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_withdraw_amount (
+ "refresh-withdraw-coin",
+ "refresh-create-reserve",
+ "EUR:5",
+ 0, /* age restriction off */
+ MHD_HTTP_OK),
+ TALER_TESTING_cmd_deposit (
+ "refresh-deposit-partial",
+ "refresh-withdraw-coin",
+ 0,
+ bc.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 ("refresh-melt",
- "refresh-withdraw-coin",
- MHD_HTTP_OK,
- NULL),
+ TALER_TESTING_cmd_melt (
+ "refresh-melt",
+ "refresh-withdraw-coin",
+ MHD_HTTP_OK,
+ NULL),
/* Trigger 409 Conflict. */
- TALER_TESTING_cmd_flip_upload ("flip-upload",
- config_file,
- "transfer_privs.0"),
- TALER_TESTING_cmd_refresh_reveal ("refresh-(flipped-)reveal",
- "refresh-melt",
- MHD_HTTP_CONFLICT),
+ TALER_TESTING_cmd_flip_upload (
+ "flip-upload",
+ config_file,
+ "transfer_privs.0"),
+ TALER_TESTING_cmd_refresh_reveal (
+ "refresh-(flipped-)reveal",
+ "refresh-melt",
+ MHD_HTTP_CONFLICT),
TALER_TESTING_cmd_end ()
};
@@ -159,23 +164,25 @@ run (void *cls,
* lib test suite.
*/
struct TALER_TESTING_Command refund[] = {
- CMD_TRANSFER_TO_EXCHANGE ("create-reserve-r1",
- "EUR:5.01"),
+ CMD_TRANSFER_TO_EXCHANGE (
+ "create-reserve-r1",
+ "EUR:5.01"),
CMD_EXEC_WIREWATCH ("wirewatch-r1"),
- TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-r1",
- "create-reserve-r1",
- "EUR:5",
- 0, /* age restriction off */
- MHD_HTTP_OK),
- TALER_TESTING_cmd_deposit ("deposit-refund-1",
- "withdraw-coin-r1",
- 0,
- bc.user42_payto,
- "{\"items\":[{\"name\":\"ice cream\","
- "\"value\":\"EUR:5\"}]}",
- GNUNET_TIME_UNIT_MINUTES,
- "EUR:5",
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_withdraw_amount (
+ "withdraw-coin-r1",
+ "create-reserve-r1",
+ "EUR:5",
+ 0, /* age restriction off */
+ MHD_HTTP_OK),
+ TALER_TESTING_cmd_deposit (
+ "deposit-refund-1",
+ "withdraw-coin-r1",
+ 0,
+ bc.user42_payto,
+ "{\"items\":[{\"name\":\"ice cream\",\"value\":\"EUR:5\"}]}",
+ GNUNET_TIME_UNIT_MINUTES,
+ "EUR:5",
+ MHD_HTTP_OK),
TALER_TESTING_cmd_refund ("refund-currency-mismatch",
MHD_HTTP_BAD_REQUEST,
"USD:5",
@@ -190,18 +197,18 @@ run (void *cls,
/* This next deposit CMD is only used to provide a
* good merchant signature to the next (failing) refund
* operations. */
- TALER_TESTING_cmd_deposit ("deposit-refund-to-fail",
- "withdraw-coin-r1",
- 0, /* coin index. */
- bc.user42_payto,
- /* This parameter will make any comparison about
- h_contract_terms fail, when /refund will be handled.
- So in other words, this is h_contract mismatch. */
- "{\"items\":[{\"name\":\"ice skate\","
- "\"value\":\"EUR:5\"}]}",
- GNUNET_TIME_UNIT_MINUTES,
- "EUR:5",
- MHD_HTTP_CONFLICT),
+ TALER_TESTING_cmd_deposit (
+ "deposit-refund-to-fail",
+ "withdraw-coin-r1",
+ 0, /* coin index. */
+ bc.user42_payto,
+ /* This parameter will make any comparison about
+ h_contract_terms fail, when /refund will be handled.
+ So in other words, this is h_contract mismatch. */
+ "{\"items\":[{\"name\":\"ice skate\",\"value\":\"EUR:5\"}]}",
+ GNUNET_TIME_UNIT_MINUTES,
+ "EUR:5",
+ MHD_HTTP_CONFLICT),
TALER_TESTING_cmd_refund ("refund-deposit-not-found",
MHD_HTTP_NOT_FOUND,
"EUR:5",
@@ -219,10 +226,11 @@ run (void *cls,
* are out of date.
*/
struct TALER_TESTING_Command expired_keys[] = {
- TALER_TESTING_cmd_modify_header_dl ("modify-expiration",
- config_file,
- MHD_HTTP_HEADER_EXPIRES,
- "Wed, 19 Jan 586524 08:01:49 GMT"),
+ TALER_TESTING_cmd_modify_header_dl (
+ "modify-expiration",
+ config_file,
+ MHD_HTTP_HEADER_EXPIRES,
+ "Wed, 19 Jan 586524 08:01:49 GMT"),
TALER_TESTING_cmd_check_keys_pull_all_keys (
"check-keys-expiration-0",
2),
@@ -232,28 +240,34 @@ run (void *cls,
CMD_TRANSFER_TO_EXCHANGE ("create-reserve-r2",
"EUR:55.01"),
CMD_EXEC_WIREWATCH ("wirewatch-r2"),
- TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-r2",
- "create-reserve-r2",
- "EUR:5",
- 0, /* age restriction off */
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_withdraw_amount (
+ "withdraw-coin-r2",
+ "create-reserve-r2",
+ "EUR:5",
+ 0, /* age restriction off */
+ MHD_HTTP_OK),
TALER_TESTING_cmd_end ()
};
#endif
struct TALER_TESTING_Command commands[] = {
- TALER_TESTING_cmd_wire_add ("add-wire-account",
- "payto://x-taler-bank/localhost/2?receiver-name=2",
- MHD_HTTP_NO_CONTENT,
- false),
- TALER_TESTING_cmd_exec_offline_sign_keys ("offline-sign-future-keys",
- config_file),
- TALER_TESTING_cmd_check_keys_pull_all_keys ("refetch /keys",
- 1),
- TALER_TESTING_cmd_batch ("refresh-reveal-409-conflict",
- refresh_409_conflict),
- TALER_TESTING_cmd_batch ("refund",
- refund),
+ TALER_TESTING_cmd_wire_add (
+ "add-wire-account",
+ "payto://x-taler-bank/localhost/2?receiver-name=2",
+ MHD_HTTP_NO_CONTENT,
+ false),
+ TALER_TESTING_cmd_exec_offline_sign_keys (
+ "offline-sign-future-keys",
+ config_file),
+ TALER_TESTING_cmd_check_keys_pull_all_keys (
+ "refetch /keys",
+ 1),
+ TALER_TESTING_cmd_batch (
+ "refresh-reveal-409-conflict",
+ refresh_409_conflict),
+ TALER_TESTING_cmd_batch (
+ "refund",
+ refund),
#if 0
TALER_TESTING_cmd_batch ("expired-keys",
expired_keys),
diff --git a/src/testing/testing_api_cmd_bank_history_credit.c b/src/testing/testing_api_cmd_bank_history_credit.c
index 9a61d6d53..119c5d86c 100644
--- a/src/testing/testing_api_cmd_bank_history_credit.c
+++ b/src/testing/testing_api_cmd_bank_history_credit.c
@@ -386,10 +386,10 @@ history_cb (void *cls,
GNUNET_break (0);
goto error;
case MHD_HTTP_OK:
- for (unsigned int i = 0; i<chr->details.success.details_length; i++)
+ for (unsigned int i = 0; i<chr->details.ok.details_length; i++)
{
const struct TALER_BANK_CreditDetails *cd =
- &chr->details.success.details[i];
+ &chr->details.ok.details[i];
/* check current element */
if (GNUNET_OK !=
diff --git a/src/testing/testing_api_cmd_bank_history_debit.c b/src/testing/testing_api_cmd_bank_history_debit.c
index 33b212ad0..fd1e81994 100644
--- a/src/testing/testing_api_cmd_bank_history_debit.c
+++ b/src/testing/testing_api_cmd_bank_history_debit.c
@@ -378,10 +378,10 @@ history_cb (void *cls,
GNUNET_break (0);
goto error;
case MHD_HTTP_OK:
- for (unsigned int i = 0; i<dhr->details.success.details_length; i++)
+ for (unsigned int i = 0; i<dhr->details.ok.details_length; i++)
{
const struct TALER_BANK_DebitDetails *dd =
- &dhr->details.success.details[i];
+ &dhr->details.ok.details[i];
/* check current element */
if (GNUNET_OK !=
diff --git a/src/testing/testing_api_cmd_batch.c b/src/testing/testing_api_cmd_batch.c
index a5263b03e..d81a77678 100644
--- a/src/testing/testing_api_cmd_batch.c
+++ b/src/testing/testing_api_cmd_batch.c
@@ -150,9 +150,9 @@ TALER_TESTING_cmd_batch (const char *label,
bs->batch = GNUNET_new_array (i + 1,
struct TALER_TESTING_Command);
- memcpy (bs->batch,
- batch,
- sizeof (struct TALER_TESTING_Command) * i);
+ GNUNET_memcpy (bs->batch,
+ batch,
+ sizeof (struct TALER_TESTING_Command) * i);
{
struct TALER_TESTING_Command cmd = {
.cls = bs,
diff --git a/src/testing/testing_api_cmd_batch_deposit.c b/src/testing/testing_api_cmd_batch_deposit.c
index 54a20cdb2..d3275875d 100644
--- a/src/testing/testing_api_cmd_batch_deposit.c
+++ b/src/testing/testing_api_cmd_batch_deposit.c
@@ -212,17 +212,17 @@ batch_deposit_cb (void *cls,
}
if (MHD_HTTP_OK == dr->hr.http_status)
{
- if (ds->num_coins != dr->details.success.num_signatures)
+ if (ds->num_coins != dr->details.ok.num_signatures)
{
GNUNET_break (0);
TALER_TESTING_interpreter_fail (ds->is);
return;
}
ds->deposit_succeeded = GNUNET_YES;
- ds->exchange_timestamp = dr->details.success.deposit_timestamp;
- ds->exchange_pub = *dr->details.success.exchange_pub;
- ds->exchange_sigs = GNUNET_memdup (dr->details.success.exchange_sigs,
- dr->details.success.num_signatures
+ ds->exchange_timestamp = dr->details.ok.deposit_timestamp;
+ ds->exchange_pub = *dr->details.ok.exchange_pub;
+ ds->exchange_sigs = GNUNET_memdup (dr->details.ok.exchange_sigs,
+ dr->details.ok.num_signatures
* sizeof (struct
TALER_ExchangeSignatureP));
}
diff --git a/src/testing/testing_api_cmd_batch_withdraw.c b/src/testing/testing_api_cmd_batch_withdraw.c
index a5229ae9c..2aa549c0f 100644
--- a/src/testing/testing_api_cmd_batch_withdraw.c
+++ b/src/testing/testing_api_cmd_batch_withdraw.c
@@ -210,7 +210,7 @@ reserve_batch_withdraw_cb (void *cls,
{
struct CoinState *cs = &ws->coins[i];
const struct TALER_EXCHANGE_PrivateCoinDetails *pcd
- = &wr->details.success.coins[i];
+ = &wr->details.ok.coins[i];
TALER_denom_sig_deep_copy (&cs->sig,
&pcd->sig);
diff --git a/src/testing/testing_api_cmd_check_aml_decision.c b/src/testing/testing_api_cmd_check_aml_decision.c
index d77e9b6b9..dd317142b 100644
--- a/src/testing/testing_api_cmd_check_aml_decision.c
+++ b/src/testing/testing_api_cmd_check_aml_decision.c
@@ -116,10 +116,10 @@ check_aml_decision_cb (void *cls,
GNUNET_assert (GNUNET_OK ==
TALER_TESTING_get_trait_amount (ref,
&amount));
- for (unsigned int i = 0; i<adr->details.success.aml_history_length; i++)
+ for (unsigned int i = 0; i<adr->details.ok.aml_history_length; i++)
{
const struct TALER_EXCHANGE_AmlDecisionDetail *aml_history
- = &adr->details.success.aml_history[i];
+ = &adr->details.ok.aml_history[i];
if ( (NULL == oldest) ||
(0 !=
diff --git a/src/testing/testing_api_cmd_contract_get.c b/src/testing/testing_api_cmd_contract_get.c
index 428bf7e8c..d599cb595 100644
--- a/src/testing/testing_api_cmd_contract_get.c
+++ b/src/testing/testing_api_cmd_contract_get.c
@@ -121,7 +121,7 @@ get_cb (void *cls,
const struct TALER_PurseMergePrivateKeyP *mp;
const json_t *ct;
- ds->purse_pub = dr->details.success.purse_pub;
+ ds->purse_pub = dr->details.ok.purse_pub;
if (ds->merge)
{
if (GNUNET_OK !=
@@ -136,8 +136,8 @@ get_cb (void *cls,
TALER_CRYPTO_contract_decrypt_for_merge (
&ds->contract_priv,
&ds->purse_pub,
- dr->details.success.econtract,
- dr->details.success.econtract_size,
+ dr->details.ok.econtract,
+ dr->details.ok.econtract_size,
&ds->merge_priv);
if (0 !=
GNUNET_memcmp (mp,
@@ -153,8 +153,8 @@ get_cb (void *cls,
ds->contract_terms =
TALER_CRYPTO_contract_decrypt_for_deposit (
&ds->contract_priv,
- dr->details.success.econtract,
- dr->details.success.econtract_size);
+ dr->details.ok.econtract,
+ dr->details.ok.econtract_size);
}
if (NULL == ds->contract_terms)
{
diff --git a/src/testing/testing_api_cmd_deposit.c b/src/testing/testing_api_cmd_deposit.c
index 16ac139f4..1b097a346 100644
--- a/src/testing/testing_api_cmd_deposit.c
+++ b/src/testing/testing_api_cmd_deposit.c
@@ -264,9 +264,9 @@ deposit_cb (void *cls,
if (MHD_HTTP_OK == dr->hr.http_status)
{
ds->deposit_succeeded = GNUNET_YES;
- ds->exchange_timestamp = dr->details.success.deposit_timestamp;
- ds->exchange_pub = *dr->details.success.exchange_pub;
- ds->exchange_sig = *dr->details.success.exchange_sig;
+ ds->exchange_timestamp = dr->details.ok.deposit_timestamp;
+ ds->exchange_pub = *dr->details.ok.exchange_pub;
+ ds->exchange_sig = *dr->details.ok.exchange_sig;
}
TALER_TESTING_interpreter_next (ds->is);
}
diff --git a/src/testing/testing_api_cmd_deposits_get.c b/src/testing/testing_api_cmd_deposits_get.c
index 8fd4e813c..c39d7f6c1 100644
--- a/src/testing/testing_api_cmd_deposits_get.c
+++ b/src/testing/testing_api_cmd_deposits_get.c
@@ -128,7 +128,7 @@ deposit_wtid_cb (void *cls,
switch (dr->hr.http_status)
{
case MHD_HTTP_OK:
- tts->wtid = dr->details.success.wtid;
+ tts->wtid = dr->details.ok.wtid;
if (NULL != tts->bank_transfer_reference)
{
const struct TALER_TESTING_Command *bank_transfer_cmd;
@@ -155,7 +155,7 @@ deposit_wtid_cb (void *cls,
}
/* Compare that expected and gotten subjects match. */
- if (0 != GNUNET_memcmp (&dr->details.success.wtid,
+ if (0 != GNUNET_memcmp (&dr->details.ok.wtid,
wtid_want))
{
GNUNET_break (0);
@@ -281,6 +281,7 @@ track_transaction_run (void *cls,
&h_wire_details,
&h_contract_terms,
&coin_pub,
+ GNUNET_TIME_UNIT_ZERO,
&deposit_wtid_cb,
tts);
GNUNET_assert (NULL != tts->tth);
diff --git a/src/testing/testing_api_cmd_exec_wget.c b/src/testing/testing_api_cmd_exec_wget.c
new file mode 100644
index 000000000..67aceca0a
--- /dev/null
+++ b/src/testing/testing_api_cmd_exec_wget.c
@@ -0,0 +1,158 @@
+/*
+ This file is part of TALER
+ Copyright (C) 2023 Taler Systems SA
+
+ TALER is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 3,
+ or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with TALER; see the file COPYING. If not, see
+ <http://www.gnu.org/licenses/>
+*/
+/**
+ * @file testing/testing_api_cmd_exec_wget.c
+ * @brief run a wget command
+ * @author Christian Grothoff
+ */
+#include "platform.h"
+#include "taler_json_lib.h"
+#include <gnunet/gnunet_curl_lib.h>
+#include "taler_signatures.h"
+#include "taler_testing_lib.h"
+
+
+/**
+ * State for a "wget" CMD.
+ */
+struct WgetState
+{
+ /**
+ * Process for the wgeter.
+ */
+ struct GNUNET_OS_Process *wget_proc;
+
+ /**
+ * URL to used by the wget.
+ */
+ const char *url;
+};
+
+
+/**
+ * Run the command; use the `wget' program.
+ *
+ * @param cls closure.
+ * @param cmd command currently being executed.
+ * @param is interpreter state.
+ */
+static void
+wget_run (void *cls,
+ const struct TALER_TESTING_Command *cmd,
+ struct TALER_TESTING_Interpreter *is)
+{
+ struct WgetState *ws = cls;
+
+ (void) cmd;
+ ws->wget_proc
+ = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_ALL,
+ NULL, NULL, NULL,
+ "wget",
+ "wget",
+ ws->url,
+ NULL);
+ if (NULL == ws->wget_proc)
+ {
+ GNUNET_break (0);
+ TALER_TESTING_interpreter_fail (is);
+ return;
+ }
+ TALER_TESTING_wait_for_sigchld (is);
+}
+
+
+/**
+ * Free the state of a "wget" CMD, and possibly
+ * kills its process if it did not terminate regularly.
+ *
+ * @param cls closure.
+ * @param cmd the command being freed.
+ */
+static void
+wget_cleanup (void *cls,
+ const struct TALER_TESTING_Command *cmd)
+{
+ struct WgetState *ws = cls;
+
+ (void) cmd;
+ if (NULL != ws->wget_proc)
+ {
+ GNUNET_break (0 ==
+ GNUNET_OS_process_kill (ws->wget_proc,
+ SIGKILL));
+ GNUNET_OS_process_wait (ws->wget_proc);
+ GNUNET_OS_process_destroy (ws->wget_proc);
+ ws->wget_proc = NULL;
+ }
+ GNUNET_free (ws);
+}
+
+
+/**
+ * Offer "wget" CMD internal data to other commands.
+ *
+ * @param cls closure.
+ * @param[out] ret result.
+ * @param trait name of the trait.
+ * @param index index number of the object to offer.
+ * @return #GNUNET_OK on success.
+ */
+static enum GNUNET_GenericReturnValue
+wget_traits (void *cls,
+ const void **ret,
+ const char *trait,
+ unsigned int index)
+{
+ struct WgetState *ws = cls;
+ struct TALER_TESTING_Trait traits[] = {
+ TALER_TESTING_make_trait_process (&ws->wget_proc),
+ TALER_TESTING_trait_end ()
+ };
+
+ return TALER_TESTING_get_trait (traits,
+ ret,
+ trait,
+ index);
+}
+
+
+struct TALER_TESTING_Command
+TALER_TESTING_cmd_exec_wget (const char *label,
+ const char *url)
+{
+ struct WgetState *ws;
+
+ ws = GNUNET_new (struct WgetState);
+ ws->url = url;
+
+ {
+ struct TALER_TESTING_Command cmd = {
+ .cls = ws,
+ .label = label,
+ .run = &wget_run,
+ .cleanup = &wget_cleanup,
+ .traits = &wget_traits
+ };
+
+ return cmd;
+ }
+}
+
+
+/* end of testing_api_cmd_exec_wget.c */
diff --git a/src/testing/testing_api_cmd_nexus_fetch_transactions.c b/src/testing/testing_api_cmd_nexus_fetch_transactions.c
new file mode 100644
index 000000000..ff1497f3f
--- /dev/null
+++ b/src/testing/testing_api_cmd_nexus_fetch_transactions.c
@@ -0,0 +1,187 @@
+/*
+ This file is part of TALER
+ Copyright (C) 2023 Taler Systems SA
+
+ TALER is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 3,
+ or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with TALER; see the file COPYING. If not, see
+ <http://www.gnu.org/licenses/>
+*/
+/**
+ * @file testing/testing_api_cmd_nexus_fetch_transactions.c
+ * @brief run a nft command
+ * @author Christian Grothoff
+ */
+#include "platform.h"
+#include "taler_json_lib.h"
+#include <gnunet/gnunet_curl_lib.h>
+#include "taler_signatures.h"
+#include "taler_testing_lib.h"
+
+
+/**
+ * State for a "nft" CMD.
+ */
+struct NftState
+{
+ /**
+ * Process for the nfter.
+ */
+ struct GNUNET_OS_Process *nft_proc;
+
+ const char *username;
+ const char *password;
+ const char *bank_base_url;
+ const char *account_id;
+};
+
+
+/**
+ * Run the command; use the `nft' program.
+ *
+ * @param cls closure.
+ * @param cmd command currently being executed.
+ * @param is interpreter state.
+ */
+static void
+nft_run (void *cls,
+ const struct TALER_TESTING_Command *cmd,
+ struct TALER_TESTING_Interpreter *is)
+{
+ struct NftState *ws = cls;
+ char *url;
+ char *user;
+ char *pass;
+
+ (void) cmd;
+ GNUNET_asprintf (&url,
+ "%s/bank-accounts/%s/fetch-transactions",
+ ws->bank_base_url,
+ ws->account_id);
+ GNUNET_asprintf (&user,
+ "--user=%s",
+ ws->username);
+ GNUNET_asprintf (&pass,
+ "--password=%s",
+ ws->password);
+ ws->nft_proc
+ = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_ALL,
+ NULL, NULL, NULL,
+ "wget",
+ "wget",
+ "--header=Content-Type:application/json",
+ "--auth-no-challenge",
+ "--output-file=/dev/null",
+ "--post-data={\"level\":\"all\",\"rangeType\":\"latest\"}",
+ user,
+ pass,
+ url,
+ NULL);
+ GNUNET_free (url);
+ GNUNET_free (user);
+ GNUNET_free (pass);
+ if (NULL == ws->nft_proc)
+ {
+ GNUNET_break (0);
+ TALER_TESTING_interpreter_fail (is);
+ return;
+ }
+ TALER_TESTING_wait_for_sigchld (is);
+}
+
+
+/**
+ * Free the state of a "nft" CMD, and possibly
+ * kills its process if it did not terminate regularly.
+ *
+ * @param cls closure.
+ * @param cmd the command being freed.
+ */
+static void
+nft_cleanup (void *cls,
+ const struct TALER_TESTING_Command *cmd)
+{
+ struct NftState *ws = cls;
+
+ (void) cmd;
+ if (NULL != ws->nft_proc)
+ {
+ GNUNET_break (0 ==
+ GNUNET_OS_process_kill (ws->nft_proc,
+ SIGKILL));
+ GNUNET_OS_process_wait (ws->nft_proc);
+ GNUNET_OS_process_destroy (ws->nft_proc);
+ ws->nft_proc = NULL;
+ }
+ GNUNET_free (ws);
+}
+
+
+/**
+ * Offer "nft" CMD internal data to other commands.
+ *
+ * @param cls closure.
+ * @param[out] ret result.
+ * @param trait name of the trait.
+ * @param index index number of the object to offer.
+ * @return #GNUNET_OK on success.
+ */
+static enum GNUNET_GenericReturnValue
+nft_traits (void *cls,
+ const void **ret,
+ const char *trait,
+ unsigned int index)
+{
+ struct NftState *ws = cls;
+ struct TALER_TESTING_Trait traits[] = {
+ TALER_TESTING_make_trait_process (&ws->nft_proc),
+ TALER_TESTING_trait_end ()
+ };
+
+ return TALER_TESTING_get_trait (traits,
+ ret,
+ trait,
+ index);
+}
+
+
+struct TALER_TESTING_Command
+TALER_TESTING_cmd_nexus_fetch_transactions (
+ const char *label,
+ const char *username,
+ const char *password,
+ const char *bank_base_url,
+ const char *account_id)
+{
+ struct NftState *ws;
+
+ ws = GNUNET_new (struct NftState);
+ ws->username = username;
+ ws->password = password;
+ ws->bank_base_url = bank_base_url;
+ ws->account_id = account_id;
+
+ {
+ struct TALER_TESTING_Command cmd = {
+ .cls = ws,
+ .label = label,
+ .run = &nft_run,
+ .cleanup = &nft_cleanup,
+ .traits = &nft_traits
+ };
+
+ return cmd;
+ }
+}
+
+
+/* end of testing_api_cmd_nexus_fetch_transactions.c */
diff --git a/src/testing/testing_api_cmd_oauth.c b/src/testing/testing_api_cmd_oauth.c
index 514b4ac8c..0bcf2f680 100644
--- a/src/testing/testing_api_cmd_oauth.c
+++ b/src/testing/testing_api_cmd_oauth.c
@@ -310,6 +310,7 @@ cleanup (void *cls,
(void) toe;
if (NULL == rc)
return;
+ MHD_destroy_post_processor (rc->pp);
GNUNET_free (rc->code);
GNUNET_free (rc->client_id);
GNUNET_free (rc->redirect_uri);
diff --git a/src/testing/testing_api_cmd_purse_create_deposit.c b/src/testing/testing_api_cmd_purse_create_deposit.c
index 200127b77..6fa7d91f9 100644
--- a/src/testing/testing_api_cmd_purse_create_deposit.c
+++ b/src/testing/testing_api_cmd_purse_create_deposit.c
@@ -176,8 +176,8 @@ deposit_cb (void *cls,
}
if (MHD_HTTP_OK == dr->hr.http_status)
{
- ds->exchange_pub = dr->details.success.exchange_pub;
- ds->exchange_sig = dr->details.success.exchange_sig;
+ ds->exchange_pub = dr->details.ok.exchange_pub;
+ ds->exchange_sig = dr->details.ok.exchange_sig;
}
TALER_TESTING_interpreter_next (ds->is);
}
diff --git a/src/testing/testing_api_cmd_purse_deposit.c b/src/testing/testing_api_cmd_purse_deposit.c
index ff8e6d2e3..aaf6ff6ba 100644
--- a/src/testing/testing_api_cmd_purse_deposit.c
+++ b/src/testing/testing_api_cmd_purse_deposit.c
@@ -152,8 +152,8 @@ deposit_cb (void *cls,
if (MHD_HTTP_OK == dr->hr.http_status)
{
if (-1 !=
- TALER_amount_cmp (&dr->details.success.total_deposited,
- &dr->details.success.purse_value_after_fees))
+ TALER_amount_cmp (&dr->details.ok.total_deposited,
+ &dr->details.ok.purse_value_after_fees))
{
const struct TALER_TESTING_Command *purse_cmd;
const struct TALER_ReserveSignatureP *reserve_sig;
@@ -213,7 +213,7 @@ deposit_cb (void *cls,
/* Note: change when flags below changes! */
ds->reserve_history.amount
- = dr->details.success.purse_value_after_fees;
+ = dr->details.ok.purse_value_after_fees;
if (true)
{
ds->reserve_history.details.merge_details.purse_fee = gf->fees.purse;
@@ -226,7 +226,7 @@ deposit_cb (void *cls,
}
}
ds->reserve_history.details.merge_details.h_contract_terms
- = dr->details.success.h_contract_terms;
+ = dr->details.ok.h_contract_terms;
ds->reserve_history.details.merge_details.merge_pub
= *merge_pub;
ds->reserve_history.details.merge_details.purse_pub
@@ -236,7 +236,7 @@ deposit_cb (void *cls,
ds->reserve_history.details.merge_details.merge_timestamp
= *merge_timestamp;
ds->reserve_history.details.merge_details.purse_expiration
- = dr->details.success.purse_expiration;
+ = dr->details.ok.purse_expiration;
ds->reserve_history.details.merge_details.min_age
= ds->min_age;
ds->reserve_history.details.merge_details.flags
diff --git a/src/testing/testing_api_cmd_purse_get.c b/src/testing/testing_api_cmd_purse_get.c
index 3e7da38f0..60638752f 100644
--- a/src/testing/testing_api_cmd_purse_get.c
+++ b/src/testing/testing_api_cmd_purse_get.c
@@ -147,11 +147,11 @@ purse_status_cb (void *cls,
TALER_string_to_amount (ss->expected_balance,
&eb));
if (0 != TALER_amount_cmp (&eb,
- &rs->details.success.balance))
+ &rs->details.ok.balance))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Unexpected amount in purse: %s\n",
- TALER_amount_to_string (&rs->details.success.balance));
+ TALER_amount_to_string (&rs->details.ok.balance));
TALER_TESTING_interpreter_fail (ss->is);
return;
}
diff --git a/src/testing/testing_api_cmd_recoup.c b/src/testing/testing_api_cmd_recoup.c
index ed8c7eed7..e11475f20 100644
--- a/src/testing/testing_api_cmd_recoup.c
+++ b/src/testing/testing_api_cmd_recoup.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2014-2018 Taler Systems SA
+ Copyright (C) 2014-2023 Taler Systems SA
TALER is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as
@@ -73,15 +73,14 @@ struct RecoupState
* was paid back belonged to the right reserve.
*
* @param cls closure
- * @param hr HTTP response details
- * @param reserve_pub public key of the reserve receiving the recoup
+ * @param rr response details
*/
static void
recoup_cb (void *cls,
- const struct TALER_EXCHANGE_HttpResponse *hr,
- const struct TALER_ReservePublicKeyP *reserve_pub)
+ const struct TALER_EXCHANGE_RecoupResponse *rr)
{
struct RecoupState *ps = cls;
+ const struct TALER_EXCHANGE_HttpResponse *hr = &rr->hr;
struct TALER_TESTING_Interpreter *is = ps->is;
struct TALER_TESTING_Command *cmd = &is->commands[is->ip];
const struct TALER_TESTING_Command *reserve_cmd;
@@ -135,12 +134,6 @@ recoup_cb (void *cls,
{
const struct TALER_ReservePrivateKeyP *reserve_priv;
- if (NULL == reserve_pub)
- {
- GNUNET_break (0);
- TALER_TESTING_interpreter_fail (is);
- return;
- }
if (GNUNET_OK !=
TALER_TESTING_get_trait_reserve_priv (reserve_cmd,
&reserve_priv))
@@ -151,7 +144,7 @@ recoup_cb (void *cls,
}
GNUNET_CRYPTO_eddsa_key_get_public (&reserve_priv->eddsa_priv,
&ps->reserve_pub.eddsa_pub);
- if (0 != GNUNET_memcmp (reserve_pub,
+ if (0 != GNUNET_memcmp (&rr->details.ok.reserve_pub,
&ps->reserve_pub))
{
GNUNET_break (0);
diff --git a/src/testing/testing_api_cmd_recoup_refresh.c b/src/testing/testing_api_cmd_recoup_refresh.c
index 6081a4ba1..ff7dab004 100644
--- a/src/testing/testing_api_cmd_recoup_refresh.c
+++ b/src/testing/testing_api_cmd_recoup_refresh.c
@@ -73,15 +73,14 @@ struct RecoupRefreshState
* was paid back belonged to the right old coin.
*
* @param cls closure
- * @param hr HTTP response details
- * @param old_coin_pub public key of the dirty coin
+ * @param rrr response details
*/
static void
recoup_refresh_cb (void *cls,
- const struct TALER_EXCHANGE_HttpResponse *hr,
- const struct TALER_CoinSpendPublicKeyP *old_coin_pub)
+ const struct TALER_EXCHANGE_RecoupRefreshResponse *rrr)
{
struct RecoupRefreshState *rrs = cls;
+ const struct TALER_EXCHANGE_HttpResponse *hr = &rrr->hr;
struct TALER_TESTING_Interpreter *is = rrs->is;
struct TALER_TESTING_Command *cmd = &is->commands[is->ip];
char *cref;
@@ -150,7 +149,7 @@ recoup_refresh_cb (void *cls,
GNUNET_CRYPTO_eddsa_key_get_public (&dirty_priv->eddsa_priv,
&oc.eddsa_pub);
if (0 != GNUNET_memcmp (&oc,
- old_coin_pub))
+ &rrr->details.ok.old_coin_pub))
{
GNUNET_break (0);
TALER_TESTING_interpreter_fail (is);
diff --git a/src/testing/testing_api_cmd_refresh.c b/src/testing/testing_api_cmd_refresh.c
index 2aad77ce3..9c2bd8d5e 100644
--- a/src/testing/testing_api_cmd_refresh.c
+++ b/src/testing/testing_api_cmd_refresh.c
@@ -411,7 +411,7 @@ reveal_cb (void *cls,
switch (hr->http_status)
{
case MHD_HTTP_OK:
- rrs->num_fresh_coins = rr->details.success.num_coins;
+ rrs->num_fresh_coins = rr->details.ok.num_coins;
rrs->psa = GNUNET_new_array (rrs->num_fresh_coins,
struct TALER_PlanchetMasterSecretP);
rrs->fresh_coins = GNUNET_new_array (rrs->num_fresh_coins,
@@ -419,7 +419,7 @@ reveal_cb (void *cls,
for (unsigned int i = 0; i<rrs->num_fresh_coins; i++)
{
const struct TALER_EXCHANGE_RevealedCoinInfo *coin
- = &rr->details.success.coins[i];
+ = &rr->details.ok.coins[i];
struct TALER_TESTING_FreshCoinData *fc = &rrs->fresh_coins[i];
rrs->psa[i] = coin->ps;
@@ -675,11 +675,11 @@ link_cb (void *cls,
TALER_TESTING_interpreter_fail (rls->is);
return;
}
- if (lr->details.success.num_coins != *num_fresh_coins)
+ if (lr->details.ok.num_coins != *num_fresh_coins)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Unexpected number of fresh coins: %d vs %d in %s:%u\n",
- lr->details.success.num_coins,
+ lr->details.ok.num_coins,
*num_fresh_coins,
__FILE__,
__LINE__);
@@ -687,11 +687,11 @@ link_cb (void *cls,
return;
}
/* check that the coins match */
- for (unsigned int i = 0; i<lr->details.success.num_coins; i++)
- for (unsigned int j = i + 1; j<lr->details.success.num_coins; j++)
+ for (unsigned int i = 0; i<lr->details.ok.num_coins; i++)
+ for (unsigned int j = i + 1; j<lr->details.ok.num_coins; j++)
if (0 ==
- GNUNET_memcmp (&lr->details.success.coins[i].coin_priv,
- &lr->details.success.coins[j].coin_priv))
+ GNUNET_memcmp (&lr->details.ok.coins[i].coin_priv,
+ &lr->details.ok.coins[j].coin_priv))
GNUNET_break (0);
/* Note: coins might be legitimately permutated in here... */
found = 0;
@@ -709,12 +709,12 @@ link_cb (void *cls,
return;
}
- for (unsigned int i = 0; i<lr->details.success.num_coins; i++)
+ for (unsigned int i = 0; i<lr->details.ok.num_coins; i++)
{
const struct TALER_EXCHANGE_LinkedCoinInfo *lci_i
- = &lr->details.success.coins[i];
+ = &lr->details.ok.coins[i];
- for (unsigned int j = 0; j<lr->details.success.num_coins; j++)
+ for (unsigned int j = 0; j<lr->details.ok.num_coins; j++)
{
const struct TALER_TESTING_FreshCoinData *fcj
= &(*fc)[j];
@@ -735,12 +735,12 @@ link_cb (void *cls,
} /* for j*/
} /* for i */
}
- if (found != lr->details.success.num_coins)
+ if (found != lr->details.ok.num_coins)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Only %u/%u coins match expectations\n",
found,
- lr->details.success.num_coins);
+ lr->details.ok.num_coins);
GNUNET_break (0);
TALER_TESTING_interpreter_fail (rls->is);
return;
@@ -952,16 +952,16 @@ melt_cb (void *cls,
}
if (MHD_HTTP_OK == hr->http_status)
{
- rms->noreveal_index = mr->details.success.noreveal_index;
- if (mr->details.success.num_mbds != rms->num_fresh_coins)
+ rms->noreveal_index = mr->details.ok.noreveal_index;
+ if (mr->details.ok.num_mbds != rms->num_fresh_coins)
{
GNUNET_break (0);
TALER_TESTING_interpreter_fail (rms->is);
return;
}
GNUNET_free (rms->mbds);
- rms->mbds = GNUNET_memdup (mr->details.success.mbds,
- mr->details.success.num_mbds
+ rms->mbds = GNUNET_memdup (mr->details.ok.mbds,
+ mr->details.ok.num_mbds
* sizeof (struct
TALER_EXCHANGE_MeltBlindingDetail));
}
@@ -1239,9 +1239,11 @@ melt_traits (void *cls,
TALER_TESTING_make_trait_h_age_commitment (
index,
rms->refresh_data.melt_h_age_commitment),
- TALER_TESTING_make_trait_exchange_wd_value (index,
- &rms->mbds[index].alg_value),
TALER_TESTING_make_trait_refresh_secret (&rms->rms),
+ (NULL != rms->mbds)
+ ? TALER_TESTING_make_trait_exchange_wd_value (index,
+ &rms->mbds[index].alg_value)
+ : TALER_TESTING_trait_end (),
TALER_TESTING_trait_end ()
};
diff --git a/src/testing/testing_api_cmd_refund.c b/src/testing/testing_api_cmd_refund.c
index 4be3605a4..d41700d1a 100644
--- a/src/testing/testing_api_cmd_refund.c
+++ b/src/testing/testing_api_cmd_refund.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2014-2020 Taler Systems SA
+ Copyright (C) 2014-2023 Taler Systems SA
TALER is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as
@@ -75,19 +75,14 @@ struct RefundState
* response code is acceptable.
*
* @param cls closure
- * @param hr HTTP response details
- * @param exchange_pub public key the exchange
- * used for signing @a obj.
- * @param exchange_sig actual signature confirming the refund
+ * @param rr response details
*/
static void
refund_cb (void *cls,
- const struct TALER_EXCHANGE_HttpResponse *hr,
- const struct TALER_ExchangePublicKeyP *exchange_pub,
- const struct TALER_ExchangeSignatureP *exchange_sig)
+ const struct TALER_EXCHANGE_RefundResponse *rr)
{
-
struct RefundState *rs = cls;
+ const struct TALER_EXCHANGE_HttpResponse *hr = &rr->hr;
struct TALER_TESTING_Command *refund_cmd;
refund_cmd = &rs->is->commands[rs->is->ip];
diff --git a/src/testing/testing_api_cmd_revoke_denom_key.c b/src/testing/testing_api_cmd_revoke_denom_key.c
index 7c77c3566..8afd4f203 100644
--- a/src/testing/testing_api_cmd_revoke_denom_key.c
+++ b/src/testing/testing_api_cmd_revoke_denom_key.c
@@ -65,14 +65,15 @@ struct RevokeState
* Function called with information about the post revocation operation result.
*
* @param cls closure with a `struct RevokeState *`
- * @param hr HTTP response data
+ * @param rdr response data
*/
static void
success_cb (
void *cls,
- const struct TALER_EXCHANGE_HttpResponse *hr)
+ const struct TALER_EXCHANGE_ManagementRevokeDenominationResponse *rdr)
{
struct RevokeState *rs = cls;
+ const struct TALER_EXCHANGE_HttpResponse *hr = &rdr->hr;
rs->kh = NULL;
if (rs->expected_response_code != hr->http_status)
diff --git a/src/testing/testing_api_cmd_revoke_sign_key.c b/src/testing/testing_api_cmd_revoke_sign_key.c
index 9745d728d..3b869312a 100644
--- a/src/testing/testing_api_cmd_revoke_sign_key.c
+++ b/src/testing/testing_api_cmd_revoke_sign_key.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2014-2020 Taler Systems SA
+ Copyright (C) 2014-2023 Taler Systems SA
TALER is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as
@@ -65,14 +65,15 @@ struct RevokeState
* Function called with information about the post revocation operation result.
*
* @param cls closure with a `struct RevokeState *`
- * @param hr HTTP response data
+ * @param rsr response data
*/
static void
success_cb (
void *cls,
- const struct TALER_EXCHANGE_HttpResponse *hr)
+ const struct TALER_EXCHANGE_ManagementRevokeSigningKeyResponse *rsr)
{
struct RevokeState *rs = cls;
+ const struct TALER_EXCHANGE_HttpResponse *hr = &rsr->hr;
rs->kh = NULL;
if (rs->expected_response_code != hr->http_status)
diff --git a/src/testing/testing_api_cmd_set_officer.c b/src/testing/testing_api_cmd_set_officer.c
index 0e6de262f..1c0495f32 100644
--- a/src/testing/testing_api_cmd_set_officer.c
+++ b/src/testing/testing_api_cmd_set_officer.c
@@ -84,13 +84,15 @@ struct SetOfficerState
* if the response code is acceptable.
*
* @param cls closure.
- * @param hr HTTP response details
+ * @param ar response details
*/
static void
set_officer_cb (void *cls,
- const struct TALER_EXCHANGE_HttpResponse *hr)
+ const struct
+ TALER_EXCHANGE_ManagementUpdateAmlOfficerResponse *ar)
{
struct SetOfficerState *ds = cls;
+ const struct TALER_EXCHANGE_HttpResponse *hr = &ar->hr;
ds->dh = NULL;
if (MHD_HTTP_NO_CONTENT != hr->http_status)
diff --git a/src/testing/testing_api_cmd_transfer_get.c b/src/testing/testing_api_cmd_transfer_get.c
index 3c467e6da..cb6bb7dfa 100644
--- a/src/testing/testing_api_cmd_transfer_get.c
+++ b/src/testing/testing_api_cmd_transfer_get.c
@@ -115,15 +115,14 @@ track_transfer_cleanup (void *cls,
* wire fees and hashed wire details as well.
*
* @param cls closure.
- * @param hr HTTP response details
- * @param ta transfer data returned by the exchange
+ * @param tgr response details
*/
static void
track_transfer_cb (void *cls,
- const struct TALER_EXCHANGE_HttpResponse *hr,
- const struct TALER_EXCHANGE_TransferData *ta)
+ const struct TALER_EXCHANGE_TransfersGetResponse *tgr)
{
struct TrackTransferState *tts = cls;
+ const struct TALER_EXCHANGE_HttpResponse *hr = &tgr->hr;
struct TALER_TESTING_Interpreter *is = tts->is;
struct TALER_TESTING_Command *cmd = &is->commands[is->ip];
struct TALER_Amount expected_amount;
@@ -148,138 +147,62 @@ track_transfer_cb (void *cls,
switch (hr->http_status)
{
case MHD_HTTP_OK:
- if (NULL == tts->expected_total_amount)
{
- GNUNET_break (0);
- TALER_TESTING_interpreter_fail (is);
- return;
- }
- if (NULL == tts->expected_wire_fee)
- {
- GNUNET_break (0);
- TALER_TESTING_interpreter_fail (is);
- return;
- }
-
- if (GNUNET_OK !=
- TALER_string_to_amount (tts->expected_total_amount,
- &expected_amount))
- {
- GNUNET_break (0);
- TALER_TESTING_interpreter_fail (is);
- return;
- }
- if (0 != TALER_amount_cmp (&ta->total_amount,
- &expected_amount))
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Total amount mismatch to command %s - "
- "%s vs %s\n",
- cmd->label,
- TALER_amount_to_string (&ta->total_amount),
- TALER_amount_to_string (&expected_amount));
- json_dumpf (hr->reply,
- stderr,
- 0);
- fprintf (stderr, "\n");
- TALER_TESTING_interpreter_fail (is);
- return;
- }
-
- if (GNUNET_OK !=
- TALER_string_to_amount (tts->expected_wire_fee,
- &expected_amount))
- {
- GNUNET_break (0);
- TALER_TESTING_interpreter_fail (is);
- return;
- }
-
- if (0 != TALER_amount_cmp (&ta->wire_fee,
- &expected_amount))
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Wire fee mismatch to command %s\n",
- cmd->label);
- json_dumpf (hr->reply,
- stderr,
- 0);
- TALER_TESTING_interpreter_fail (is);
- return;
- }
+ const struct TALER_EXCHANGE_TransferData *ta
+ = &tgr->details.ok.td;
- /**
- * Optionally checking: (1) wire-details for this transfer
- * match the ones from a referenced "deposit" operation -
- * or any operation that could provide wire-details. (2)
- * Total amount for this transfer matches the one from any
- * referenced command that could provide one.
- */
- if (NULL != tts->wire_details_reference)
- {
- const struct TALER_TESTING_Command *wire_details_cmd;
- const char **payto_uri;
- struct TALER_PaytoHashP h_payto;
-
- wire_details_cmd
- = TALER_TESTING_interpreter_lookup_command (is,
- tts->wire_details_reference);
- if (NULL == wire_details_cmd)
+ if (NULL == tts->expected_total_amount)
{
GNUNET_break (0);
TALER_TESTING_interpreter_fail (is);
return;
}
+ if (NULL == tts->expected_wire_fee)
+ {
+ GNUNET_break (0);
+ TALER_TESTING_interpreter_fail (is);
+ return;
+ }
+
if (GNUNET_OK !=
- TALER_TESTING_get_trait_payto_uri (wire_details_cmd,
- &payto_uri))
+ TALER_string_to_amount (tts->expected_total_amount,
+ &expected_amount))
{
GNUNET_break (0);
TALER_TESTING_interpreter_fail (is);
return;
}
- TALER_payto_hash (*payto_uri,
- &h_payto);
- if (0 != GNUNET_memcmp (&h_payto,
- &ta->h_payto))
+ if (0 != TALER_amount_cmp (&ta->total_amount,
+ &expected_amount))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Wire hash missmath to command %s\n",
- cmd->label);
+ "Total amount mismatch to command %s - "
+ "%s vs %s\n",
+ cmd->label,
+ TALER_amount_to_string (&ta->total_amount),
+ TALER_amount_to_string (&expected_amount));
json_dumpf (hr->reply,
stderr,
0);
+ fprintf (stderr, "\n");
TALER_TESTING_interpreter_fail (is);
return;
}
- }
- if (NULL != tts->total_amount_reference)
- {
- const struct TALER_TESTING_Command *total_amount_cmd;
- const struct TALER_Amount *total_amount_from_reference;
- total_amount_cmd
- = TALER_TESTING_interpreter_lookup_command (is,
- tts->total_amount_reference);
- if (NULL == total_amount_cmd)
- {
- GNUNET_break (0);
- TALER_TESTING_interpreter_fail (is);
- return;
- }
if (GNUNET_OK !=
- TALER_TESTING_get_trait_amount (total_amount_cmd,
- &total_amount_from_reference))
+ TALER_string_to_amount (tts->expected_wire_fee,
+ &expected_amount))
{
GNUNET_break (0);
TALER_TESTING_interpreter_fail (is);
return;
}
- if (0 != TALER_amount_cmp (&ta->total_amount,
- total_amount_from_reference))
+
+ if (0 != TALER_amount_cmp (&ta->wire_fee,
+ &expected_amount))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Amount missmath to command %s\n",
+ "Wire fee mismatch to command %s\n",
cmd->label);
json_dumpf (hr->reply,
stderr,
@@ -287,8 +210,92 @@ track_transfer_cb (void *cls,
TALER_TESTING_interpreter_fail (is);
return;
}
- }
- }
+
+ /**
+ * Optionally checking: (1) wire-details for this transfer
+ * match the ones from a referenced "deposit" operation -
+ * or any operation that could provide wire-details. (2)
+ * Total amount for this transfer matches the one from any
+ * referenced command that could provide one.
+ */
+ if (NULL != tts->wire_details_reference)
+ {
+ const struct TALER_TESTING_Command *wire_details_cmd;
+ const char **payto_uri;
+ struct TALER_PaytoHashP h_payto;
+
+ wire_details_cmd
+ = TALER_TESTING_interpreter_lookup_command (is,
+ tts->
+ wire_details_reference);
+ if (NULL == wire_details_cmd)
+ {
+ GNUNET_break (0);
+ TALER_TESTING_interpreter_fail (is);
+ return;
+ }
+ if (GNUNET_OK !=
+ TALER_TESTING_get_trait_payto_uri (wire_details_cmd,
+ &payto_uri))
+ {
+ GNUNET_break (0);
+ TALER_TESTING_interpreter_fail (is);
+ return;
+ }
+ TALER_payto_hash (*payto_uri,
+ &h_payto);
+ if (0 != GNUNET_memcmp (&h_payto,
+ &ta->h_payto))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Wire hash missmath to command %s\n",
+ cmd->label);
+ json_dumpf (hr->reply,
+ stderr,
+ 0);
+ TALER_TESTING_interpreter_fail (is);
+ return;
+ }
+ }
+ if (NULL != tts->total_amount_reference)
+ {
+ const struct TALER_TESTING_Command *total_amount_cmd;
+ const struct TALER_Amount *total_amount_from_reference;
+
+ total_amount_cmd
+ = TALER_TESTING_interpreter_lookup_command (is,
+ tts->
+ total_amount_reference);
+ if (NULL == total_amount_cmd)
+ {
+ GNUNET_break (0);
+ TALER_TESTING_interpreter_fail (is);
+ return;
+ }
+ if (GNUNET_OK !=
+ TALER_TESTING_get_trait_amount (total_amount_cmd,
+ &total_amount_from_reference))
+ {
+ GNUNET_break (0);
+ TALER_TESTING_interpreter_fail (is);
+ return;
+ }
+ if (0 != TALER_amount_cmp (&ta->total_amount,
+ total_amount_from_reference))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Amount missmath to command %s\n",
+ cmd->label);
+ json_dumpf (hr->reply,
+ stderr,
+ 0);
+ TALER_TESTING_interpreter_fail (is);
+ return;
+ }
+ }
+ break;
+ } /* case OK */
+ } /* switch on status */
TALER_TESTING_interpreter_next (is);
}
diff --git a/src/testing/testing_api_cmd_wire.c b/src/testing/testing_api_cmd_wire.c
index 6e44403bc..5fbd41b1e 100644
--- a/src/testing/testing_api_cmd_wire.c
+++ b/src/testing/testing_api_cmd_wire.c
@@ -72,18 +72,14 @@ struct WireState
* that the wire fee is acceptable too.
*
* @param cls closure.
- * @param hr HTTP response details
- * @param accounts_len length of the @a accounts array.
- * @param accounts list of wire accounts of the exchange,
- * NULL on error.
+ * @param wr response details
*/
static void
wire_cb (void *cls,
- const struct TALER_EXCHANGE_HttpResponse *hr,
- unsigned int accounts_len,
- const struct TALER_EXCHANGE_WireAccount *accounts)
+ const struct TALER_EXCHANGE_WireResponse *wr)
{
struct WireState *ws = cls;
+ const struct TALER_EXCHANGE_HttpResponse *hr = &wr->hr;
struct TALER_TESTING_Command *cmd = &ws->is->commands[ws->is->ip];
struct TALER_Amount expected_fee;
@@ -100,6 +96,15 @@ wire_cb (void *cls,
if (MHD_HTTP_OK == hr->http_status)
{
+ unsigned int accounts_len
+ = wr->details.ok.accounts_len;
+ unsigned int fees_len
+ = wr->details.ok.fees_len;
+ const struct TALER_EXCHANGE_WireAccount *accounts
+ = wr->details.ok.accounts;
+ const struct TALER_EXCHANGE_WireFeesByMethod *fees
+ = wr->details.ok.fees;
+
for (unsigned int i = 0; i<accounts_len; i++)
{
char *method;
@@ -115,32 +120,46 @@ wire_cb (void *cls,
method))
{
ws->method_found = GNUNET_OK;
- if (NULL != ws->expected_fee)
+ }
+ GNUNET_free (method);
+ }
+ if (NULL != ws->expected_fee)
+ {
+ bool fee_found = false;
+
+ GNUNET_assert (GNUNET_OK ==
+ TALER_string_to_amount (ws->expected_fee,
+ &expected_fee));
+ for (unsigned int i = 0; i<fees_len; i++)
+ {
+ if (0 != strcmp (fees[i].method,
+ ws->expected_method))
+ continue;
+ for (const struct TALER_EXCHANGE_WireAggregateFees *waf
+ = fees[i].fees_head;
+ NULL != waf;
+ waf = waf->next)
{
- GNUNET_assert (GNUNET_OK ==
- TALER_string_to_amount (ws->expected_fee,
- &expected_fee));
- for (const struct TALER_EXCHANGE_WireAggregateFees *waf
- = accounts[i].fees;
- NULL != waf;
- waf = waf->next)
+ if (0 != TALER_amount_cmp (&waf->fees.wire,
+ &expected_fee))
{
- if (0 != TALER_amount_cmp (&waf->fees.wire,
- &expected_fee))
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Wire fee mismatch to command %s\n",
- cmd->label);
- TALER_TESTING_interpreter_fail (ws->is);
- GNUNET_free (method);
- return;
- }
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Wire fee mismatch to command %s\n",
+ cmd->label);
+ TALER_TESTING_interpreter_fail (ws->is);
+ return;
}
+ fee_found = true;
}
}
- TALER_LOG_DEBUG ("Freeing method '%s'\n",
- method);
- GNUNET_free (method);
+ if (! fee_found)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "/wire does not contain expected fee '%s'\n",
+ ws->expected_fee);
+ TALER_TESTING_interpreter_fail (ws->is);
+ return;
+ }
}
if (GNUNET_OK != ws->method_found)
{
diff --git a/src/testing/testing_api_cmd_wire_add.c b/src/testing/testing_api_cmd_wire_add.c
index c07e9bba6..c36f03b15 100644
--- a/src/testing/testing_api_cmd_wire_add.c
+++ b/src/testing/testing_api_cmd_wire_add.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2020 Taler Systems SA
+ Copyright (C) 2020-2023 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
@@ -67,13 +67,14 @@ struct WireAddState
* if the response code is acceptable.
*
* @param cls closure.
- * @param hr HTTP response details
+ * @param wer response details
*/
static void
wire_add_cb (void *cls,
- const struct TALER_EXCHANGE_HttpResponse *hr)
+ const struct TALER_EXCHANGE_ManagementWireEnableResponse *wer)
{
struct WireAddState *ds = cls;
+ const struct TALER_EXCHANGE_HttpResponse *hr = &wer->hr;
ds->dh = NULL;
if (ds->expected_response_code != hr->http_status)
@@ -110,10 +111,14 @@ wire_add_run (void *cls,
struct TALER_MasterSignatureP master_sig1;
struct TALER_MasterSignatureP master_sig2;
struct GNUNET_TIME_Timestamp now;
+ json_t *credit_rest;
+ json_t *debit_rest;
(void) cmd;
now = GNUNET_TIME_timestamp_get ();
ds->is = is;
+ debit_rest = json_array ();
+ credit_rest = json_array ();
if (ds->bad_sig)
{
memset (&master_sig1,
@@ -126,10 +131,16 @@ wire_add_run (void *cls,
else
{
TALER_exchange_offline_wire_add_sign (ds->payto_uri,
+ NULL,
+ debit_rest,
+ credit_rest,
now,
&is->master_priv,
&master_sig1);
TALER_exchange_wire_signature_make (ds->payto_uri,
+ NULL,
+ debit_rest,
+ credit_rest,
&is->master_priv,
&master_sig2);
}
@@ -137,11 +148,16 @@ wire_add_run (void *cls,
is->ctx,
is->exchange_url,
ds->payto_uri,
+ NULL,
+ debit_rest,
+ credit_rest,
now,
&master_sig1,
&master_sig2,
&wire_add_cb,
ds);
+ json_decref (debit_rest);
+ json_decref (credit_rest);
if (NULL == ds->dh)
{
GNUNET_break (0);
diff --git a/src/testing/testing_api_cmd_wire_del.c b/src/testing/testing_api_cmd_wire_del.c
index 15d29d727..89fb83957 100644
--- a/src/testing/testing_api_cmd_wire_del.c
+++ b/src/testing/testing_api_cmd_wire_del.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2020 Taler Systems SA
+ Copyright (C) 2020, 2023 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
@@ -67,13 +67,14 @@ struct WireDelState
* if the response code is acceptable.
*
* @param cls closure.
- * @param hr HTTP response details
+ * @param wdr response details
*/
static void
wire_del_cb (void *cls,
- const struct TALER_EXCHANGE_HttpResponse *hr)
+ const struct TALER_EXCHANGE_ManagementWireDisableResponse *wdr)
{
struct WireDelState *ds = cls;
+ const struct TALER_EXCHANGE_HttpResponse *hr = &wdr->hr;
ds->dh = NULL;
if (ds->expected_response_code != hr->http_status)
diff --git a/src/testing/testing_api_cmd_withdraw.c b/src/testing/testing_api_cmd_withdraw.c
index 1bd3c187e..8d53f4d07 100644
--- a/src/testing/testing_api_cmd_withdraw.c
+++ b/src/testing/testing_api_cmd_withdraw.c
@@ -297,10 +297,10 @@ reserve_withdraw_cb (void *cls,
{
case MHD_HTTP_OK:
TALER_denom_sig_deep_copy (&ws->sig,
- &wr->details.success.sig);
- ws->coin_priv = wr->details.success.coin_priv;
- ws->bks = wr->details.success.bks;
- ws->exchange_vals = wr->details.success.exchange_vals;
+ &wr->details.ok.sig);
+ ws->coin_priv = wr->details.ok.coin_priv;
+ ws->bks = wr->details.ok.bks;
+ ws->exchange_vals = wr->details.ok.exchange_vals;
if (0 != ws->total_backoff.rel_value_us)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
diff --git a/src/testing/testing_api_helpers_bank.c b/src/testing/testing_api_helpers_bank.c
index 2507a87e9..f2f92956d 100644
--- a/src/testing/testing_api_helpers_bank.c
+++ b/src/testing/testing_api_helpers_bank.c
@@ -30,6 +30,10 @@
#define BANK_FAIL() \
do {GNUNET_break (0); return NULL; } while (0)
+#define JDBC_TALERCHECK \
+ "jdbc:postgresql://localhost/talercheck?socketFactory=org.newsclub.net.unix." \
+ "AFUNIXSocketFactory$FactoryArg&socketFactoryArg" \
+ "=/var/run/postgresql/.s.PGSQL.5432"
struct TALER_FAKEBANK_Handle *
TALER_TESTING_run_fakebank (const char *bank_url,
@@ -95,7 +99,7 @@ TALER_TESTING_run_libeufin (const struct TALER_TESTING_BankConfiguration *bc)
setenv (
"LIBEUFIN_NEXUS_DB_CONNECTION",
- "jdbc:sqlite:/tmp/libeufin-exchange-test-nexusdb.sqlite3",
+ JDBC_TALERCHECK,
1); // not overwriting any potentially existing DB.
nexus_proc = GNUNET_OS_start_process (
@@ -145,7 +149,7 @@ TALER_TESTING_run_libeufin (const struct TALER_TESTING_BankConfiguration *bc)
fprintf (stderr, "\n");
setenv (
"LIBEUFIN_SANDBOX_DB_CONNECTION",
- "jdbc:sqlite:/tmp/libeufin-exchange-test-sandboxdb.sqlite3",
+ JDBC_TALERCHECK,
1); // not overwriting any potentially existing DB.
setenv (
"LIBEUFIN_SANDBOX_ADMIN_PASSWORD",
@@ -366,7 +370,12 @@ TALER_TESTING_prepare_libeufin (const char *config_filename,
/* DB preparation */
if (reset_db)
{
- if (0 != system ("rm -f /tmp/libeufin-exchange-test-nexusdb.sqlite3"))
+ setenv (
+ "LIBEUFIN_NEXUS_DB_CONNECTION",
+ JDBC_TALERCHECK,
+ 1); // not overwriting any potentially existing DB.
+
+ if (0 != system ("libeufin-nexus reset-tables"))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to invoke db-removal command on nexusdb.\n");
@@ -374,7 +383,13 @@ TALER_TESTING_prepare_libeufin (const char *config_filename,
GNUNET_CONFIGURATION_destroy (cfg);
return GNUNET_SYSERR;
}
- if (0 != system ("rm -f /tmp/libeufin-exchange-test-sandboxdb.sqlite3"))
+
+ setenv (
+ "LIBEUFIN_SANDBOX_DB_CONNECTION",
+ JDBC_TALERCHECK,
+ 1); // not overwriting any potentially existing DB.
+
+ if (0 != system ("libeufin-sandbox reset-tables"))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to invoke db-removal command on sandboxdb.\n");
diff --git a/src/testing/testing_api_loop.c b/src/testing/testing_api_loop.c
index 1865a1129..271b6e768 100644
--- a/src/testing/testing_api_loop.c
+++ b/src/testing/testing_api_loop.c
@@ -452,9 +452,9 @@ TALER_TESTING_run2 (struct TALER_TESTING_Interpreter *is,
is->commands = GNUNET_malloc_large ( (i + 1)
* sizeof (struct TALER_TESTING_Command));
GNUNET_assert (NULL != is->commands);
- memcpy (is->commands,
- commands,
- sizeof (struct TALER_TESTING_Command) * i);
+ GNUNET_memcpy (is->commands,
+ commands,
+ sizeof (struct TALER_TESTING_Command) * i);
is->timeout_task = GNUNET_SCHEDULER_add_delayed (
timeout,
&do_timeout,
@@ -526,49 +526,46 @@ sighandler_child_death (void)
void
TALER_TESTING_cert_cb (void *cls,
- const struct TALER_EXCHANGE_HttpResponse *hr,
- const struct TALER_EXCHANGE_Keys *keys,
- enum TALER_EXCHANGE_VersionCompatibility compat)
+ const struct TALER_EXCHANGE_KeysResponse *kr)
{
+ const struct TALER_EXCHANGE_HttpResponse *hr = &kr->hr;
struct MainContext *main_ctx = cls;
struct TALER_TESTING_Interpreter *is = main_ctx->is;
- (void) compat;
- if (NULL == keys)
+ switch (hr->http_status)
{
- if (GNUNET_NO == is->working)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "Got NULL response for /keys during startup (%u/%d), retrying!\n",
- hr->http_status,
- (int) hr->ec);
- TALER_EXCHANGE_disconnect (is->exchange);
- GNUNET_assert (
- NULL != (is->exchange
- = TALER_EXCHANGE_connect (is->ctx,
- main_ctx->exchange_url,
- &TALER_TESTING_cert_cb,
- main_ctx,
- TALER_EXCHANGE_OPTION_END)));
- return;
- }
- else
+ case MHD_HTTP_OK:
+ /* dealt with below */
+ break;
+ default:
+ if (GNUNET_YES == is->working)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Got NULL response for /keys during execution (%u/%d)!\n",
hr->http_status,
(int) hr->ec);
+ return;
}
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Got failure response for /keys during startup (%u/%d), retrying!\n",
+ hr->http_status,
+ (int) hr->ec);
+ TALER_EXCHANGE_disconnect (is->exchange);
+ GNUNET_assert (
+ NULL != (is->exchange
+ = TALER_EXCHANGE_connect (is->ctx,
+ main_ctx->exchange_url,
+ &TALER_TESTING_cert_cb,
+ main_ctx,
+ TALER_EXCHANGE_OPTION_END)));
+ return;
}
- else
- {
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Got %d DK from /keys in generation %u\n",
- keys->num_denom_keys,
- is->key_generation + 1);
- }
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Got %d DK from /keys in generation %u\n",
+ kr->details.ok.keys->num_denom_keys,
+ is->key_generation + 1);
is->key_generation++;
- is->keys = keys;
+ is->keys = kr->details.ok.keys;
/* /keys has been called for some reason and
* the interpreter is already running. */