diff options
author | Nic Eigel <nic@eigel.ch> | 2024-04-26 09:32:25 +0200 |
---|---|---|
committer | Nic Eigel <nic@eigel.ch> | 2024-04-26 09:32:25 +0200 |
commit | 157dd4fa26a039bf2600290b2680b3ba79b15b2a (patch) | |
tree | 39b3f1a2af210fd3a0fdcb9bbd712b5dd7c1f2cc | |
parent | ba41bba2a251d00bd2411782890b9ae003243a98 (diff) | |
parent | 72f9b0cb96ee7daaa92f8e6891078fa5e0119ab3 (diff) | |
download | exchange-157dd4fa26a039bf2600290b2680b3ba79b15b2a.tar.gz exchange-157dd4fa26a039bf2600290b2680b3ba79b15b2a.tar.bz2 exchange-157dd4fa26a039bf2600290b2680b3ba79b15b2a.zip |
Merge remote-tracking branch 'origin/dev/nic/real-time-auditor-zwah' into dev/nic/real-time-auditor
# Conflicts:
# src/auditor/taler-auditor-httpd_denominations-without-sigs-get.c
# src/auditor/taler-auditor-httpd_deposit-confirmation-get.c
# src/auditor/taler-auditor-httpd_purse-not-closed-inconsistencies-get.c
# src/auditor/test-auditor.sh
# src/auditordb/pg_insert_reserve_balance_summary_wrong_inconsistency.c
113 files changed, 1427 insertions, 1866 deletions
diff --git a/src/auditor/generate-auditor-basedb.conf b/src/auditor/generate-auditor-basedb.conf index 8cf63fbba..9ecbf11c7 100644 --- a/src/auditor/generate-auditor-basedb.conf +++ b/src/auditor/generate-auditor-basedb.conf @@ -114,6 +114,7 @@ BASE_URL = http://localhost:8083/ TINY_AMOUNT = TESTKUDOS:0.01 PUBLIC_KEY = 0EHPW5WEKHXPPN4MPJNGA7Z6D29JP21GKVNV8ARFB1YW7WWJX20G db = postgres +TALER_AUDITOR_TOKEN = secret-token:abc [auditordb-postgres] CONFIG = postgres:///auditor-basedb diff --git a/src/auditor/taler-auditor-httpd.c b/src/auditor/taler-auditor-httpd.c index f2a25b394..c79e4551d 100644 --- a/src/auditor/taler-auditor-httpd.c +++ b/src/auditor/taler-auditor-httpd.c @@ -336,6 +336,44 @@ handle_config (struct TAH_RequestHandler *rh, } +char *TMA_auth; + +#define RFC_8959_PREFIX "secret-token:" + +/** + * Extract the token from authorization header value @a auth. + * + * @param auth pointer to authorization header value, + * will be updated to point to the start of the token + * or set to NULL if header value is invalid + */ +static void +extract_token (const char **auth) +{ + const char *bearer = "Bearer "; + const char *tok = *auth; + + if (0 != strncmp (tok, + bearer, + strlen (bearer))) + { + *auth = NULL; + return; + } + tok += strlen (bearer); + while (' ' == *tok) + tok++; + if (0 != strncasecmp (tok, + RFC_8959_PREFIX, + strlen (RFC_8959_PREFIX))) + { + *auth = NULL; + return; + } + *auth = tok; +} + + /** * Handle incoming HTTP request. * @@ -359,593 +397,594 @@ handle_mhd_request (void *cls, size_t *upload_data_size, void **con_cls) { + static struct TAH_RequestHandler handlers[] = { /* Our most popular handler (thus first!), used by merchants to probabilistically report us their deposit confirmations. */ { "/deposit-confirmation", MHD_HTTP_METHOD_PUT, "application/json", NULL, 0, - &TAH_DEPOSIT_CONFIRMATION_handler, MHD_HTTP_OK }, + &TAH_DEPOSIT_CONFIRMATION_handler, MHD_HTTP_OK, false }, { "/deposit-confirmation", MHD_HTTP_METHOD_GET, "application/json", NULL, 0, - &TAH_DEPOSIT_CONFIRMATION_handler_get, MHD_HTTP_OK }, + &TAH_DEPOSIT_CONFIRMATION_handler_get, MHD_HTTP_OK, false }, { "/deposit-confirmation", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, - &TAH_DEPOSIT_CONFIRMATION_handler_delete, MHD_HTTP_OK }, + &TAH_DEPOSIT_CONFIRMATION_handler_delete, MHD_HTTP_OK, false }, { "/amount-arithmetic-inconsistency", MHD_HTTP_METHOD_GET, "application/json", NULL, 0, - &TAH_AMOUNT_ARITHMETIC_INCONSISTENCY_handler_get, MHD_HTTP_OK }, + &TAH_AMOUNT_ARITHMETIC_INCONSISTENCY_handler_get, MHD_HTTP_OK, false }, { "/amount-arithmetic-inconsistency", MHD_HTTP_METHOD_PUT, "application/json", NULL, 0, - &TAH_AMOUNT_ARITHMETIC_INCONSISTENCY_PUT_handler, MHD_HTTP_OK }, + &TAH_AMOUNT_ARITHMETIC_INCONSISTENCY_PUT_handler, MHD_HTTP_OK, false }, { "/amount-arithmetic-inconsistency", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, - &TAH_AMOUNT_ARITHMETIC_INCONSISTENCY_handler_delete, MHD_HTTP_OK }, + &TAH_AMOUNT_ARITHMETIC_INCONSISTENCY_handler_delete, MHD_HTTP_OK, false }, { "/coin-inconsistency", MHD_HTTP_METHOD_GET, "application/json", NULL, 0, - &TAH_COIN_INCONSISTENCY_handler_get, MHD_HTTP_OK }, + &TAH_COIN_INCONSISTENCY_handler_get, MHD_HTTP_OK, false }, { "/coin-inconsistency", MHD_HTTP_METHOD_PUT, "application/json", NULL, 0, - &TAH_COIN_INCONSISTENCY_PUT_handler, MHD_HTTP_OK }, + &TAH_COIN_INCONSISTENCY_PUT_handler, MHD_HTTP_OK, false }, { "/coin-inconsistency", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, - &TAH_COIN_INCONSISTENCY_handler_delete, MHD_HTTP_OK }, + &TAH_COIN_INCONSISTENCY_handler_delete, MHD_HTTP_OK, false }, { "/row-inconsistency", MHD_HTTP_METHOD_GET, "application/json", NULL, 0, - &TAH_ROW_INCONSISTENCY_handler_get, MHD_HTTP_OK }, + &TAH_ROW_INCONSISTENCY_handler_get, MHD_HTTP_OK, false }, { "/row-inconsistency", MHD_HTTP_METHOD_PUT, "application/json", NULL, 0, - &TAH_ROW_INCONSISTENCY_PUT_handler, MHD_HTTP_OK }, + &TAH_ROW_INCONSISTENCY_PUT_handler, MHD_HTTP_OK, false }, { "/row-inconsistency", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, - &TAH_ROW_INCONSISTENCY_handler_delete, MHD_HTTP_OK }, + &TAH_ROW_INCONSISTENCY_handler_delete, MHD_HTTP_OK, false }, { "/reserve-balance-insufficient-inconsistency", MHD_HTTP_METHOD_GET, "application/json", NULL, 0, &TAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_handler_get, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/reserve-balance-insufficient-inconsistency", MHD_HTTP_METHOD_PUT, "application/json", NULL, 0, &TAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_handler_put, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/reserve-balance-insufficient-inconsistency", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, &TAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_handler_delete, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/bad-sig-losses", MHD_HTTP_METHOD_GET, "application/json", NULL, 0, &TAH_BAD_SIG_LOSSES_handler_get, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/bad-sig-losses", MHD_HTTP_METHOD_PUT, "application/json", NULL, 0, &TAH_BAD_SIG_LOSSES_PUT_handler, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/bad-sig-losses", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, &TAH_BAD_SIG_LOSSES_handler_delete, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/bad-sig-losses", MHD_HTTP_METHOD_PATCH, "application/json", NULL, 0, &TAH_BAD_SIG_LOSSES_handler_update, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/closure-lags", MHD_HTTP_METHOD_GET, "application/json", NULL, 0, &TAH_CLOSURE_LAGS_handler_get, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/closure-lags", MHD_HTTP_METHOD_PUT, "application/json", NULL, 0, &TAH_CLOSURE_LAGS_PUT_handler, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/closure-lags", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, &TAH_CLOSURE_LAGS_handler_delete, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/closure-lags", MHD_HTTP_METHOD_PATCH, "application/json", NULL, 0, &TAH_CLOSURE_LAGS_handler_update, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/emergency", MHD_HTTP_METHOD_GET, "application/json", NULL, 0, &TAH_EMERGENCY_handler_get, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/emergency", MHD_HTTP_METHOD_PUT, "application/json", NULL, 0, &TAH_EMERGENCY_PUT_handler, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/emergency", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, &TAH_EMERGENCY_handler_delete, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/emergency", MHD_HTTP_METHOD_PATCH, "application/json", NULL, 0, &TAH_EMERGENCY_handler_update, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/refreshes-hanging", MHD_HTTP_METHOD_GET, "application/json", NULL, 0, &TAH_REFRESHES_HANGING_handler_get, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/refreshes-hanging", MHD_HTTP_METHOD_PUT, "application/json", NULL, 0, &TAH_REFRESHES_HANGING_PUT_handler, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/refreshes-hanging", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, &TAH_REFRESHES_HANGING_handler_delete, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/refreshes-hanging", MHD_HTTP_METHOD_PATCH, "application/json", NULL, 0, &TAH_REFRESHES_HANGING_handler_update, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/denomination-key-validity-withdraw-inconsistency", MHD_HTTP_METHOD_GET, "application/json", NULL, 0, &TAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_handler_get, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/denomination-key-validity-withdraw-inconsistency", MHD_HTTP_METHOD_PUT, "application/json", NULL, 0, &TAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_PUT_handler, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/denomination-key-validity-withdraw-inconsistency", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, &TAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_handler_delete, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/denomination-key-validity-withdraw-inconsistency", MHD_HTTP_METHOD_PATCH, "application/json", NULL, 0, &TAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_handler_update, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/progress", MHD_HTTP_METHOD_GET, "application/json", NULL, 0, &TAH_PROGRESS_handler_get, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/progress", MHD_HTTP_METHOD_PUT, "application/json", NULL, 0, &TAH_PROGRESS_PUT_handler, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/progress", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, &TAH_PROGRESS_handler_delete, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/progress", MHD_HTTP_METHOD_PATCH, "application/json", NULL, 0, &TAH_PROGRESS_handler_update, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/reserve-balance-insufficient-inconsistency", MHD_HTTP_METHOD_GET, "application/json", NULL, 0, &TAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_handler_get, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/reserve-balance-insufficient-inconsistency", MHD_HTTP_METHOD_PUT, "application/json", NULL, 0, &TAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_handler_put, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/reserve-balance-insufficient-inconsistency", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, &TAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_handler_delete, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/reserve-balance-insufficient-inconsistency", MHD_HTTP_METHOD_PATCH, "application/json", NULL, 0, &TAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_handler_update, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/purse-not-closed-inconsistencies", MHD_HTTP_METHOD_GET, "application/json", NULL, 0, &TAH_PURSE_NOT_CLOSED_INCONSISTENCIES_handler_get, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/purse-not-closed-inconsistencies", MHD_HTTP_METHOD_PUT, "application/json", NULL, 0, &TAH_PURSE_NOT_CLOSED_INCONSISTENCIES_PUT_handler, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/purse-not-closed-inconsistencies", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, &TAH_PURSE_NOT_CLOSED_INCONSISTENCIES_handler_delete, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/purse-not-closed-inconsistencies", MHD_HTTP_METHOD_PATCH, "application/json", NULL, 0, &TAH_PURSE_NOT_CLOSED_INCONSISTENCIES_handler_update, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/emergency-by-count", MHD_HTTP_METHOD_GET, "application/json", NULL, 0, &TAH_EMERGENCY_BY_COUNT_handler_get, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/emergency-by-count", MHD_HTTP_METHOD_PUT, "application/json", NULL, 0, &TAH_EMERGENCY_BY_COUNT_PUT_handler, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/emergency-by-count", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, &TAH_EMERGENCY_BY_COUNT_handler_delete, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/emergency-by-count", MHD_HTTP_METHOD_PATCH, "application/json", NULL, 0, &TAH_EMERGENCY_BY_COUNT_handler_update, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/reserve-in-inconsistency", MHD_HTTP_METHOD_GET, "application/json", NULL, 0, &TAH_RESERVE_IN_INCONSISTENCY_handler_get, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/reserve-in-inconsistency", MHD_HTTP_METHOD_PUT, "application/json", NULL, 0, &TAH_RESERVE_IN_INCONSISTENCY_handler_put, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/reserve-in-inconsistency", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, &TAH_RESERVE_IN_INCONSISTENCY_handler_delete, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/reserve-in-inconsistency", MHD_HTTP_METHOD_PATCH, "application/json", NULL, 0, &TAH_RESERVE_IN_INCONSISTENCY_handler_update, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/reserve-not-closed-inconsistency", MHD_HTTP_METHOD_GET, "application/json", NULL, 0, &TAH_RESERVE_NOT_CLOSED_INCONSISTENCY_handler_get, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/reserve-not-closed-inconsistency", MHD_HTTP_METHOD_PUT, "application/json", NULL, 0, &TAH_RESERVE_NOT_CLOSED_INCONSISTENCY_handler_put, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/reserve-not-closed-inconsistency", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, &TAH_RESERVE_NOT_CLOSED_INCONSISTENCY_handler_delete, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/reserve-not-closed-inconsistency", MHD_HTTP_METHOD_PATCH, "application/json", NULL, 0, &TAH_RESERVE_NOT_CLOSED_INCONSISTENCY_handler_update, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/denominations-without-sigs", MHD_HTTP_METHOD_GET, "application/json", NULL, 0, &TAH_DENOMINATIONS_WITHOUT_SIGS_handler_get, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/denominations-without-sigs", MHD_HTTP_METHOD_PUT, "application/json", NULL, 0, &TAH_DENOMINATIONS_WITHOUT_SIGS_handler_put, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/denominations-without-sigs", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, &TAH_DENOMINATIONS_WITHOUT_SIGS_handler_delete, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/denominations-without-sigs", MHD_HTTP_METHOD_PATCH, "application/json", NULL, 0, &TAH_DENOMINATIONS_WITHOUT_SIGS_handler_update, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/misattribution-in-inconsistency", MHD_HTTP_METHOD_GET, "application/json", NULL, 0, &TAH_MISATTRIBUTION_IN_INCONSISTENCY_handler_get, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/misattribution-in-inconsistency", MHD_HTTP_METHOD_PUT, "application/json", NULL, 0, &TAH_MISATTRIBUTION_IN_INCONSISTENCY_handler_put, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/misattribution-in-inconsistency", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, &TAH_MISATTRIBUTION_IN_INCONSISTENCY_handler_delete, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/misattribution-in-inconsistency", MHD_HTTP_METHOD_PATCH, "application/json", NULL, 0, &TAH_MISATTRIBUTION_IN_INCONSISTENCY_handler_update, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/reserves", MHD_HTTP_METHOD_GET, "application/json", NULL, 0, &TAH_RESERVES_handler_get, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/reserves", MHD_HTTP_METHOD_PUT, "application/json", NULL, 0, &TAH_RESERVES_handler_put, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/reserves", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, &TAH_RESERVES_handler_delete, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/reserves", MHD_HTTP_METHOD_PATCH, "application/json", NULL, 0, &TAH_RESERVES_handler_update, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/purses", MHD_HTTP_METHOD_GET, "application/json", NULL, 0, &TAH_PURSES_handler_get, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/purses", MHD_HTTP_METHOD_PUT, "application/json", NULL, 0, &TAH_PURSES_handler_put, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/purses", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, &TAH_PURSES_handler_delete, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/purses", MHD_HTTP_METHOD_PATCH, "application/json", NULL, 0, &TAH_PURSES_handler_update, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/historic-denomination-revenue", MHD_HTTP_METHOD_GET, "application/json", NULL, 0, &TAH_HISTORIC_DENOMINATION_REVENUE_handler_get, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/historic-denomination-revenue", MHD_HTTP_METHOD_PUT, "application/json", NULL, 0, &TAH_HISTORIC_DENOMINATION_REVENUE_handler_put, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/historic-denomination-revenue", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, &TAH_HISTORIC_DENOMINATION_REVENUE_handler_delete, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/historic-denomination-revenue", MHD_HTTP_METHOD_PATCH, "application/json", NULL, 0, &TAH_HISTORIC_DENOMINATION_REVENUE_handler_update, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/denomination-pending", MHD_HTTP_METHOD_GET, "application/json", NULL, 0, &TAH_DENOMINATION_PENDING_handler_get, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/denomination-pending", MHD_HTTP_METHOD_PUT, "application/json", NULL, 0, &TAH_DENOMINATION_PENDING_handler_put, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/denomination-pending", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, &TAH_DENOMINATION_PENDING_handler_delete, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/denomination-pending", MHD_HTTP_METHOD_PATCH, "application/json", NULL, 0, &TAH_DENOMINATION_PENDING_handler_update, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/historic-reserve-summary", MHD_HTTP_METHOD_GET, "application/json", NULL, 0, &TAH_HISTORIC_RESERVE_SUMMARY_handler_get, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/historic-reserve-summary", MHD_HTTP_METHOD_PUT, "application/json", NULL, 0, &TAH_HISTORIC_RESERVE_SUMMARY_handler_put, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/historic-reserve-summary", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, &TAH_HISTORIC_RESERVE_SUMMARY_handler_delete, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/historic-reserve-summary", MHD_HTTP_METHOD_PATCH, "application/json", NULL, 0, &TAH_HISTORIC_RESERVE_SUMMARY_handler_update, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/exchange-signkeys", MHD_HTTP_METHOD_GET, "application/json", NULL, 0, &TAH_EXCHANGE_SIGNKEYS_handler_get, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/exchange-signkeys", MHD_HTTP_METHOD_PUT, "application/json", NULL, 0, &TAH_EXCHANGE_SIGNKEYS_handler_put, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/exchange-signkeys", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, &TAH_EXCHANGE_SIGNKEYS_handler_delete, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/exchange-signkeys", MHD_HTTP_METHOD_PATCH, "application/json", NULL, 0, &TAH_EXCHANGE_SIGNKEYS_handler_update, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/wire-format-inconsistency", MHD_HTTP_METHOD_GET, "application/json", NULL, 0, &TAH_WIRE_FORMAT_INCONSISTENCY_handler_get, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/wire-format-inconsistency", MHD_HTTP_METHOD_PUT, "application/json", NULL, 0, &TAH_WIRE_FORMAT_INCONSISTENCY_handler_put, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/wire-format-inconsistency", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, &TAH_WIRE_FORMAT_INCONSISTENCY_handler_delete, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/wire-format-inconsistency", MHD_HTTP_METHOD_PATCH, "application/json", NULL, 0, &TAH_WIRE_FORMAT_INCONSISTENCY_handler_update, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/wire-out-inconsistency", MHD_HTTP_METHOD_GET, "application/json", NULL, 0, &TAH_WIRE_OUT_INCONSISTENCY_handler_get, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/wire-out-inconsistency", MHD_HTTP_METHOD_PUT, "application/json", NULL, 0, &TAH_WIRE_OUT_INCONSISTENCY_handler_put, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/wire-out-inconsistency", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, &TAH_WIRE_OUT_INCONSISTENCY_handler_delete, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/wire-out-inconsistency", MHD_HTTP_METHOD_PATCH, "application/json", NULL, 0, &TAH_WIRE_OUT_INCONSISTENCY_handler_update, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/reserve-balance-summary-wrong-inconsistency", MHD_HTTP_METHOD_GET, "application/json", NULL, 0, &TAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_handler_get, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/reserve-balance-summary-wrong-inconsistency", MHD_HTTP_METHOD_PUT, "application/json", NULL, 0, &TAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_handler_put, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/reserve-balance-summary-wrong-inconsistency", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, &TAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_handler_delete, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/reserve-balance-summary-wrong-inconsistency", MHD_HTTP_METHOD_PATCH, "application/json", NULL, 0, &TAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_handler_update, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/row-minor-inconsistencies", MHD_HTTP_METHOD_GET, "application/json", NULL, 0, &TAH_ROW_MINOR_INCONSISTENCIES_handler_get, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/row-minor-inconsistencies", MHD_HTTP_METHOD_PUT, "application/json", NULL, 0, &TAH_ROW_MINOR_INCONSISTENCIES_handler_put, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/row-minor-inconsistencies", MHD_HTTP_METHOD_DELETE, "application/json", NULL, 0, &TAH_ROW_MINOR_INCONSISTENCIES_handler_delete, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/row-minor-inconsistencies", MHD_HTTP_METHOD_PATCH, "application/json", NULL, 0, &TAH_ROW_MINOR_INCONSISTENCIES_handler_update, - MHD_HTTP_OK }, + MHD_HTTP_OK, false }, { "/config", MHD_HTTP_METHOD_GET, "application/json", NULL, 0, - &handle_config, MHD_HTTP_OK }, + &handle_config, MHD_HTTP_OK, true }, /* Landing page, for now tells humans to go away * (NOTE: ideally, the reverse proxy will respond with a nicer page) */ { "/", MHD_HTTP_METHOD_GET, "text/plain", "Hello, I'm the Taler auditor. This HTTP server is not for humans.\n", 0, - &TAH_MHD_handler_static_response, MHD_HTTP_OK }, + &TAH_MHD_handler_static_response, MHD_HTTP_OK, true }, /* /robots.txt: disallow everything */ { "/robots.txt", MHD_HTTP_METHOD_GET, "text/plain", "User-agent: *\nDisallow: /\n", 0, - &TAH_MHD_handler_static_response, MHD_HTTP_OK }, + &TAH_MHD_handler_static_response, MHD_HTTP_OK, true }, /* AGPL licensing page, redirect to source. As per the AGPL-license, every deployment is required to offer the user a download of the source. We make this easy by including a redirect t the source here. */ { "/agpl", MHD_HTTP_METHOD_GET, "text/plain", NULL, 0, - &TAH_MHD_handler_agpl_redirect, MHD_HTTP_FOUND }, - { NULL, NULL, NULL, NULL, 0, NULL, 0 } + &TAH_MHD_handler_agpl_redirect, MHD_HTTP_FOUND, true }, + { NULL, NULL, NULL, NULL, 0, NULL, 0, false } }; (void) cls; @@ -1000,12 +1039,76 @@ handle_mhd_request (void *cls, ( (NULL == rh->method) || (0 == strcasecmp (method, rh->method)) ) ) + { + + if (! rh->no_auth_required) + { + + const char *auth; + + /* PATCHing an instance can alternatively be checked against + the default instance */ + auth = MHD_lookup_connection_value (connection, + MHD_HEADER_KIND, + MHD_HTTP_HEADER_AUTHORIZATION); + +// let some requests as through, even if they don't have an auth token + if (NULL != auth) + { + /* We _only_ complain about malformed auth headers if + authorization was truly required (#6737). This helps + in case authorization was disabled in the backend + because some reverse proxy is already doing it, and + then that reverse proxy may forward malformed auth + headers to the backend. */ + extract_token (&auth); + if (NULL == auth) + return TALER_MHD_reply_with_error (connection, + MHD_HTTP_UNAUTHORIZED, + TALER_EC_GENERIC_PARAMETER_MALFORMED, + "'" RFC_8959_PREFIX + "' prefix or 'Bearer' missing in 'Authorization' header"); + + if (strcmp (auth,TMA_auth) == 0) + { + + printf ("AUTH SUCCESS \n"); + + } + else + { + + return TALER_MHD_reply_with_error (connection, + MHD_HTTP_UNAUTHORIZED, + TALER_EC_MERCHANT_GENERIC_UNAUTHORIZED, + "Check 'Authorization' header"); + + + } + + + } + else + { + return TALER_MHD_reply_with_error (connection, + MHD_HTTP_UNAUTHORIZED, + TALER_EC_MERCHANT_GENERIC_UNAUTHORIZED, + "Check 'Authorization' header"); + } + + + } + return rh->handler (rh, connection, con_cls, upload_data, upload_data_size, args); + + } + + } #define NOT_FOUND "<html><title>404: not found</title></html>" return TALER_MHD_reply_static (connection, @@ -1199,6 +1302,32 @@ run (void *cls, enum TALER_MHD_GlobalOptions go; int fh; + { + const char *tok; + + tok = getenv ("TALER_AUDITOR_TOKEN"); + + printf ("token: %s\n", tok); + + if ( (NULL != tok) && + (NULL == TMA_auth) ) + TMA_auth = GNUNET_strdup (tok); + if ( (NULL != TMA_auth) && + (0 != strncmp (TMA_auth, + RFC_8959_PREFIX, + strlen (RFC_8959_PREFIX))) ) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Authentication token does not start with `%s' prefix\n", + RFC_8959_PREFIX); + global_ret = EXIT_NOTCONFIGURED; + GNUNET_SCHEDULER_shutdown (); + return; + } + + + } + (void) cls; (void) args; (void) cfgfile; diff --git a/src/auditor/taler-auditor-httpd.h b/src/auditor/taler-auditor-httpd.h index 5952c6934..a1b6f4710 100644 --- a/src/auditor/taler-auditor-httpd.h +++ b/src/auditor/taler-auditor-httpd.h @@ -102,6 +102,12 @@ struct TAH_RequestHandler * Default response code. */ unsigned int response_code; + + /** + * No authorization token required + */ + + bool no_auth_required; }; diff --git a/src/auditor/taler-auditor-httpd_amount-arithmetic-inconsistency-get.c b/src/auditor/taler-auditor-httpd_amount-arithmetic-inconsistency-get.c index d9edc0662..97d0d1875 100644 --- a/src/auditor/taler-auditor-httpd_amount-arithmetic-inconsistency-get.c +++ b/src/auditor/taler-auditor-httpd_amount-arithmetic-inconsistency-get.c @@ -87,28 +87,28 @@ TAH_AMOUNT_ARITHMETIC_INCONSISTENCY_handler_get (struct TAH_RequestHandler *rh, ja = json_array (); GNUNET_break (NULL != ja); - int64_t limit = -20; - uint64_t offset; + int64_t limit = -20; + uint64_t offset; - TALER_MHD_parse_request_snumber (connection, - "limit", - &limit); + TALER_MHD_parse_request_snumber (connection, + "limit", + &limit); - if (limit < 0) - offset = INT64_MAX; - else - offset = 0; + if (limit < 0) + offset = INT64_MAX; + else + offset = 0; - TALER_MHD_parse_request_number (connection, - "offset", - &offset); + TALER_MHD_parse_request_number (connection, + "offset", + &offset); - bool return_suppressed = false; + bool return_suppressed = false; - struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_bool ("return_suppressed", &return_suppressed), - GNUNET_JSON_spec_end () - }; + struct GNUNET_JSON_Specification spec[] = { + GNUNET_JSON_spec_bool ("return_suppressed", &return_suppressed), + GNUNET_JSON_spec_end () + }; // read the input json diff --git a/src/auditor/taler-auditor-httpd_closure-lags-upd.c b/src/auditor/taler-auditor-httpd_closure-lags-upd.c index 2cf86ecd5..546d77304 100644 --- a/src/auditor/taler-auditor-httpd_closure-lags-upd.c +++ b/src/auditor/taler-auditor-httpd_closure-lags-upd.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -135,5 +132,3 @@ TAH_CLOSURE_LAGS_handler_update ( return ret; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_coin-inconsistency-upd.c b/src/auditor/taler-auditor-httpd_coin-inconsistency-upd.c index b8e9abbbc..1e47ef2ab 100644 --- a/src/auditor/taler-auditor-httpd_coin-inconsistency-upd.c +++ b/src/auditor/taler-auditor-httpd_coin-inconsistency-upd.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -135,5 +132,3 @@ TAH_COIN_INCONSISTENCY_handler_update ( return ret; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-get.c b/src/auditor/taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-get.c index b124729f9..95affcbca 100644 --- a/src/auditor/taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-get.c +++ b/src/auditor/taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-get.c @@ -122,44 +122,16 @@ TAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_handler_get (struct TALER_MHD_parse_request_number (connection, "offset", &offset); - limit = 0; - bool return_suppressed = false; - - struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_bool ("return_suppressed", &return_suppressed), - GNUNET_JSON_spec_end () - }; - - // read the input json - /*json_t *json_in; + bool return_suppressed = false; + const char *ret_s = MHD_lookup_connection_value (connection, + MHD_GET_ARGUMENT_KIND, + "return_suppressed"); + if (ret_s != NULL && strcmp (ret_s, "true") == 0) { - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_post_json (connection, - connection_cls, - upload_data, - upload_data_size, - &json_in); - if (GNUNET_SYSERR == res) - return MHD_NO; - if ((GNUNET_NO == res) || - (NULL == json_in)) - return MHD_YES; - res = TALER_MHD_parse_json_data (connection, - json_in, - spec); - if (GNUNET_SYSERR == res) - { - json_decref (json_in); - return MHD_NO; - } - if (GNUNET_NO == res) - { - json_decref (json_in); - return MHD_YES; - } - }*/ + return_suppressed = true; + } + qs = TAH_plugin->get_denomination_key_validity_withdraw_inconsistency ( TAH_plugin->cls, diff --git a/src/auditor/taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-upd.c b/src/auditor/taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-upd.c index 9ff522b8e..a8410b41d 100644 --- a/src/auditor/taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-upd.c +++ b/src/auditor/taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-upd.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -27,7 +24,8 @@ #include "taler_json_lib.h" #include "taler_mhd_lib.h" #include "taler-auditor-httpd.h" -#include "taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-upd.h" +#include \ + "taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-upd.h" MHD_RESULT TAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_handler_update ( @@ -95,7 +93,8 @@ TAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_handler_update ( } /* execute transaction */ - qs = TAH_plugin->update_denomination_key_validity_withdraw_inconsistency (TAH_plugin->cls, &gu); + qs = TAH_plugin->update_denomination_key_validity_withdraw_inconsistency ( + TAH_plugin->cls, &gu); GNUNET_JSON_parse_free (spec); json_decref (json); @@ -135,5 +134,3 @@ TAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_handler_update ( return ret; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_denomination-pending-del.c b/src/auditor/taler-auditor-httpd_denomination-pending-del.c index 9436cb612..72fbf2100 100644 --- a/src/auditor/taler-auditor-httpd_denomination-pending-del.c +++ b/src/auditor/taler-auditor-httpd_denomination-pending-del.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -23,12 +20,12 @@ MHD_RESULT TAH_DENOMINATION_PENDING_handler_delete (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) + struct MHD_Connection * + connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]) { MHD_RESULT res; @@ -58,7 +55,7 @@ TAH_DENOMINATION_PENDING_handler_delete (struct TAH_RequestHandler *rh, // execute the transaction qs = TAH_plugin->delete_denomination_pending (TAH_plugin->cls, - row_id); + row_id); if (0 == qs) { @@ -83,5 +80,3 @@ TAH_DENOMINATION_PENDING_handler_delete (struct TAH_RequestHandler *rh, return res; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_denomination-pending-get.c b/src/auditor/taler-auditor-httpd_denomination-pending-get.c index 9b37a837f..49d1ab9d8 100644 --- a/src/auditor/taler-auditor-httpd_denomination-pending-get.c +++ b/src/auditor/taler-auditor-httpd_denomination-pending-get.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -18,7 +15,6 @@ */ - #include "platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> @@ -40,23 +36,23 @@ */ static enum GNUNET_GenericReturnValue process_denomination_pending (void *cls, - uint64_t serial_id, - const struct - TALER_AUDITORDB_DenominationPending - *dc) + uint64_t serial_id, + const struct + TALER_AUDITORDB_DenominationPending + *dc) { json_t *list = cls; json_t *obj; obj = GNUNET_JSON_PACK ( - GNUNET_JSON_pack_data_auto("denom_pub_hash", &dc->denom_pub_hash), -TALER_JSON_pack_amount("denom_balance", &dc->denom_balance), -TALER_JSON_pack_amount("denom_loss", &dc->denom_loss), -GNUNET_JSON_pack_int64("num_issued", dc->num_issued), -TALER_JSON_pack_amount("denom_risk", &dc->denom_risk), -TALER_JSON_pack_amount("recoup_loss", &dc->recoup_loss), -GNUNET_JSON_pack_bool("suppressed", dc->suppressed) + GNUNET_JSON_pack_data_auto ("denom_pub_hash", &dc->denom_pub_hash), + TALER_JSON_pack_amount ("denom_balance", &dc->denom_balance), + TALER_JSON_pack_amount ("denom_loss", &dc->denom_loss), + GNUNET_JSON_pack_int64 ("num_issued", dc->num_issued), + TALER_JSON_pack_amount ("denom_risk", &dc->denom_risk), + TALER_JSON_pack_amount ("recoup_loss", &dc->recoup_loss), + GNUNET_JSON_pack_bool ("suppressed", dc->suppressed) ); @@ -80,12 +76,12 @@ GNUNET_JSON_pack_bool("suppressed", dc->suppressed) */ MHD_RESULT TAH_DENOMINATION_PENDING_handler_get (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) + struct MHD_Connection * + connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]) { json_t *ja; enum GNUNET_DB_QueryStatus qs; @@ -184,6 +180,3 @@ TAH_DENOMINATION_PENDING_handler_get (struct TAH_RequestHandler *rh, GNUNET_JSON_pack_array_steal ("denomination-pending", ja)); } - - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_denomination-pending-put.c b/src/auditor/taler-auditor-httpd_denomination-pending-put.c index 6d271ada8..2bebbf085 100644 --- a/src/auditor/taler-auditor-httpd_denomination-pending-put.c +++ b/src/auditor/taler-auditor-httpd_denomination-pending-put.c @@ -1,5 +1,3 @@ - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -17,7 +15,6 @@ */ - #include "platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> @@ -58,7 +55,7 @@ process_inconsistency ( /* execute transaction */ qs = TAH_plugin->insert_denomination_pending (TAH_plugin->cls, - dc); + dc); if (0 > qs) { GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -91,13 +88,13 @@ TAH_DENOMINATION_PENDING_handler_put ( struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_fixed_auto("denom_pub_hash", &dc.denom_pub_hash), -TALER_JSON_spec_amount("denom_balance", TAH_currency, &dc.denom_balance), -TALER_JSON_spec_amount("denom_loss", TAH_currency, &dc.denom_loss), -GNUNET_JSON_spec_int64("num_issued", &dc.num_issued), -TALER_JSON_spec_amount("denom_risk", TAH_currency, &dc.denom_risk), -TALER_JSON_spec_amount("recoup_loss", TAH_currency, &dc.recoup_loss), -GNUNET_JSON_spec_bool("suppressed", &dc.suppressed), + GNUNET_JSON_spec_fixed_auto ("denom_pub_hash", &dc.denom_pub_hash), + TALER_JSON_spec_amount ("denom_balance", TAH_currency, &dc.denom_balance), + TALER_JSON_spec_amount ("denom_loss", TAH_currency, &dc.denom_loss), + GNUNET_JSON_spec_int64 ("num_issued", &dc.num_issued), + TALER_JSON_spec_amount ("denom_risk", TAH_currency, &dc.denom_risk), + TALER_JSON_spec_amount ("recoup_loss", TAH_currency, &dc.recoup_loss), + GNUNET_JSON_spec_bool ("suppressed", &dc.suppressed), GNUNET_JSON_spec_end () @@ -161,5 +158,3 @@ TEAH_DENOMINATION_PENDING_PUT_done (void) { } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_denomination-pending-upd.c b/src/auditor/taler-auditor-httpd_denomination-pending-upd.c index e2f9fa635..15fef5454 100644 --- a/src/auditor/taler-auditor-httpd_denomination-pending-upd.c +++ b/src/auditor/taler-auditor-httpd_denomination-pending-upd.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -135,5 +132,3 @@ TAH_DENOMINATION_PENDING_handler_update ( return ret; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_denominations-without-sigs-del.c b/src/auditor/taler-auditor-httpd_denominations-without-sigs-del.c index 7cb06eb05..88a708900 100644 --- a/src/auditor/taler-auditor-httpd_denominations-without-sigs-del.c +++ b/src/auditor/taler-auditor-httpd_denominations-without-sigs-del.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -23,12 +20,12 @@ MHD_RESULT TAH_DENOMINATIONS_WITHOUT_SIGS_handler_delete (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) + struct MHD_Connection * + connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]) { MHD_RESULT res; @@ -58,7 +55,7 @@ TAH_DENOMINATIONS_WITHOUT_SIGS_handler_delete (struct TAH_RequestHandler *rh, // execute the transaction qs = TAH_plugin->delete_denominations_without_sigs (TAH_plugin->cls, - row_id); + row_id); if (0 == qs) { @@ -83,5 +80,3 @@ TAH_DENOMINATIONS_WITHOUT_SIGS_handler_delete (struct TAH_RequestHandler *rh, return res; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_denominations-without-sigs-get.c b/src/auditor/taler-auditor-httpd_denominations-without-sigs-get.c index 34852d8c6..9279420f6 100644 --- a/src/auditor/taler-auditor-httpd_denominations-without-sigs-get.c +++ b/src/auditor/taler-auditor-httpd_denominations-without-sigs-get.c @@ -118,40 +118,12 @@ TAH_DENOMINATIONS_WITHOUT_SIGS_handler_get (struct TAH_RequestHandler *rh, &offset); bool return_suppressed = false; - - struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_bool ("return_suppressed", &return_suppressed), - GNUNET_JSON_spec_end () - }; - - // read the input json - json_t *json_in; + const char *ret_s = MHD_lookup_connection_value (connection, + MHD_GET_ARGUMENT_KIND, + "return_suppressed"); + if (ret_s != NULL && strcmp (ret_s, "true") == 0) { - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_post_json (connection, - connection_cls, - upload_data, - upload_data_size, - &json_in); - if (GNUNET_SYSERR == res) - return MHD_NO; - if ((GNUNET_NO == res) || - (NULL == json_in)) - return MHD_YES; - res = TALER_MHD_parse_json_data (connection, - json_in, - spec); - if (GNUNET_SYSERR == res) - { - json_decref (json_in); - return MHD_NO; /* hard failure */ - } - if (GNUNET_NO == res) - { - json_decref (json_in); - return MHD_YES; /* failure */ - } + return_suppressed = true; } qs = TAH_plugin->get_denominations_without_sigs ( @@ -176,6 +148,6 @@ TAH_DENOMINATIONS_WITHOUT_SIGS_handler_get (struct TAH_RequestHandler *rh, return TALER_MHD_REPLY_JSON_PACK ( connection, MHD_HTTP_OK, - GNUNET_JSON_pack_array_steal ("denominations-without-sigs", + GNUNET_JSON_pack_array_steal ("denominations_without_sigs", ja)); } diff --git a/src/auditor/taler-auditor-httpd_denominations-without-sigs-put.c b/src/auditor/taler-auditor-httpd_denominations-without-sigs-put.c index 0a7a1b1f3..025e9fdfc 100644 --- a/src/auditor/taler-auditor-httpd_denominations-without-sigs-put.c +++ b/src/auditor/taler-auditor-httpd_denominations-without-sigs-put.c @@ -1,5 +1,3 @@ - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -17,7 +15,6 @@ */ - #include "platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> @@ -58,7 +55,7 @@ process_inconsistency ( /* execute transaction */ qs = TAH_plugin->insert_denominations_without_sigs (TAH_plugin->cls, - dc); + dc); if (0 > qs) { GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -91,11 +88,11 @@ TAH_DENOMINATIONS_WITHOUT_SIGS_handler_put ( struct GNUNET_JSON_Specification spec[] = { -GNUNET_JSON_spec_fixed_auto("denompub_h", &dc.denompub_h), -TALER_JSON_spec_amount("value", TAH_currency, &dc.value), -GNUNET_JSON_spec_int64("start_time", &dc.start_time), -GNUNET_JSON_spec_int64("end_time", &dc.end_time), -GNUNET_JSON_spec_bool("suppressed", &dc.suppressed), + GNUNET_JSON_spec_fixed_auto ("denompub_h", &dc.denompub_h), + TALER_JSON_spec_amount ("value", TAH_currency, &dc.value), + GNUNET_JSON_spec_int64 ("start_time", &dc.start_time), + GNUNET_JSON_spec_int64 ("end_time", &dc.end_time), + GNUNET_JSON_spec_bool ("suppressed", &dc.suppressed), GNUNET_JSON_spec_end () @@ -159,5 +156,3 @@ TEAH_DENOMINATIONS_WITHOUT_SIGS_PUT_done (void) { } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_denominations-without-sigs-upd.c b/src/auditor/taler-auditor-httpd_denominations-without-sigs-upd.c index 3a2a9749b..15e21df99 100644 --- a/src/auditor/taler-auditor-httpd_denominations-without-sigs-upd.c +++ b/src/auditor/taler-auditor-httpd_denominations-without-sigs-upd.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -135,5 +132,3 @@ TAH_DENOMINATIONS_WITHOUT_SIGS_handler_update ( return ret; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_deposit-confirmation-get.c b/src/auditor/taler-auditor-httpd_deposit-confirmation-get.c index de1829ca9..3a3719e77 100644 --- a/src/auditor/taler-auditor-httpd_deposit-confirmation-get.c +++ b/src/auditor/taler-auditor-httpd_deposit-confirmation-get.c @@ -77,8 +77,7 @@ TAH_DEPOSIT_CONFIRMATION_handler_get (struct TAH_RequestHandler *rh, {
json_t *ja;
enum GNUNET_DB_QueryStatus qs;
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "getting in here 2\n");
+
(void) rh;
(void) connection_cls;
(void) upload_data;
@@ -98,46 +97,31 @@ TAH_DEPOSIT_CONFIRMATION_handler_get (struct TAH_RequestHandler *rh, uint64_t row_id = 0;
bool return_suppressed = false;
- struct GNUNET_JSON_Specification spec[] = {
- GNUNET_JSON_spec_uint64 ("row_id",
- &row_id),
+ int64_t limit = -20; // unused here
+ uint64_t offset;
+
+ TALER_MHD_parse_request_snumber (connection,
+ "limit",
+ &limit);
- GNUNET_JSON_spec_bool ("return_suppressed",
- &return_suppressed),
+ if (limit < 0)
+ offset = INT64_MAX;
+ else
+ offset = 0;
- GNUNET_JSON_spec_end ()
- };
+ TALER_MHD_parse_request_number (connection,
+ "offset",
+ &offset);
- // read the input json
- /*json_t *json_in;
+ const char *ret_s = MHD_lookup_connection_value (connection,
+ MHD_GET_ARGUMENT_KIND,
+ "return_suppressed");
+ if (ret_s != NULL && strcmp (ret_s, "true") == 0)
{
- enum GNUNET_GenericReturnValue res;
-
- res = TALER_MHD_parse_post_json (connection,
- connection_cls,
- upload_data,
- upload_data_size,
- &json_in);
- if (GNUNET_SYSERR == res)
- return MHD_NO;
- if ((GNUNET_NO == res) ||
- (NULL == json_in))
- return MHD_YES;
- res = TALER_MHD_parse_json_data (connection,
- json_in,
- spec);
- if (GNUNET_SYSERR == res)
- {
- json_decref (json_in);
- return MHD_NO;
- }
- if (GNUNET_NO == res)
- {
- json_decref (json_in);
- return MHD_YES;
- }
- }*/
+ return_suppressed = true;
+ }
+
qs = TAH_plugin->get_deposit_confirmations (
TAH_plugin->cls,
@@ -145,8 +129,7 @@ TAH_DEPOSIT_CONFIRMATION_handler_get (struct TAH_RequestHandler *rh, return_suppressed,
&add_deposit_confirmation,
ja);
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "getting in here 4\n");
+
if (0 > qs)
{
GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs);
diff --git a/src/auditor/taler-auditor-httpd_emergency-by-count-get.c b/src/auditor/taler-auditor-httpd_emergency-by-count-get.c index 6a7f2e9b9..b099b17ad 100644 --- a/src/auditor/taler-auditor-httpd_emergency-by-count-get.c +++ b/src/auditor/taler-auditor-httpd_emergency-by-count-get.c @@ -118,48 +118,19 @@ TAH_EMERGENCY_BY_COUNT_handler_get (struct TAH_RequestHandler *rh, offset = INT64_MAX; else offset = 0; - limit = 0; + TALER_MHD_parse_request_number (connection, "offset", &offset); bool return_suppressed = false; - - struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_bool ("return_suppressed", &return_suppressed), - GNUNET_JSON_spec_end () - }; - - - // read the input json - /*json_t *json_in; + const char *ret_s = MHD_lookup_connection_value (connection, + MHD_GET_ARGUMENT_KIND, + "return_suppressed"); + if (ret_s != NULL && strcmp (ret_s, "true") == 0) { - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_post_json (connection, - connection_cls, - upload_data, - upload_data_size, - &json_in); - if (GNUNET_SYSERR == res) - return MHD_NO; - if ((GNUNET_NO == res) || - (NULL == json_in)) - return MHD_YES; - res = TALER_MHD_parse_json_data (connection, - json_in, - spec); - if (GNUNET_SYSERR == res) - { - json_decref (json_in); - return MHD_NO; - } - if (GNUNET_NO == res) - { - json_decref (json_in); - return MHD_YES; - } - }*/ + return_suppressed = true; + } qs = TAH_plugin->get_emergency_by_count ( TAH_plugin->cls, diff --git a/src/auditor/taler-auditor-httpd_emergency-by-count-upd.c b/src/auditor/taler-auditor-httpd_emergency-by-count-upd.c index 892f2a29e..5b5d1b079 100644 --- a/src/auditor/taler-auditor-httpd_emergency-by-count-upd.c +++ b/src/auditor/taler-auditor-httpd_emergency-by-count-upd.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -135,5 +132,3 @@ TAH_EMERGENCY_BY_COUNT_handler_update ( return ret; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_emergency-get.c b/src/auditor/taler-auditor-httpd_emergency-get.c index 95648c793..a2bf555e7 100644 --- a/src/auditor/taler-auditor-httpd_emergency-get.c +++ b/src/auditor/taler-auditor-httpd_emergency-get.c @@ -126,43 +126,13 @@ TAH_EMERGENCY_handler_get (struct TAH_RequestHandler *rh, &offset); bool return_suppressed = false; - limit = 0; - - struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_bool ("return_suppressed", &return_suppressed), - GNUNET_JSON_spec_end () - }; - - - // read the input json - /*json_t *json_in; + const char *ret_s = MHD_lookup_connection_value (connection, + MHD_GET_ARGUMENT_KIND, + "return_suppressed"); + if (ret_s != NULL && strcmp (ret_s, "true") == 0) { - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_post_json (connection, - connection_cls, - upload_data, - upload_data_size, - &json_in); - if (GNUNET_SYSERR == res) - return MHD_NO; - if ((GNUNET_NO == res) || - (NULL == json_in)) - return MHD_YES; - res = TALER_MHD_parse_json_data (connection, - json_in, - spec); - if (GNUNET_SYSERR == res) - { - json_decref (json_in); - return MHD_NO; - } - if (GNUNET_NO == res) - { - json_decref (json_in); - return MHD_YES; - } - }*/ + return_suppressed = true; + } qs = TAH_plugin->get_emergency ( TAH_plugin->cls, diff --git a/src/auditor/taler-auditor-httpd_emergency-upd.c b/src/auditor/taler-auditor-httpd_emergency-upd.c index f53a7748d..ace66b34b 100644 --- a/src/auditor/taler-auditor-httpd_emergency-upd.c +++ b/src/auditor/taler-auditor-httpd_emergency-upd.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -135,5 +132,3 @@ TAH_EMERGENCY_handler_update ( return ret; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_exchange-signkeys-del.c b/src/auditor/taler-auditor-httpd_exchange-signkeys-del.c index 7ff5c2fd6..53da744ee 100644 --- a/src/auditor/taler-auditor-httpd_exchange-signkeys-del.c +++ b/src/auditor/taler-auditor-httpd_exchange-signkeys-del.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -23,12 +20,12 @@ MHD_RESULT TAH_EXCHANGE_SIGNKEYS_handler_delete (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) + struct MHD_Connection * + connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]) { MHD_RESULT res; @@ -58,7 +55,7 @@ TAH_EXCHANGE_SIGNKEYS_handler_delete (struct TAH_RequestHandler *rh, // execute the transaction qs = TAH_plugin->delete_exchange_signkeys (TAH_plugin->cls, - row_id); + row_id); if (0 == qs) { @@ -83,5 +80,3 @@ TAH_EXCHANGE_SIGNKEYS_handler_delete (struct TAH_RequestHandler *rh, return res; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_exchange-signkeys-get.c b/src/auditor/taler-auditor-httpd_exchange-signkeys-get.c index 7f7ba049a..003f33d08 100644 --- a/src/auditor/taler-auditor-httpd_exchange-signkeys-get.c +++ b/src/auditor/taler-auditor-httpd_exchange-signkeys-get.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -18,7 +15,6 @@ */ - #include "platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> @@ -40,22 +36,22 @@ */ static enum GNUNET_GenericReturnValue process_exchange_signkeys (void *cls, - uint64_t serial_id, - const struct - TALER_AUDITORDB_ExchangeSignkeys - *dc) + uint64_t serial_id, + const struct + TALER_AUDITORDB_ExchangeSignkeys + *dc) { json_t *list = cls; json_t *obj; obj = GNUNET_JSON_PACK ( - GNUNET_JSON_pack_data_auto("exchange_pub", &dc->exchange_pub), -GNUNET_JSON_pack_data_auto("master_sig", &dc->master_sig), -GNUNET_JSON_pack_int64("ep_valid_from", dc->ep_valid_from), -GNUNET_JSON_pack_int64("ep_expire_sign", dc->ep_expire_sign), -GNUNET_JSON_pack_int64("ep_expire_legal", dc->ep_expire_legal), -GNUNET_JSON_pack_bool("suppressed", dc->suppressed) + GNUNET_JSON_pack_data_auto ("exchange_pub", &dc->exchange_pub), + GNUNET_JSON_pack_data_auto ("master_sig", &dc->master_sig), + GNUNET_JSON_pack_int64 ("ep_valid_from", dc->ep_valid_from), + GNUNET_JSON_pack_int64 ("ep_expire_sign", dc->ep_expire_sign), + GNUNET_JSON_pack_int64 ("ep_expire_legal", dc->ep_expire_legal), + GNUNET_JSON_pack_bool ("suppressed", dc->suppressed) ); @@ -79,12 +75,12 @@ GNUNET_JSON_pack_bool("suppressed", dc->suppressed) */ MHD_RESULT TAH_EXCHANGE_SIGNKEYS_handler_get (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) + struct MHD_Connection * + connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]) { json_t *ja; enum GNUNET_DB_QueryStatus qs; @@ -183,6 +179,3 @@ TAH_EXCHANGE_SIGNKEYS_handler_get (struct TAH_RequestHandler *rh, GNUNET_JSON_pack_array_steal ("exchange-signkeys", ja)); } - - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_exchange-signkeys-put.c b/src/auditor/taler-auditor-httpd_exchange-signkeys-put.c index 8e6d7a8ee..a05ad3fc0 100644 --- a/src/auditor/taler-auditor-httpd_exchange-signkeys-put.c +++ b/src/auditor/taler-auditor-httpd_exchange-signkeys-put.c @@ -1,5 +1,3 @@ - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -17,7 +15,6 @@ */ - #include "platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> @@ -58,7 +55,7 @@ process_inconsistency ( /* execute transaction */ qs = TAH_plugin->insert_exchange_signkeys (TAH_plugin->cls, - dc); + dc); if (0 > qs) { GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -91,12 +88,12 @@ TAH_EXCHANGE_SIGNKEYS_handler_put ( struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_fixed_auto("exchange_pub", &dc.exchange_pub), -GNUNET_JSON_spec_fixed_auto("master_sig", &dc.master_sig), -GNUNET_JSON_spec_int64("ep_valid_from", &dc.ep_valid_from), -GNUNET_JSON_spec_int64("ep_expire_sign", &dc.ep_expire_sign), -GNUNET_JSON_spec_int64("ep_expire_legal", &dc.ep_expire_legal), -GNUNET_JSON_spec_bool("suppressed", &dc.suppressed), + GNUNET_JSON_spec_fixed_auto ("exchange_pub", &dc.exchange_pub), + GNUNET_JSON_spec_fixed_auto ("master_sig", &dc.master_sig), + GNUNET_JSON_spec_int64 ("ep_valid_from", &dc.ep_valid_from), + GNUNET_JSON_spec_int64 ("ep_expire_sign", &dc.ep_expire_sign), + GNUNET_JSON_spec_int64 ("ep_expire_legal", &dc.ep_expire_legal), + GNUNET_JSON_spec_bool ("suppressed", &dc.suppressed), GNUNET_JSON_spec_end () @@ -160,5 +157,3 @@ TEAH_EXCHANGE_SIGNKEYS_PUT_done (void) { } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_exchange-signkeys-upd.c b/src/auditor/taler-auditor-httpd_exchange-signkeys-upd.c index c76a0e18b..d934284fc 100644 --- a/src/auditor/taler-auditor-httpd_exchange-signkeys-upd.c +++ b/src/auditor/taler-auditor-httpd_exchange-signkeys-upd.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -135,5 +132,3 @@ TAH_EXCHANGE_SIGNKEYS_handler_update ( return ret; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_historic-denomination-revenue-del.c b/src/auditor/taler-auditor-httpd_historic-denomination-revenue-del.c index e9c3eba90..62d672050 100644 --- a/src/auditor/taler-auditor-httpd_historic-denomination-revenue-del.c +++ b/src/auditor/taler-auditor-httpd_historic-denomination-revenue-del.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -23,12 +20,12 @@ MHD_RESULT TAH_HISTORIC_DENOMINATION_REVENUE_handler_delete (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) + struct MHD_Connection * + connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]) { MHD_RESULT res; @@ -58,7 +55,7 @@ TAH_HISTORIC_DENOMINATION_REVENUE_handler_delete (struct TAH_RequestHandler *rh, // execute the transaction qs = TAH_plugin->delete_historic_denomination_revenue (TAH_plugin->cls, - row_id); + row_id); if (0 == qs) { @@ -83,5 +80,3 @@ TAH_HISTORIC_DENOMINATION_REVENUE_handler_delete (struct TAH_RequestHandler *rh, return res; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_historic-denomination-revenue-get.c b/src/auditor/taler-auditor-httpd_historic-denomination-revenue-get.c index af3a84784..ff9f7b71e 100644 --- a/src/auditor/taler-auditor-httpd_historic-denomination-revenue-get.c +++ b/src/auditor/taler-auditor-httpd_historic-denomination-revenue-get.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -18,7 +15,6 @@ */ - #include "platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> @@ -40,21 +36,21 @@ */ static enum GNUNET_GenericReturnValue process_historic_denomination_revenue (void *cls, - uint64_t serial_id, - const struct - TALER_AUDITORDB_HistoricDenominationRevenue - *dc) + uint64_t serial_id, + const struct + TALER_AUDITORDB_HistoricDenominationRevenue + *dc) { json_t *list = cls; json_t *obj; obj = GNUNET_JSON_PACK ( - GNUNET_JSON_pack_data_auto("denom_pub_hash", &dc->denom_pub_hash), -GNUNET_JSON_pack_int64("revenue_timestamp", dc->revenue_timestamp), -TALER_JSON_pack_amount("revenue_balance", &dc->revenue_balance), -TALER_JSON_pack_amount("loss_balance", &dc->loss_balance), -GNUNET_JSON_pack_bool("suppressed", dc->suppressed) + GNUNET_JSON_pack_data_auto ("denom_pub_hash", &dc->denom_pub_hash), + GNUNET_JSON_pack_int64 ("revenue_timestamp", dc->revenue_timestamp), + TALER_JSON_pack_amount ("revenue_balance", &dc->revenue_balance), + TALER_JSON_pack_amount ("loss_balance", &dc->loss_balance), + GNUNET_JSON_pack_bool ("suppressed", dc->suppressed) ); @@ -78,12 +74,12 @@ GNUNET_JSON_pack_bool("suppressed", dc->suppressed) */ MHD_RESULT TAH_HISTORIC_DENOMINATION_REVENUE_handler_get (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) + struct MHD_Connection * + connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]) { json_t *ja; enum GNUNET_DB_QueryStatus qs; @@ -182,6 +178,3 @@ TAH_HISTORIC_DENOMINATION_REVENUE_handler_get (struct TAH_RequestHandler *rh, GNUNET_JSON_pack_array_steal ("historic-denomination-revenue", ja)); } - - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_historic-denomination-revenue-put.c b/src/auditor/taler-auditor-httpd_historic-denomination-revenue-put.c index 938507c14..89166925a 100644 --- a/src/auditor/taler-auditor-httpd_historic-denomination-revenue-put.c +++ b/src/auditor/taler-auditor-httpd_historic-denomination-revenue-put.c @@ -1,5 +1,3 @@ - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -17,7 +15,6 @@ */ - #include "platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> @@ -58,7 +55,7 @@ process_inconsistency ( /* execute transaction */ qs = TAH_plugin->insert_historic_denomination_revenue (TAH_plugin->cls, - dc); + dc); if (0 > qs) { GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -91,11 +88,12 @@ TAH_HISTORIC_DENOMINATION_REVENUE_handler_put ( struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_fixed_auto("denom_pub_hash", &dc.denom_pub_hash), -GNUNET_JSON_spec_int64("revenue_timestamp", &dc.revenue_timestamp), -TALER_JSON_spec_amount("revenue_balance", TAH_currency, &dc.revenue_balance), -TALER_JSON_spec_amount("loss_balance", TAH_currency, &dc.loss_balance), -GNUNET_JSON_spec_bool("suppressed", &dc.suppressed), + GNUNET_JSON_spec_fixed_auto ("denom_pub_hash", &dc.denom_pub_hash), + GNUNET_JSON_spec_int64 ("revenue_timestamp", &dc.revenue_timestamp), + TALER_JSON_spec_amount ("revenue_balance", TAH_currency, + &dc.revenue_balance), + TALER_JSON_spec_amount ("loss_balance", TAH_currency, &dc.loss_balance), + GNUNET_JSON_spec_bool ("suppressed", &dc.suppressed), GNUNET_JSON_spec_end () @@ -159,5 +157,3 @@ TEAH_HISTORIC_DENOMINATION_REVENUE_PUT_done (void) { } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_historic-denomination-revenue-upd.c b/src/auditor/taler-auditor-httpd_historic-denomination-revenue-upd.c index 1f01d5ce4..39865004f 100644 --- a/src/auditor/taler-auditor-httpd_historic-denomination-revenue-upd.c +++ b/src/auditor/taler-auditor-httpd_historic-denomination-revenue-upd.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -135,5 +132,3 @@ TAH_HISTORIC_DENOMINATION_REVENUE_handler_update ( return ret; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_historic-reserve-summary-del.c b/src/auditor/taler-auditor-httpd_historic-reserve-summary-del.c index 373d5d12f..c30a08420 100644 --- a/src/auditor/taler-auditor-httpd_historic-reserve-summary-del.c +++ b/src/auditor/taler-auditor-httpd_historic-reserve-summary-del.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -23,12 +20,12 @@ MHD_RESULT TAH_HISTORIC_RESERVE_SUMMARY_handler_delete (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) + struct MHD_Connection * + connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]) { MHD_RESULT res; @@ -58,7 +55,7 @@ TAH_HISTORIC_RESERVE_SUMMARY_handler_delete (struct TAH_RequestHandler *rh, // execute the transaction qs = TAH_plugin->delete_historic_reserve_summary (TAH_plugin->cls, - row_id); + row_id); if (0 == qs) { @@ -83,5 +80,3 @@ TAH_HISTORIC_RESERVE_SUMMARY_handler_delete (struct TAH_RequestHandler *rh, return res; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_historic-reserve-summary-get.c b/src/auditor/taler-auditor-httpd_historic-reserve-summary-get.c index f6f2ad8e3..b58c5f3cb 100644 --- a/src/auditor/taler-auditor-httpd_historic-reserve-summary-get.c +++ b/src/auditor/taler-auditor-httpd_historic-reserve-summary-get.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -18,7 +15,6 @@ */ - #include "platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> @@ -40,20 +36,20 @@ */ static enum GNUNET_GenericReturnValue process_historic_reserve_summary (void *cls, - uint64_t serial_id, - const struct - TALER_AUDITORDB_HistoricReserveSummary - *dc) + uint64_t serial_id, + const struct + TALER_AUDITORDB_HistoricReserveSummary + *dc) { json_t *list = cls; json_t *obj; obj = GNUNET_JSON_PACK ( - GNUNET_JSON_pack_int64("start_date", dc->start_date), -GNUNET_JSON_pack_int64("end_date", dc->end_date), -TALER_JSON_pack_amount("reserve_profits", &dc->reserve_profits), -GNUNET_JSON_pack_bool("suppressed", dc->suppressed) + GNUNET_JSON_pack_int64 ("start_date", dc->start_date), + GNUNET_JSON_pack_int64 ("end_date", dc->end_date), + TALER_JSON_pack_amount ("reserve_profits", &dc->reserve_profits), + GNUNET_JSON_pack_bool ("suppressed", dc->suppressed) ); @@ -77,12 +73,12 @@ GNUNET_JSON_pack_bool("suppressed", dc->suppressed) */ MHD_RESULT TAH_HISTORIC_RESERVE_SUMMARY_handler_get (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) + struct MHD_Connection * + connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]) { json_t *ja; enum GNUNET_DB_QueryStatus qs; @@ -181,6 +177,3 @@ TAH_HISTORIC_RESERVE_SUMMARY_handler_get (struct TAH_RequestHandler *rh, GNUNET_JSON_pack_array_steal ("historic-reserve-summary", ja)); } - - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_historic-reserve-summary-put.c b/src/auditor/taler-auditor-httpd_historic-reserve-summary-put.c index 89d9c5100..e0f099464 100644 --- a/src/auditor/taler-auditor-httpd_historic-reserve-summary-put.c +++ b/src/auditor/taler-auditor-httpd_historic-reserve-summary-put.c @@ -1,5 +1,3 @@ - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -17,7 +15,6 @@ */ - #include "platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> @@ -58,7 +55,7 @@ process_inconsistency ( /* execute transaction */ qs = TAH_plugin->insert_historic_reserve_summary (TAH_plugin->cls, - dc); + dc); if (0 > qs) { GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -91,10 +88,11 @@ TAH_HISTORIC_RESERVE_SUMMARY_handler_put ( struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_int64("start_date", &dc.start_date), -GNUNET_JSON_spec_int64("end_date", &dc.end_date), -TALER_JSON_spec_amount("reserve_profits", TAH_currency, &dc.reserve_profits), -GNUNET_JSON_spec_bool("suppressed", &dc.suppressed), + GNUNET_JSON_spec_int64 ("start_date", &dc.start_date), + GNUNET_JSON_spec_int64 ("end_date", &dc.end_date), + TALER_JSON_spec_amount ("reserve_profits", TAH_currency, + &dc.reserve_profits), + GNUNET_JSON_spec_bool ("suppressed", &dc.suppressed), GNUNET_JSON_spec_end () @@ -158,5 +156,3 @@ TEAH_HISTORIC_RESERVE_SUMMARY_PUT_done (void) { } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_historic-reserve-summary-upd.c b/src/auditor/taler-auditor-httpd_historic-reserve-summary-upd.c index 0a79f94fb..10d5264d3 100644 --- a/src/auditor/taler-auditor-httpd_historic-reserve-summary-upd.c +++ b/src/auditor/taler-auditor-httpd_historic-reserve-summary-upd.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -135,5 +132,3 @@ TAH_HISTORIC_RESERVE_SUMMARY_handler_update ( return ret; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_misattribution-in-inconsistency-del.c b/src/auditor/taler-auditor-httpd_misattribution-in-inconsistency-del.c index 128b9a42a..1a0fbdce3 100644 --- a/src/auditor/taler-auditor-httpd_misattribution-in-inconsistency-del.c +++ b/src/auditor/taler-auditor-httpd_misattribution-in-inconsistency-del.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -22,13 +19,14 @@ MHD_RESULT -TAH_MISATTRIBUTION_IN_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) +TAH_MISATTRIBUTION_IN_INCONSISTENCY_handler_delete (struct + TAH_RequestHandler *rh, + struct MHD_Connection * + connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]) { MHD_RESULT res; @@ -58,7 +56,7 @@ TAH_MISATTRIBUTION_IN_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *r // execute the transaction qs = TAH_plugin->delete_misattribution_in_inconsistency (TAH_plugin->cls, - row_id); + row_id); if (0 == qs) { @@ -83,5 +81,3 @@ TAH_MISATTRIBUTION_IN_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *r return res; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_misattribution-in-inconsistency-get.c b/src/auditor/taler-auditor-httpd_misattribution-in-inconsistency-get.c index 268c58636..a282721ce 100644 --- a/src/auditor/taler-auditor-httpd_misattribution-in-inconsistency-get.c +++ b/src/auditor/taler-auditor-httpd_misattribution-in-inconsistency-get.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -18,7 +15,6 @@ */ - #include "platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> @@ -40,21 +36,21 @@ */ static enum GNUNET_GenericReturnValue process_misattribution_in_inconsistency (void *cls, - uint64_t serial_id, - const struct - TALER_AUDITORDB_MisattributionInInconsistency - *dc) + uint64_t serial_id, + const struct + TALER_AUDITORDB_MisattributionInInconsistency + *dc) { json_t *list = cls; json_t *obj; obj = GNUNET_JSON_PACK ( - GNUNET_JSON_pack_int64("row_id", serial_id), -TALER_JSON_pack_amount("amount", &dc->amount), -GNUNET_JSON_pack_int64("bank_row", dc->bank_row), -GNUNET_JSON_pack_data_auto("reserve_pub", &dc->reserve_pub), -GNUNET_JSON_pack_bool("suppressed", dc->suppressed) + GNUNET_JSON_pack_int64 ("row_id", serial_id), + TALER_JSON_pack_amount ("amount", &dc->amount), + GNUNET_JSON_pack_int64 ("bank_row", dc->bank_row), + GNUNET_JSON_pack_data_auto ("reserve_pub", &dc->reserve_pub), + GNUNET_JSON_pack_bool ("suppressed", dc->suppressed) ); @@ -78,12 +74,12 @@ GNUNET_JSON_pack_bool("suppressed", dc->suppressed) */ MHD_RESULT TAH_MISATTRIBUTION_IN_INCONSISTENCY_handler_get (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) + struct MHD_Connection * + connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]) { json_t *ja; enum GNUNET_DB_QueryStatus qs; @@ -182,6 +178,3 @@ TAH_MISATTRIBUTION_IN_INCONSISTENCY_handler_get (struct TAH_RequestHandler *rh, GNUNET_JSON_pack_array_steal ("misattribution-in-inconsistency", ja)); } - - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_misattribution-in-inconsistency-put.c b/src/auditor/taler-auditor-httpd_misattribution-in-inconsistency-put.c index 99bfd48ed..346058f96 100644 --- a/src/auditor/taler-auditor-httpd_misattribution-in-inconsistency-put.c +++ b/src/auditor/taler-auditor-httpd_misattribution-in-inconsistency-put.c @@ -1,5 +1,3 @@ - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -17,7 +15,6 @@ */ - #include "platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> @@ -58,7 +55,7 @@ process_inconsistency ( /* execute transaction */ qs = TAH_plugin->insert_misattribution_in_inconsistency (TAH_plugin->cls, - dc); + dc); if (0 > qs) { GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -91,10 +88,10 @@ TAH_MISATTRIBUTION_IN_INCONSISTENCY_handler_put ( struct GNUNET_JSON_Specification spec[] = { -TALER_JSON_spec_amount("amount", TAH_currency, &dc.amount), -GNUNET_JSON_spec_int64("bank_row", &dc.bank_row), -GNUNET_JSON_spec_fixed_auto("reserve_pub", &dc.reserve_pub), -GNUNET_JSON_spec_bool("suppressed", &dc.suppressed), + TALER_JSON_spec_amount ("amount", TAH_currency, &dc.amount), + GNUNET_JSON_spec_int64 ("bank_row", &dc.bank_row), + GNUNET_JSON_spec_fixed_auto ("reserve_pub", &dc.reserve_pub), + GNUNET_JSON_spec_bool ("suppressed", &dc.suppressed), GNUNET_JSON_spec_end () @@ -158,5 +155,3 @@ TEAH_MISATTRIBUTION_IN_INCONSISTENCY_PUT_done (void) { } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_misattribution-in-inconsistency-upd.c b/src/auditor/taler-auditor-httpd_misattribution-in-inconsistency-upd.c index d86645ff9..b237b2f03 100644 --- a/src/auditor/taler-auditor-httpd_misattribution-in-inconsistency-upd.c +++ b/src/auditor/taler-auditor-httpd_misattribution-in-inconsistency-upd.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -95,7 +92,8 @@ TAH_MISATTRIBUTION_IN_INCONSISTENCY_handler_update ( } /* execute transaction */ - qs = TAH_plugin->update_misattribution_in_inconsistency (TAH_plugin->cls, &gu); + qs = TAH_plugin->update_misattribution_in_inconsistency (TAH_plugin->cls, + &gu); GNUNET_JSON_parse_free (spec); json_decref (json); @@ -135,5 +133,3 @@ TAH_MISATTRIBUTION_IN_INCONSISTENCY_handler_update ( return ret; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_progress-upd.c b/src/auditor/taler-auditor-httpd_progress-upd.c index 906644138..5788364cd 100644 --- a/src/auditor/taler-auditor-httpd_progress-upd.c +++ b/src/auditor/taler-auditor-httpd_progress-upd.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -135,5 +132,3 @@ TAH_PROGRESS_handler_update ( return ret; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_purse-not-closed-inconsistencies-get.c b/src/auditor/taler-auditor-httpd_purse-not-closed-inconsistencies-get.c index fc55be4aa..5190d34cd 100644 --- a/src/auditor/taler-auditor-httpd_purse-not-closed-inconsistencies-get.c +++ b/src/auditor/taler-auditor-httpd_purse-not-closed-inconsistencies-get.c @@ -121,40 +121,6 @@ TAH_PURSE_NOT_CLOSED_INCONSISTENCIES_handler_get (struct TAH_RequestHandler *rh, bool return_suppressed = false; - struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_bool ("return_suppressed", &return_suppressed), - GNUNET_JSON_spec_end () - }; - - // read the input json - json_t *json_in; - { - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_post_json (connection, - connection_cls, - upload_data, - upload_data_size, - &json_in); - if (GNUNET_SYSERR == res) - return MHD_NO; - if ((GNUNET_NO == res) || - (NULL == json_in)) - return MHD_YES; - res = TALER_MHD_parse_json_data (connection, - json_in, - spec); - if (GNUNET_SYSERR == res) - { - json_decref (json_in); - return MHD_NO; /* hard failure */ - } - if (GNUNET_NO == res) - { - json_decref (json_in); - return MHD_YES; /* failure */ - } - } qs = TAH_plugin->get_purse_not_closed_inconsistencies ( TAH_plugin->cls, diff --git a/src/auditor/taler-auditor-httpd_purse-not-closed-inconsistencies-upd.c b/src/auditor/taler-auditor-httpd_purse-not-closed-inconsistencies-upd.c index 226f9ea2f..c72531f9e 100644 --- a/src/auditor/taler-auditor-httpd_purse-not-closed-inconsistencies-upd.c +++ b/src/auditor/taler-auditor-httpd_purse-not-closed-inconsistencies-upd.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -95,7 +92,8 @@ TAH_PURSE_NOT_CLOSED_INCONSISTENCIES_handler_update ( } /* execute transaction */ - qs = TAH_plugin->update_purse_not_closed_inconsistencies (TAH_plugin->cls, &gu); + qs = TAH_plugin->update_purse_not_closed_inconsistencies (TAH_plugin->cls, + &gu); GNUNET_JSON_parse_free (spec); json_decref (json); @@ -135,5 +133,3 @@ TAH_PURSE_NOT_CLOSED_INCONSISTENCIES_handler_update ( return ret; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_purses-del.c b/src/auditor/taler-auditor-httpd_purses-del.c index da81e3b59..75ad5e585 100644 --- a/src/auditor/taler-auditor-httpd_purses-del.c +++ b/src/auditor/taler-auditor-httpd_purses-del.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -23,12 +20,12 @@ MHD_RESULT TAH_PURSES_handler_delete (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) + struct MHD_Connection * + connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]) { MHD_RESULT res; @@ -58,7 +55,7 @@ TAH_PURSES_handler_delete (struct TAH_RequestHandler *rh, // execute the transaction qs = TAH_plugin->delete_purses (TAH_plugin->cls, - row_id); + row_id); if (0 == qs) { @@ -83,5 +80,3 @@ TAH_PURSES_handler_delete (struct TAH_RequestHandler *rh, return res; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_purses-get.c b/src/auditor/taler-auditor-httpd_purses-get.c index 20d97ac83..2ce236fc4 100644 --- a/src/auditor/taler-auditor-httpd_purses-get.c +++ b/src/auditor/taler-auditor-httpd_purses-get.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -18,7 +15,6 @@ */ - #include "platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> @@ -40,22 +36,22 @@ */ static enum GNUNET_GenericReturnValue process_purses (void *cls, - uint64_t serial_id, - const struct - TALER_AUDITORDB_Purses - *dc) + uint64_t serial_id, + const struct + TALER_AUDITORDB_Purses + *dc) { json_t *list = cls; json_t *obj; obj = GNUNET_JSON_PACK ( - GNUNET_JSON_pack_int64("auditor_purses_rowid", dc->auditor_purses_rowid), -GNUNET_JSON_pack_data_auto("purse_pub", &dc->purse_pub), -TALER_JSON_pack_amount("balance", &dc->balance), -TALER_JSON_pack_amount("target", &dc->target), -GNUNET_JSON_pack_int64("expiration_date", dc->expiration_date), -GNUNET_JSON_pack_bool("suppressed", dc->suppressed) + GNUNET_JSON_pack_int64 ("auditor_purses_rowid", dc->auditor_purses_rowid), + GNUNET_JSON_pack_data_auto ("purse_pub", &dc->purse_pub), + TALER_JSON_pack_amount ("balance", &dc->balance), + TALER_JSON_pack_amount ("target", &dc->target), + GNUNET_JSON_pack_int64 ("expiration_date", dc->expiration_date), + GNUNET_JSON_pack_bool ("suppressed", dc->suppressed) ); @@ -79,12 +75,12 @@ GNUNET_JSON_pack_bool("suppressed", dc->suppressed) */ MHD_RESULT TAH_PURSES_handler_get (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) + struct MHD_Connection * + connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]) { json_t *ja; enum GNUNET_DB_QueryStatus qs; @@ -183,6 +179,3 @@ TAH_PURSES_handler_get (struct TAH_RequestHandler *rh, GNUNET_JSON_pack_array_steal ("purses", ja)); } - - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_purses-put.c b/src/auditor/taler-auditor-httpd_purses-put.c index c5edd2c91..e2d96179f 100644 --- a/src/auditor/taler-auditor-httpd_purses-put.c +++ b/src/auditor/taler-auditor-httpd_purses-put.c @@ -1,5 +1,3 @@ - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -17,7 +15,6 @@ */ - #include "platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> @@ -58,7 +55,7 @@ process_inconsistency ( /* execute transaction */ qs = TAH_plugin->insert_purses (TAH_plugin->cls, - dc); + dc); if (0 > qs) { GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -91,12 +88,12 @@ TAH_PURSES_handler_put ( struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_int64("auditor_purses_rowid", &dc.auditor_purses_rowid), -GNUNET_JSON_spec_fixed_auto("purse_pub", &dc.purse_pub), -TALER_JSON_spec_amount("balance", TAH_currency, &dc.balance), -TALER_JSON_spec_amount("target", TAH_currency, &dc.target), -GNUNET_JSON_spec_int64("expiration_date", &dc.expiration_date), -GNUNET_JSON_spec_bool("suppressed", &dc.suppressed), + GNUNET_JSON_spec_int64 ("auditor_purses_rowid", &dc.auditor_purses_rowid), + GNUNET_JSON_spec_fixed_auto ("purse_pub", &dc.purse_pub), + TALER_JSON_spec_amount ("balance", TAH_currency, &dc.balance), + TALER_JSON_spec_amount ("target", TAH_currency, &dc.target), + GNUNET_JSON_spec_int64 ("expiration_date", &dc.expiration_date), + GNUNET_JSON_spec_bool ("suppressed", &dc.suppressed), GNUNET_JSON_spec_end () @@ -160,5 +157,3 @@ TEAH_PURSES_PUT_done (void) { } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_purses-upd.c b/src/auditor/taler-auditor-httpd_purses-upd.c index 7c188de2e..9956e1f46 100644 --- a/src/auditor/taler-auditor-httpd_purses-upd.c +++ b/src/auditor/taler-auditor-httpd_purses-upd.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -135,5 +132,3 @@ TAH_PURSES_handler_update ( return ret; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_refreshes-hanging-upd.c b/src/auditor/taler-auditor-httpd_refreshes-hanging-upd.c index bf7bd8ea1..8675ea4fc 100644 --- a/src/auditor/taler-auditor-httpd_refreshes-hanging-upd.c +++ b/src/auditor/taler-auditor-httpd_refreshes-hanging-upd.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -135,5 +132,3 @@ TAH_REFRESHES_HANGING_handler_update ( return ret; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_reserve-balance-insufficient-inconsistency-get.c b/src/auditor/taler-auditor-httpd_reserve-balance-insufficient-inconsistency-get.c index cad7f0b43..859331f66 100644 --- a/src/auditor/taler-auditor-httpd_reserve-balance-insufficient-inconsistency-get.c +++ b/src/auditor/taler-auditor-httpd_reserve-balance-insufficient-inconsistency-get.c @@ -110,28 +110,28 @@ TAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_handler_get (struct ja = json_array (); GNUNET_break (NULL != ja); - int64_t limit = -20; - uint64_t offset; + int64_t limit = -20; + uint64_t offset; - TALER_MHD_parse_request_snumber (connection, - "limit", - &limit); + TALER_MHD_parse_request_snumber (connection, + "limit", + &limit); - if (limit < 0) - offset = INT64_MAX; - else - offset = 0; + if (limit < 0) + offset = INT64_MAX; + else + offset = 0; - TALER_MHD_parse_request_number (connection, - "offset", - &offset); + TALER_MHD_parse_request_number (connection, + "offset", + &offset); - bool return_suppressed = false; + bool return_suppressed = false; - struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_bool ("return_suppressed", &return_suppressed), - GNUNET_JSON_spec_end () - }; + struct GNUNET_JSON_Specification spec[] = { + GNUNET_JSON_spec_bool ("return_suppressed", &return_suppressed), + GNUNET_JSON_spec_end () + }; // read the input json diff --git a/src/auditor/taler-auditor-httpd_reserve-balance-insufficient-inconsistency-upd.c b/src/auditor/taler-auditor-httpd_reserve-balance-insufficient-inconsistency-upd.c index 124efd6dc..fb9a008f9 100644 --- a/src/auditor/taler-auditor-httpd_reserve-balance-insufficient-inconsistency-upd.c +++ b/src/auditor/taler-auditor-httpd_reserve-balance-insufficient-inconsistency-upd.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -95,7 +92,8 @@ TAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_handler_update ( } /* execute transaction */ - qs = TAH_plugin->update_reserve_balance_insufficient_inconsistency (TAH_plugin->cls, &gu); + qs = TAH_plugin->update_reserve_balance_insufficient_inconsistency ( + TAH_plugin->cls, &gu); GNUNET_JSON_parse_free (spec); json_decref (json); @@ -135,5 +133,3 @@ TAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_handler_update ( return ret; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-del.c b/src/auditor/taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-del.c index 071dcbe9d..ae71aedd2 100644 --- a/src/auditor/taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-del.c +++ b/src/auditor/taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-del.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -22,13 +19,20 @@ MHD_RESULT -TAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) +TAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_handler_delete (struct + TAH_RequestHandler + *rh, + struct + MHD_Connection * + connection, + void ** + connection_cls, + const char * + upload_data, + size_t * + upload_data_size, + const char * + const args[]) { MHD_RESULT res; @@ -57,8 +61,9 @@ TAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_handler_delete (struct TAH_Reque // execute the transaction - qs = TAH_plugin->delete_reserve_balance_summary_wrong_inconsistency (TAH_plugin->cls, - row_id); + qs = TAH_plugin->delete_reserve_balance_summary_wrong_inconsistency ( + TAH_plugin->cls, + row_id); if (0 == qs) { @@ -83,5 +88,3 @@ TAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_handler_delete (struct TAH_Reque return res; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-get.c b/src/auditor/taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-get.c index 212b58852..c30524419 100644 --- a/src/auditor/taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-get.c +++ b/src/auditor/taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-get.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -18,7 +15,6 @@ */ - #include "platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> @@ -40,21 +36,21 @@ */ static enum GNUNET_GenericReturnValue process_reserve_balance_summary_wrong_inconsistency (void *cls, - uint64_t serial_id, - const struct - TALER_AUDITORDB_ReserveBalanceSummaryWrongInconsistency - *dc) + uint64_t serial_id, + const struct + TALER_AUDITORDB_ReserveBalanceSummaryWrongInconsistency + *dc) { json_t *list = cls; json_t *obj; obj = GNUNET_JSON_PACK ( - GNUNET_JSON_pack_int64("row_id", serial_id), -GNUNET_JSON_pack_data_auto("reserve_pub", &dc->reserve_pub), -TALER_JSON_pack_amount("exchange_amount", &dc->exchange_amount), -TALER_JSON_pack_amount("auditor_amount", &dc->auditor_amount), -GNUNET_JSON_pack_bool("suppressed", dc->suppressed) + GNUNET_JSON_pack_int64 ("row_id", serial_id), + GNUNET_JSON_pack_data_auto ("reserve_pub", &dc->reserve_pub), + TALER_JSON_pack_amount ("exchange_amount", &dc->exchange_amount), + TALER_JSON_pack_amount ("auditor_amount", &dc->auditor_amount), + GNUNET_JSON_pack_bool ("suppressed", dc->suppressed) ); @@ -77,13 +73,20 @@ GNUNET_JSON_pack_bool("suppressed", dc->suppressed) * @return MHD result code */ MHD_RESULT -TAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_handler_get (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) +TAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_handler_get (struct + TAH_RequestHandler + *rh, + struct + MHD_Connection * + connection, + void ** + connection_cls, + const char * + upload_data, + size_t * + upload_data_size, + const char *const + args[]) { json_t *ja; enum GNUNET_DB_QueryStatus qs; @@ -182,6 +185,3 @@ TAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_handler_get (struct TAH_RequestH GNUNET_JSON_pack_array_steal ("reserve-balance-summary-wrong-inconsistency", ja)); } - - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-put.c b/src/auditor/taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-put.c index df6cac9b4..7cd7c31a7 100644 --- a/src/auditor/taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-put.c +++ b/src/auditor/taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-put.c @@ -1,5 +1,3 @@ - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -17,7 +15,6 @@ */ - #include "platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> @@ -57,8 +54,9 @@ process_inconsistency ( } /* execute transaction */ - qs = TAH_plugin->insert_reserve_balance_summary_wrong_inconsistency (TAH_plugin->cls, - dc); + qs = TAH_plugin->insert_reserve_balance_summary_wrong_inconsistency ( + TAH_plugin->cls, + dc); if (0 > qs) { GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -91,10 +89,11 @@ TAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_handler_put ( struct GNUNET_JSON_Specification spec[] = { -GNUNET_JSON_spec_fixed_auto("reserve_pub", &dc.reserve_pub), -TALER_JSON_spec_amount("exchange_amount", TAH_currency, &dc.exchange_amount), -TALER_JSON_spec_amount("auditor_amount", TAH_currency, &dc.auditor_amount), -GNUNET_JSON_spec_bool("suppressed", &dc.suppressed), + GNUNET_JSON_spec_fixed_auto ("reserve_pub", &dc.reserve_pub), + TALER_JSON_spec_amount ("exchange_amount", TAH_currency, + &dc.exchange_amount), + TALER_JSON_spec_amount ("auditor_amount", TAH_currency, &dc.auditor_amount), + GNUNET_JSON_spec_bool ("suppressed", &dc.suppressed), GNUNET_JSON_spec_end () @@ -158,5 +157,3 @@ TEAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_PUT_done (void) { } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-upd.c b/src/auditor/taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-upd.c index df8ee3e1c..4810fa3be 100644 --- a/src/auditor/taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-upd.c +++ b/src/auditor/taler-auditor-httpd_reserve-balance-summary-wrong-inconsistency-upd.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -95,7 +92,8 @@ TAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_handler_update ( } /* execute transaction */ - qs = TAH_plugin->update_reserve_balance_summary_wrong_inconsistency (TAH_plugin->cls, &gu); + qs = TAH_plugin->update_reserve_balance_summary_wrong_inconsistency ( + TAH_plugin->cls, &gu); GNUNET_JSON_parse_free (spec); json_decref (json); @@ -135,5 +133,3 @@ TAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_handler_update ( return ret; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_reserve-in-inconsistency-del.c b/src/auditor/taler-auditor-httpd_reserve-in-inconsistency-del.c index 0fb10be55..25db4b5e6 100644 --- a/src/auditor/taler-auditor-httpd_reserve-in-inconsistency-del.c +++ b/src/auditor/taler-auditor-httpd_reserve-in-inconsistency-del.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -23,12 +20,12 @@ MHD_RESULT TAH_RESERVE_IN_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) + struct MHD_Connection * + connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]) { MHD_RESULT res; @@ -58,7 +55,7 @@ TAH_RESERVE_IN_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *rh, // execute the transaction qs = TAH_plugin->delete_reserve_in_inconsistency (TAH_plugin->cls, - row_id); + row_id); if (0 == qs) { @@ -83,5 +80,3 @@ TAH_RESERVE_IN_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *rh, return res; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_reserve-in-inconsistency-get.c b/src/auditor/taler-auditor-httpd_reserve-in-inconsistency-get.c index 55773073f..b691a4446 100644 --- a/src/auditor/taler-auditor-httpd_reserve-in-inconsistency-get.c +++ b/src/auditor/taler-auditor-httpd_reserve-in-inconsistency-get.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -18,7 +15,6 @@ */ - #include "platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> @@ -40,24 +36,25 @@ */ static enum GNUNET_GenericReturnValue process_reserve_in_inconsistency (void *cls, - uint64_t serial_id, - const struct - TALER_AUDITORDB_ReserveInInconsistency - *dc) + uint64_t serial_id, + const struct + TALER_AUDITORDB_ReserveInInconsistency + *dc) { json_t *list = cls; json_t *obj; obj = GNUNET_JSON_PACK ( - GNUNET_JSON_pack_int64("row_id", serial_id), -TALER_JSON_pack_amount("amount_exchange_expected", &dc->amount_exchange_expected), -TALER_JSON_pack_amount("amount_wired", &dc->amount_wired), - GNUNET_JSON_pack_data_auto("reserve_pub", &dc->reserve_pub), -GNUNET_JSON_pack_int64("timestamp", dc->timestamp), -GNUNET_JSON_pack_string("account", dc->account), -GNUNET_JSON_pack_string("diagnostic", dc->diagnostic), -GNUNET_JSON_pack_bool("suppressed", dc->suppressed) + GNUNET_JSON_pack_int64 ("row_id", serial_id), + TALER_JSON_pack_amount ("amount_exchange_expected", + &dc->amount_exchange_expected), + TALER_JSON_pack_amount ("amount_wired", &dc->amount_wired), + GNUNET_JSON_pack_data_auto ("reserve_pub", &dc->reserve_pub), + GNUNET_JSON_pack_int64 ("timestamp", dc->timestamp), + GNUNET_JSON_pack_string ("account", dc->account), + GNUNET_JSON_pack_string ("diagnostic", dc->diagnostic), + GNUNET_JSON_pack_bool ("suppressed", dc->suppressed) ); @@ -81,12 +78,12 @@ GNUNET_JSON_pack_bool("suppressed", dc->suppressed) */ MHD_RESULT TAH_RESERVE_IN_INCONSISTENCY_handler_get (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) + struct MHD_Connection * + connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]) { json_t *ja; enum GNUNET_DB_QueryStatus qs; @@ -185,6 +182,3 @@ TAH_RESERVE_IN_INCONSISTENCY_handler_get (struct TAH_RequestHandler *rh, GNUNET_JSON_pack_array_steal ("reserve-in-inconsistency", ja)); } - - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_reserve-in-inconsistency-put.c b/src/auditor/taler-auditor-httpd_reserve-in-inconsistency-put.c index e5d57243c..dd1765b45 100644 --- a/src/auditor/taler-auditor-httpd_reserve-in-inconsistency-put.c +++ b/src/auditor/taler-auditor-httpd_reserve-in-inconsistency-put.c @@ -1,5 +1,3 @@ - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -17,7 +15,6 @@ */ - #include "platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> @@ -58,7 +55,7 @@ process_inconsistency ( /* execute transaction */ qs = TAH_plugin->insert_reserve_in_inconsistency (TAH_plugin->cls, - dc); + dc); if (0 > qs) { GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -91,14 +88,15 @@ TAH_RESERVE_IN_INCONSISTENCY_handler_put ( struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_int64("row_id", dc.row_id), -TALER_JSON_spec_amount("amount_exchange_expected", TAH_currency, &dc.amount_exchange_expected), -TALER_JSON_spec_amount("amount_wired", TAH_currency, &dc.amount_wired), -GNUNET_JSON_spec_fixed_auto("reserve_pub", &dc.reserve_pub), -GNUNET_JSON_spec_int64("timestamp", &dc.timestamp), -GNUNET_JSON_spec_fixed_auto("account", &dc.account), -GNUNET_JSON_spec_fixed_auto("diagnostic", &dc.diagnostic), -GNUNET_JSON_spec_bool("suppressed", &dc.suppressed), + GNUNET_JSON_spec_int64 ("row_id", dc.row_id), + TALER_JSON_spec_amount ("amount_exchange_expected", TAH_currency, + &dc.amount_exchange_expected), + TALER_JSON_spec_amount ("amount_wired", TAH_currency, &dc.amount_wired), + GNUNET_JSON_spec_fixed_auto ("reserve_pub", &dc.reserve_pub), + GNUNET_JSON_spec_int64 ("timestamp", &dc.timestamp), + GNUNET_JSON_spec_fixed_auto ("account", &dc.account), + GNUNET_JSON_spec_fixed_auto ("diagnostic", &dc.diagnostic), + GNUNET_JSON_spec_bool ("suppressed", &dc.suppressed), GNUNET_JSON_spec_end () @@ -162,5 +160,3 @@ TEAH_RESERVE_IN_INCONSISTENCY_PUT_done (void) { } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_reserve-in-inconsistency-upd.c b/src/auditor/taler-auditor-httpd_reserve-in-inconsistency-upd.c index 73a4a63f9..5d731f01e 100644 --- a/src/auditor/taler-auditor-httpd_reserve-in-inconsistency-upd.c +++ b/src/auditor/taler-auditor-httpd_reserve-in-inconsistency-upd.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -135,5 +132,3 @@ TAH_RESERVE_IN_INCONSISTENCY_handler_update ( return ret; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_reserve-not-closed-inconsistency-del.c b/src/auditor/taler-auditor-httpd_reserve-not-closed-inconsistency-del.c index befaa42dc..c0abf141d 100644 --- a/src/auditor/taler-auditor-httpd_reserve-not-closed-inconsistency-del.c +++ b/src/auditor/taler-auditor-httpd_reserve-not-closed-inconsistency-del.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -22,13 +19,14 @@ MHD_RESULT -TAH_RESERVE_NOT_CLOSED_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) +TAH_RESERVE_NOT_CLOSED_INCONSISTENCY_handler_delete (struct + TAH_RequestHandler *rh, + struct MHD_Connection * + connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]) { MHD_RESULT res; @@ -58,7 +56,7 @@ TAH_RESERVE_NOT_CLOSED_INCONSISTENCY_handler_delete (struct TAH_RequestHandler * // execute the transaction qs = TAH_plugin->delete_reserve_not_closed_inconsistency (TAH_plugin->cls, - row_id); + row_id); if (0 == qs) { @@ -83,5 +81,3 @@ TAH_RESERVE_NOT_CLOSED_INCONSISTENCY_handler_delete (struct TAH_RequestHandler * return res; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_reserve-not-closed-inconsistency-get.c b/src/auditor/taler-auditor-httpd_reserve-not-closed-inconsistency-get.c index e642c6131..7193fe3dd 100644 --- a/src/auditor/taler-auditor-httpd_reserve-not-closed-inconsistency-get.c +++ b/src/auditor/taler-auditor-httpd_reserve-not-closed-inconsistency-get.c @@ -118,40 +118,12 @@ TAH_RESERVE_NOT_CLOSED_INCONSISTENCY_handler_get (struct TAH_RequestHandler *rh, &offset); bool return_suppressed = false; - - struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_bool ("return_suppressed", &return_suppressed), - GNUNET_JSON_spec_end () - }; - - // read the input json - json_t *json_in; + const char *ret_s = MHD_lookup_connection_value (connection, + MHD_GET_ARGUMENT_KIND, + "return_suppressed"); + if (ret_s != NULL && strcmp (ret_s, "true") == 0) { - enum GNUNET_GenericReturnValue res; - - res = TALER_MHD_parse_post_json (connection, - connection_cls, - upload_data, - upload_data_size, - &json_in); - if (GNUNET_SYSERR == res) - return MHD_NO; - if ((GNUNET_NO == res) || - (NULL == json_in)) - return MHD_YES; - res = TALER_MHD_parse_json_data (connection, - json_in, - spec); - if (GNUNET_SYSERR == res) - { - json_decref (json_in); - return MHD_NO; /* hard failure */ - } - if (GNUNET_NO == res) - { - json_decref (json_in); - return MHD_YES; /* failure */ - } + return_suppressed = true; } qs = TAH_plugin->get_reserve_not_closed_inconsistency ( diff --git a/src/auditor/taler-auditor-httpd_reserve-not-closed-inconsistency-put.c b/src/auditor/taler-auditor-httpd_reserve-not-closed-inconsistency-put.c index 9524e5da4..ded6beaf3 100644 --- a/src/auditor/taler-auditor-httpd_reserve-not-closed-inconsistency-put.c +++ b/src/auditor/taler-auditor-httpd_reserve-not-closed-inconsistency-put.c @@ -1,5 +1,3 @@ - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -17,7 +15,6 @@ */ - #include "platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> @@ -58,7 +55,7 @@ process_inconsistency ( /* execute transaction */ qs = TAH_plugin->insert_reserve_not_closed_inconsistency (TAH_plugin->cls, - dc); + dc); if (0 > qs) { GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -91,11 +88,11 @@ TAH_RESERVE_NOT_CLOSED_INCONSISTENCY_handler_put ( struct GNUNET_JSON_Specification spec[] = { -GNUNET_JSON_spec_fixed_auto("reserve_pub", &dc.reserve_pub), -TALER_JSON_spec_amount("balance", TAH_currency, &dc.balance), -GNUNET_JSON_spec_int64("expiration_time", &dc.expiration_time), -GNUNET_JSON_spec_fixed_auto("diagnostic", &dc.diagnostic), -GNUNET_JSON_spec_bool("suppressed", &dc.suppressed), + GNUNET_JSON_spec_fixed_auto ("reserve_pub", &dc.reserve_pub), + TALER_JSON_spec_amount ("balance", TAH_currency, &dc.balance), + GNUNET_JSON_spec_int64 ("expiration_time", &dc.expiration_time), + GNUNET_JSON_spec_fixed_auto ("diagnostic", &dc.diagnostic), + GNUNET_JSON_spec_bool ("suppressed", &dc.suppressed), GNUNET_JSON_spec_end () @@ -159,5 +156,3 @@ TEAH_RESERVE_NOT_CLOSED_INCONSISTENCY_PUT_done (void) { } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_reserve-not-closed-inconsistency-upd.c b/src/auditor/taler-auditor-httpd_reserve-not-closed-inconsistency-upd.c index 28a8a1f69..81a5365de 100644 --- a/src/auditor/taler-auditor-httpd_reserve-not-closed-inconsistency-upd.c +++ b/src/auditor/taler-auditor-httpd_reserve-not-closed-inconsistency-upd.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -95,7 +92,8 @@ TAH_RESERVE_NOT_CLOSED_INCONSISTENCY_handler_update ( } /* execute transaction */ - qs = TAH_plugin->update_reserve_not_closed_inconsistency (TAH_plugin->cls, &gu); + qs = TAH_plugin->update_reserve_not_closed_inconsistency (TAH_plugin->cls, + &gu); GNUNET_JSON_parse_free (spec); json_decref (json); @@ -135,5 +133,3 @@ TAH_RESERVE_NOT_CLOSED_INCONSISTENCY_handler_update ( return ret; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_reserves-del.c b/src/auditor/taler-auditor-httpd_reserves-del.c index 2de0ab40d..075b69815 100644 --- a/src/auditor/taler-auditor-httpd_reserves-del.c +++ b/src/auditor/taler-auditor-httpd_reserves-del.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -23,12 +20,12 @@ MHD_RESULT TAH_RESERVES_handler_delete (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) + struct MHD_Connection * + connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]) { MHD_RESULT res; @@ -58,7 +55,7 @@ TAH_RESERVES_handler_delete (struct TAH_RequestHandler *rh, // execute the transaction qs = TAH_plugin->delete_reserves (TAH_plugin->cls, - row_id); + row_id); if (0 == qs) { @@ -83,5 +80,3 @@ TAH_RESERVES_handler_delete (struct TAH_RequestHandler *rh, return res; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_reserves-get.c b/src/auditor/taler-auditor-httpd_reserves-get.c index 54b1a1863..5ba748eb6 100644 --- a/src/auditor/taler-auditor-httpd_reserves-get.c +++ b/src/auditor/taler-auditor-httpd_reserves-get.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -18,7 +15,6 @@ */ - #include "platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> @@ -40,28 +36,29 @@ */ static enum GNUNET_GenericReturnValue process_reserves (void *cls, - uint64_t serial_id, - const struct - TALER_AUDITORDB_Reserves - *dc) + uint64_t serial_id, + const struct + TALER_AUDITORDB_Reserves + *dc) { json_t *list = cls; json_t *obj; obj = GNUNET_JSON_PACK ( - GNUNET_JSON_pack_int64("auditor_reserves_rowid", dc->auditor_reserves_rowid), -GNUNET_JSON_pack_data_auto("reserve_pub", &dc->reserve_pub), -TALER_JSON_pack_amount("reserve_balance", &dc->reserve_balance), -TALER_JSON_pack_amount("reserve_loss", &dc->reserve_loss), -TALER_JSON_pack_amount("withdraw_fee_balance", &dc->withdraw_fee_balance), -TALER_JSON_pack_amount("close_fee_balance", &dc->close_fee_balance), -TALER_JSON_pack_amount("purse_fee_balance", &dc->purse_fee_balance), -TALER_JSON_pack_amount("open_fee_balance", &dc->open_fee_balance), -TALER_JSON_pack_amount("history_fee_balance", &dc->history_fee_balance), -GNUNET_JSON_pack_int64("expiration_date", dc->expiration_date), -GNUNET_JSON_pack_string("origin_account", dc->origin_account), -GNUNET_JSON_pack_bool("suppressed", dc->suppressed) + GNUNET_JSON_pack_int64 ("auditor_reserves_rowid", + dc->auditor_reserves_rowid), + GNUNET_JSON_pack_data_auto ("reserve_pub", &dc->reserve_pub), + TALER_JSON_pack_amount ("reserve_balance", &dc->reserve_balance), + TALER_JSON_pack_amount ("reserve_loss", &dc->reserve_loss), + TALER_JSON_pack_amount ("withdraw_fee_balance", &dc->withdraw_fee_balance), + TALER_JSON_pack_amount ("close_fee_balance", &dc->close_fee_balance), + TALER_JSON_pack_amount ("purse_fee_balance", &dc->purse_fee_balance), + TALER_JSON_pack_amount ("open_fee_balance", &dc->open_fee_balance), + TALER_JSON_pack_amount ("history_fee_balance", &dc->history_fee_balance), + GNUNET_JSON_pack_int64 ("expiration_date", dc->expiration_date), + GNUNET_JSON_pack_string ("origin_account", dc->origin_account), + GNUNET_JSON_pack_bool ("suppressed", dc->suppressed) ); @@ -85,12 +82,12 @@ GNUNET_JSON_pack_bool("suppressed", dc->suppressed) */ MHD_RESULT TAH_RESERVES_handler_get (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) + struct MHD_Connection * + connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]) { json_t *ja; enum GNUNET_DB_QueryStatus qs; @@ -189,6 +186,3 @@ TAH_RESERVES_handler_get (struct TAH_RequestHandler *rh, GNUNET_JSON_pack_array_steal ("reserves", ja)); } - - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_reserves-put.c b/src/auditor/taler-auditor-httpd_reserves-put.c index 5b85db3cd..39aa5e421 100644 --- a/src/auditor/taler-auditor-httpd_reserves-put.c +++ b/src/auditor/taler-auditor-httpd_reserves-put.c @@ -1,5 +1,3 @@ - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -17,7 +15,6 @@ */ - #include "platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> @@ -58,7 +55,7 @@ process_inconsistency ( /* execute transaction */ qs = TAH_plugin->insert_reserves (TAH_plugin->cls, - dc); + dc); if (0 > qs) { GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -91,18 +88,26 @@ TAH_RESERVES_handler_put ( struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_int64("auditor_reserves_rowid", &dc.auditor_reserves_rowid), -GNUNET_JSON_spec_fixed_auto("reserve_pub", &dc.reserve_pub), -TALER_JSON_spec_amount("reserve_balance", TAH_currency, &dc.reserve_balance), -TALER_JSON_spec_amount("reserve_loss", TAH_currency, &dc.reserve_loss), -TALER_JSON_spec_amount("withdraw_fee_balance", TAH_currency, &dc.withdraw_fee_balance), -TALER_JSON_spec_amount("close_fee_balance", TAH_currency, &dc.close_fee_balance), -TALER_JSON_spec_amount("purse_fee_balance", TAH_currency, &dc.purse_fee_balance), -TALER_JSON_spec_amount("open_fee_balance", TAH_currency, &dc.open_fee_balance), -TALER_JSON_spec_amount("history_fee_balance", TAH_currency, &dc.history_fee_balance), -GNUNET_JSON_spec_int64("expiration_date", &dc.expiration_date), -GNUNET_JSON_spec_string("origin_account", (const char **)dc.origin_account), -GNUNET_JSON_spec_bool("suppressed", &dc.suppressed), + GNUNET_JSON_spec_int64 ("auditor_reserves_rowid", + &dc.auditor_reserves_rowid), + GNUNET_JSON_spec_fixed_auto ("reserve_pub", &dc.reserve_pub), + TALER_JSON_spec_amount ("reserve_balance", TAH_currency, + &dc.reserve_balance), + TALER_JSON_spec_amount ("reserve_loss", TAH_currency, &dc.reserve_loss), + TALER_JSON_spec_amount ("withdraw_fee_balance", TAH_currency, + &dc.withdraw_fee_balance), + TALER_JSON_spec_amount ("close_fee_balance", TAH_currency, + &dc.close_fee_balance), + TALER_JSON_spec_amount ("purse_fee_balance", TAH_currency, + &dc.purse_fee_balance), + TALER_JSON_spec_amount ("open_fee_balance", TAH_currency, + &dc.open_fee_balance), + TALER_JSON_spec_amount ("history_fee_balance", TAH_currency, + &dc.history_fee_balance), + GNUNET_JSON_spec_int64 ("expiration_date", &dc.expiration_date), + GNUNET_JSON_spec_string ("origin_account", (const + char **) dc.origin_account), + GNUNET_JSON_spec_bool ("suppressed", &dc.suppressed), GNUNET_JSON_spec_end () @@ -166,5 +171,3 @@ TEAH_RESERVES_PUT_done (void) { } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_reserves-upd.c b/src/auditor/taler-auditor-httpd_reserves-upd.c index fca94651e..d177d439d 100644 --- a/src/auditor/taler-auditor-httpd_reserves-upd.c +++ b/src/auditor/taler-auditor-httpd_reserves-upd.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -135,5 +132,3 @@ TAH_RESERVES_handler_update ( return ret; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_row-inconsistency-upd.c b/src/auditor/taler-auditor-httpd_row-inconsistency-upd.c index 2a4cda8f9..ee65492d3 100644 --- a/src/auditor/taler-auditor-httpd_row-inconsistency-upd.c +++ b/src/auditor/taler-auditor-httpd_row-inconsistency-upd.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -135,5 +132,3 @@ TAH_ROW_INCONSISTENCY_handler_update ( return ret; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_row-minor-inconsistencies-del.c b/src/auditor/taler-auditor-httpd_row-minor-inconsistencies-del.c index 165f1d4b1..d138b5eac 100644 --- a/src/auditor/taler-auditor-httpd_row-minor-inconsistencies-del.c +++ b/src/auditor/taler-auditor-httpd_row-minor-inconsistencies-del.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -23,12 +20,12 @@ MHD_RESULT TAH_ROW_MINOR_INCONSISTENCIES_handler_delete (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) + struct MHD_Connection * + connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]) { MHD_RESULT res; @@ -58,7 +55,7 @@ TAH_ROW_MINOR_INCONSISTENCIES_handler_delete (struct TAH_RequestHandler *rh, // execute the transaction qs = TAH_plugin->delete_row_minor_inconsistencies (TAH_plugin->cls, - row_id); + row_id); if (0 == qs) { @@ -83,5 +80,3 @@ TAH_ROW_MINOR_INCONSISTENCIES_handler_delete (struct TAH_RequestHandler *rh, return res; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_row-minor-inconsistencies-get.c b/src/auditor/taler-auditor-httpd_row-minor-inconsistencies-get.c index 81ff2e6fb..0462f44bb 100644 --- a/src/auditor/taler-auditor-httpd_row-minor-inconsistencies-get.c +++ b/src/auditor/taler-auditor-httpd_row-minor-inconsistencies-get.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -18,7 +15,6 @@ */ - #include "platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> @@ -40,20 +36,20 @@ */ static enum GNUNET_GenericReturnValue process_row_minor_inconsistencies (void *cls, - uint64_t serial_id, - const struct - TALER_AUDITORDB_RowMinorInconsistencies - *dc) + uint64_t serial_id, + const struct + TALER_AUDITORDB_RowMinorInconsistencies + *dc) { json_t *list = cls; json_t *obj; obj = GNUNET_JSON_PACK ( - GNUNET_JSON_pack_int64("row_id", serial_id), -GNUNET_JSON_pack_string("row_table", dc->row_table), -GNUNET_JSON_pack_string("diagnostic", dc->diagnostic), -GNUNET_JSON_pack_bool("suppressed", dc->suppressed) + GNUNET_JSON_pack_int64 ("row_id", serial_id), + GNUNET_JSON_pack_string ("row_table", dc->row_table), + GNUNET_JSON_pack_string ("diagnostic", dc->diagnostic), + GNUNET_JSON_pack_bool ("suppressed", dc->suppressed) ); @@ -77,12 +73,12 @@ GNUNET_JSON_pack_bool("suppressed", dc->suppressed) */ MHD_RESULT TAH_ROW_MINOR_INCONSISTENCIES_handler_get (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) + struct MHD_Connection * + connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]) { json_t *ja; enum GNUNET_DB_QueryStatus qs; @@ -181,6 +177,3 @@ TAH_ROW_MINOR_INCONSISTENCIES_handler_get (struct TAH_RequestHandler *rh, GNUNET_JSON_pack_array_steal ("row-minor-inconsistencies", ja)); } - - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_row-minor-inconsistencies-put.c b/src/auditor/taler-auditor-httpd_row-minor-inconsistencies-put.c index 1b32dd4f4..bd795513e 100644 --- a/src/auditor/taler-auditor-httpd_row-minor-inconsistencies-put.c +++ b/src/auditor/taler-auditor-httpd_row-minor-inconsistencies-put.c @@ -1,5 +1,3 @@ - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -17,7 +15,6 @@ */ - #include "platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> @@ -58,7 +55,7 @@ process_inconsistency ( /* execute transaction */ qs = TAH_plugin->insert_row_minor_inconsistencies (TAH_plugin->cls, - dc); + dc); if (0 > qs) { GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -91,9 +88,9 @@ TAH_ROW_MINOR_INCONSISTENCIES_handler_put ( struct GNUNET_JSON_Specification spec[] = { -GNUNET_JSON_spec_fixed_auto("row_table", &dc.row_table), -GNUNET_JSON_spec_fixed_auto("diagnostic", &dc.diagnostic), -GNUNET_JSON_spec_bool("suppressed", &dc.suppressed), + GNUNET_JSON_spec_fixed_auto ("row_table", &dc.row_table), + GNUNET_JSON_spec_fixed_auto ("diagnostic", &dc.diagnostic), + GNUNET_JSON_spec_bool ("suppressed", &dc.suppressed), GNUNET_JSON_spec_end () @@ -157,5 +154,3 @@ TEAH_ROW_MINOR_INCONSISTENCIES_PUT_done (void) { } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_row-minor-inconsistencies-upd.c b/src/auditor/taler-auditor-httpd_row-minor-inconsistencies-upd.c index ea8c8cb21..57cfc3d50 100644 --- a/src/auditor/taler-auditor-httpd_row-minor-inconsistencies-upd.c +++ b/src/auditor/taler-auditor-httpd_row-minor-inconsistencies-upd.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -135,5 +132,3 @@ TAH_ROW_MINOR_INCONSISTENCIES_handler_update ( return ret; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_wire-format-inconsistency-del.c b/src/auditor/taler-auditor-httpd_wire-format-inconsistency-del.c index e40bc7b09..fc89943ef 100644 --- a/src/auditor/taler-auditor-httpd_wire-format-inconsistency-del.c +++ b/src/auditor/taler-auditor-httpd_wire-format-inconsistency-del.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -23,12 +20,12 @@ MHD_RESULT TAH_WIRE_FORMAT_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) + struct MHD_Connection * + connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]) { MHD_RESULT res; @@ -58,7 +55,7 @@ TAH_WIRE_FORMAT_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *rh, // execute the transaction qs = TAH_plugin->delete_wire_format_inconsistency (TAH_plugin->cls, - row_id); + row_id); if (0 == qs) { @@ -83,5 +80,3 @@ TAH_WIRE_FORMAT_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *rh, return res; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_wire-format-inconsistency-get.c b/src/auditor/taler-auditor-httpd_wire-format-inconsistency-get.c index f342505ba..585ca6a30 100644 --- a/src/auditor/taler-auditor-httpd_wire-format-inconsistency-get.c +++ b/src/auditor/taler-auditor-httpd_wire-format-inconsistency-get.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -18,7 +15,6 @@ */ - #include "platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> @@ -40,21 +36,21 @@ */ static enum GNUNET_GenericReturnValue process_wire_format_inconsistency (void *cls, - uint64_t serial_id, - const struct - TALER_AUDITORDB_WireFormatInconsistency - *dc) + uint64_t serial_id, + const struct + TALER_AUDITORDB_WireFormatInconsistency + *dc) { json_t *list = cls; json_t *obj; obj = GNUNET_JSON_PACK ( - GNUNET_JSON_pack_int64("row_id", serial_id), -TALER_JSON_pack_amount("amount", &dc->amount), -GNUNET_JSON_pack_int64("wire_offset", dc->wire_offset), -GNUNET_JSON_pack_data_auto("diagnostic", dc->diagnostic), -GNUNET_JSON_pack_bool("suppressed", dc->suppressed) + GNUNET_JSON_pack_int64 ("row_id", serial_id), + TALER_JSON_pack_amount ("amount", &dc->amount), + GNUNET_JSON_pack_int64 ("wire_offset", dc->wire_offset), + GNUNET_JSON_pack_data_auto ("diagnostic", dc->diagnostic), + GNUNET_JSON_pack_bool ("suppressed", dc->suppressed) ); @@ -78,12 +74,12 @@ GNUNET_JSON_pack_bool("suppressed", dc->suppressed) */ MHD_RESULT TAH_WIRE_FORMAT_INCONSISTENCY_handler_get (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) + struct MHD_Connection * + connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]) { json_t *ja; enum GNUNET_DB_QueryStatus qs; @@ -182,6 +178,3 @@ TAH_WIRE_FORMAT_INCONSISTENCY_handler_get (struct TAH_RequestHandler *rh, GNUNET_JSON_pack_array_steal ("wire-format-inconsistency", ja)); } - - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_wire-format-inconsistency-put.c b/src/auditor/taler-auditor-httpd_wire-format-inconsistency-put.c index 66e8eb968..9f9ebd04e 100644 --- a/src/auditor/taler-auditor-httpd_wire-format-inconsistency-put.c +++ b/src/auditor/taler-auditor-httpd_wire-format-inconsistency-put.c @@ -1,5 +1,3 @@ - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -17,7 +15,6 @@ */ - #include "platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> @@ -58,7 +55,7 @@ process_inconsistency ( /* execute transaction */ qs = TAH_plugin->insert_wire_format_inconsistency (TAH_plugin->cls, - dc); + dc); if (0 > qs) { GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -91,10 +88,10 @@ TAH_WIRE_FORMAT_INCONSISTENCY_handler_put ( struct GNUNET_JSON_Specification spec[] = { -TALER_JSON_spec_amount("amount", TAH_currency, &dc.amount), -GNUNET_JSON_spec_int64("wire_offset", &dc.wire_offset), -GNUNET_JSON_spec_fixed_auto("diagnostic", &dc.diagnostic), -GNUNET_JSON_spec_bool("suppressed", &dc.suppressed), + TALER_JSON_spec_amount ("amount", TAH_currency, &dc.amount), + GNUNET_JSON_spec_int64 ("wire_offset", &dc.wire_offset), + GNUNET_JSON_spec_fixed_auto ("diagnostic", &dc.diagnostic), + GNUNET_JSON_spec_bool ("suppressed", &dc.suppressed), GNUNET_JSON_spec_end () @@ -158,5 +155,3 @@ TEAH_WIRE_FORMAT_INCONSISTENCY_PUT_done (void) { } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_wire-format-inconsistency-upd.c b/src/auditor/taler-auditor-httpd_wire-format-inconsistency-upd.c index 5af604098..1eacc2e6c 100644 --- a/src/auditor/taler-auditor-httpd_wire-format-inconsistency-upd.c +++ b/src/auditor/taler-auditor-httpd_wire-format-inconsistency-upd.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -135,5 +132,3 @@ TAH_WIRE_FORMAT_INCONSISTENCY_handler_update ( return ret; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_wire-out-inconsistency-del.c b/src/auditor/taler-auditor-httpd_wire-out-inconsistency-del.c index 3d3ce9a54..6dc2506d4 100644 --- a/src/auditor/taler-auditor-httpd_wire-out-inconsistency-del.c +++ b/src/auditor/taler-auditor-httpd_wire-out-inconsistency-del.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -23,12 +20,12 @@ MHD_RESULT TAH_WIRE_OUT_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *rh, - struct MHD_Connection * - connection, - void **connection_cls, - const char *upload_data, - size_t *upload_data_size, - const char *const args[]) + struct MHD_Connection * + connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size, + const char *const args[]) { MHD_RESULT res; @@ -58,7 +55,7 @@ TAH_WIRE_OUT_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *rh, // execute the transaction qs = TAH_plugin->delete_wire_out_inconsistency (TAH_plugin->cls, - row_id); + row_id); if (0 == qs) { @@ -83,5 +80,3 @@ TAH_WIRE_OUT_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *rh, return res; } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_wire-out-inconsistency-put.c b/src/auditor/taler-auditor-httpd_wire-out-inconsistency-put.c index 2c7462c4b..42c13fc77 100644 --- a/src/auditor/taler-auditor-httpd_wire-out-inconsistency-put.c +++ b/src/auditor/taler-auditor-httpd_wire-out-inconsistency-put.c @@ -1,5 +1,3 @@ - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -17,7 +15,6 @@ */ - #include "platform.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> @@ -58,7 +55,7 @@ process_inconsistency ( /* execute transaction */ qs = TAH_plugin->insert_wire_out_inconsistency (TAH_plugin->cls, - dc); + dc); if (0 > qs) { GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -91,10 +88,11 @@ TAH_WIRE_OUT_INCONSISTENCY_handler_put ( struct GNUNET_JSON_Specification spec[] = { -GNUNET_JSON_spec_fixed_auto("destination_account", &dc.destination_account), -TALER_JSON_spec_amount("expected", TAH_currency, &dc.expected), -TALER_JSON_spec_amount("claimed", TAH_currency, &dc.claimed), -GNUNET_JSON_spec_bool("suppressed", &dc.suppressed), + GNUNET_JSON_spec_fixed_auto ("destination_account", + &dc.destination_account), + TALER_JSON_spec_amount ("expected", TAH_currency, &dc.expected), + TALER_JSON_spec_amount ("claimed", TAH_currency, &dc.claimed), + GNUNET_JSON_spec_bool ("suppressed", &dc.suppressed), GNUNET_JSON_spec_end () @@ -158,5 +156,3 @@ TEAH_WIRE_OUT_INCONSISTENCY_PUT_done (void) { } - -
\ No newline at end of file diff --git a/src/auditor/taler-auditor-httpd_wire-out-inconsistency-upd.c b/src/auditor/taler-auditor-httpd_wire-out-inconsistency-upd.c index 9ed7c4a27..a0fdd11e3 100644 --- a/src/auditor/taler-auditor-httpd_wire-out-inconsistency-upd.c +++ b/src/auditor/taler-auditor-httpd_wire-out-inconsistency-upd.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -135,5 +132,3 @@ TAH_WIRE_OUT_INCONSISTENCY_handler_update ( return ret; } - -
\ No newline at end of file diff --git a/src/auditor/test-auditor.sh b/src/auditor/test-auditor.sh index 5245cffef..1d4b7a8b6 100755 --- a/src/auditor/test-auditor.sh +++ b/src/auditor/test-auditor.sh @@ -44,6 +44,8 @@ ALL_TESTS=$(seq 0 33) # TESTS=${1:-$ALL_TESTS} +export TALER_AUDITOR_TOKEN="secret-token:abc" + # Global variable to run the auditor processes under valgrind # VALGRIND=valgrind VALGRIND="" @@ -415,13 +417,13 @@ function test_0() { # if an emergency was detected, that is a bug and we should fail echo -n "Test for emergencies... " - curl -s -H "Accept: application/json" -o "${MY_TMP_DIR}/test-audit-emergencies.json" 'localhost:8083/emergency' + curl -s -H "Accept: application/json\n Authorization: Bearer ${TALER_AUDITOR_TOKEN}" -o "${MY_TMP_DIR}/test-audit-emergencies.json" 'localhost:8083/emergency' jq -e .emergency[0] < ${MY_TMP_DIR}/test-audit-emergencies.json > /dev/null && exit_fail "Unexpected emergency detected in ordinary run" || echo PASS echo -n "Test for deposit confirmation emergencies... " - curl -s -H "Accept: application/json" -o "${MY_TMP_DIR}/test-audit-deposits.json" 'localhost:8083/deposit-confirmation' + curl -s -H "Accept: application/json\n Authorization: Bearer ${TALER_AUDITOR_TOKEN}" -o "${MY_TMP_DIR}/test-audit-deposits.json" 'localhost:8083/deposit-confirmation' jq -e .deposit_confirmation[0] < ${MY_TMP_DIR}/test-audit-deposits.json > /dev/null && exit_fail "Unexpected deposit confirmation inconsistency detected" || echo PASS + curl -s -H "Accept: application/json\n Authorization: Bearer ${TALER_AUDITOR_TOKEN}" -o "${MY_TMP_DIR}/test-audit-emergency-by-count.json" 'localhost:8083/emergency-by-count' echo -n "Test for emergencies by count... " - curl -s -H "Accept: application/json" -o "${MY_TMP_DIR}/test-audit-emergency-by-count.json" 'localhost:8083/emergency-by-count' jq -e .emergency_by_count[0] < ${MY_TMP_DIR}/test-audit-emergency-by-count.json > /dev/null && exit_fail "Unexpected emergency by count detected in ordinary run" || echo PASS echo -n "Test for wire inconsistencies... " @@ -2299,7 +2301,7 @@ export PGHOST MYDIR="${MY_TMP_DIR}/basedb" mkdir -p "${MYDIR}" -REUSE_BASEDB_DIR="/tmp/taler-auditor-basedbMv9gmN" +REUSE_BASEDB_DIR="" if [ -z $REUSE_BASEDB_DIR ] then echo "Generating fresh database at $MYDIR" diff --git a/src/auditordb/pg_get_amount_arithmetic_inconsistency.c b/src/auditordb/pg_get_amount_arithmetic_inconsistency.c index 312d9e233..a23fa40bd 100644 --- a/src/auditordb/pg_get_amount_arithmetic_inconsistency.c +++ b/src/auditordb/pg_get_amount_arithmetic_inconsistency.c @@ -111,12 +111,12 @@ TAH_PG_get_amount_arithmetic_inconsistency ( struct PostgresClosure *pg = cls; - struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_uint64 (&offset), - GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), - GNUNET_PQ_query_param_end - }; + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&offset), + GNUNET_PQ_query_param_bool (return_suppressed), + GNUNET_PQ_query_param_int64 (&limit), + GNUNET_PQ_query_param_end + }; struct AmountArithmeticInconsistencyContext dcc = { .cb = cb, .cb_cls = cb_cls, @@ -138,22 +138,25 @@ TAH_PG_get_amount_arithmetic_inconsistency ( " ORDER BY row_id DESC" " LIMIT $3" ); - PREPARE (pg, - "auditor_amount_arithmetic_inconsistency_select_asc", - "SELECT" - " row_id" - ",operation" - ",exchange_amount" - ",auditor_amount" - ",profitable" - " FROM auditor_amount_arithmetic_inconsistency" - " WHERE (row_id>$1)" - " AND ($2 OR suppressed is false)" - " ORDER BY row_id ASC" - " LIMIT $3" - ); + PREPARE (pg, + "auditor_amount_arithmetic_inconsistency_select_asc", + "SELECT" + " row_id" + ",operation" + ",exchange_amount" + ",auditor_amount" + ",profitable" + " FROM auditor_amount_arithmetic_inconsistency" + " WHERE (row_id>$1)" + " AND ($2 OR suppressed is false)" + " ORDER BY row_id ASC" + " LIMIT $3" + ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, - (limit > 0) ? "auditor_amount_arithmetic_inconsistency_select_asc" : "auditor_amount_arithmetic_inconsistency_select_desc", + (limit > 0) ? + "auditor_amount_arithmetic_inconsistency_select_asc" + : + "auditor_amount_arithmetic_inconsistency_select_desc", params, &amount_arithmetic_inconsistency_cb, &dcc); diff --git a/src/auditordb/pg_get_auditor_closure_lags.c b/src/auditordb/pg_get_auditor_closure_lags.c index 409be8a9b..0cf9bcf72 100644 --- a/src/auditordb/pg_get_auditor_closure_lags.c +++ b/src/auditordb/pg_get_auditor_closure_lags.c @@ -104,12 +104,12 @@ TAH_PG_get_auditor_closure_lags ( { struct PostgresClosure *pg = cls; - struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_uint64 (&offset), - GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), - GNUNET_PQ_query_param_end - }; + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&offset), + GNUNET_PQ_query_param_bool (return_suppressed), + GNUNET_PQ_query_param_int64 (&limit), + GNUNET_PQ_query_param_end + }; struct ClosureLagsContext dcc = { .cb = cb, @@ -132,22 +132,25 @@ TAH_PG_get_auditor_closure_lags ( " ORDER BY row_id DESC" " LIMIT $3" ); - PREPARE (pg, - "auditor_closure_lags_get_asc", - "SELECT" - " row_id" - ",amount" - ",deadline" - ",wtid" - ",account" - " FROM auditor_closure_lags" - " WHERE (row_id > $1)" - " AND ($2 OR suppressed is false)" - " ORDER BY row_id ASC" - " LIMIT $3" - ); + PREPARE (pg, + "auditor_closure_lags_get_asc", + "SELECT" + " row_id" + ",amount" + ",deadline" + ",wtid" + ",account" + " FROM auditor_closure_lags" + " WHERE (row_id > $1)" + " AND ($2 OR suppressed is false)" + " ORDER BY row_id ASC" + " LIMIT $3" + ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, - (limit > 0) ? "auditor_auditor_closure_lags_get_asc" : "auditor_auditor_closure_lags_get_desc", + (limit > 0) ? + "auditor_auditor_closure_lags_get_asc" + : + "auditor_auditor_closure_lags_get_desc", params, &closure_lags_cb, &dcc); diff --git a/src/auditordb/pg_get_coin_inconsistency.c b/src/auditordb/pg_get_coin_inconsistency.c index 0e6c45a18..c29d386db 100644 --- a/src/auditordb/pg_get_coin_inconsistency.c +++ b/src/auditordb/pg_get_coin_inconsistency.c @@ -115,12 +115,12 @@ TAH_PG_get_coin_inconsistency ( printf ("checkpoint pg_0\n"); struct PostgresClosure *pg = cls; - struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_uint64 (&offset), - GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), - GNUNET_PQ_query_param_end - }; + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&offset), + GNUNET_PQ_query_param_bool (return_suppressed), + GNUNET_PQ_query_param_int64 (&limit), + GNUNET_PQ_query_param_end + }; struct CoinInconsistencyContext dcc = { .cb = cb, .cb_cls = cb_cls, @@ -145,23 +145,26 @@ TAH_PG_get_coin_inconsistency ( " ORDER BY row_id DESC" " LIMIT $3" ); - PREPARE (pg, - "auditor_coin_inconsistency_select_asc", - "SELECT" - " row_id" - ",operation" - ",exchange_amount" - ",auditor_amount" - ",coin_pub" - ",profitable" - " FROM auditor_coin_inconsistency" - " WHERE (row_id > $1)" - " AND ($2 OR suppressed is false)" - " ORDER BY row_id ASC" - " LIMIT $3" - ); + PREPARE (pg, + "auditor_coin_inconsistency_select_asc", + "SELECT" + " row_id" + ",operation" + ",exchange_amount" + ",auditor_amount" + ",coin_pub" + ",profitable" + " FROM auditor_coin_inconsistency" + " WHERE (row_id > $1)" + " AND ($2 OR suppressed is false)" + " ORDER BY row_id ASC" + " LIMIT $3" + ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, - (limit > 0) ? "auditor_coin_inconsistency_select_asc" : "auditor_coin_inconsistency_select_desc", + (limit > 0) ? + "auditor_coin_inconsistency_select_asc" + : + "auditor_coin_inconsistency_select_desc", params, &coin_inconsistency_cb, &dcc); diff --git a/src/auditordb/pg_get_denomination_key_validity_withdraw_inconsistency.c b/src/auditordb/pg_get_denomination_key_validity_withdraw_inconsistency.c index 94537b151..345384e11 100644 --- a/src/auditordb/pg_get_denomination_key_validity_withdraw_inconsistency.c +++ b/src/auditordb/pg_get_denomination_key_validity_withdraw_inconsistency.c @@ -106,12 +106,12 @@ TAH_PG_get_denomination_key_validity_withdraw_inconsistency ( { struct PostgresClosure *pg = cls; - struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_uint64 (&offset), - GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), - GNUNET_PQ_query_param_end - }; + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&offset), + GNUNET_PQ_query_param_bool (return_suppressed), + GNUNET_PQ_query_param_int64 (&limit), + GNUNET_PQ_query_param_end + }; struct DenominationKeyValidityWithdrawInconsistencyContext dcc = { .cb = cb, .cb_cls = cb_cls, @@ -132,21 +132,24 @@ TAH_PG_get_denomination_key_validity_withdraw_inconsistency ( " ORDER BY row_id DESC" " LIMIT $3" ); - PREPARE (pg, - "auditor_denomination_key_validity_withdraw_inconsistency_get_asc", - "SELECT" - " row_id" - ",execution_date" - ",reserve_pub" - ",denompub_h" - " FROM auditor_denomination_key_validity_withdraw_inconsistency" - " WHERE (row_id > $1)" - " AND ($2 OR suppressed is false)" - " ORDER BY row_id ASC" - " LIMIT $3" - ); + PREPARE (pg, + "auditor_denomination_key_validity_withdraw_inconsistency_get_asc", + "SELECT" + " row_id" + ",execution_date" + ",reserve_pub" + ",denompub_h" + " FROM auditor_denomination_key_validity_withdraw_inconsistency" + " WHERE (row_id > $1)" + " AND ($2 OR suppressed is false)" + " ORDER BY row_id ASC" + " LIMIT $3" + ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, - (limit > 0 ) ? "auditor_denomination_key_validity_withdraw_inconsistency_get_asc" : "auditor_denomination_key_validity_withdraw_inconsistency_get_desc", + (limit > 0) ? + "auditor_denomination_key_validity_withdraw_inconsistency_get_asc" + : + "auditor_denomination_key_validity_withdraw_inconsistency_get_desc", params, & denomination_key_validity_withdraw_inconsistency_cb, diff --git a/src/auditordb/pg_get_denomination_pending.c b/src/auditordb/pg_get_denomination_pending.c index e7b82fe9b..975034189 100644 --- a/src/auditordb/pg_get_denomination_pending.c +++ b/src/auditordb/pg_get_denomination_pending.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -63,8 +60,8 @@ struct DenominationPendingContext */ static void denomination_pending_cb (void *cls, - PGresult *result, - unsigned int num_results) + PGresult *result, + unsigned int num_results) { struct DenominationPendingContext *dcc = cls; struct PostgresClosure *pg = dcc->pg; @@ -79,13 +76,14 @@ denomination_pending_cb (void *cls, GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - GNUNET_PQ_result_spec_auto_from_type("denom_pub_hash", &dc.denom_pub_hash), -TALER_PQ_RESULT_SPEC_AMOUNT("denom_balance", &dc.denom_balance), -TALER_PQ_RESULT_SPEC_AMOUNT("denom_loss", &dc.denom_loss), -GNUNET_PQ_result_spec_int64("num_issued", &dc.num_issued), -TALER_PQ_RESULT_SPEC_AMOUNT("denom_risk", &dc.denom_risk), -TALER_PQ_RESULT_SPEC_AMOUNT("recoup_loss", &dc.recoup_loss), -GNUNET_PQ_result_spec_bool("suppressed", &dc.suppressed), + GNUNET_PQ_result_spec_auto_from_type ("denom_pub_hash", + &dc.denom_pub_hash), + TALER_PQ_RESULT_SPEC_AMOUNT ("denom_balance", &dc.denom_balance), + TALER_PQ_RESULT_SPEC_AMOUNT ("denom_loss", &dc.denom_loss), + GNUNET_PQ_result_spec_int64 ("num_issued", &dc.num_issued), + TALER_PQ_RESULT_SPEC_AMOUNT ("denom_risk", &dc.denom_risk), + TALER_PQ_RESULT_SPEC_AMOUNT ("recoup_loss", &dc.recoup_loss), + GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), GNUNET_PQ_result_spec_end @@ -142,12 +140,12 @@ TAH_PG_get_denomination_pending ( "auditor_denomination_pending_get_desc", "SELECT" " denom_pub_hash," -" denom_balance," -" denom_loss," -" num_issued," -" denom_risk," -" recoup_loss," -" suppressed" + " denom_balance," + " denom_loss," + " num_issued," + " denom_risk," + " recoup_loss," + " suppressed" " FROM auditor_denomination_pending" " WHERE (row_id < $1)" " AND ($2 OR suppressed is false)" @@ -158,12 +156,12 @@ TAH_PG_get_denomination_pending ( "auditor_denomination_pending_get_asc", "SELECT" " denom_pub_hash," -" denom_balance," -" denom_loss," -" num_issued," -" denom_risk," -" recoup_loss," -" suppressed" + " denom_balance," + " denom_loss," + " num_issued," + " denom_risk," + " recoup_loss," + " suppressed" " FROM auditor_denomination_pending" " WHERE (row_id > $1)" " AND ($2 OR suppressed is false)" @@ -172,8 +170,10 @@ TAH_PG_get_denomination_pending ( ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, (limit > 0) - ? "auditor_denomination_pending_get_asc" - : "auditor_denomination_pending_get_desc", + ? + "auditor_denomination_pending_get_asc" + : + "auditor_denomination_pending_get_desc", params, &denomination_pending_cb, &dcc); @@ -183,6 +183,3 @@ TAH_PG_get_denomination_pending ( GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; } - - -
\ No newline at end of file diff --git a/src/auditordb/pg_get_denominations_without_sigs.c b/src/auditordb/pg_get_denominations_without_sigs.c index 227c00d45..c19d704aa 100644 --- a/src/auditordb/pg_get_denominations_without_sigs.c +++ b/src/auditordb/pg_get_denominations_without_sigs.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -63,8 +60,8 @@ struct DenominationsWithoutSigsContext */ static void denominations_without_sigs_cb (void *cls, - PGresult *result, - unsigned int num_results) + PGresult *result, + unsigned int num_results) { struct DenominationsWithoutSigsContext *dcc = cls; struct PostgresClosure *pg = dcc->pg; @@ -79,11 +76,11 @@ denominations_without_sigs_cb (void *cls, GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - GNUNET_PQ_result_spec_auto_from_type("denompub_h", &dc.denompub_h), -TALER_PQ_RESULT_SPEC_AMOUNT("value", &dc.value), -GNUNET_PQ_result_spec_int64("start_time", &dc.start_time), -GNUNET_PQ_result_spec_int64("end_time", &dc.end_time), -GNUNET_PQ_result_spec_bool("suppressed", &dc.suppressed), + GNUNET_PQ_result_spec_auto_from_type ("denompub_h", &dc.denompub_h), + TALER_PQ_RESULT_SPEC_AMOUNT ("value", &dc.value), + GNUNET_PQ_result_spec_int64 ("start_time", &dc.start_time), + GNUNET_PQ_result_spec_int64 ("end_time", &dc.end_time), + GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), GNUNET_PQ_result_spec_end @@ -140,11 +137,11 @@ TAH_PG_get_denominations_without_sigs ( "auditor_denominations_without_sigs_get_desc", "SELECT" " row_id," -" denompub_h," -" value," -" start_time," -" end_time," -" suppressed" + " denompub_h," + " value," + " start_time," + " end_time," + " suppressed" " FROM auditor_denominations_without_sigs" " WHERE (row_id < $1)" " AND ($2 OR suppressed is false)" @@ -155,11 +152,11 @@ TAH_PG_get_denominations_without_sigs ( "auditor_denominations_without_sigs_get_asc", "SELECT" " row_id," -" denompub_h," -" value," -" start_time," -" end_time," -" suppressed" + " denompub_h," + " value," + " start_time," + " end_time," + " suppressed" " FROM auditor_denominations_without_sigs" " WHERE (row_id > $1)" " AND ($2 OR suppressed is false)" @@ -168,8 +165,10 @@ TAH_PG_get_denominations_without_sigs ( ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, (limit > 0) - ? "auditor_denominations_without_sigs_get_asc" - : "auditor_denominations_without_sigs_get_desc", + ? + "auditor_denominations_without_sigs_get_asc" + : + "auditor_denominations_without_sigs_get_desc", params, &denominations_without_sigs_cb, &dcc); @@ -179,6 +178,3 @@ TAH_PG_get_denominations_without_sigs ( GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; } - - -
\ No newline at end of file diff --git a/src/auditordb/pg_get_exchange_signkeys.c b/src/auditordb/pg_get_exchange_signkeys.c index 0d0ee64dd..96d2d2917 100644 --- a/src/auditordb/pg_get_exchange_signkeys.c +++ b/src/auditordb/pg_get_exchange_signkeys.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -63,8 +60,8 @@ struct ExchangeSignkeysContext */ static void exchange_signkeys_cb (void *cls, - PGresult *result, - unsigned int num_results) + PGresult *result, + unsigned int num_results) { struct ExchangeSignkeysContext *dcc = cls; struct PostgresClosure *pg = dcc->pg; @@ -79,12 +76,12 @@ exchange_signkeys_cb (void *cls, GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - GNUNET_PQ_result_spec_auto_from_type("exchange_pub", &dc.exchange_pub), -GNUNET_PQ_result_spec_auto_from_type("master_sig", &dc.master_sig), -GNUNET_PQ_result_spec_int64("ep_valid_from", &dc.ep_valid_from), -GNUNET_PQ_result_spec_int64("ep_expire_sign", &dc.ep_expire_sign), -GNUNET_PQ_result_spec_int64("ep_expire_legal", &dc.ep_expire_legal), -GNUNET_PQ_result_spec_bool("suppressed", &dc.suppressed), + GNUNET_PQ_result_spec_auto_from_type ("exchange_pub", &dc.exchange_pub), + GNUNET_PQ_result_spec_auto_from_type ("master_sig", &dc.master_sig), + GNUNET_PQ_result_spec_int64 ("ep_valid_from", &dc.ep_valid_from), + GNUNET_PQ_result_spec_int64 ("ep_expire_sign", &dc.ep_expire_sign), + GNUNET_PQ_result_spec_int64 ("ep_expire_legal", &dc.ep_expire_legal), + GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), GNUNET_PQ_result_spec_end @@ -141,11 +138,11 @@ TAH_PG_get_exchange_signkeys ( "auditor_exchange_signkeys_get_desc", "SELECT" " exchange_pub," -" master_sig," -" ep_valid_from," -" ep_expire_sign," -" ep_expire_legal," -" suppressed" + " master_sig," + " ep_valid_from," + " ep_expire_sign," + " ep_expire_legal," + " suppressed" " FROM auditor_exchange_signkeys" " WHERE (row_id < $1)" " AND ($2 OR suppressed is false)" @@ -156,11 +153,11 @@ TAH_PG_get_exchange_signkeys ( "auditor_exchange_signkeys_get_asc", "SELECT" " exchange_pub," -" master_sig," -" ep_valid_from," -" ep_expire_sign," -" ep_expire_legal," -" suppressed" + " master_sig," + " ep_valid_from," + " ep_expire_sign," + " ep_expire_legal," + " suppressed" " FROM auditor_exchange_signkeys" " WHERE (row_id > $1)" " AND ($2 OR suppressed is false)" @@ -169,8 +166,10 @@ TAH_PG_get_exchange_signkeys ( ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, (limit > 0) - ? "auditor_exchange_signkeys_get_asc" - : "auditor_exchange_signkeys_get_desc", + ? + "auditor_exchange_signkeys_get_asc" + : + "auditor_exchange_signkeys_get_desc", params, &exchange_signkeys_cb, &dcc); @@ -180,6 +179,3 @@ TAH_PG_get_exchange_signkeys ( GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; } - - -
\ No newline at end of file diff --git a/src/auditordb/pg_get_fee_time_inconsistency.c b/src/auditordb/pg_get_fee_time_inconsistency.c index 5b1a7aa3f..e63dddfab 100644 --- a/src/auditordb/pg_get_fee_time_inconsistency.c +++ b/src/auditordb/pg_get_fee_time_inconsistency.c @@ -107,12 +107,12 @@ TAH_PG_get_fee_time_inconsistency ( { struct PostgresClosure *pg = cls; - struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_uint64 (&offset), - GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), - GNUNET_PQ_query_param_end - }; + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&offset), + GNUNET_PQ_query_param_bool (return_suppressed), + GNUNET_PQ_query_param_int64 (&limit), + GNUNET_PQ_query_param_end + }; struct FeeTimeInconsistencyContext dcc = { .cb = cb, .cb_cls = cb_cls, @@ -133,21 +133,24 @@ TAH_PG_get_fee_time_inconsistency ( " ORDER BY row_id DESC" " LIMIT $3" ); - PREPARE (pg, - "auditor_fee_time_inconsistency_get_asc", - "SELECT" - " row_id" - ",type" - ",time" - ",diagnostic" - " FROM auditor_fee_time_inconsistency" - " WHERE (row_id > $1)" - " AND ($2 OR suppressed is false)" - " ORDER BY row_id ASC" - " LIMIT $3" - ); + PREPARE (pg, + "auditor_fee_time_inconsistency_get_asc", + "SELECT" + " row_id" + ",type" + ",time" + ",diagnostic" + " FROM auditor_fee_time_inconsistency" + " WHERE (row_id > $1)" + " AND ($2 OR suppressed is false)" + " ORDER BY row_id ASC" + " LIMIT $3" + ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, - (limit > 0) ? "auditor_fee_time_inconsistency_get_asc" : "auditor_fee_time_inconsistency_get_desc", + (limit > 0) ? + "auditor_fee_time_inconsistency_get_asc" + : + "auditor_fee_time_inconsistency_get_desc", params, &fee_time_inconsistency_cb, &dcc); diff --git a/src/auditordb/pg_get_historic_denomination_revenue.c b/src/auditordb/pg_get_historic_denomination_revenue.c index ca14e88a0..4eea62750 100644 --- a/src/auditordb/pg_get_historic_denomination_revenue.c +++ b/src/auditordb/pg_get_historic_denomination_revenue.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -63,8 +60,8 @@ struct HistoricDenominationRevenueContext */ static void historic_denomination_revenue_cb (void *cls, - PGresult *result, - unsigned int num_results) + PGresult *result, + unsigned int num_results) { struct HistoricDenominationRevenueContext *dcc = cls; struct PostgresClosure *pg = dcc->pg; @@ -79,11 +76,12 @@ historic_denomination_revenue_cb (void *cls, GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - GNUNET_PQ_result_spec_auto_from_type("denom_pub_hash", &dc.denom_pub_hash), -GNUNET_PQ_result_spec_int64("revenue_timestamp", &dc.revenue_timestamp), -TALER_PQ_RESULT_SPEC_AMOUNT("revenue_balance", &dc.revenue_balance), -TALER_PQ_RESULT_SPEC_AMOUNT("loss_balance", &dc.loss_balance), -GNUNET_PQ_result_spec_bool("suppressed", &dc.suppressed), + GNUNET_PQ_result_spec_auto_from_type ("denom_pub_hash", + &dc.denom_pub_hash), + GNUNET_PQ_result_spec_int64 ("revenue_timestamp", &dc.revenue_timestamp), + TALER_PQ_RESULT_SPEC_AMOUNT ("revenue_balance", &dc.revenue_balance), + TALER_PQ_RESULT_SPEC_AMOUNT ("loss_balance", &dc.loss_balance), + GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), GNUNET_PQ_result_spec_end @@ -140,10 +138,10 @@ TAH_PG_get_historic_denomination_revenue ( "auditor_historic_denomination_revenue_get_desc", "SELECT" " denom_pub_hash," -" revenue_timestamp," -" revenue_balance," -" loss_balance," -" suppressed" + " revenue_timestamp," + " revenue_balance," + " loss_balance," + " suppressed" " FROM auditor_historic_denomination_revenue" " WHERE (row_id < $1)" " AND ($2 OR suppressed is false)" @@ -154,10 +152,10 @@ TAH_PG_get_historic_denomination_revenue ( "auditor_historic_denomination_revenue_get_asc", "SELECT" " denom_pub_hash," -" revenue_timestamp," -" revenue_balance," -" loss_balance," -" suppressed" + " revenue_timestamp," + " revenue_balance," + " loss_balance," + " suppressed" " FROM auditor_historic_denomination_revenue" " WHERE (row_id > $1)" " AND ($2 OR suppressed is false)" @@ -166,8 +164,10 @@ TAH_PG_get_historic_denomination_revenue ( ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, (limit > 0) - ? "auditor_historic_denomination_revenue_get_asc" - : "auditor_historic_denomination_revenue_get_desc", + ? + "auditor_historic_denomination_revenue_get_asc" + : + "auditor_historic_denomination_revenue_get_desc", params, &historic_denomination_revenue_cb, &dcc); @@ -177,6 +177,3 @@ TAH_PG_get_historic_denomination_revenue ( GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; } - - -
\ No newline at end of file diff --git a/src/auditordb/pg_get_historic_reserve_summary.c b/src/auditordb/pg_get_historic_reserve_summary.c index 454224533..68c0724ab 100644 --- a/src/auditordb/pg_get_historic_reserve_summary.c +++ b/src/auditordb/pg_get_historic_reserve_summary.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -63,8 +60,8 @@ struct HistoricReserveSummaryContext */ static void historic_reserve_summary_cb (void *cls, - PGresult *result, - unsigned int num_results) + PGresult *result, + unsigned int num_results) { struct HistoricReserveSummaryContext *dcc = cls; struct PostgresClosure *pg = dcc->pg; @@ -79,10 +76,10 @@ historic_reserve_summary_cb (void *cls, GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - GNUNET_PQ_result_spec_int64("start_date", &dc.start_date), -GNUNET_PQ_result_spec_int64("end_date", &dc.end_date), -TALER_PQ_RESULT_SPEC_AMOUNT("reserve_profits", &dc.reserve_profits), -GNUNET_PQ_result_spec_bool("suppressed", &dc.suppressed), + GNUNET_PQ_result_spec_int64 ("start_date", &dc.start_date), + GNUNET_PQ_result_spec_int64 ("end_date", &dc.end_date), + TALER_PQ_RESULT_SPEC_AMOUNT ("reserve_profits", &dc.reserve_profits), + GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), GNUNET_PQ_result_spec_end @@ -139,9 +136,9 @@ TAH_PG_get_historic_reserve_summary ( "auditor_historic_reserve_summary_get_desc", "SELECT" " start_date," -" end_date," -" reserve_profits," -" suppressed" + " end_date," + " reserve_profits," + " suppressed" " FROM auditor_historic_reserve_summary" " WHERE (row_id < $1)" " AND ($2 OR suppressed is false)" @@ -152,9 +149,9 @@ TAH_PG_get_historic_reserve_summary ( "auditor_historic_reserve_summary_get_asc", "SELECT" " start_date," -" end_date," -" reserve_profits," -" suppressed" + " end_date," + " reserve_profits," + " suppressed" " FROM auditor_historic_reserve_summary" " WHERE (row_id > $1)" " AND ($2 OR suppressed is false)" @@ -163,8 +160,10 @@ TAH_PG_get_historic_reserve_summary ( ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, (limit > 0) - ? "auditor_historic_reserve_summary_get_asc" - : "auditor_historic_reserve_summary_get_desc", + ? + "auditor_historic_reserve_summary_get_asc" + : + "auditor_historic_reserve_summary_get_desc", params, &historic_reserve_summary_cb, &dcc); @@ -174,6 +173,3 @@ TAH_PG_get_historic_reserve_summary ( GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; } - - -
\ No newline at end of file diff --git a/src/auditordb/pg_get_misattribution_in_inconsistency.c b/src/auditordb/pg_get_misattribution_in_inconsistency.c index a47b11306..c5e990642 100644 --- a/src/auditordb/pg_get_misattribution_in_inconsistency.c +++ b/src/auditordb/pg_get_misattribution_in_inconsistency.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -63,8 +60,8 @@ struct MisattributionInInconsistencyContext */ static void misattribution_in_inconsistency_cb (void *cls, - PGresult *result, - unsigned int num_results) + PGresult *result, + unsigned int num_results) { struct MisattributionInInconsistencyContext *dcc = cls; struct PostgresClosure *pg = dcc->pg; @@ -79,10 +76,10 @@ misattribution_in_inconsistency_cb (void *cls, GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - TALER_PQ_RESULT_SPEC_AMOUNT("amount", &dc.amount), -GNUNET_PQ_result_spec_int64("bank_row", &dc.bank_row), -GNUNET_PQ_result_spec_auto_from_type("reserve_pub", &dc.reserve_pub), -GNUNET_PQ_result_spec_bool("suppressed", &dc.suppressed), + TALER_PQ_RESULT_SPEC_AMOUNT ("amount", &dc.amount), + GNUNET_PQ_result_spec_int64 ("bank_row", &dc.bank_row), + GNUNET_PQ_result_spec_auto_from_type ("reserve_pub", &dc.reserve_pub), + GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), GNUNET_PQ_result_spec_end @@ -139,10 +136,10 @@ TAH_PG_get_misattribution_in_inconsistency ( "auditor_misattribution_in_inconsistency_get_desc", "SELECT" " row_id," -" amount," -" bank_row," -" reserve_pub," -" suppressed" + " amount," + " bank_row," + " reserve_pub," + " suppressed" " FROM auditor_misattribution_in_inconsistency" " WHERE (row_id < $1)" " AND ($2 OR suppressed is false)" @@ -153,10 +150,10 @@ TAH_PG_get_misattribution_in_inconsistency ( "auditor_misattribution_in_inconsistency_get_asc", "SELECT" " row_id," -" amount," -" bank_row," -" reserve_pub," -" suppressed" + " amount," + " bank_row," + " reserve_pub," + " suppressed" " FROM auditor_misattribution_in_inconsistency" " WHERE (row_id > $1)" " AND ($2 OR suppressed is false)" @@ -165,8 +162,10 @@ TAH_PG_get_misattribution_in_inconsistency ( ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, (limit > 0) - ? "auditor_misattribution_in_inconsistency_get_asc" - : "auditor_misattribution_in_inconsistency_get_desc", + ? + "auditor_misattribution_in_inconsistency_get_asc" + : + "auditor_misattribution_in_inconsistency_get_desc", params, &misattribution_in_inconsistency_cb, &dcc); @@ -176,6 +175,3 @@ TAH_PG_get_misattribution_in_inconsistency ( GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; } - - -
\ No newline at end of file diff --git a/src/auditordb/pg_get_purse_not_closed_inconsistencies.c b/src/auditordb/pg_get_purse_not_closed_inconsistencies.c index 7489f7ccb..c5e891ee0 100644 --- a/src/auditordb/pg_get_purse_not_closed_inconsistencies.c +++ b/src/auditordb/pg_get_purse_not_closed_inconsistencies.c @@ -108,12 +108,12 @@ TAH_PG_get_purse_not_closed_inconsistencies ( { struct PostgresClosure *pg = cls; - struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_uint64 (&offset), - GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), - GNUNET_PQ_query_param_end - }; + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&offset), + GNUNET_PQ_query_param_bool (return_suppressed), + GNUNET_PQ_query_param_int64 (&limit), + GNUNET_PQ_query_param_end + }; struct PurseNotClosedInconsistenciesContext dcc = { .cb = cb, .cb_cls = cb_cls, @@ -134,21 +134,24 @@ TAH_PG_get_purse_not_closed_inconsistencies ( " ORDER BY row_id DESC" " LIMIT $3" ); - PREPARE (pg, - "auditor_purse_not_closed_inconsistencies_get_asc", - "SELECT" - " row_id" - ",purse_pub" - ",amount" - ",expiration_date" - " FROM auditor_purse_not_closed_inconsistencies" - " WHERE (row_id > $1)" - " AND ($2 OR suppressed is false)" - " ORDER BY row_id ASC" - " LIMIT $3" - ); + PREPARE (pg, + "auditor_purse_not_closed_inconsistencies_get_asc", + "SELECT" + " row_id" + ",purse_pub" + ",amount" + ",expiration_date" + " FROM auditor_purse_not_closed_inconsistencies" + " WHERE (row_id > $1)" + " AND ($2 OR suppressed is false)" + " ORDER BY row_id ASC" + " LIMIT $3" + ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, - (limit > 0) ? "auditor_purse_not_closed_inconsistencies_get_asc" : "auditor_purse_not_closed_inconsistencies_get_desc", + (limit > 0) ? + "auditor_purse_not_closed_inconsistencies_get_asc" + : + "auditor_purse_not_closed_inconsistencies_get_desc", params, & purse_not_closed_inconsistencies_cb, diff --git a/src/auditordb/pg_get_purses.c b/src/auditordb/pg_get_purses.c index a977a1a94..ce4ae6001 100644 --- a/src/auditordb/pg_get_purses.c +++ b/src/auditordb/pg_get_purses.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -63,8 +60,8 @@ struct PursesContext */ static void purses_cb (void *cls, - PGresult *result, - unsigned int num_results) + PGresult *result, + unsigned int num_results) { struct PursesContext *dcc = cls; struct PostgresClosure *pg = dcc->pg; @@ -79,12 +76,13 @@ purses_cb (void *cls, GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - GNUNET_PQ_result_spec_int64("auditor_purses_rowid", &dc.auditor_purses_rowid), -GNUNET_PQ_result_spec_auto_from_type("purse_pub", &dc.purse_pub), -TALER_PQ_RESULT_SPEC_AMOUNT("balance", &dc.balance), -TALER_PQ_RESULT_SPEC_AMOUNT("target", &dc.target), -GNUNET_PQ_result_spec_int64("expiration_date", &dc.expiration_date), -GNUNET_PQ_result_spec_bool("suppressed", &dc.suppressed), + GNUNET_PQ_result_spec_int64 ("auditor_purses_rowid", + &dc.auditor_purses_rowid), + GNUNET_PQ_result_spec_auto_from_type ("purse_pub", &dc.purse_pub), + TALER_PQ_RESULT_SPEC_AMOUNT ("balance", &dc.balance), + TALER_PQ_RESULT_SPEC_AMOUNT ("target", &dc.target), + GNUNET_PQ_result_spec_int64 ("expiration_date", &dc.expiration_date), + GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), GNUNET_PQ_result_spec_end @@ -141,11 +139,11 @@ TAH_PG_get_purses ( "auditor_purses_get_desc", "SELECT" " auditor_purses_rowid," -" purse_pub," -" balance," -" target," -" expiration_date," -" suppressed" + " purse_pub," + " balance," + " target," + " expiration_date," + " suppressed" " FROM auditor_purses" " WHERE (row_id < $1)" " AND ($2 OR suppressed is false)" @@ -156,11 +154,11 @@ TAH_PG_get_purses ( "auditor_purses_get_asc", "SELECT" " auditor_purses_rowid," -" purse_pub," -" balance," -" target," -" expiration_date," -" suppressed" + " purse_pub," + " balance," + " target," + " expiration_date," + " suppressed" " FROM auditor_purses" " WHERE (row_id > $1)" " AND ($2 OR suppressed is false)" @@ -180,6 +178,3 @@ TAH_PG_get_purses ( GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; } - - -
\ No newline at end of file diff --git a/src/auditordb/pg_get_refreshes_hanging.c b/src/auditordb/pg_get_refreshes_hanging.c index d4dd83b67..6d86ae7a6 100644 --- a/src/auditordb/pg_get_refreshes_hanging.c +++ b/src/auditordb/pg_get_refreshes_hanging.c @@ -106,12 +106,12 @@ TAH_PG_get_refreshes_hanging ( { struct PostgresClosure *pg = cls; - struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_uint64 (&offset), - GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), - GNUNET_PQ_query_param_end - }; + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&offset), + GNUNET_PQ_query_param_bool (return_suppressed), + GNUNET_PQ_query_param_int64 (&limit), + GNUNET_PQ_query_param_end + }; struct RefreshesHangingContext dcc = { .cb = cb, .cb_cls = cb_cls, @@ -131,20 +131,22 @@ TAH_PG_get_refreshes_hanging ( " ORDER BY row_id DESC" " LIMIT $3" ); - PREPARE (pg, - "auditor_refreshes_hanging_get_asc", - "SELECT" - " row_id" - ",amount" - ",coin_pub" - " FROM auditor_refreshes_hanging" - " WHERE (row_id > $1)" - " AND ($2 OR suppressed is false)" - " ORDER BY row_id ASC" - " LIMIT $3" - ); + PREPARE (pg, + "auditor_refreshes_hanging_get_asc", + "SELECT" + " row_id" + ",amount" + ",coin_pub" + " FROM auditor_refreshes_hanging" + " WHERE (row_id > $1)" + " AND ($2 OR suppressed is false)" + " ORDER BY row_id ASC" + " LIMIT $3" + ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, - (limit > 0) ? "auditor_refreshes_hanging_get_asc" : "auditor_refreshes_hanging_get_desc", + (limit > 0) ? + "auditor_refreshes_hanging_get_asc" + : "auditor_refreshes_hanging_get_desc", params, &refreshes_hanging_cb, &dcc); diff --git a/src/auditordb/pg_get_reserve_balance_insufficient_inconsistency.c b/src/auditordb/pg_get_reserve_balance_insufficient_inconsistency.c index 4182e5dc9..ed482937b 100644 --- a/src/auditordb/pg_get_reserve_balance_insufficient_inconsistency.c +++ b/src/auditordb/pg_get_reserve_balance_insufficient_inconsistency.c @@ -108,12 +108,12 @@ TAH_PG_get_reserve_balance_insufficient_inconsistency ( { struct PostgresClosure *pg = cls; - struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_uint64 (&offset), - GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), - GNUNET_PQ_query_param_end - }; + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&offset), + GNUNET_PQ_query_param_bool (return_suppressed), + GNUNET_PQ_query_param_int64 (&limit), + GNUNET_PQ_query_param_end + }; struct ReserveBalanceInsufficientInconsistencyContext dcc = { .cb = cb, .cb_cls = cb_cls, @@ -134,21 +134,24 @@ TAH_PG_get_reserve_balance_insufficient_inconsistency ( " ORDER BY row_id DESC" " LIMIT $3" ); - PREPARE (pg, - "auditor_reserve_balance_insufficient_inconsistency_get_asc", - "SELECT" - " row_id" - ",reserve_pub" - ",inconsistency_gain" - ",inconsistency_amount" - " FROM auditor_reserve_balance_insufficient_inconsistency" - " WHERE (row_id > $1)" - " AND ($2 OR suppressed is false)" - " ORDER BY row_id ASC" - " LIMIT $3" - ); + PREPARE (pg, + "auditor_reserve_balance_insufficient_inconsistency_get_asc", + "SELECT" + " row_id" + ",reserve_pub" + ",inconsistency_gain" + ",inconsistency_amount" + " FROM auditor_reserve_balance_insufficient_inconsistency" + " WHERE (row_id > $1)" + " AND ($2 OR suppressed is false)" + " ORDER BY row_id ASC" + " LIMIT $3" + ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, - (limit > 0) ? "auditor_reserve_balance_insufficient_inconsistency_get_asc" : "auditor_reserve_balance_insufficient_inconsistency_get_desc", + (limit > 0) ? + "auditor_reserve_balance_insufficient_inconsistency_get_asc" + : + "auditor_reserve_balance_insufficient_inconsistency_get_desc", params, & reserve_balance_insufficient_inconsistency_cb, diff --git a/src/auditordb/pg_get_reserve_balance_summary_wrong_inconsistency.c b/src/auditordb/pg_get_reserve_balance_summary_wrong_inconsistency.c index 5e7ac3533..a2ae412f0 100644 --- a/src/auditordb/pg_get_reserve_balance_summary_wrong_inconsistency.c +++ b/src/auditordb/pg_get_reserve_balance_summary_wrong_inconsistency.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -63,8 +60,8 @@ struct ReserveBalanceSummaryWrongInconsistencyContext */ static void reserve_balance_summary_wrong_inconsistency_cb (void *cls, - PGresult *result, - unsigned int num_results) + PGresult *result, + unsigned int num_results) { struct ReserveBalanceSummaryWrongInconsistencyContext *dcc = cls; struct PostgresClosure *pg = dcc->pg; @@ -79,10 +76,10 @@ reserve_balance_summary_wrong_inconsistency_cb (void *cls, GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - GNUNET_PQ_result_spec_auto_from_type("reserve_pub", &dc.reserve_pub), -TALER_PQ_RESULT_SPEC_AMOUNT("exchange_amount", &dc.exchange_amount), -TALER_PQ_RESULT_SPEC_AMOUNT("auditor_amount", &dc.auditor_amount), -GNUNET_PQ_result_spec_bool("suppressed", &dc.suppressed), + GNUNET_PQ_result_spec_auto_from_type ("reserve_pub", &dc.reserve_pub), + TALER_PQ_RESULT_SPEC_AMOUNT ("exchange_amount", &dc.exchange_amount), + TALER_PQ_RESULT_SPEC_AMOUNT ("auditor_amount", &dc.auditor_amount), + GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), GNUNET_PQ_result_spec_end @@ -139,10 +136,10 @@ TAH_PG_get_reserve_balance_summary_wrong_inconsistency ( "auditor_reserve_balance_summary_wrong_inconsistency_get_desc", "SELECT" " row_id," -" reserve_pub," -" exchange_amount," -" auditor_amount," -" suppressed" + " reserve_pub," + " exchange_amount," + " auditor_amount," + " suppressed" " FROM auditor_reserve_balance_summary_wrong_inconsistency" " WHERE (row_id < $1)" " AND ($2 OR suppressed is false)" @@ -153,10 +150,10 @@ TAH_PG_get_reserve_balance_summary_wrong_inconsistency ( "auditor_reserve_balance_summary_wrong_inconsistency_get_asc", "SELECT" " row_id," -" reserve_pub," -" exchange_amount," -" auditor_amount," -" suppressed" + " reserve_pub," + " exchange_amount," + " auditor_amount," + " suppressed" " FROM auditor_reserve_balance_summary_wrong_inconsistency" " WHERE (row_id > $1)" " AND ($2 OR suppressed is false)" @@ -165,10 +162,13 @@ TAH_PG_get_reserve_balance_summary_wrong_inconsistency ( ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, (limit > 0) - ? "auditor_reserve_balance_summary_wrong_inconsistency_get_asc" - : "auditor_reserve_balance_summary_wrong_inconsistency_get_desc", + ? + "auditor_reserve_balance_summary_wrong_inconsistency_get_asc" + : + "auditor_reserve_balance_summary_wrong_inconsistency_get_desc", params, - &reserve_balance_summary_wrong_inconsistency_cb, + & + reserve_balance_summary_wrong_inconsistency_cb, &dcc); if (qs > 0) @@ -176,6 +176,3 @@ TAH_PG_get_reserve_balance_summary_wrong_inconsistency ( GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; } - - -
\ No newline at end of file diff --git a/src/auditordb/pg_get_reserve_in_inconsistency.c b/src/auditordb/pg_get_reserve_in_inconsistency.c index 22950f537..1ad3559ac 100644 --- a/src/auditordb/pg_get_reserve_in_inconsistency.c +++ b/src/auditordb/pg_get_reserve_in_inconsistency.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -63,8 +60,8 @@ struct ReserveInInconsistencyContext */ static void reserve_in_inconsistency_cb (void *cls, - PGresult *result, - unsigned int num_results) + PGresult *result, + unsigned int num_results) { struct ReserveInInconsistencyContext *dcc = cls; struct PostgresClosure *pg = dcc->pg; @@ -79,13 +76,14 @@ reserve_in_inconsistency_cb (void *cls, GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - TALER_PQ_RESULT_SPEC_AMOUNT("amount_exchange_expected", &dc.amount_exchange_expected), -TALER_PQ_RESULT_SPEC_AMOUNT("amount_wired", &dc.amount_wired), -GNUNET_PQ_result_spec_auto_from_type("reserve_pub", &dc.reserve_pub), -GNUNET_PQ_result_spec_int64("timestamp", &dc.timestamp), -GNUNET_PQ_result_spec_auto_from_type("account", &dc.account), -GNUNET_PQ_result_spec_auto_from_type("diagnostic", &dc.diagnostic), -GNUNET_PQ_result_spec_bool("suppressed", &dc.suppressed), + TALER_PQ_RESULT_SPEC_AMOUNT ("amount_exchange_expected", + &dc.amount_exchange_expected), + TALER_PQ_RESULT_SPEC_AMOUNT ("amount_wired", &dc.amount_wired), + GNUNET_PQ_result_spec_auto_from_type ("reserve_pub", &dc.reserve_pub), + GNUNET_PQ_result_spec_int64 ("timestamp", &dc.timestamp), + GNUNET_PQ_result_spec_auto_from_type ("account", &dc.account), + GNUNET_PQ_result_spec_auto_from_type ("diagnostic", &dc.diagnostic), + GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), GNUNET_PQ_result_spec_end @@ -142,13 +140,13 @@ TAH_PG_get_reserve_in_inconsistency ( "auditor_reserve_in_inconsistency_get_desc", "SELECT" " row_id," -" amount_exchange_expected," -" amount_wired," -" reserve_pub," -" timestamp," -" account," -" diagnostic," -" suppressed" + " amount_exchange_expected," + " amount_wired," + " reserve_pub," + " timestamp," + " account," + " diagnostic," + " suppressed" " FROM auditor_reserve_in_inconsistency" " WHERE (row_id < $1)" " AND ($2 OR suppressed is false)" @@ -159,13 +157,13 @@ TAH_PG_get_reserve_in_inconsistency ( "auditor_reserve_in_inconsistency_get_asc", "SELECT" " row_id," -" amount_exchange_expected," -" amount_wired," -" reserve_pub," -" timestamp," -" account," -" diagnostic," -" suppressed" + " amount_exchange_expected," + " amount_wired," + " reserve_pub," + " timestamp," + " account," + " diagnostic," + " suppressed" " FROM auditor_reserve_in_inconsistency" " WHERE (row_id > $1)" " AND ($2 OR suppressed is false)" @@ -174,8 +172,10 @@ TAH_PG_get_reserve_in_inconsistency ( ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, (limit > 0) - ? "auditor_reserve_in_inconsistency_get_asc" - : "auditor_reserve_in_inconsistency_get_desc", + ? + "auditor_reserve_in_inconsistency_get_asc" + : + "auditor_reserve_in_inconsistency_get_desc", params, &reserve_in_inconsistency_cb, &dcc); @@ -185,6 +185,3 @@ TAH_PG_get_reserve_in_inconsistency ( GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; } - - -
\ No newline at end of file diff --git a/src/auditordb/pg_get_reserve_not_closed_inconsistency.c b/src/auditordb/pg_get_reserve_not_closed_inconsistency.c index ebef6697f..3a47f759a 100644 --- a/src/auditordb/pg_get_reserve_not_closed_inconsistency.c +++ b/src/auditordb/pg_get_reserve_not_closed_inconsistency.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -63,8 +60,8 @@ struct ReserveNotClosedInconsistencyContext */ static void reserve_not_closed_inconsistency_cb (void *cls, - PGresult *result, - unsigned int num_results) + PGresult *result, + unsigned int num_results) { struct ReserveNotClosedInconsistencyContext *dcc = cls; struct PostgresClosure *pg = dcc->pg; @@ -79,11 +76,11 @@ reserve_not_closed_inconsistency_cb (void *cls, GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - GNUNET_PQ_result_spec_auto_from_type("reserve_pub", &dc.reserve_pub), -TALER_PQ_RESULT_SPEC_AMOUNT("balance", &dc.balance), -GNUNET_PQ_result_spec_int64("expiration_time", &dc.expiration_time), -GNUNET_PQ_result_spec_auto_from_type("diagnostic", &dc.diagnostic), -GNUNET_PQ_result_spec_bool("suppressed", &dc.suppressed), + GNUNET_PQ_result_spec_auto_from_type ("reserve_pub", &dc.reserve_pub), + TALER_PQ_RESULT_SPEC_AMOUNT ("balance", &dc.balance), + GNUNET_PQ_result_spec_int64 ("expiration_time", &dc.expiration_time), + GNUNET_PQ_result_spec_auto_from_type ("diagnostic", &dc.diagnostic), + GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), GNUNET_PQ_result_spec_end @@ -140,11 +137,11 @@ TAH_PG_get_reserve_not_closed_inconsistency ( "auditor_reserve_not_closed_inconsistency_get_desc", "SELECT" " row_id," -" reserve_pub," -" balance," -" expiration_time," -" diagnostic," -" suppressed" + " reserve_pub," + " balance," + " expiration_time," + " diagnostic," + " suppressed" " FROM auditor_reserve_not_closed_inconsistency" " WHERE (row_id < $1)" " AND ($2 OR suppressed is false)" @@ -155,11 +152,11 @@ TAH_PG_get_reserve_not_closed_inconsistency ( "auditor_reserve_not_closed_inconsistency_get_asc", "SELECT" " row_id," -" reserve_pub," -" balance," -" expiration_time," -" diagnostic," -" suppressed" + " reserve_pub," + " balance," + " expiration_time," + " diagnostic," + " suppressed" " FROM auditor_reserve_not_closed_inconsistency" " WHERE (row_id > $1)" " AND ($2 OR suppressed is false)" @@ -168,10 +165,13 @@ TAH_PG_get_reserve_not_closed_inconsistency ( ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, (limit > 0) - ? "auditor_reserve_not_closed_inconsistency_get_asc" - : "auditor_reserve_not_closed_inconsistency_get_desc", + ? + "auditor_reserve_not_closed_inconsistency_get_asc" + : + "auditor_reserve_not_closed_inconsistency_get_desc", params, - &reserve_not_closed_inconsistency_cb, + & + reserve_not_closed_inconsistency_cb, &dcc); if (qs > 0) @@ -179,6 +179,3 @@ TAH_PG_get_reserve_not_closed_inconsistency ( GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; } - - -
\ No newline at end of file diff --git a/src/auditordb/pg_get_reserves.c b/src/auditordb/pg_get_reserves.c index 8eefba898..9bb817d5f 100644 --- a/src/auditordb/pg_get_reserves.c +++ b/src/auditordb/pg_get_reserves.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -63,8 +60,8 @@ struct ReservesContext */ static void reserves_cb (void *cls, - PGresult *result, - unsigned int num_results) + PGresult *result, + unsigned int num_results) { struct ReservesContext *dcc = cls; struct PostgresClosure *pg = dcc->pg; @@ -79,18 +76,21 @@ reserves_cb (void *cls, GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - GNUNET_PQ_result_spec_int64("auditor_reserves_rowid", &dc.auditor_reserves_rowid), -GNUNET_PQ_result_spec_auto_from_type("reserve_pub", &dc.reserve_pub), -TALER_PQ_RESULT_SPEC_AMOUNT("reserve_balance", &dc.reserve_balance), -TALER_PQ_RESULT_SPEC_AMOUNT("reserve_loss", &dc.reserve_loss), -TALER_PQ_RESULT_SPEC_AMOUNT("withdraw_fee_balance", &dc.withdraw_fee_balance), -TALER_PQ_RESULT_SPEC_AMOUNT("close_fee_balance", &dc.close_fee_balance), -TALER_PQ_RESULT_SPEC_AMOUNT("purse_fee_balance", &dc.purse_fee_balance), -TALER_PQ_RESULT_SPEC_AMOUNT("open_fee_balance", &dc.open_fee_balance), -TALER_PQ_RESULT_SPEC_AMOUNT("history_fee_balance", &dc.history_fee_balance), -GNUNET_PQ_result_spec_int64("expiration_date", &dc.expiration_date), -GNUNET_PQ_result_spec_string("origin_account", &dc.origin_account), -GNUNET_PQ_result_spec_bool("suppressed", &dc.suppressed), + GNUNET_PQ_result_spec_int64 ("auditor_reserves_rowid", + &dc.auditor_reserves_rowid), + GNUNET_PQ_result_spec_auto_from_type ("reserve_pub", &dc.reserve_pub), + TALER_PQ_RESULT_SPEC_AMOUNT ("reserve_balance", &dc.reserve_balance), + TALER_PQ_RESULT_SPEC_AMOUNT ("reserve_loss", &dc.reserve_loss), + TALER_PQ_RESULT_SPEC_AMOUNT ("withdraw_fee_balance", + &dc.withdraw_fee_balance), + TALER_PQ_RESULT_SPEC_AMOUNT ("close_fee_balance", &dc.close_fee_balance), + TALER_PQ_RESULT_SPEC_AMOUNT ("purse_fee_balance", &dc.purse_fee_balance), + TALER_PQ_RESULT_SPEC_AMOUNT ("open_fee_balance", &dc.open_fee_balance), + TALER_PQ_RESULT_SPEC_AMOUNT ("history_fee_balance", + &dc.history_fee_balance), + GNUNET_PQ_result_spec_int64 ("expiration_date", &dc.expiration_date), + GNUNET_PQ_result_spec_string ("origin_account", &dc.origin_account), + GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), GNUNET_PQ_result_spec_end @@ -147,17 +147,17 @@ TAH_PG_get_reserves ( "auditor_reserves_get_desc", "SELECT" " auditor_reserves_rowid," -" reserve_pub," -" reserve_balance," -" reserve_loss," -" withdraw_fee_balance," -" close_fee_balance," -" purse_fee_balance," -" open_fee_balance," -" history_fee_balance," -" expiration_date," -" origin_account," -" suppressed" + " reserve_pub," + " reserve_balance," + " reserve_loss," + " withdraw_fee_balance," + " close_fee_balance," + " purse_fee_balance," + " open_fee_balance," + " history_fee_balance," + " expiration_date," + " origin_account," + " suppressed" " FROM auditor_reserves" " WHERE (row_id < $1)" " AND ($2 OR suppressed is false)" @@ -168,17 +168,17 @@ TAH_PG_get_reserves ( "auditor_reserves_get_asc", "SELECT" " auditor_reserves_rowid," -" reserve_pub," -" reserve_balance," -" reserve_loss," -" withdraw_fee_balance," -" close_fee_balance," -" purse_fee_balance," -" open_fee_balance," -" history_fee_balance," -" expiration_date," -" origin_account," -" suppressed" + " reserve_pub," + " reserve_balance," + " reserve_loss," + " withdraw_fee_balance," + " close_fee_balance," + " purse_fee_balance," + " open_fee_balance," + " history_fee_balance," + " expiration_date," + " origin_account," + " suppressed" " FROM auditor_reserves" " WHERE (row_id > $1)" " AND ($2 OR suppressed is false)" @@ -198,6 +198,3 @@ TAH_PG_get_reserves ( GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; } - - -
\ No newline at end of file diff --git a/src/auditordb/pg_get_row_inconsistency.c b/src/auditordb/pg_get_row_inconsistency.c index 67f83f6ed..f90d1cf0e 100644 --- a/src/auditordb/pg_get_row_inconsistency.c +++ b/src/auditordb/pg_get_row_inconsistency.c @@ -107,12 +107,12 @@ TAH_PG_get_row_inconsistency ( { struct PostgresClosure *pg = cls; - struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_uint64 (&offset), - GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), - GNUNET_PQ_query_param_end - }; + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&offset), + GNUNET_PQ_query_param_bool (return_suppressed), + GNUNET_PQ_query_param_int64 (&limit), + GNUNET_PQ_query_param_end + }; struct RowInconsistencyContext dcc = { .cb = cb, .cb_cls = cb_cls, @@ -133,20 +133,23 @@ TAH_PG_get_row_inconsistency ( " ORDER BY row_id DESC" " LIMIT $3" ); - PREPARE (pg, - "auditor_row_inconsistency_select_asc", - "SELECT" - " row_id" - ",row_table" - ",diagnostic" - " FROM auditor_row_inconsistency" - " WHERE (row_id > $1)" - " AND ($2 OR suppressed is false)" - " ORDER BY row_id DESC" - " LIMIT $3" - ); + PREPARE (pg, + "auditor_row_inconsistency_select_asc", + "SELECT" + " row_id" + ",row_table" + ",diagnostic" + " FROM auditor_row_inconsistency" + " WHERE (row_id > $1)" + " AND ($2 OR suppressed is false)" + " ORDER BY row_id DESC" + " LIMIT $3" + ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, - (limit > 0) ? "auditor_row_inconsistency_select_asc" : "auditor_row_inconsistency_select_desc", + (limit > 0) ? + "auditor_row_inconsistency_select_asc" + : + "auditor_row_inconsistency_select_desc", params, &row_inconsistency_cb, &dcc); diff --git a/src/auditordb/pg_get_row_minor_inconsistencies.c b/src/auditordb/pg_get_row_minor_inconsistencies.c index 002abbda3..8308d5dbb 100644 --- a/src/auditordb/pg_get_row_minor_inconsistencies.c +++ b/src/auditordb/pg_get_row_minor_inconsistencies.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -63,8 +60,8 @@ struct RowMinorInconsistenciesContext */ static void row_minor_inconsistencies_cb (void *cls, - PGresult *result, - unsigned int num_results) + PGresult *result, + unsigned int num_results) { struct RowMinorInconsistenciesContext *dcc = cls; struct PostgresClosure *pg = dcc->pg; @@ -79,9 +76,9 @@ row_minor_inconsistencies_cb (void *cls, GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - GNUNET_PQ_result_spec_auto_from_type("row_table", &dc.row_table), -GNUNET_PQ_result_spec_auto_from_type("diagnostic", &dc.diagnostic), -GNUNET_PQ_result_spec_bool("suppressed", &dc.suppressed), + GNUNET_PQ_result_spec_auto_from_type ("row_table", &dc.row_table), + GNUNET_PQ_result_spec_auto_from_type ("diagnostic", &dc.diagnostic), + GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), GNUNET_PQ_result_spec_end @@ -138,9 +135,9 @@ TAH_PG_get_row_minor_inconsistencies ( "auditor_row_minor_inconsistencies_get_desc", "SELECT" " row_id," -" row_table," -" diagnostic," -" suppressed" + " row_table," + " diagnostic," + " suppressed" " FROM auditor_row_minor_inconsistencies" " WHERE (row_id < $1)" " AND ($2 OR suppressed is false)" @@ -151,9 +148,9 @@ TAH_PG_get_row_minor_inconsistencies ( "auditor_row_minor_inconsistencies_get_asc", "SELECT" " row_id," -" row_table," -" diagnostic," -" suppressed" + " row_table," + " diagnostic," + " suppressed" " FROM auditor_row_minor_inconsistencies" " WHERE (row_id > $1)" " AND ($2 OR suppressed is false)" @@ -162,8 +159,10 @@ TAH_PG_get_row_minor_inconsistencies ( ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, (limit > 0) - ? "auditor_row_minor_inconsistencies_get_asc" - : "auditor_row_minor_inconsistencies_get_desc", + ? + "auditor_row_minor_inconsistencies_get_asc" + : + "auditor_row_minor_inconsistencies_get_desc", params, &row_minor_inconsistencies_cb, &dcc); @@ -173,6 +172,3 @@ TAH_PG_get_row_minor_inconsistencies ( GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; } - - -
\ No newline at end of file diff --git a/src/auditordb/pg_get_wire_format_inconsistency.c b/src/auditordb/pg_get_wire_format_inconsistency.c index ec443616e..b3ab1b60d 100644 --- a/src/auditordb/pg_get_wire_format_inconsistency.c +++ b/src/auditordb/pg_get_wire_format_inconsistency.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -63,8 +60,8 @@ struct WireFormatInconsistencyContext */ static void wire_format_inconsistency_cb (void *cls, - PGresult *result, - unsigned int num_results) + PGresult *result, + unsigned int num_results) { struct WireFormatInconsistencyContext *dcc = cls; struct PostgresClosure *pg = dcc->pg; @@ -79,10 +76,10 @@ wire_format_inconsistency_cb (void *cls, GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - TALER_PQ_RESULT_SPEC_AMOUNT("amount", &dc.amount), -GNUNET_PQ_result_spec_int64("wire_offset", &dc.wire_offset), -GNUNET_PQ_result_spec_auto_from_type("diagnostic", &dc.diagnostic), -GNUNET_PQ_result_spec_bool("suppressed", &dc.suppressed), + TALER_PQ_RESULT_SPEC_AMOUNT ("amount", &dc.amount), + GNUNET_PQ_result_spec_int64 ("wire_offset", &dc.wire_offset), + GNUNET_PQ_result_spec_auto_from_type ("diagnostic", &dc.diagnostic), + GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), GNUNET_PQ_result_spec_end @@ -139,10 +136,10 @@ TAH_PG_get_wire_format_inconsistency ( "auditor_wire_format_inconsistency_get_desc", "SELECT" " row_id," -" amount," -" wire_offset," -" diagnostic," -" suppressed" + " amount," + " wire_offset," + " diagnostic," + " suppressed" " FROM auditor_wire_format_inconsistency" " WHERE (row_id < $1)" " AND ($2 OR suppressed is false)" @@ -153,10 +150,10 @@ TAH_PG_get_wire_format_inconsistency ( "auditor_wire_format_inconsistency_get_asc", "SELECT" " row_id," -" amount," -" wire_offset," -" diagnostic," -" suppressed" + " amount," + " wire_offset," + " diagnostic," + " suppressed" " FROM auditor_wire_format_inconsistency" " WHERE (row_id > $1)" " AND ($2 OR suppressed is false)" @@ -165,8 +162,10 @@ TAH_PG_get_wire_format_inconsistency ( ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, (limit > 0) - ? "auditor_wire_format_inconsistency_get_asc" - : "auditor_wire_format_inconsistency_get_desc", + ? + "auditor_wire_format_inconsistency_get_asc" + : + "auditor_wire_format_inconsistency_get_desc", params, &wire_format_inconsistency_cb, &dcc); @@ -176,6 +175,3 @@ TAH_PG_get_wire_format_inconsistency ( GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; } - - -
\ No newline at end of file diff --git a/src/auditordb/pg_get_wire_out_inconsistency.c b/src/auditordb/pg_get_wire_out_inconsistency.c index f9394375d..3a7051ad3 100644 --- a/src/auditordb/pg_get_wire_out_inconsistency.c +++ b/src/auditordb/pg_get_wire_out_inconsistency.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -63,8 +60,8 @@ struct WireOutInconsistencyContext */ static void wire_out_inconsistency_cb (void *cls, - PGresult *result, - unsigned int num_results) + PGresult *result, + unsigned int num_results) { struct WireOutInconsistencyContext *dcc = cls; struct PostgresClosure *pg = dcc->pg; @@ -79,10 +76,11 @@ wire_out_inconsistency_cb (void *cls, GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - GNUNET_PQ_result_spec_auto_from_type("destination_account", &dc.destination_account), -TALER_PQ_RESULT_SPEC_AMOUNT("expected", &dc.expected), -TALER_PQ_RESULT_SPEC_AMOUNT("claimed", &dc.claimed), -GNUNET_PQ_result_spec_bool("suppressed", &dc.suppressed), + GNUNET_PQ_result_spec_auto_from_type ("destination_account", + &dc.destination_account), + TALER_PQ_RESULT_SPEC_AMOUNT ("expected", &dc.expected), + TALER_PQ_RESULT_SPEC_AMOUNT ("claimed", &dc.claimed), + GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), GNUNET_PQ_result_spec_end @@ -139,10 +137,10 @@ TAH_PG_get_wire_out_inconsistency ( "auditor_wire_out_inconsistency_get_desc", "SELECT" " row_id," -" destination_account," -" expected," -" claimed," -" suppressed" + " destination_account," + " expected," + " claimed," + " suppressed" " FROM auditor_wire_out_inconsistency" " WHERE (row_id < $1)" " AND ($2 OR suppressed is false)" @@ -153,10 +151,10 @@ TAH_PG_get_wire_out_inconsistency ( "auditor_wire_out_inconsistency_get_asc", "SELECT" " row_id," -" destination_account," -" expected," -" claimed," -" suppressed" + " destination_account," + " expected," + " claimed," + " suppressed" " FROM auditor_wire_out_inconsistency" " WHERE (row_id > $1)" " AND ($2 OR suppressed is false)" @@ -165,8 +163,10 @@ TAH_PG_get_wire_out_inconsistency ( ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, (limit > 0) - ? "auditor_wire_out_inconsistency_get_asc" - : "auditor_wire_out_inconsistency_get_desc", + ? + "auditor_wire_out_inconsistency_get_asc" + : + "auditor_wire_out_inconsistency_get_desc", params, &wire_out_inconsistency_cb, &dcc); @@ -176,6 +176,3 @@ TAH_PG_get_wire_out_inconsistency ( GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; } - - -
\ No newline at end of file diff --git a/src/auditordb/pg_insert_denomination_pending.c b/src/auditordb/pg_insert_denomination_pending.c index 70a9981d7..dbea8c6a9 100644 --- a/src/auditordb/pg_insert_denomination_pending.c +++ b/src/auditordb/pg_insert_denomination_pending.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -32,13 +29,13 @@ TAH_PG_insert_denomination_pending ( struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type(&dc->denom_pub_hash), -TALER_PQ_query_param_amount(pg->conn, &dc->denom_balance), -TALER_PQ_query_param_amount(pg->conn, &dc->denom_loss), -GNUNET_PQ_query_param_int64(&dc->num_issued), -TALER_PQ_query_param_amount(pg->conn, &dc->denom_risk), -TALER_PQ_query_param_amount(pg->conn, &dc->recoup_loss), -GNUNET_PQ_query_param_bool(dc->suppressed), + GNUNET_PQ_query_param_auto_from_type (&dc->denom_pub_hash), + TALER_PQ_query_param_amount (pg->conn, &dc->denom_balance), + TALER_PQ_query_param_amount (pg->conn, &dc->denom_loss), + GNUNET_PQ_query_param_int64 (&dc->num_issued), + TALER_PQ_query_param_amount (pg->conn, &dc->denom_risk), + TALER_PQ_query_param_amount (pg->conn, &dc->recoup_loss), + GNUNET_PQ_query_param_bool (dc->suppressed), GNUNET_PQ_query_param_end @@ -48,17 +45,15 @@ GNUNET_PQ_query_param_bool(dc->suppressed), "auditor_denomination_pending_insert", "INSERT INTO auditor_denomination_pending " "( denom_pub_hash," -" denom_balance," -" denom_loss," -" num_issued," -" denom_risk," -" recoup_loss," -" suppressed" -") VALUES ($1,$2,$3,$4,$5,$6,$7);" + " denom_balance," + " denom_loss," + " num_issued," + " denom_risk," + " recoup_loss," + " suppressed" + ") VALUES ($1,$2,$3,$4,$5,$6,$7);" ); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "auditor_denomination_pending_insert", params); } - -
\ No newline at end of file diff --git a/src/auditordb/pg_insert_denominations_without_sigs.c b/src/auditordb/pg_insert_denominations_without_sigs.c index e22e4ffe9..30d2f0caf 100644 --- a/src/auditordb/pg_insert_denominations_without_sigs.c +++ b/src/auditordb/pg_insert_denominations_without_sigs.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -32,11 +29,11 @@ TAH_PG_insert_denominations_without_sigs ( struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type(&dc->denompub_h), -TALER_PQ_query_param_amount(pg->conn, &dc->value), -GNUNET_PQ_query_param_int64(&dc->start_time), -GNUNET_PQ_query_param_int64(&dc->end_time), -GNUNET_PQ_query_param_bool(dc->suppressed), + GNUNET_PQ_query_param_auto_from_type (&dc->denompub_h), + TALER_PQ_query_param_amount (pg->conn, &dc->value), + GNUNET_PQ_query_param_int64 (&dc->start_time), + GNUNET_PQ_query_param_int64 (&dc->end_time), + GNUNET_PQ_query_param_bool (dc->suppressed), GNUNET_PQ_query_param_end @@ -46,16 +43,14 @@ GNUNET_PQ_query_param_bool(dc->suppressed), "auditor_denominations_without_sigs_insert", "INSERT INTO auditor_denominations_without_sigs " "( row_id," -" denompub_h," -" value," -" start_time," -" end_time," -" suppressed" -") VALUES ($1,$2,$3,$4,$5,$6);" + " denompub_h," + " value," + " start_time," + " end_time," + " suppressed" + ") VALUES ($1,$2,$3,$4,$5,$6);" ); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "auditor_denominations_without_sigs_insert", params); } - -
\ No newline at end of file diff --git a/src/auditordb/pg_insert_exchange_signkeys.c b/src/auditordb/pg_insert_exchange_signkeys.c index 09ab0e941..14928e8ae 100644 --- a/src/auditordb/pg_insert_exchange_signkeys.c +++ b/src/auditordb/pg_insert_exchange_signkeys.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -32,12 +29,12 @@ TAH_PG_insert_exchange_signkeys ( struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type(&dc->exchange_pub), -GNUNET_PQ_query_param_auto_from_type(&dc->master_sig), -GNUNET_PQ_query_param_int64(&dc->ep_valid_from), -GNUNET_PQ_query_param_int64(&dc->ep_expire_sign), -GNUNET_PQ_query_param_int64(&dc->ep_expire_legal), -GNUNET_PQ_query_param_bool(dc->suppressed), + GNUNET_PQ_query_param_auto_from_type (&dc->exchange_pub), + GNUNET_PQ_query_param_auto_from_type (&dc->master_sig), + GNUNET_PQ_query_param_int64 (&dc->ep_valid_from), + GNUNET_PQ_query_param_int64 (&dc->ep_expire_sign), + GNUNET_PQ_query_param_int64 (&dc->ep_expire_legal), + GNUNET_PQ_query_param_bool (dc->suppressed), GNUNET_PQ_query_param_end @@ -47,16 +44,14 @@ GNUNET_PQ_query_param_bool(dc->suppressed), "auditor_exchange_signkeys_insert", "INSERT INTO auditor_exchange_signkeys " "( exchange_pub," -" master_sig," -" ep_valid_from," -" ep_expire_sign," -" ep_expire_legal," -" suppressed" -") VALUES ($1,$2,$3,$4,$5,$6);" + " master_sig," + " ep_valid_from," + " ep_expire_sign," + " ep_expire_legal," + " suppressed" + ") VALUES ($1,$2,$3,$4,$5,$6);" ); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "auditor_exchange_signkeys_insert", params); } - -
\ No newline at end of file diff --git a/src/auditordb/pg_insert_historic_denomination_revenue.c b/src/auditordb/pg_insert_historic_denomination_revenue.c index c7779c9b3..b46bde680 100644 --- a/src/auditordb/pg_insert_historic_denomination_revenue.c +++ b/src/auditordb/pg_insert_historic_denomination_revenue.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -32,11 +29,11 @@ TAH_PG_insert_historic_denomination_revenue ( struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type(&dc->denom_pub_hash), -GNUNET_PQ_query_param_int64(&dc->revenue_timestamp), -TALER_PQ_query_param_amount(pg->conn, &dc->revenue_balance), -TALER_PQ_query_param_amount(pg->conn, &dc->loss_balance), -GNUNET_PQ_query_param_bool(dc->suppressed), + GNUNET_PQ_query_param_auto_from_type (&dc->denom_pub_hash), + GNUNET_PQ_query_param_int64 (&dc->revenue_timestamp), + TALER_PQ_query_param_amount (pg->conn, &dc->revenue_balance), + TALER_PQ_query_param_amount (pg->conn, &dc->loss_balance), + GNUNET_PQ_query_param_bool (dc->suppressed), GNUNET_PQ_query_param_end @@ -46,15 +43,13 @@ GNUNET_PQ_query_param_bool(dc->suppressed), "auditor_historic_denomination_revenue_insert", "INSERT INTO auditor_historic_denomination_revenue " "( denom_pub_hash," -" revenue_timestamp," -" revenue_balance," -" loss_balance," -" suppressed" -") VALUES ($1,$2,$3,$4,$5);" + " revenue_timestamp," + " revenue_balance," + " loss_balance," + " suppressed" + ") VALUES ($1,$2,$3,$4,$5);" ); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "auditor_historic_denomination_revenue_insert", params); } - -
\ No newline at end of file diff --git a/src/auditordb/pg_insert_historic_reserve_summary.c b/src/auditordb/pg_insert_historic_reserve_summary.c index 420b6223c..7b70984c4 100644 --- a/src/auditordb/pg_insert_historic_reserve_summary.c +++ b/src/auditordb/pg_insert_historic_reserve_summary.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -32,10 +29,10 @@ TAH_PG_insert_historic_reserve_summary ( struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_int64(&dc->start_date), -GNUNET_PQ_query_param_int64(&dc->end_date), -TALER_PQ_query_param_amount(pg->conn, &dc->reserve_profits), -GNUNET_PQ_query_param_bool(dc->suppressed), + GNUNET_PQ_query_param_int64 (&dc->start_date), + GNUNET_PQ_query_param_int64 (&dc->end_date), + TALER_PQ_query_param_amount (pg->conn, &dc->reserve_profits), + GNUNET_PQ_query_param_bool (dc->suppressed), GNUNET_PQ_query_param_end @@ -45,14 +42,12 @@ GNUNET_PQ_query_param_bool(dc->suppressed), "auditor_historic_reserve_summary_insert", "INSERT INTO auditor_historic_reserve_summary " "( start_date," -" end_date," -" reserve_profits," -" suppressed" -") VALUES ($1,$2,$3,$4);" + " end_date," + " reserve_profits," + " suppressed" + ") VALUES ($1,$2,$3,$4);" ); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "auditor_historic_reserve_summary_insert", params); } - -
\ No newline at end of file diff --git a/src/auditordb/pg_insert_misattribution_in_inconsistency.c b/src/auditordb/pg_insert_misattribution_in_inconsistency.c index 45eb8c004..7d86a6ec1 100644 --- a/src/auditordb/pg_insert_misattribution_in_inconsistency.c +++ b/src/auditordb/pg_insert_misattribution_in_inconsistency.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -32,10 +29,10 @@ TAH_PG_insert_misattribution_in_inconsistency ( struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - TALER_PQ_query_param_amount(pg->conn, &dc->amount), -GNUNET_PQ_query_param_int64(&dc->bank_row), -GNUNET_PQ_query_param_auto_from_type(&dc->reserve_pub), -GNUNET_PQ_query_param_bool(dc->suppressed), + TALER_PQ_query_param_amount (pg->conn, &dc->amount), + GNUNET_PQ_query_param_int64 (&dc->bank_row), + GNUNET_PQ_query_param_auto_from_type (&dc->reserve_pub), + GNUNET_PQ_query_param_bool (dc->suppressed), GNUNET_PQ_query_param_end @@ -45,15 +42,13 @@ GNUNET_PQ_query_param_bool(dc->suppressed), "auditor_misattribution_in_inconsistency_insert", "INSERT INTO auditor_misattribution_in_inconsistency " "( row_id," -" amount," -" bank_row," -" reserve_pub," -" suppressed" -") VALUES ($1,$2,$3,$4,$5);" + " amount," + " bank_row," + " reserve_pub," + " suppressed" + ") VALUES ($1,$2,$3,$4,$5);" ); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "auditor_misattribution_in_inconsistency_insert", params); } - -
\ No newline at end of file diff --git a/src/auditordb/pg_insert_purses.c b/src/auditordb/pg_insert_purses.c index e32b33bd5..ab7f305d1 100644 --- a/src/auditordb/pg_insert_purses.c +++ b/src/auditordb/pg_insert_purses.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -32,12 +29,12 @@ TAH_PG_insert_purses ( struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_int64(&dc->auditor_purses_rowid), -GNUNET_PQ_query_param_auto_from_type(&dc->purse_pub), -TALER_PQ_query_param_amount(pg->conn, &dc->balance), -TALER_PQ_query_param_amount(pg->conn, &dc->target), -GNUNET_PQ_query_param_int64(&dc->expiration_date), -GNUNET_PQ_query_param_bool(dc->suppressed), + GNUNET_PQ_query_param_int64 (&dc->auditor_purses_rowid), + GNUNET_PQ_query_param_auto_from_type (&dc->purse_pub), + TALER_PQ_query_param_amount (pg->conn, &dc->balance), + TALER_PQ_query_param_amount (pg->conn, &dc->target), + GNUNET_PQ_query_param_int64 (&dc->expiration_date), + GNUNET_PQ_query_param_bool (dc->suppressed), GNUNET_PQ_query_param_end @@ -47,16 +44,14 @@ GNUNET_PQ_query_param_bool(dc->suppressed), "auditor_purses_insert", "INSERT INTO auditor_purses " "( auditor_purses_rowid," -" purse_pub," -" balance," -" target," -" expiration_date," -" suppressed" -") VALUES ($1,$2,$3,$4,$5,$6);" + " purse_pub," + " balance," + " target," + " expiration_date," + " suppressed" + ") VALUES ($1,$2,$3,$4,$5,$6);" ); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "auditor_purses_insert", params); } - -
\ No newline at end of file diff --git a/src/auditordb/pg_insert_reserve_in_inconsistency.c b/src/auditordb/pg_insert_reserve_in_inconsistency.c index 0b69f10e9..7090e20df 100644 --- a/src/auditordb/pg_insert_reserve_in_inconsistency.c +++ b/src/auditordb/pg_insert_reserve_in_inconsistency.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -32,13 +29,13 @@ TAH_PG_insert_reserve_in_inconsistency ( struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - TALER_PQ_query_param_amount(pg->conn, &dc->amount_exchange_expected), -TALER_PQ_query_param_amount(pg->conn, &dc->amount_wired), -GNUNET_PQ_query_param_auto_from_type(&dc->reserve_pub), -GNUNET_PQ_query_param_int64(&dc->timestamp), -GNUNET_PQ_query_param_auto_from_type(&dc->account), -GNUNET_PQ_query_param_auto_from_type(&dc->diagnostic), -GNUNET_PQ_query_param_bool(dc->suppressed), + TALER_PQ_query_param_amount (pg->conn, &dc->amount_exchange_expected), + TALER_PQ_query_param_amount (pg->conn, &dc->amount_wired), + GNUNET_PQ_query_param_auto_from_type (&dc->reserve_pub), + GNUNET_PQ_query_param_int64 (&dc->timestamp), + GNUNET_PQ_query_param_auto_from_type (&dc->account), + GNUNET_PQ_query_param_auto_from_type (&dc->diagnostic), + GNUNET_PQ_query_param_bool (dc->suppressed), GNUNET_PQ_query_param_end @@ -48,18 +45,16 @@ GNUNET_PQ_query_param_bool(dc->suppressed), "auditor_reserve_in_inconsistency_insert", "INSERT INTO auditor_reserve_in_inconsistency " "( row_id," -" amount_exchange_expected," -" amount_wired," -" reserve_pub," -" timestamp," -" account," -" diagnostic," -" suppressed" -") VALUES ($1,$2,$3,$4,$5,$6,$7,$8);" + " amount_exchange_expected," + " amount_wired," + " reserve_pub," + " timestamp," + " account," + " diagnostic," + " suppressed" + ") VALUES ($1,$2,$3,$4,$5,$6,$7,$8);" ); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "auditor_reserve_in_inconsistency_insert", params); } - -
\ No newline at end of file diff --git a/src/auditordb/pg_insert_reserve_not_closed_inconsistency.c b/src/auditordb/pg_insert_reserve_not_closed_inconsistency.c index 6f35e6f77..1a5302ce3 100644 --- a/src/auditordb/pg_insert_reserve_not_closed_inconsistency.c +++ b/src/auditordb/pg_insert_reserve_not_closed_inconsistency.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -32,11 +29,11 @@ TAH_PG_insert_reserve_not_closed_inconsistency ( struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type(&dc->reserve_pub), -TALER_PQ_query_param_amount(pg->conn, &dc->balance), -GNUNET_PQ_query_param_int64(&dc->expiration_time), -GNUNET_PQ_query_param_auto_from_type(&dc->diagnostic), -GNUNET_PQ_query_param_bool(dc->suppressed), + GNUNET_PQ_query_param_auto_from_type (&dc->reserve_pub), + TALER_PQ_query_param_amount (pg->conn, &dc->balance), + GNUNET_PQ_query_param_int64 (&dc->expiration_time), + GNUNET_PQ_query_param_auto_from_type (&dc->diagnostic), + GNUNET_PQ_query_param_bool (dc->suppressed), GNUNET_PQ_query_param_end @@ -46,16 +43,14 @@ GNUNET_PQ_query_param_bool(dc->suppressed), "auditor_reserve_not_closed_inconsistency_insert", "INSERT INTO auditor_reserve_not_closed_inconsistency " "( row_id," -" reserve_pub," -" balance," -" expiration_time," -" diagnostic," -" suppressed" -") VALUES ($1,$2,$3,$4,$5,$6);" + " reserve_pub," + " balance," + " expiration_time," + " diagnostic," + " suppressed" + ") VALUES ($1,$2,$3,$4,$5,$6);" ); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "auditor_reserve_not_closed_inconsistency_insert", params); } - -
\ No newline at end of file diff --git a/src/auditordb/pg_insert_reserves.c b/src/auditordb/pg_insert_reserves.c index 3bb73a73e..d7626310e 100644 --- a/src/auditordb/pg_insert_reserves.c +++ b/src/auditordb/pg_insert_reserves.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -32,18 +29,18 @@ TAH_PG_insert_reserves ( struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_int64(&dc->auditor_reserves_rowid), -GNUNET_PQ_query_param_auto_from_type(&dc->reserve_pub), -TALER_PQ_query_param_amount(pg->conn, &dc->reserve_balance), -TALER_PQ_query_param_amount(pg->conn, &dc->reserve_loss), -TALER_PQ_query_param_amount(pg->conn, &dc->withdraw_fee_balance), -TALER_PQ_query_param_amount(pg->conn, &dc->close_fee_balance), -TALER_PQ_query_param_amount(pg->conn, &dc->purse_fee_balance), -TALER_PQ_query_param_amount(pg->conn, &dc->open_fee_balance), -TALER_PQ_query_param_amount(pg->conn, &dc->history_fee_balance), -GNUNET_PQ_query_param_int64(&dc->expiration_date), -GNUNET_PQ_query_param_string(dc->origin_account), -GNUNET_PQ_query_param_bool(dc->suppressed), + GNUNET_PQ_query_param_int64 (&dc->auditor_reserves_rowid), + GNUNET_PQ_query_param_auto_from_type (&dc->reserve_pub), + TALER_PQ_query_param_amount (pg->conn, &dc->reserve_balance), + TALER_PQ_query_param_amount (pg->conn, &dc->reserve_loss), + TALER_PQ_query_param_amount (pg->conn, &dc->withdraw_fee_balance), + TALER_PQ_query_param_amount (pg->conn, &dc->close_fee_balance), + TALER_PQ_query_param_amount (pg->conn, &dc->purse_fee_balance), + TALER_PQ_query_param_amount (pg->conn, &dc->open_fee_balance), + TALER_PQ_query_param_amount (pg->conn, &dc->history_fee_balance), + GNUNET_PQ_query_param_int64 (&dc->expiration_date), + GNUNET_PQ_query_param_string (dc->origin_account), + GNUNET_PQ_query_param_bool (dc->suppressed), GNUNET_PQ_query_param_end @@ -53,22 +50,20 @@ GNUNET_PQ_query_param_bool(dc->suppressed), "auditor_reserves_insert", "INSERT INTO auditor_reserves " "( auditor_reserves_rowid," -" reserve_pub," -" reserve_balance," -" reserve_loss," -" withdraw_fee_balance," -" close_fee_balance," -" purse_fee_balance," -" open_fee_balance," -" history_fee_balance," -" expiration_date," -" origin_account," -" suppressed" -") VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12);" + " reserve_pub," + " reserve_balance," + " reserve_loss," + " withdraw_fee_balance," + " close_fee_balance," + " purse_fee_balance," + " open_fee_balance," + " history_fee_balance," + " expiration_date," + " origin_account," + " suppressed" + ") VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12);" ); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "auditor_reserves_insert", params); } - -
\ No newline at end of file diff --git a/src/auditordb/pg_insert_row_minor_inconsistencies.c b/src/auditordb/pg_insert_row_minor_inconsistencies.c index c60fdc3c5..2759d4c40 100644 --- a/src/auditordb/pg_insert_row_minor_inconsistencies.c +++ b/src/auditordb/pg_insert_row_minor_inconsistencies.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -32,9 +29,9 @@ TAH_PG_insert_row_minor_inconsistencies ( struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type(&dc->row_table), -GNUNET_PQ_query_param_auto_from_type(&dc->diagnostic), -GNUNET_PQ_query_param_bool(dc->suppressed), + GNUNET_PQ_query_param_auto_from_type (&dc->row_table), + GNUNET_PQ_query_param_auto_from_type (&dc->diagnostic), + GNUNET_PQ_query_param_bool (dc->suppressed), GNUNET_PQ_query_param_end @@ -44,14 +41,12 @@ GNUNET_PQ_query_param_bool(dc->suppressed), "auditor_row_minor_inconsistencies_insert", "INSERT INTO auditor_row_minor_inconsistencies " "( row_id," -" row_table," -" diagnostic," -" suppressed" -") VALUES ($1,$2,$3,$4);" + " row_table," + " diagnostic," + " suppressed" + ") VALUES ($1,$2,$3,$4);" ); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "auditor_row_minor_inconsistencies_insert", params); } - -
\ No newline at end of file diff --git a/src/auditordb/pg_insert_wire_format_inconsistency.c b/src/auditordb/pg_insert_wire_format_inconsistency.c index 210bcc5e8..fb031d8f3 100644 --- a/src/auditordb/pg_insert_wire_format_inconsistency.c +++ b/src/auditordb/pg_insert_wire_format_inconsistency.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -32,10 +29,10 @@ TAH_PG_insert_wire_format_inconsistency ( struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - TALER_PQ_query_param_amount(pg->conn, &dc->amount), -GNUNET_PQ_query_param_int64(&dc->wire_offset), -GNUNET_PQ_query_param_auto_from_type(&dc->diagnostic), -GNUNET_PQ_query_param_bool(dc->suppressed), + TALER_PQ_query_param_amount (pg->conn, &dc->amount), + GNUNET_PQ_query_param_int64 (&dc->wire_offset), + GNUNET_PQ_query_param_auto_from_type (&dc->diagnostic), + GNUNET_PQ_query_param_bool (dc->suppressed), GNUNET_PQ_query_param_end @@ -45,15 +42,13 @@ GNUNET_PQ_query_param_bool(dc->suppressed), "auditor_wire_format_inconsistency_insert", "INSERT INTO auditor_wire_format_inconsistency " "( row_id," -" amount," -" wire_offset," -" diagnostic," -" suppressed" -") VALUES ($1,$2,$3,$4,$5);" + " amount," + " wire_offset," + " diagnostic," + " suppressed" + ") VALUES ($1,$2,$3,$4,$5);" ); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "auditor_wire_format_inconsistency_insert", params); } - -
\ No newline at end of file diff --git a/src/auditordb/pg_insert_wire_out_inconsistency.c b/src/auditordb/pg_insert_wire_out_inconsistency.c index ea72a5fc1..aa1021110 100644 --- a/src/auditordb/pg_insert_wire_out_inconsistency.c +++ b/src/auditordb/pg_insert_wire_out_inconsistency.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -32,10 +29,10 @@ TAH_PG_insert_wire_out_inconsistency ( struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type(&dc->destination_account), -TALER_PQ_query_param_amount(pg->conn, &dc->expected), -TALER_PQ_query_param_amount(pg->conn, &dc->claimed), -GNUNET_PQ_query_param_bool(dc->suppressed), + GNUNET_PQ_query_param_auto_from_type (&dc->destination_account), + TALER_PQ_query_param_amount (pg->conn, &dc->expected), + TALER_PQ_query_param_amount (pg->conn, &dc->claimed), + GNUNET_PQ_query_param_bool (dc->suppressed), GNUNET_PQ_query_param_end @@ -45,15 +42,13 @@ GNUNET_PQ_query_param_bool(dc->suppressed), "auditor_wire_out_inconsistency_insert", "INSERT INTO auditor_wire_out_inconsistency " "( row_id," -" destination_account," -" expected," -" claimed," -" suppressed" -") VALUES ($1,$2,$3,$4,$5);" + " destination_account," + " expected," + " claimed," + " suppressed" + ") VALUES ($1,$2,$3,$4,$5);" ); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "auditor_wire_out_inconsistency_insert", params); } - -
\ No newline at end of file diff --git a/src/testing/taler-unified-setup.sh b/src/testing/taler-unified-setup.sh index d933cc819..a2fcc351e 100755 --- a/src/testing/taler-unified-setup.sh +++ b/src/testing/taler-unified-setup.sh @@ -715,6 +715,9 @@ STAGE="auditor" if [ "1" = "$START_AUDITOR" ] then echo -n "Starting auditor ..." + + export TALER_AUDITOR_TOKEN=$(taler-config -c "$CONF" -s AUDITOR -o TALER_AUDITOR_TOKEN) + AUDITOR_URL=$(taler-config -c "$CONF" -s AUDITOR -o BASE_URL) AUDITOR_PRIV_FILE=$(taler-config -f -c "$CONF" -s AUDITOR -o AUDITOR_PRIV_FILE) AUDITOR_PRIV_DIR=$(dirname "$AUDITOR_PRIV_FILE") |