From 7b25787a4b8ac0a0b3cbc2174ba3cac9c564346a Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 30 May 2022 16:31:24 +0200 Subject: -generate 404 on non-existing accounts for fakebank, use payto://-URIs with receiver-name in tests --- src/auditor/taler-helper-auditor-wire.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'src/auditor/taler-helper-auditor-wire.c') diff --git a/src/auditor/taler-helper-auditor-wire.c b/src/auditor/taler-helper-auditor-wire.c index 274344ff6..2cc70a940 100644 --- a/src/auditor/taler-helper-auditor-wire.c +++ b/src/auditor/taler-helper-auditor-wire.c @@ -304,6 +304,12 @@ static struct GNUNET_CURL_RescheduleContext *rc; */ static int internal_checks; +/** + * Should we ignore if the bank does not know our bank + * account? + */ +static int ignore_account_404; + /* ***************************** Shutdown **************************** */ /** @@ -1166,7 +1172,7 @@ check_rc_matches (void *cls, * @param value the `struct ReserveOutInfo` to report * @return #GNUNET_OK */ -static int +static enum GNUNET_GenericReturnValue complain_out_not_found (void *cls, const struct GNUNET_HashCode *key, void *value) @@ -1275,7 +1281,7 @@ check_exchange_wire_out (struct WireAccount *wa) * @param json original response in JSON format * @return #GNUNET_OK to continue, #GNUNET_SYSERR to abort iteration */ -static int +static enum GNUNET_GenericReturnValue history_debit_cb (void *cls, unsigned int http_status_code, enum TALER_ErrorCode ec, @@ -1291,7 +1297,9 @@ history_debit_cb (void *cls, if (NULL == details) { wa->dhh = NULL; - if (TALER_EC_NONE != ec) + if ( (TALER_EC_NONE != ec) && + ( (! ignore_account_404) || + (MHD_HTTP_NOT_FOUND != http_status_code) ) ) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Error fetching debit history of account %s: %u/%u!\n", @@ -1584,7 +1592,9 @@ history_credit_cb (void *cls, if (NULL == details) { wa->chh = NULL; - if (TALER_EC_NONE != ec) + if ( (TALER_EC_NONE != ec) && + ( (! ignore_account_404) || + (MHD_HTTP_NOT_FOUND != http_status) ) ) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Error fetching credit history of account %s: %u/%s!\n", @@ -2177,6 +2187,10 @@ main (int argc, "internal", "perform checks only applicable for exchange-internal audits", &internal_checks), + GNUNET_GETOPT_option_flag ('I', + "ignore-not-found", + "continue, even if the bank account of the exchange was not found", + &ignore_account_404), GNUNET_GETOPT_option_base32_auto ('m', "exchange-key", "KEY", -- cgit v1.2.3