diff options
author | Cedric Zwahlen <cedric.zwahlen@students.bfh.ch> | 2024-04-16 18:54:24 +0200 |
---|---|---|
committer | Cedric Zwahlen <cedric.zwahlen@students.bfh.ch> | 2024-04-19 20:47:34 +0200 |
commit | ba725b627efe5d5a6b4131898c7ee643fce85380 (patch) | |
tree | 01aad63c0e7a12f37e026fc64d1fc8f839fda5ce | |
parent | 962bcbc6a6bd10f3bbe80766278c36b02f53c7e4 (diff) | |
download | exchange-ba725b627efe5d5a6b4131898c7ee643fce85380.tar.gz exchange-ba725b627efe5d5a6b4131898c7ee643fce85380.tar.bz2 exchange-ba725b627efe5d5a6b4131898c7ee643fce85380.zip |
Fix various CRUD bugs
133 files changed, 2310 insertions, 3324 deletions
diff --git a/src/auditor/taler-auditor-httpd.c b/src/auditor/taler-auditor-httpd.c index 34c057228..3cec1a665 100644 --- a/src/auditor/taler-auditor-httpd.c +++ b/src/auditor/taler-auditor-httpd.c @@ -92,7 +92,8 @@ #include "taler-auditor-httpd_reserve-balance-insufficient-inconsistency-upd.h" #include "taler-auditor-httpd_coin-inconsistency-upd.h" #include "taler-auditor-httpd_progress-upd.h" -#include "taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-upd.h" +#include \ + "taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-upd.h" #include "taler-auditor-httpd_refreshes-hanging-upd.h" #include "taler-auditor-httpd_emergency-upd.h" #include "taler-auditor-httpd_closure-lags-upd.h" @@ -449,479 +450,481 @@ handle_mhd_request (void *cls, MHD_HTTP_OK }, { "/closure-lags", MHD_HTTP_METHOD_GET, - "application/json", - NULL, 0, - &TAH_CLOSURE_LAGS_handler_get, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_CLOSURE_LAGS_handler_get, + MHD_HTTP_OK }, { "/closure-lags", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_CLOSURE_LAGS_PUT_handler, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_CLOSURE_LAGS_PUT_handler, + MHD_HTTP_OK }, { "/closure-lags", MHD_HTTP_METHOD_DELETE, - "application/json", - NULL, 0, - &TAH_CLOSURE_LAGS_handler_delete, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_CLOSURE_LAGS_handler_delete, + MHD_HTTP_OK }, { "/closure-lags", MHD_HTTP_METHOD_PATCH, - "application/json", - NULL, 0, - &TAH_CLOSURE_LAGS_handler_update, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_CLOSURE_LAGS_handler_update, + MHD_HTTP_OK }, { "/emergency", MHD_HTTP_METHOD_GET, - "application/json", - NULL, 0, - &TAH_EMERGENCY_handler_get, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_EMERGENCY_handler_get, + MHD_HTTP_OK }, { "/emergency", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_EMERGENCY_PUT_handler, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_EMERGENCY_PUT_handler, + MHD_HTTP_OK }, { "/emergency", MHD_HTTP_METHOD_DELETE, - "application/json", - NULL, 0, - &TAH_EMERGENCY_handler_delete, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_EMERGENCY_handler_delete, + MHD_HTTP_OK }, { "/emergency", MHD_HTTP_METHOD_PATCH, - "application/json", - NULL, 0, - &TAH_EMERGENCY_handler_update, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_EMERGENCY_handler_update, + MHD_HTTP_OK }, { "/refreshes-hanging", MHD_HTTP_METHOD_GET, - "application/json", - NULL, 0, - &TAH_REFRESHES_HANGING_handler_get, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_REFRESHES_HANGING_handler_get, + MHD_HTTP_OK }, { "/refreshes-hanging", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_REFRESHES_HANGING_PUT_handler, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_REFRESHES_HANGING_PUT_handler, + MHD_HTTP_OK }, { "/refreshes-hanging", MHD_HTTP_METHOD_DELETE, - "application/json", - NULL, 0, - &TAH_REFRESHES_HANGING_handler_delete, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_REFRESHES_HANGING_handler_delete, + MHD_HTTP_OK }, { "/refreshes-hanging", MHD_HTTP_METHOD_PATCH, - "application/json", - NULL, 0, - &TAH_REFRESHES_HANGING_handler_update, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_REFRESHES_HANGING_handler_update, + MHD_HTTP_OK }, { "/denomination-key-validity-withdraw-inconsistency", MHD_HTTP_METHOD_GET, - "application/json", - NULL, 0, - &TAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_handler_get, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_handler_get, + MHD_HTTP_OK }, { "/denomination-key-validity-withdraw-inconsistency", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_PUT_handler, - MHD_HTTP_OK }, - { "/denomination-key-validity-withdraw-inconsistency", MHD_HTTP_METHOD_DELETE, - "application/json", - NULL, 0, - &TAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_handler_delete, - MHD_HTTP_OK }, - { "/denomination-key-validity-withdraw-inconsistency", MHD_HTTP_METHOD_PATCH, - "application/json", - NULL, 0, - &TAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_handler_update, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_PUT_handler, + MHD_HTTP_OK }, + { "/denomination-key-validity-withdraw-inconsistency", + MHD_HTTP_METHOD_DELETE, + "application/json", + NULL, 0, + &TAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_handler_delete, + MHD_HTTP_OK }, + { "/denomination-key-validity-withdraw-inconsistency", + MHD_HTTP_METHOD_PATCH, + "application/json", + NULL, 0, + &TAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_handler_update, + MHD_HTTP_OK }, { "/progress", MHD_HTTP_METHOD_GET, - "application/json", - NULL, 0, - &TAH_PROGRESS_handler_get, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_PROGRESS_handler_get, + MHD_HTTP_OK }, { "/progress", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_PROGRESS_PUT_handler, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_PROGRESS_PUT_handler, + MHD_HTTP_OK }, { "/progress", MHD_HTTP_METHOD_DELETE, - "application/json", - NULL, 0, - &TAH_PROGRESS_handler_delete, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_PROGRESS_handler_delete, + MHD_HTTP_OK }, { "/progress", MHD_HTTP_METHOD_PATCH, - "application/json", - NULL, 0, - &TAH_PROGRESS_handler_update, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_PROGRESS_handler_update, + MHD_HTTP_OK }, { "/reserve-balance-insufficient-inconsistency", MHD_HTTP_METHOD_GET, - "application/json", - NULL, 0, - &TAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_handler_get, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_handler_get, + MHD_HTTP_OK }, { "/reserve-balance-insufficient-inconsistency", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_handler_put, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_handler_put, + MHD_HTTP_OK }, { "/reserve-balance-insufficient-inconsistency", MHD_HTTP_METHOD_DELETE, - "application/json", - NULL, 0, - &TAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_handler_delete, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_handler_delete, + MHD_HTTP_OK }, { "/reserve-balance-insufficient-inconsistency", MHD_HTTP_METHOD_PATCH, - "application/json", - NULL, 0, - &TAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_handler_update, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_handler_update, + MHD_HTTP_OK }, { "/purse-not-closed-inconsistencies", MHD_HTTP_METHOD_GET, - "application/json", - NULL, 0, - &TAH_PURSE_NOT_CLOSED_INCONSISTENCIES_handler_get, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_PURSE_NOT_CLOSED_INCONSISTENCIES_handler_get, + MHD_HTTP_OK }, { "/purse-not-closed-inconsistencies", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_PURSE_NOT_CLOSED_INCONSISTENCIES_PUT_handler, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_PURSE_NOT_CLOSED_INCONSISTENCIES_PUT_handler, + MHD_HTTP_OK }, { "/purse-not-closed-inconsistencies", MHD_HTTP_METHOD_DELETE, - "application/json", - NULL, 0, - &TAH_PURSE_NOT_CLOSED_INCONSISTENCIES_handler_delete, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_PURSE_NOT_CLOSED_INCONSISTENCIES_handler_delete, + MHD_HTTP_OK }, { "/purse-not-closed-inconsistencies", MHD_HTTP_METHOD_PATCH, - "application/json", - NULL, 0, - &TAH_PURSE_NOT_CLOSED_INCONSISTENCIES_handler_update, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_PURSE_NOT_CLOSED_INCONSISTENCIES_handler_update, + MHD_HTTP_OK }, { "/emergency-by-count", MHD_HTTP_METHOD_GET, - "application/json", - NULL, 0, - &TAH_EMERGENCY_BY_COUNT_handler_get, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_EMERGENCY_BY_COUNT_handler_get, + MHD_HTTP_OK }, { "/emergency-by-count", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_EMERGENCY_BY_COUNT_PUT_handler, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_EMERGENCY_BY_COUNT_PUT_handler, + MHD_HTTP_OK }, { "/emergency-by-count", MHD_HTTP_METHOD_DELETE, - "application/json", - NULL, 0, - &TAH_EMERGENCY_BY_COUNT_handler_delete, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_EMERGENCY_BY_COUNT_handler_delete, + MHD_HTTP_OK }, { "/emergency-by-count", MHD_HTTP_METHOD_PATCH, - "application/json", - NULL, 0, - &TAH_EMERGENCY_BY_COUNT_handler_update, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_EMERGENCY_BY_COUNT_handler_update, + MHD_HTTP_OK }, { "/reserve-in-inconsistency", MHD_HTTP_METHOD_GET, - "application/json", - NULL, 0, - &TAH_RESERVE_IN_INCONSISTENCY_handler_get, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_RESERVE_IN_INCONSISTENCY_handler_get, + MHD_HTTP_OK }, { "/reserve-in-inconsistency", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_RESERVE_IN_INCONSISTENCY_handler_put, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_RESERVE_IN_INCONSISTENCY_handler_put, + MHD_HTTP_OK }, { "/reserve-in-inconsistency", MHD_HTTP_METHOD_DELETE, - "application/json", - NULL, 0, - &TAH_RESERVE_IN_INCONSISTENCY_handler_delete, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_RESERVE_IN_INCONSISTENCY_handler_delete, + MHD_HTTP_OK }, { "/reserve-in-inconsistency", MHD_HTTP_METHOD_PATCH, - "application/json", - NULL, 0, - &TAH_RESERVE_IN_INCONSISTENCY_handler_update, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_RESERVE_IN_INCONSISTENCY_handler_update, + MHD_HTTP_OK }, { "/reserve-not-closed-inconsistency", MHD_HTTP_METHOD_GET, - "application/json", - NULL, 0, - &TAH_RESERVE_NOT_CLOSED_INCONSISTENCY_handler_get, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_RESERVE_NOT_CLOSED_INCONSISTENCY_handler_get, + MHD_HTTP_OK }, { "/reserve-not-closed-inconsistency", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_RESERVE_NOT_CLOSED_INCONSISTENCY_handler_put, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_RESERVE_NOT_CLOSED_INCONSISTENCY_handler_put, + MHD_HTTP_OK }, { "/reserve-not-closed-inconsistency", MHD_HTTP_METHOD_DELETE, - "application/json", - NULL, 0, - &TAH_RESERVE_NOT_CLOSED_INCONSISTENCY_handler_delete, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_RESERVE_NOT_CLOSED_INCONSISTENCY_handler_delete, + MHD_HTTP_OK }, { "/reserve-not-closed-inconsistency", MHD_HTTP_METHOD_PATCH, - "application/json", - NULL, 0, - &TAH_RESERVE_NOT_CLOSED_INCONSISTENCY_handler_update, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_RESERVE_NOT_CLOSED_INCONSISTENCY_handler_update, + MHD_HTTP_OK }, { "/denominations-without-sigs", MHD_HTTP_METHOD_GET, - "application/json", - NULL, 0, - &TAH_DENOMINATIONS_WITHOUT_SIGS_handler_get, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_DENOMINATIONS_WITHOUT_SIGS_handler_get, + MHD_HTTP_OK }, { "/denominations-without-sigs", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_DENOMINATIONS_WITHOUT_SIGS_handler_put, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_DENOMINATIONS_WITHOUT_SIGS_handler_put, + MHD_HTTP_OK }, { "/denominations-without-sigs", MHD_HTTP_METHOD_DELETE, - "application/json", - NULL, 0, - &TAH_DENOMINATIONS_WITHOUT_SIGS_handler_delete, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_DENOMINATIONS_WITHOUT_SIGS_handler_delete, + MHD_HTTP_OK }, { "/denominations-without-sigs", MHD_HTTP_METHOD_PATCH, - "application/json", - NULL, 0, - &TAH_DENOMINATIONS_WITHOUT_SIGS_handler_update, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_DENOMINATIONS_WITHOUT_SIGS_handler_update, + MHD_HTTP_OK }, { "/misattribution-in-inconsistency", MHD_HTTP_METHOD_GET, - "application/json", - NULL, 0, - &TAH_MISATTRIBUTION_IN_INCONSISTENCY_handler_get, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_MISATTRIBUTION_IN_INCONSISTENCY_handler_get, + MHD_HTTP_OK }, { "/misattribution-in-inconsistency", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_MISATTRIBUTION_IN_INCONSISTENCY_handler_put, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_MISATTRIBUTION_IN_INCONSISTENCY_handler_put, + MHD_HTTP_OK }, { "/misattribution-in-inconsistency", MHD_HTTP_METHOD_DELETE, - "application/json", - NULL, 0, - &TAH_MISATTRIBUTION_IN_INCONSISTENCY_handler_delete, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_MISATTRIBUTION_IN_INCONSISTENCY_handler_delete, + MHD_HTTP_OK }, { "/misattribution-in-inconsistency", MHD_HTTP_METHOD_PATCH, - "application/json", - NULL, 0, - &TAH_MISATTRIBUTION_IN_INCONSISTENCY_handler_update, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_MISATTRIBUTION_IN_INCONSISTENCY_handler_update, + MHD_HTTP_OK }, { "/reserves", MHD_HTTP_METHOD_GET, - "application/json", - NULL, 0, - &TAH_RESERVES_handler_get, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_RESERVES_handler_get, + MHD_HTTP_OK }, { "/reserves", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_RESERVES_handler_put, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_RESERVES_handler_put, + MHD_HTTP_OK }, { "/reserves", MHD_HTTP_METHOD_DELETE, - "application/json", - NULL, 0, - &TAH_RESERVES_handler_delete, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_RESERVES_handler_delete, + MHD_HTTP_OK }, { "/reserves", MHD_HTTP_METHOD_PATCH, - "application/json", - NULL, 0, - &TAH_RESERVES_handler_update, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_RESERVES_handler_update, + MHD_HTTP_OK }, { "/purses", MHD_HTTP_METHOD_GET, - "application/json", - NULL, 0, - &TAH_PURSES_handler_get, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_PURSES_handler_get, + MHD_HTTP_OK }, { "/purses", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_PURSES_handler_put, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_PURSES_handler_put, + MHD_HTTP_OK }, { "/purses", MHD_HTTP_METHOD_DELETE, - "application/json", - NULL, 0, - &TAH_PURSES_handler_delete, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_PURSES_handler_delete, + MHD_HTTP_OK }, { "/purses", MHD_HTTP_METHOD_PATCH, - "application/json", - NULL, 0, - &TAH_PURSES_handler_update, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_PURSES_handler_update, + MHD_HTTP_OK }, { "/historic-denomination-revenue", MHD_HTTP_METHOD_GET, - "application/json", - NULL, 0, - &TAH_HISTORIC_DENOMINATION_REVENUE_handler_get, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_HISTORIC_DENOMINATION_REVENUE_handler_get, + MHD_HTTP_OK }, { "/historic-denomination-revenue", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_HISTORIC_DENOMINATION_REVENUE_handler_put, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_HISTORIC_DENOMINATION_REVENUE_handler_put, + MHD_HTTP_OK }, { "/historic-denomination-revenue", MHD_HTTP_METHOD_DELETE, - "application/json", - NULL, 0, - &TAH_HISTORIC_DENOMINATION_REVENUE_handler_delete, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_HISTORIC_DENOMINATION_REVENUE_handler_delete, + MHD_HTTP_OK }, { "/historic-denomination-revenue", MHD_HTTP_METHOD_PATCH, - "application/json", - NULL, 0, - &TAH_HISTORIC_DENOMINATION_REVENUE_handler_update, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_HISTORIC_DENOMINATION_REVENUE_handler_update, + MHD_HTTP_OK }, { "/denomination-pending", MHD_HTTP_METHOD_GET, - "application/json", - NULL, 0, - &TAH_DENOMINATION_PENDING_handler_get, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_DENOMINATION_PENDING_handler_get, + MHD_HTTP_OK }, { "/denomination-pending", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_DENOMINATION_PENDING_handler_put, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_DENOMINATION_PENDING_handler_put, + MHD_HTTP_OK }, { "/denomination-pending", MHD_HTTP_METHOD_DELETE, - "application/json", - NULL, 0, - &TAH_DENOMINATION_PENDING_handler_delete, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_DENOMINATION_PENDING_handler_delete, + MHD_HTTP_OK }, { "/denomination-pending", MHD_HTTP_METHOD_PATCH, - "application/json", - NULL, 0, - &TAH_DENOMINATION_PENDING_handler_update, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_DENOMINATION_PENDING_handler_update, + MHD_HTTP_OK }, { "/historic-reserve-summary", MHD_HTTP_METHOD_GET, - "application/json", - NULL, 0, - &TAH_HISTORIC_RESERVE_SUMMARY_handler_get, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_HISTORIC_RESERVE_SUMMARY_handler_get, + MHD_HTTP_OK }, { "/historic-reserve-summary", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_HISTORIC_RESERVE_SUMMARY_handler_put, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_HISTORIC_RESERVE_SUMMARY_handler_put, + MHD_HTTP_OK }, { "/historic-reserve-summary", MHD_HTTP_METHOD_DELETE, - "application/json", - NULL, 0, - &TAH_HISTORIC_RESERVE_SUMMARY_handler_delete, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_HISTORIC_RESERVE_SUMMARY_handler_delete, + MHD_HTTP_OK }, { "/historic-reserve-summary", MHD_HTTP_METHOD_PATCH, - "application/json", - NULL, 0, - &TAH_HISTORIC_RESERVE_SUMMARY_handler_update, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_HISTORIC_RESERVE_SUMMARY_handler_update, + MHD_HTTP_OK }, { "/exchange-signkeys", MHD_HTTP_METHOD_GET, - "application/json", - NULL, 0, - &TAH_EXCHANGE_SIGNKEYS_handler_get, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_EXCHANGE_SIGNKEYS_handler_get, + MHD_HTTP_OK }, { "/exchange-signkeys", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_EXCHANGE_SIGNKEYS_handler_put, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_EXCHANGE_SIGNKEYS_handler_put, + MHD_HTTP_OK }, { "/exchange-signkeys", MHD_HTTP_METHOD_DELETE, - "application/json", - NULL, 0, - &TAH_EXCHANGE_SIGNKEYS_handler_delete, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_EXCHANGE_SIGNKEYS_handler_delete, + MHD_HTTP_OK }, { "/exchange-signkeys", MHD_HTTP_METHOD_PATCH, - "application/json", - NULL, 0, - &TAH_EXCHANGE_SIGNKEYS_handler_update, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_EXCHANGE_SIGNKEYS_handler_update, + MHD_HTTP_OK }, { "/wire-format-inconsistency", MHD_HTTP_METHOD_GET, - "application/json", - NULL, 0, - &TAH_WIRE_FORMAT_INCONSISTENCY_handler_get, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_WIRE_FORMAT_INCONSISTENCY_handler_get, + MHD_HTTP_OK }, { "/wire-format-inconsistency", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_WIRE_FORMAT_INCONSISTENCY_handler_put, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_WIRE_FORMAT_INCONSISTENCY_handler_put, + MHD_HTTP_OK }, { "/wire-format-inconsistency", MHD_HTTP_METHOD_DELETE, - "application/json", - NULL, 0, - &TAH_WIRE_FORMAT_INCONSISTENCY_handler_delete, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_WIRE_FORMAT_INCONSISTENCY_handler_delete, + MHD_HTTP_OK }, { "/wire-format-inconsistency", MHD_HTTP_METHOD_PATCH, - "application/json", - NULL, 0, - &TAH_WIRE_FORMAT_INCONSISTENCY_handler_update, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_WIRE_FORMAT_INCONSISTENCY_handler_update, + MHD_HTTP_OK }, { "/wire-out-inconsistency", MHD_HTTP_METHOD_GET, - "application/json", - NULL, 0, - &TAH_WIRE_OUT_INCONSISTENCY_handler_get, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_WIRE_OUT_INCONSISTENCY_handler_get, + MHD_HTTP_OK }, { "/wire-out-inconsistency", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_WIRE_OUT_INCONSISTENCY_handler_put, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_WIRE_OUT_INCONSISTENCY_handler_put, + MHD_HTTP_OK }, { "/wire-out-inconsistency", MHD_HTTP_METHOD_DELETE, - "application/json", - NULL, 0, - &TAH_WIRE_OUT_INCONSISTENCY_handler_delete, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_WIRE_OUT_INCONSISTENCY_handler_delete, + MHD_HTTP_OK }, { "/wire-out-inconsistency", MHD_HTTP_METHOD_PATCH, - "application/json", - NULL, 0, - &TAH_WIRE_OUT_INCONSISTENCY_handler_update, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_WIRE_OUT_INCONSISTENCY_handler_update, + MHD_HTTP_OK }, { "/reserve-balance-summary-wrong-inconsistency", MHD_HTTP_METHOD_GET, - "application/json", - NULL, 0, - &TAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_handler_get, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_handler_get, + MHD_HTTP_OK }, { "/reserve-balance-summary-wrong-inconsistency", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_handler_put, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_handler_put, + MHD_HTTP_OK }, { "/reserve-balance-summary-wrong-inconsistency", MHD_HTTP_METHOD_DELETE, - "application/json", - NULL, 0, - &TAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_handler_delete, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_handler_delete, + MHD_HTTP_OK }, { "/reserve-balance-summary-wrong-inconsistency", MHD_HTTP_METHOD_PATCH, - "application/json", - NULL, 0, - &TAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_handler_update, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_handler_update, + MHD_HTTP_OK }, { "/row-minor-inconsistencies", MHD_HTTP_METHOD_GET, - "application/json", - NULL, 0, - &TAH_ROW_MINOR_INCONSISTENCIES_handler_get, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_ROW_MINOR_INCONSISTENCIES_handler_get, + MHD_HTTP_OK }, { "/row-minor-inconsistencies", MHD_HTTP_METHOD_PUT, - "application/json", - NULL, 0, - &TAH_ROW_MINOR_INCONSISTENCIES_handler_put, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_ROW_MINOR_INCONSISTENCIES_handler_put, + MHD_HTTP_OK }, { "/row-minor-inconsistencies", MHD_HTTP_METHOD_DELETE, - "application/json", - NULL, 0, - &TAH_ROW_MINOR_INCONSISTENCIES_handler_delete, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_ROW_MINOR_INCONSISTENCIES_handler_delete, + MHD_HTTP_OK }, { "/row-minor-inconsistencies", MHD_HTTP_METHOD_PATCH, - "application/json", - NULL, 0, - &TAH_ROW_MINOR_INCONSISTENCIES_handler_update, - MHD_HTTP_OK }, + "application/json", + NULL, 0, + &TAH_ROW_MINOR_INCONSISTENCIES_handler_update, + MHD_HTTP_OK }, { "/config", MHD_HTTP_METHOD_GET, "application/json", NULL, 0, @@ -981,8 +984,6 @@ handle_mhd_request (void *cls, } - printf ("args: %s, %s, %s\n", args[0], args[1], args[2]); - // max length url could be char argurl[strlen (url) + 2]; strcpy (argurl,"/"); @@ -990,8 +991,6 @@ handle_mhd_request (void *cls, if (args[0] != NULL) strcat (argurl,args[0]); - printf ("reconstructed link: %s\n", argurl); - if ( (0 == strcasecmp (argurl, rh->url)) && ( (NULL == rh->method) || diff --git a/src/auditor/taler-auditor-httpd_amount-arithmetic-inconsistency-del.c b/src/auditor/taler-auditor-httpd_amount-arithmetic-inconsistency-del.c index fa914daf7..9b9e5ab49 100644 --- a/src/auditor/taler-auditor-httpd_amount-arithmetic-inconsistency-del.c +++ b/src/auditor/taler-auditor-httpd_amount-arithmetic-inconsistency-del.c @@ -22,9 +22,8 @@ TAH_AMOUNT_ARITHMETIC_INCONSISTENCY_handler_delete (struct else return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_URI_MISSING_PATH_COMPONENT, + "uri is missing a trailing path component"); if (GNUNET_SYSERR == TAH_plugin->preflight (TAH_plugin->cls)) @@ -41,7 +40,7 @@ TAH_AMOUNT_ARITHMETIC_INCONSISTENCY_handler_delete (struct qs = TAH_plugin->delete_amount_arithmetic_inconsistency (TAH_plugin->cls, row_id); - if (0 > qs) + if (0 >= qs) { // goes in here if there was an error with the transaction GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -50,9 +49,8 @@ TAH_AMOUNT_ARITHMETIC_INCONSISTENCY_handler_delete (struct args[1]); return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, + "resource to be deleted could not be found"); } 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..5d82ac37a 100644 --- a/src/auditor/taler-auditor-httpd_amount-arithmetic-inconsistency-get.c +++ b/src/auditor/taler-auditor-httpd_amount-arithmetic-inconsistency-get.c @@ -87,61 +87,31 @@ TAH_AMOUNT_ARITHMETIC_INCONSISTENCY_handler_get (struct TAH_RequestHandler *rh, ja = json_array (); GNUNET_break (NULL != ja); - int64_t limit = -20; - uint64_t offset; - - TALER_MHD_parse_request_snumber (connection, - "limit", - &limit); - - if (limit < 0) - offset = INT64_MAX; - else - offset = 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; + int64_t limit = -20; + uint64_t offset; + + TALER_MHD_parse_request_snumber (connection, + "limit", + &limit); + + if (limit < 0) + offset = INT64_MAX; + else + offset = 0; + + TALER_MHD_parse_request_number (connection, + "offset", + &offset); + + 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; /* hard failure */ - } - if (GNUNET_NO == res) - { - json_decref (json_in); - return MHD_YES; /* failure */ - } + return_suppressed = true; } - qs = TAH_plugin->get_amount_arithmetic_inconsistency ( TAH_plugin->cls, limit, diff --git a/src/auditor/taler-auditor-httpd_bad-sig-losses-del.c b/src/auditor/taler-auditor-httpd_bad-sig-losses-del.c index aed37e311..57b2d3996 100644 --- a/src/auditor/taler-auditor-httpd_bad-sig-losses-del.c +++ b/src/auditor/taler-auditor-httpd_bad-sig-losses-del.c @@ -37,9 +37,8 @@ TAH_BAD_SIG_LOSSES_handler_delete (struct TAH_RequestHandler *rh, else return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_URI_MISSING_PATH_COMPONENT, + "uri is missing a trailing path component"); if (GNUNET_SYSERR == TAH_plugin->preflight (TAH_plugin->cls)) @@ -56,7 +55,7 @@ TAH_BAD_SIG_LOSSES_handler_delete (struct TAH_RequestHandler *rh, qs = TAH_plugin->delete_bad_sig_losses (TAH_plugin->cls, row_id); - if (0 == qs) + if (0 >= qs) { // goes in here if there was an error with the transaction GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -65,9 +64,8 @@ TAH_BAD_SIG_LOSSES_handler_delete (struct TAH_RequestHandler *rh, args[1]); return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, + "uri is missing a trailing path component"); } diff --git a/src/auditor/taler-auditor-httpd_bad-sig-losses-get.c b/src/auditor/taler-auditor-httpd_bad-sig-losses-get.c index 7b586346e..cd3c89297 100644 --- a/src/auditor/taler-auditor-httpd_bad-sig-losses-get.c +++ b/src/auditor/taler-auditor-httpd_bad-sig-losses-get.c @@ -49,7 +49,8 @@ add_bad_sig_losses (void *cls, GNUNET_JSON_pack_uint64 ("row_id", serial_id), GNUNET_JSON_pack_string ("operation", dc->operation), TALER_JSON_pack_amount ("loss", &dc->loss), - GNUNET_JSON_pack_data_auto ("operation_specific_pub", &dc->operation_specific_pub) + GNUNET_JSON_pack_data_auto ("operation_specific_pub", + &dc->operation_specific_pub) ); GNUNET_break (0 == json_array_append_new (list, @@ -114,40 +115,12 @@ TAH_BAD_SIG_LOSSES_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_bad_sig_losses ( diff --git a/src/auditor/taler-auditor-httpd_bad-sig-losses-upd.c b/src/auditor/taler-auditor-httpd_bad-sig-losses-upd.c index 09b37e766..b0e28f649 100644 --- a/src/auditor/taler-auditor-httpd_bad-sig-losses-upd.c +++ b/src/auditor/taler-auditor-httpd_bad-sig-losses-upd.c @@ -118,7 +118,7 @@ TAH_BAD_SIG_LOSSES_handler_update ( case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS: return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - TALER_EC_MERCHANT_GENERIC_ACCOUNT_UNKNOWN, + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, "no updates executed"); break; case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: diff --git a/src/auditor/taler-auditor-httpd_closure-lags-del.c b/src/auditor/taler-auditor-httpd_closure-lags-del.c index 456866f90..3c4544d08 100644 --- a/src/auditor/taler-auditor-httpd_closure-lags-del.c +++ b/src/auditor/taler-auditor-httpd_closure-lags-del.c @@ -38,8 +38,7 @@ TAH_CLOSURE_LAGS_handler_delete (struct TAH_RequestHandler *rh, else return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, + TALER_EC_AUDITOR_URI_MISSING_PATH_COMPONENT, "exchange signature invalid"); if (GNUNET_SYSERR == @@ -57,7 +56,7 @@ TAH_CLOSURE_LAGS_handler_delete (struct TAH_RequestHandler *rh, qs = TAH_plugin->delete_auditor_closure_lags (TAH_plugin->cls, row_id); - if (0 > qs) + if (0 >= qs) { // goes in here if there was an error with the transaction GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -66,9 +65,8 @@ TAH_CLOSURE_LAGS_handler_delete (struct TAH_RequestHandler *rh, args[1]); return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, + "the requested resource does not exist"); } diff --git a/src/auditor/taler-auditor-httpd_closure-lags-upd.c b/src/auditor/taler-auditor-httpd_closure-lags-upd.c index 2cf86ecd5..8b2240b50 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 @@ -121,7 +118,7 @@ TAH_CLOSURE_LAGS_handler_update ( case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS: return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - TALER_EC_MERCHANT_GENERIC_ACCOUNT_UNKNOWN, + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, "no updates executed"); break; case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: @@ -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-del.c b/src/auditor/taler-auditor-httpd_coin-inconsistency-del.c index 3f767a649..2d254c904 100644 --- a/src/auditor/taler-auditor-httpd_coin-inconsistency-del.c +++ b/src/auditor/taler-auditor-httpd_coin-inconsistency-del.c @@ -16,9 +16,16 @@ TAH_COIN_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *rh, MHD_RESULT res; enum GNUNET_DB_QueryStatus qs; - // TODO: check for null first - uint64_t row_id = atoi (args[1]); + uint64_t row_id; + + if (args[1] != NULL) + row_id = atoi (args[1]); + else + return TALER_MHD_reply_with_error (connection, + MHD_HTTP_BAD_REQUEST, + TALER_EC_AUDITOR_URI_MISSING_PATH_COMPONENT, + "uri is missing a trailing path component"); if (GNUNET_SYSERR == TAH_plugin->preflight (TAH_plugin->cls)) @@ -34,7 +41,7 @@ TAH_COIN_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *rh, // execute the transaction qs = TAH_plugin->delete_coin_inconsistency (TAH_plugin->cls,row_id); - if (0 > qs) + if (0 >= qs) { // goes in here if there was an error with the transaction GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -42,9 +49,8 @@ TAH_COIN_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *rh, args[1]); return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, + "the requested resource does not exist"); } diff --git a/src/auditor/taler-auditor-httpd_coin-inconsistency-upd.c b/src/auditor/taler-auditor-httpd_coin-inconsistency-upd.c index b8e9abbbc..b2cc33c57 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 @@ -121,7 +118,7 @@ TAH_COIN_INCONSISTENCY_handler_update ( case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS: return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - TALER_EC_MERCHANT_GENERIC_ACCOUNT_UNKNOWN, + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, "no updates executed"); break; case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: @@ -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-del.c b/src/auditor/taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-del.c index 5650a108e..20e8b8091 100644 --- a/src/auditor/taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-del.c +++ b/src/auditor/taler-auditor-httpd_denomination-key-validity-withdraw-inconsistency-del.c @@ -49,9 +49,8 @@ TAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_handler_delete (struct else return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_URI_MISSING_PATH_COMPONENT, + "uri is missing a trailing path component"); if (GNUNET_SYSERR == TAH_plugin->preflight (TAH_plugin->cls)) @@ -69,7 +68,7 @@ TAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_handler_delete (struct TAH_plugin->cls, row_id); - if (0 > qs) + if (0 >= qs) { // goes in here if there was an error with the transaction GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -78,9 +77,8 @@ TAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_handler_delete (struct args[1]); return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, + "the requested resource does not exist"); } 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..73378f574 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); @@ -121,7 +120,7 @@ TAH_DENOMINATION_KEY_VALIDITY_WITHDRAW_INCONSISTENCY_handler_update ( case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS: return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - TALER_EC_MERCHANT_GENERIC_ACCOUNT_UNKNOWN, + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, "no updates executed"); break; case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: @@ -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..bf2b31816 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; @@ -41,9 +38,8 @@ TAH_DENOMINATION_PENDING_handler_delete (struct TAH_RequestHandler *rh, else return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_URI_MISSING_PATH_COMPONENT, + "uri is missing a trailing path component"); if (GNUNET_SYSERR == TAH_plugin->preflight (TAH_plugin->cls)) @@ -58,9 +54,9 @@ 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) + if (0 >= qs) { // goes in here if there was an error with the transaction GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -69,9 +65,8 @@ TAH_DENOMINATION_PENDING_handler_delete (struct TAH_RequestHandler *rh, args[1]); return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, + "the requested resource does not exist"); } @@ -83,5 +78,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..2058c3644 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; @@ -123,40 +119,12 @@ TAH_DENOMINATION_PENDING_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_denomination_pending ( @@ -184,6 +152,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..f5c095a3a 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,12 @@ 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_end () @@ -161,5 +157,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..10727b0f5 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 @@ -121,7 +118,7 @@ TAH_DENOMINATION_PENDING_handler_update ( case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS: return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - TALER_EC_MERCHANT_GENERIC_ACCOUNT_UNKNOWN, + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, "no updates executed"); break; case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: @@ -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..c1f344cc2 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; @@ -41,9 +38,8 @@ TAH_DENOMINATIONS_WITHOUT_SIGS_handler_delete (struct TAH_RequestHandler *rh, else return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_URI_MISSING_PATH_COMPONENT, + "uri is missing a trailing path component"); if (GNUNET_SYSERR == TAH_plugin->preflight (TAH_plugin->cls)) @@ -58,9 +54,9 @@ 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) + if (0 >= qs) { // goes in here if there was an error with the transaction GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -69,9 +65,8 @@ TAH_DENOMINATIONS_WITHOUT_SIGS_handler_delete (struct TAH_RequestHandler *rh, args[1]); return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, + "the requested resource does not exist"); } @@ -83,5 +78,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 35ae885b8..40b758376 100644 --- a/src/auditor/taler-auditor-httpd_denominations-without-sigs-get.c +++ b/src/auditor/taler-auditor-httpd_denominations-without-sigs-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_denominations_without_sigs (void *cls, - uint64_t serial_id, - const struct - TALER_AUDITORDB_DenominationsWithoutSigs - *dc) + uint64_t serial_id, + const struct + TALER_AUDITORDB_DenominationsWithoutSigs + *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("denompub_h", &dc->denompub_h), -TALER_JSON_pack_amount("value", &dc->value), -GNUNET_JSON_pack_int64("start_time", dc->start_time), -GNUNET_JSON_pack_int64("end_time", dc->end_time), -GNUNET_JSON_pack_bool("suppressed", dc->suppressed) + GNUNET_JSON_pack_int64 ("row_id", serial_id), + GNUNET_JSON_pack_data_auto ("denompub_h", &dc->denompub_h), + TALER_JSON_pack_amount ("value", &dc->value), + GNUNET_JSON_pack_int64 ("start_time", dc->start_time), + GNUNET_JSON_pack_int64 ("end_time", dc->end_time), + GNUNET_JSON_pack_bool ("suppressed", dc->suppressed) ); @@ -79,12 +75,12 @@ GNUNET_JSON_pack_bool("suppressed", dc->suppressed) */ MHD_RESULT TAH_DENOMINATIONS_WITHOUT_SIGS_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; @@ -122,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 ( @@ -183,6 +151,3 @@ TAH_DENOMINATIONS_WITHOUT_SIGS_handler_get (struct TAH_RequestHandler *rh, GNUNET_JSON_pack_array_steal ("denominations-without-sigs", ja)); } - - -
\ No newline at end of file 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..33221f773 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,10 @@ 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_end () @@ -159,5 +155,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..dbda72dc4 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 @@ -121,7 +118,7 @@ TAH_DENOMINATIONS_WITHOUT_SIGS_handler_update ( case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS: return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - TALER_EC_MERCHANT_GENERIC_ACCOUNT_UNKNOWN, + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, "no updates executed"); break; case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: @@ -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-del.c b/src/auditor/taler-auditor-httpd_deposit-confirmation-del.c index 96996a7de..95beab956 100644 --- a/src/auditor/taler-auditor-httpd_deposit-confirmation-del.c +++ b/src/auditor/taler-auditor-httpd_deposit-confirmation-del.c @@ -36,9 +36,15 @@ TAH_DEPOSIT_CONFIRMATION_handler_delete (struct TAH_RequestHandler *rh, MHD_RESULT res; enum GNUNET_DB_QueryStatus qs; - uint64_t row_id = atoi (args[1]); + uint64_t row_id; - // printf ("args in handler: %s\n",args[1]); + if (args[1] != NULL) + row_id = atoi (args[1]); + else + return TALER_MHD_reply_with_error (connection, + MHD_HTTP_BAD_REQUEST, + TALER_EC_AUDITOR_URI_MISSING_PATH_COMPONENT, + "uri is missing a trailing path component"); if (GNUNET_SYSERR == TAH_plugin->preflight (TAH_plugin->cls)) @@ -54,7 +60,7 @@ TAH_DEPOSIT_CONFIRMATION_handler_delete (struct TAH_RequestHandler *rh, // execute the transaction qs = TAH_plugin->delete_deposit_confirmation (TAH_plugin->cls,row_id); - if (0 > qs) + if (0 >= qs) { // goes in here if there was an error with the transaction GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); diff --git a/src/auditor/taler-auditor-httpd_emergency-by-count-del.c b/src/auditor/taler-auditor-httpd_emergency-by-count-del.c index 3c100c6be..bbebf199f 100644 --- a/src/auditor/taler-auditor-httpd_emergency-by-count-del.c +++ b/src/auditor/taler-auditor-httpd_emergency-by-count-del.c @@ -38,9 +38,8 @@ TAH_EMERGENCY_BY_COUNT_handler_delete (struct TAH_RequestHandler *rh, else return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_URI_MISSING_PATH_COMPONENT, + "uri is missing a trailing path component"); if (GNUNET_SYSERR == TAH_plugin->preflight (TAH_plugin->cls)) @@ -57,7 +56,7 @@ TAH_EMERGENCY_BY_COUNT_handler_delete (struct TAH_RequestHandler *rh, qs = TAH_plugin->delete_emergency_by_count (TAH_plugin->cls, row_id); - if (0 > qs) + if (0 >= qs) { // goes in here if there was an error with the transaction GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -66,9 +65,8 @@ TAH_EMERGENCY_BY_COUNT_handler_delete (struct TAH_RequestHandler *rh, args[1]); return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, + "the requested resource does not exist"); } 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..d9231e168 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 @@ -121,7 +118,7 @@ TAH_EMERGENCY_BY_COUNT_handler_update ( case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS: return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - TALER_EC_MERCHANT_GENERIC_ACCOUNT_UNKNOWN, + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, "no updates executed"); break; case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: @@ -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-del.c b/src/auditor/taler-auditor-httpd_emergency-del.c index 8735b0d4e..95ced7a36 100644 --- a/src/auditor/taler-auditor-httpd_emergency-del.c +++ b/src/auditor/taler-auditor-httpd_emergency-del.c @@ -38,9 +38,8 @@ TAH_EMERGENCY_handler_delete (struct TAH_RequestHandler *rh, else return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_URI_MISSING_PATH_COMPONENT, + "uri is missing a trailing path component"); if (GNUNET_SYSERR == TAH_plugin->preflight (TAH_plugin->cls)) @@ -57,7 +56,7 @@ TAH_EMERGENCY_handler_delete (struct TAH_RequestHandler *rh, qs = TAH_plugin->delete_emergency (TAH_plugin->cls, row_id); - if (0 > qs) + if (0 >= qs) { // goes in here if there was an error with the transaction GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -66,9 +65,8 @@ TAH_EMERGENCY_handler_delete (struct TAH_RequestHandler *rh, args[1]); return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, + "the requested resource does not exist"); } diff --git a/src/auditor/taler-auditor-httpd_emergency-upd.c b/src/auditor/taler-auditor-httpd_emergency-upd.c index f53a7748d..ca0e1c205 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 @@ -121,7 +118,7 @@ TAH_EMERGENCY_handler_update ( case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS: return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - TALER_EC_MERCHANT_GENERIC_ACCOUNT_UNKNOWN, + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, "no updates executed"); break; case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: @@ -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..37eea793e 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; @@ -41,9 +38,8 @@ TAH_EXCHANGE_SIGNKEYS_handler_delete (struct TAH_RequestHandler *rh, else return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_URI_MISSING_PATH_COMPONENT, + "uri is missing a trailing path component"); if (GNUNET_SYSERR == TAH_plugin->preflight (TAH_plugin->cls)) @@ -58,9 +54,9 @@ 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) + if (0 >= qs) { // goes in here if there was an error with the transaction GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -69,9 +65,8 @@ TAH_EXCHANGE_SIGNKEYS_handler_delete (struct TAH_RequestHandler *rh, args[1]); return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, + "the requested resource does not exist"); } @@ -83,5 +78,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..06b606a31 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; @@ -122,40 +118,12 @@ TAH_EXCHANGE_SIGNKEYS_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_exchange_signkeys ( @@ -183,6 +151,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..e05a1b311 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,11 @@ 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_end () @@ -160,5 +156,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..fd59543db 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 @@ -121,7 +118,7 @@ TAH_EXCHANGE_SIGNKEYS_handler_update ( case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS: return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - TALER_EC_MERCHANT_GENERIC_ACCOUNT_UNKNOWN, + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, "no updates executed"); break; case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: @@ -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_fee-time-inconsistency-del.c b/src/auditor/taler-auditor-httpd_fee-time-inconsistency-del.c index 6dfb1b919..1f37a4217 100644 --- a/src/auditor/taler-auditor-httpd_fee-time-inconsistency-del.c +++ b/src/auditor/taler-auditor-httpd_fee-time-inconsistency-del.c @@ -38,9 +38,8 @@ TAH_FEE_TIME_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *rh, else return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_URI_MISSING_PATH_COMPONENT, + "uri is missing a trailing path component"); if (GNUNET_SYSERR == TAH_plugin->preflight (TAH_plugin->cls)) @@ -57,7 +56,7 @@ TAH_FEE_TIME_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *rh, qs = TAH_plugin->delete_fee_time_inconsistency (TAH_plugin->cls, row_id); - if (0 > qs) + if (0 >= qs) { // goes in here if there was an error with the transaction GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -66,9 +65,8 @@ TAH_FEE_TIME_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *rh, args[1]); return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, + "the requested resource does not exist"); } 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..c0ca7e5e6 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; @@ -41,9 +38,8 @@ TAH_HISTORIC_DENOMINATION_REVENUE_handler_delete (struct TAH_RequestHandler *rh, else return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_URI_MISSING_PATH_COMPONENT, + "uri is missing a trailing path component"); if (GNUNET_SYSERR == TAH_plugin->preflight (TAH_plugin->cls)) @@ -58,9 +54,9 @@ 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) + if (0 >= qs) { // goes in here if there was an error with the transaction GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -69,9 +65,8 @@ TAH_HISTORIC_DENOMINATION_REVENUE_handler_delete (struct TAH_RequestHandler *rh, args[1]); return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, + "the requested resource does not exist"); } @@ -83,5 +78,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..acb9535d4 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; @@ -121,40 +117,12 @@ TAH_HISTORIC_DENOMINATION_REVENUE_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_historic_denomination_revenue ( @@ -182,6 +150,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..53ff0ff24 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,11 @@ 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_end () @@ -159,5 +156,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..ec85c3efb 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 @@ -121,7 +118,7 @@ TAH_HISTORIC_DENOMINATION_REVENUE_handler_update ( case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS: return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - TALER_EC_MERCHANT_GENERIC_ACCOUNT_UNKNOWN, + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, "no updates executed"); break; case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: @@ -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..fe5f60a41 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; @@ -41,9 +38,8 @@ TAH_HISTORIC_RESERVE_SUMMARY_handler_delete (struct TAH_RequestHandler *rh, else return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_URI_MISSING_PATH_COMPONENT, + "uri is missing a trailing path component"); if (GNUNET_SYSERR == TAH_plugin->preflight (TAH_plugin->cls)) @@ -58,9 +54,9 @@ 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) + if (0 >= qs) { // goes in here if there was an error with the transaction GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -69,9 +65,8 @@ TAH_HISTORIC_RESERVE_SUMMARY_handler_delete (struct TAH_RequestHandler *rh, args[1]); return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, + "resource to be deleted could not be found"); } @@ -83,5 +78,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..e8eb65941 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,19 @@ */ 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_uint64 ("row_id", serial_id), + 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) ); @@ -77,12 +72,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; @@ -120,40 +115,12 @@ TAH_HISTORIC_RESERVE_SUMMARY_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_historic_reserve_summary ( @@ -181,6 +148,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..217032bac 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,11 +88,10 @@ 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_end () }; @@ -158,5 +154,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..f4d11baf3 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 @@ -121,7 +118,7 @@ TAH_HISTORIC_RESERVE_SUMMARY_handler_update ( case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS: return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - TALER_EC_MERCHANT_GENERIC_ACCOUNT_UNKNOWN, + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, "no updates executed"); break; case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: @@ -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..80cebbee3 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; @@ -41,9 +39,8 @@ TAH_MISATTRIBUTION_IN_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *r else return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_URI_MISSING_PATH_COMPONENT, + "uri is missing a trailing path component"); if (GNUNET_SYSERR == TAH_plugin->preflight (TAH_plugin->cls)) @@ -58,9 +55,9 @@ 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) + if (0 >= qs) { // goes in here if there was an error with the transaction GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -69,9 +66,8 @@ TAH_MISATTRIBUTION_IN_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *r args[1]); return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, + "the requested resource does not exist"); } @@ -83,5 +79,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..f10291bc7 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; @@ -121,40 +117,12 @@ TAH_MISATTRIBUTION_IN_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_misattribution_in_inconsistency ( @@ -182,6 +150,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..d2d4e286f 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,9 @@ 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_end () @@ -158,5 +154,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..fbb57e7f6 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); @@ -121,7 +119,7 @@ TAH_MISATTRIBUTION_IN_INCONSISTENCY_handler_update ( case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS: return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - TALER_EC_MERCHANT_GENERIC_ACCOUNT_UNKNOWN, + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, "no updates executed"); break; case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: @@ -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-del.c b/src/auditor/taler-auditor-httpd_progress-del.c index bd374d8f6..ce9fcfe20 100644 --- a/src/auditor/taler-auditor-httpd_progress-del.c +++ b/src/auditor/taler-auditor-httpd_progress-del.c @@ -38,9 +38,8 @@ TAH_PROGRESS_handler_delete (struct TAH_RequestHandler *rh, else return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_URI_MISSING_PATH_COMPONENT, + "uri is missing a trailing path component"); if (GNUNET_SYSERR == TAH_plugin->preflight (TAH_plugin->cls)) @@ -57,7 +56,7 @@ TAH_PROGRESS_handler_delete (struct TAH_RequestHandler *rh, qs = TAH_plugin->delete_progress (TAH_plugin->cls, row_id); - if (0 > qs) + if (0 >= qs) { // goes in here if there was an error with the transaction GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -66,9 +65,8 @@ TAH_PROGRESS_handler_delete (struct TAH_RequestHandler *rh, args[1]); return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, + "the requested resource does not exist"); } diff --git a/src/auditor/taler-auditor-httpd_progress-upd.c b/src/auditor/taler-auditor-httpd_progress-upd.c index 906644138..13c785c0b 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 @@ -121,7 +118,7 @@ TAH_PROGRESS_handler_update ( case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS: return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - TALER_EC_MERCHANT_GENERIC_ACCOUNT_UNKNOWN, + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, "no updates executed"); break; case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: @@ -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-del.c b/src/auditor/taler-auditor-httpd_purse-not-closed-inconsistencies-del.c index e03cd19fc..8675809bf 100644 --- a/src/auditor/taler-auditor-httpd_purse-not-closed-inconsistencies-del.c +++ b/src/auditor/taler-auditor-httpd_purse-not-closed-inconsistencies-del.c @@ -39,9 +39,8 @@ TAH_PURSE_NOT_CLOSED_INCONSISTENCIES_handler_delete (struct else return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_URI_MISSING_PATH_COMPONENT, + "uri is missing a trailing path component"); if (GNUNET_SYSERR == TAH_plugin->preflight (TAH_plugin->cls)) @@ -58,7 +57,7 @@ TAH_PURSE_NOT_CLOSED_INCONSISTENCIES_handler_delete (struct qs = TAH_plugin->delete_purse_not_closed_inconsistencies (TAH_plugin->cls, row_id); - if (0 > qs) + if (0 >= qs) { // goes in here if there was an error with the transaction GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -67,9 +66,8 @@ TAH_PURSE_NOT_CLOSED_INCONSISTENCIES_handler_delete (struct args[1]); return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, + "the requested resource does not exist"); } 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..4707b61bc 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); @@ -121,7 +119,7 @@ TAH_PURSE_NOT_CLOSED_INCONSISTENCIES_handler_update ( case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS: return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - TALER_EC_MERCHANT_GENERIC_ACCOUNT_UNKNOWN, + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, "no updates executed"); break; case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: @@ -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..60a34b804 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; @@ -41,9 +38,8 @@ TAH_PURSES_handler_delete (struct TAH_RequestHandler *rh, else return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_URI_MISSING_PATH_COMPONENT, + "uri is missing a trailing path component"); if (GNUNET_SYSERR == TAH_plugin->preflight (TAH_plugin->cls)) @@ -58,9 +54,9 @@ 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) + if (0 >= qs) { // goes in here if there was an error with the transaction GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -69,9 +65,8 @@ TAH_PURSES_handler_delete (struct TAH_RequestHandler *rh, args[1]); return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, + "the requested resource does not exist"); } @@ -83,5 +78,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..81b5e16a7 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; @@ -122,40 +118,12 @@ TAH_PURSES_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_purses ( @@ -183,6 +151,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..09ec045b6 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,11 @@ 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_end () @@ -160,5 +156,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..559c9742c 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 @@ -121,7 +118,7 @@ TAH_PURSES_handler_update ( case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS: return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - TALER_EC_MERCHANT_GENERIC_ACCOUNT_UNKNOWN, + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, "no updates executed"); break; case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: @@ -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-del.c b/src/auditor/taler-auditor-httpd_refreshes-hanging-del.c index c103ed271..b5b5c39c9 100644 --- a/src/auditor/taler-auditor-httpd_refreshes-hanging-del.c +++ b/src/auditor/taler-auditor-httpd_refreshes-hanging-del.c @@ -38,9 +38,8 @@ TAH_REFRESHES_HANGING_handler_delete (struct TAH_RequestHandler *rh, else return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_URI_MISSING_PATH_COMPONENT, + "uri is missing a trailing path component"); if (GNUNET_SYSERR == TAH_plugin->preflight (TAH_plugin->cls)) @@ -57,7 +56,7 @@ TAH_REFRESHES_HANGING_handler_delete (struct TAH_RequestHandler *rh, qs = TAH_plugin->delete_refreshes_hanging (TAH_plugin->cls, row_id); - if (0 > qs) + if (0 >= qs) { // goes in here if there was an error with the transaction GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -66,9 +65,8 @@ TAH_REFRESHES_HANGING_handler_delete (struct TAH_RequestHandler *rh, args[1]); return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, + "the requested resource does not exist"); } diff --git a/src/auditor/taler-auditor-httpd_refreshes-hanging-upd.c b/src/auditor/taler-auditor-httpd_refreshes-hanging-upd.c index bf7bd8ea1..682e670ba 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 @@ -121,7 +118,7 @@ TAH_REFRESHES_HANGING_handler_update ( case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS: return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - TALER_EC_MERCHANT_GENERIC_ACCOUNT_UNKNOWN, + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, "no updates executed"); break; case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: @@ -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-del.c b/src/auditor/taler-auditor-httpd_reserve-balance-insufficient-inconsistency-del.c index f9fcd5e11..28ae0268e 100644 --- a/src/auditor/taler-auditor-httpd_reserve-balance-insufficient-inconsistency-del.c +++ b/src/auditor/taler-auditor-httpd_reserve-balance-insufficient-inconsistency-del.c @@ -45,9 +45,8 @@ TAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_handler_delete (struct else return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_URI_MISSING_PATH_COMPONENT, + "uri is missing a trailing path component"); if (GNUNET_SYSERR == TAH_plugin->preflight (TAH_plugin->cls)) @@ -65,7 +64,7 @@ TAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_handler_delete (struct TAH_plugin->cls, row_id); - if (0 == qs) + if (0 >= qs) { // goes in here if there was an error with the transaction GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -74,9 +73,8 @@ TAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_handler_delete (struct args[1]); return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, + "the requested resource does not exist"); } 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..1cb997c5f 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 @@ -46,10 +46,6 @@ process_reserve_balance_insufficient_inconsistency (void *cls, obj = GNUNET_JSON_PACK ( - // TODO: fill in - - // GNUNET_JSON_pack_... ("", &dc->), - // TALER_JSON_pack_... ("", &dc->), GNUNET_JSON_pack_uint64 ("row_id", serial_id), GNUNET_JSON_pack_data_auto ("reserve_pub", &dc->reserve_pub), @@ -110,28 +106,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-put.c b/src/auditor/taler-auditor-httpd_reserve-balance-insufficient-inconsistency-put.c index 139753658..b5585f425 100644 --- a/src/auditor/taler-auditor-httpd_reserve-balance-insufficient-inconsistency-put.c +++ b/src/auditor/taler-auditor-httpd_reserve-balance-insufficient-inconsistency-put.c @@ -89,10 +89,6 @@ TAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_handler_put ( struct GNUNET_JSON_Specification spec[] = { - // TODO: fill in - - // GNUNET_JSON_spec_... ("", &dc.), - // TALER_JSON_spec_... ("", TAH_currency, &dc.), GNUNET_JSON_spec_fixed_auto ("reserve_pub", &dc.reserve_pub), GNUNET_JSON_spec_bool ("inconsistency_gain", &dc.inconsistency_gain), 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..a765cefa6 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); @@ -121,7 +119,7 @@ TAH_RESERVE_BALANCE_INSUFFICIENT_INCONSISTENCY_handler_update ( case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS: return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - TALER_EC_MERCHANT_GENERIC_ACCOUNT_UNKNOWN, + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, "no updates executed"); break; case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: @@ -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..d474c8759 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; @@ -41,9 +45,8 @@ TAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_handler_delete (struct TAH_Reque else return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_URI_MISSING_PATH_COMPONENT, + "uri is missing a trailing path component"); if (GNUNET_SYSERR == TAH_plugin->preflight (TAH_plugin->cls)) @@ -57,10 +60,11 @@ 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) + if (0 >= qs) { // goes in here if there was an error with the transaction GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -69,9 +73,8 @@ TAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_handler_delete (struct TAH_Reque args[1]); return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, + "the requested resource does not exist"); } @@ -83,5 +86,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..77c193d64 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; @@ -121,40 +124,12 @@ TAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_handler_get (struct TAH_RequestH &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_balance_summary_wrong_inconsistency ( @@ -182,6 +157,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..231daf569 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,10 @@ 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_end () @@ -158,5 +156,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..03f335259 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); @@ -121,7 +119,7 @@ TAH_RESERVE_BALANCE_SUMMARY_WRONG_INCONSISTENCY_handler_update ( case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS: return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - TALER_EC_MERCHANT_GENERIC_ACCOUNT_UNKNOWN, + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, "no updates executed"); break; case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: @@ -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..a00dc8f89 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; @@ -41,9 +38,8 @@ TAH_RESERVE_IN_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *rh, else return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_URI_MISSING_PATH_COMPONENT, + "uri is missing a trailing path component"); if (GNUNET_SYSERR == TAH_plugin->preflight (TAH_plugin->cls)) @@ -58,9 +54,9 @@ 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) + if (0 >= qs) { // goes in here if there was an error with the transaction GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -69,9 +65,8 @@ TAH_RESERVE_IN_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *rh, args[1]); return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, + "the requested resource does not exist"); } @@ -83,5 +78,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..2131ebc41 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; @@ -124,40 +121,12 @@ TAH_RESERVE_IN_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_in_inconsistency ( @@ -185,6 +154,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..2349f90b1 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,13 @@ 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), + 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_string ("account", (const char **) &dc.account), + GNUNET_JSON_spec_string ("diagnostic", (const char **) &dc.diagnostic), GNUNET_JSON_spec_end () @@ -162,5 +158,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..952219092 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 @@ -121,7 +118,7 @@ TAH_RESERVE_IN_INCONSISTENCY_handler_update ( case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS: return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - TALER_EC_MERCHANT_GENERIC_ACCOUNT_UNKNOWN, + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, "no updates executed"); break; case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: @@ -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..3f794f839 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; @@ -41,9 +39,8 @@ TAH_RESERVE_NOT_CLOSED_INCONSISTENCY_handler_delete (struct TAH_RequestHandler * else return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_URI_MISSING_PATH_COMPONENT, + "uri is missing a trailing path component"); if (GNUNET_SYSERR == TAH_plugin->preflight (TAH_plugin->cls)) @@ -58,9 +55,9 @@ 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) + if (0 >= qs) { // goes in here if there was an error with the transaction GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -69,9 +66,8 @@ TAH_RESERVE_NOT_CLOSED_INCONSISTENCY_handler_delete (struct TAH_RequestHandler * args[1]); return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, + "the requested resource does not exist"); } @@ -83,5 +79,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 e2c9a00a5..693f1323f 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 @@ -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_reserve_not_closed_inconsistency (void *cls, - uint64_t serial_id, - const struct - TALER_AUDITORDB_ReserveNotClosedInconsistency - *dc) + uint64_t serial_id, + const struct + TALER_AUDITORDB_ReserveNotClosedInconsistency + *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("balance", &dc->balance), -GNUNET_JSON_pack_int64("expiration_time", dc->expiration_time), -GNUNET_JSON_pack_data_auto("diagnostic", &dc->diagnostic), -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 ("balance", &dc->balance), + GNUNET_JSON_pack_int64 ("expiration_time", dc->expiration_time), + GNUNET_JSON_pack_data_auto ("diagnostic", &dc->diagnostic), + GNUNET_JSON_pack_bool ("suppressed", dc->suppressed) ); @@ -79,12 +75,12 @@ GNUNET_JSON_pack_bool("suppressed", dc->suppressed) */ MHD_RESULT TAH_RESERVE_NOT_CLOSED_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; @@ -122,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 ( @@ -183,6 +151,3 @@ TAH_RESERVE_NOT_CLOSED_INCONSISTENCY_handler_get (struct TAH_RequestHandler *rh, GNUNET_JSON_pack_array_steal ("reserve-not-closed-inconsistency", ja)); } - - -
\ No newline at end of file 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..d8250f60e 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,10 @@ 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_end () @@ -159,5 +155,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..6ea57f06b 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); @@ -121,7 +119,7 @@ TAH_RESERVE_NOT_CLOSED_INCONSISTENCY_handler_update ( case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS: return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - TALER_EC_MERCHANT_GENERIC_ACCOUNT_UNKNOWN, + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, "no updates executed"); break; case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: @@ -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..755366ddd 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; @@ -41,9 +38,8 @@ TAH_RESERVES_handler_delete (struct TAH_RequestHandler *rh, else return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_URI_MISSING_PATH_COMPONENT, + "uri is missing a trailing path component"); if (GNUNET_SYSERR == TAH_plugin->preflight (TAH_plugin->cls)) @@ -58,9 +54,9 @@ 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) + if (0 >= qs) { // goes in here if there was an error with the transaction GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -69,9 +65,8 @@ TAH_RESERVES_handler_delete (struct TAH_RequestHandler *rh, args[1]); return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, + "the requested resource does not exist"); } @@ -83,5 +78,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..a98f4c2e0 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; @@ -128,40 +125,12 @@ TAH_RESERVES_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_reserves ( @@ -189,6 +158,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..d1af00928 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,25 @@ 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_end () @@ -166,5 +170,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..583561b0b 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 @@ -121,7 +118,7 @@ TAH_RESERVES_handler_update ( case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS: return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - TALER_EC_MERCHANT_GENERIC_ACCOUNT_UNKNOWN, + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, "no updates executed"); break; case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: @@ -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-del.c b/src/auditor/taler-auditor-httpd_row-inconsistency-del.c index 04d32d775..513178032 100644 --- a/src/auditor/taler-auditor-httpd_row-inconsistency-del.c +++ b/src/auditor/taler-auditor-httpd_row-inconsistency-del.c @@ -35,7 +35,7 @@ TAH_ROW_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *rh, // execute the transaction qs = TAH_plugin->delete_row_inconsistency (TAH_plugin->cls,row_id); - if (0 > qs) + if (0 >= qs) { // goes in here if there was an error with the transaction GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -43,9 +43,8 @@ TAH_ROW_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *rh, args[1]); return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, + "the requested resource does not exist"); } diff --git a/src/auditor/taler-auditor-httpd_row-inconsistency-upd.c b/src/auditor/taler-auditor-httpd_row-inconsistency-upd.c index 2a4cda8f9..d06cd5fff 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 @@ -121,7 +118,7 @@ TAH_ROW_INCONSISTENCY_handler_update ( case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS: return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - TALER_EC_MERCHANT_GENERIC_ACCOUNT_UNKNOWN, + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, "no updates executed"); break; case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: @@ -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..16fbbc0dd 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; @@ -41,9 +38,8 @@ TAH_ROW_MINOR_INCONSISTENCIES_handler_delete (struct TAH_RequestHandler *rh, else return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_URI_MISSING_PATH_COMPONENT, + "uri is missing a trailing path component"); if (GNUNET_SYSERR == TAH_plugin->preflight (TAH_plugin->cls)) @@ -58,9 +54,9 @@ 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) + if (0 >= qs) { // goes in here if there was an error with the transaction GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -69,9 +65,8 @@ TAH_ROW_MINOR_INCONSISTENCIES_handler_delete (struct TAH_RequestHandler *rh, args[1]); return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, + "the requested resource does not exist"); } @@ -83,5 +78,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..9319735fd 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; @@ -120,40 +116,12 @@ TAH_ROW_MINOR_INCONSISTENCIES_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_row_minor_inconsistencies ( @@ -181,6 +149,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..a0eab0c69 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,8 @@ 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_end () @@ -157,5 +153,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..83fe4e923 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 @@ -121,7 +118,7 @@ TAH_ROW_MINOR_INCONSISTENCIES_handler_update ( case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS: return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - TALER_EC_MERCHANT_GENERIC_ACCOUNT_UNKNOWN, + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, "no updates executed"); break; case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: @@ -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..be3736525 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; @@ -41,9 +38,8 @@ TAH_WIRE_FORMAT_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *rh, else return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_URI_MISSING_PATH_COMPONENT, + "uri is missing a trailing path component"); if (GNUNET_SYSERR == TAH_plugin->preflight (TAH_plugin->cls)) @@ -58,9 +54,9 @@ 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) + if (0 >= qs) { // goes in here if there was an error with the transaction GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -69,9 +65,8 @@ TAH_WIRE_FORMAT_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *rh, args[1]); return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, + "the requested resource does not exist"); } @@ -83,5 +78,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..f6a4cdfae 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; @@ -121,40 +117,12 @@ TAH_WIRE_FORMAT_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_wire_format_inconsistency ( @@ -182,6 +150,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..8c5bf6a39 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,9 @@ 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_end () @@ -158,5 +154,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..4766adce3 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 @@ -121,7 +118,7 @@ TAH_WIRE_FORMAT_INCONSISTENCY_handler_update ( case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS: return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - TALER_EC_MERCHANT_GENERIC_ACCOUNT_UNKNOWN, + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, "no updates executed"); break; case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: @@ -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..48afaab76 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; @@ -41,9 +38,8 @@ TAH_WIRE_OUT_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *rh, else return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_URI_MISSING_PATH_COMPONENT, + "uri is missing a trailing path component"); if (GNUNET_SYSERR == TAH_plugin->preflight (TAH_plugin->cls)) @@ -58,9 +54,9 @@ 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) + if (0 >= qs) { // goes in here if there was an error with the transaction GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR == qs); @@ -69,9 +65,8 @@ TAH_WIRE_OUT_INCONSISTENCY_handler_delete (struct TAH_RequestHandler *rh, args[1]); return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - // TODO: not the correct ec - TALER_EC_AUDITOR_DEPOSIT_CONFIRMATION_SIGNATURE_INVALID, - "exchange signature invalid"); + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, + "the requested resource does not exist"); } @@ -83,5 +78,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-get.c b/src/auditor/taler-auditor-httpd_wire-out-inconsistency-get.c index 76a3bb631..31d4e5f84 100644 --- a/src/auditor/taler-auditor-httpd_wire-out-inconsistency-get.c +++ b/src/auditor/taler-auditor-httpd_wire-out-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> @@ -30,6 +26,7 @@ #include "taler-auditor-httpd.h" #include "taler-auditor-httpd_wire-out-inconsistency-get.h" + /** * Add wire-out-inconsistency to the list. * @@ -40,21 +37,21 @@ */ static enum GNUNET_GenericReturnValue process_wire_out_inconsistency (void *cls, - uint64_t serial_id, - const struct - TALER_AUDITORDB_WireOutInconsistency - *dc) + uint64_t serial_id, + const struct + TALER_AUDITORDB_WireOutInconsistency + *dc) { json_t *list = cls; json_t *obj; obj = GNUNET_JSON_PACK ( - GNUNET_JSON_pack_int64("row_id", serial_id), -GNUNET_JSON_pack_string("destination_account", dc->destination_account), -TALER_JSON_pack_amount("expected", &dc->expected), -TALER_JSON_pack_amount("claimed", &dc->claimed), -GNUNET_JSON_pack_bool("suppressed", dc->suppressed) + GNUNET_JSON_pack_int64 ("row_id", serial_id), + GNUNET_JSON_pack_string ("destination_account", dc->destination_account), + TALER_JSON_pack_amount ("expected", &dc->expected), + TALER_JSON_pack_amount ("claimed", &dc->claimed), + GNUNET_JSON_pack_bool ("suppressed", dc->suppressed) ); @@ -78,12 +75,12 @@ GNUNET_JSON_pack_bool("suppressed", dc->suppressed) */ MHD_RESULT TAH_WIRE_OUT_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; @@ -121,40 +118,12 @@ TAH_WIRE_OUT_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_wire_out_inconsistency ( @@ -182,6 +151,3 @@ TAH_WIRE_OUT_INCONSISTENCY_handler_get (struct TAH_RequestHandler *rh, GNUNET_JSON_pack_array_steal ("wire-out-inconsistency", ja)); } - - -
\ 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..2c0f9061d 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_string ("destination_account", (const + char **) &dc. + destination_account), + TALER_JSON_spec_amount ("expected", TAH_currency, &dc.expected), + TALER_JSON_spec_amount ("claimed", TAH_currency, &dc.claimed), 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..84a72ff0b 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 @@ -121,7 +118,7 @@ TAH_WIRE_OUT_INCONSISTENCY_handler_update ( case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS: return TALER_MHD_reply_with_error (connection, MHD_HTTP_NOT_FOUND, - TALER_EC_MERCHANT_GENERIC_ACCOUNT_UNKNOWN, + TALER_EC_AUDITOR_RESOURCE_NOT_FOUND, "no updates executed"); break; case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: @@ -135,5 +132,3 @@ TAH_WIRE_OUT_INCONSISTENCY_handler_update ( return ret; } - -
\ No newline at end of file diff --git a/src/auditordb/0002-auditor_denomination_pending.sql b/src/auditordb/0002-auditor_denomination_pending.sql index c52e8c0cf..6c1239d7b 100644 --- a/src/auditordb/0002-auditor_denomination_pending.sql +++ b/src/auditordb/0002-auditor_denomination_pending.sql @@ -15,7 +15,8 @@ -- CREATE TABLE auditor_denomination_pending - (denom_pub_hash BYTEA PRIMARY KEY CHECK (LENGTH(denom_pub_hash)=64) + (row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE, + denom_pub_hash BYTEA PRIMARY KEY CHECK (LENGTH(denom_pub_hash)=64) ,denom_balance taler_amount NOT NULL ,denom_loss taler_amount NOT NULL ,num_issued INT8 NOT NULL diff --git a/src/auditordb/0002-auditor_exchange_signkeys.sql b/src/auditordb/0002-auditor_exchange_signkeys.sql index 5fbd7d781..7a160a929 100644 --- a/src/auditordb/0002-auditor_exchange_signkeys.sql +++ b/src/auditordb/0002-auditor_exchange_signkeys.sql @@ -15,7 +15,8 @@ -- CREATE TABLE auditor_exchange_signkeys - (exchange_pub BYTEA PRIMARY KEY CHECK (LENGTH(exchange_pub)=32) + (row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE, + exchange_pub BYTEA PRIMARY KEY CHECK (LENGTH(exchange_pub)=32) ,master_sig BYTEA NOT NULL CHECK (LENGTH(master_sig)=64) ,ep_valid_from INT8 NOT NULL ,ep_expire_sign INT8 NOT NULL diff --git a/src/auditordb/0002-auditor_historic_denomination_revenue.sql b/src/auditordb/0002-auditor_historic_denomination_revenue.sql index f85c1bc1d..4c8a2cd92 100644 --- a/src/auditordb/0002-auditor_historic_denomination_revenue.sql +++ b/src/auditordb/0002-auditor_historic_denomination_revenue.sql @@ -15,7 +15,9 @@ -- CREATE TABLE auditor_historic_denomination_revenue - (denom_pub_hash BYTEA PRIMARY KEY CHECK (LENGTH(denom_pub_hash)=64) + ( + row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE , + denom_pub_hash BYTEA PRIMARY KEY CHECK (LENGTH(denom_pub_hash)=64) ,revenue_timestamp INT8 NOT NULL ,revenue_balance taler_amount NOT NULL ,loss_balance taler_amount NOT NULL, diff --git a/src/auditordb/0002-auditor_historic_reserve_summary.sql b/src/auditordb/0002-auditor_historic_reserve_summary.sql index a81abb832..35020a742 100644 --- a/src/auditordb/0002-auditor_historic_reserve_summary.sql +++ b/src/auditordb/0002-auditor_historic_reserve_summary.sql @@ -16,7 +16,8 @@ SET search_path TO auditor; CREATE TABLE IF NOT EXISTS auditor_historic_reserve_summary - (start_date INT8 PRIMARY KEY + (row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE, + start_date INT8 PRIMARY KEY ,end_date INT8 NOT NULL ,reserve_profits taler_amount NOT NULL, suppressed BOOLEAN NOT NULL DEFAULT FALSE diff --git a/src/auditordb/0002-auditor_reserve_in_inconsistency.sql b/src/auditordb/0002-auditor_reserve_in_inconsistency.sql index 1a9e1c7f2..8e1390ce8 100644 --- a/src/auditordb/0002-auditor_reserve_in_inconsistency.sql +++ b/src/auditordb/0002-auditor_reserve_in_inconsistency.sql @@ -22,8 +22,8 @@ CREATE TABLE IF NOT EXISTS auditor_reserve_in_inconsistency amount_wired taler_amount,
reserve_pub BYTEA,
timestamp BIGINT,
- account BYTEA,
- diagnostic BYTEA,
+ account TEXT,
+ diagnostic TEXT,
suppressed BOOLEAN NOT NULL DEFAULT FALSE
);
COMMENT ON TABLE auditor_reserve_in_inconsistency
diff --git a/src/auditordb/0002-auditor_wire_out_inconsistency.sql b/src/auditordb/0002-auditor_wire_out_inconsistency.sql index efd1b56d9..cc3d811d3 100644 --- a/src/auditordb/0002-auditor_wire_out_inconsistency.sql +++ b/src/auditordb/0002-auditor_wire_out_inconsistency.sql @@ -18,7 +18,7 @@ SET search_path TO auditor; CREATE TABLE IF NOT EXISTS auditor_wire_out_inconsistency
(
row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE PRIMARY KEY,
- destination_account BYTEA,
+ destination_account TEXT,
expected taler_amount,
claimed taler_amount,
suppressed BOOLEAN NOT NULL DEFAULT FALSE
diff --git a/src/auditordb/pg_get_amount_arithmetic_inconsistency.c b/src/auditordb/pg_get_amount_arithmetic_inconsistency.c index 312d9e233..4579a19ed 100644 --- a/src/auditordb/pg_get_amount_arithmetic_inconsistency.c +++ b/src/auditordb/pg_get_amount_arithmetic_inconsistency.c @@ -109,14 +109,16 @@ TAH_PG_get_amount_arithmetic_inconsistency ( void *cb_cls) { + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); + 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_uint64 (&plimit), + GNUNET_PQ_query_param_end + }; struct AmountArithmeticInconsistencyContext dcc = { .cb = cb, .cb_cls = cb_cls, @@ -138,22 +140,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..8cc48caa2 100644 --- a/src/auditordb/pg_get_auditor_closure_lags.c +++ b/src/auditordb/pg_get_auditor_closure_lags.c @@ -103,13 +103,15 @@ TAH_PG_get_auditor_closure_lags ( void *cb_cls) { + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); + 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_uint64 (&plimit), + GNUNET_PQ_query_param_end + }; struct ClosureLagsContext dcc = { .cb = cb, @@ -132,22 +134,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_bad_sig_losses.c b/src/auditordb/pg_get_bad_sig_losses.c index 7c2e8eae0..b2194c13c 100644 --- a/src/auditordb/pg_get_bad_sig_losses.c +++ b/src/auditordb/pg_get_bad_sig_losses.c @@ -104,12 +104,12 @@ TAH_PG_get_bad_sig_losses ( TALER_AUDITORDB_BadSigLossesCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); 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_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct BadSigLossesContext dcc = { diff --git a/src/auditordb/pg_get_coin_inconsistency.c b/src/auditordb/pg_get_coin_inconsistency.c index 0e6c45a18..866900b67 100644 --- a/src/auditordb/pg_get_coin_inconsistency.c +++ b/src/auditordb/pg_get_coin_inconsistency.c @@ -91,8 +91,6 @@ coin_inconsistency_cb (void *cls, dcc->qs = i + 1; - printf ("checkpoint pg_2\n"); - rval = dcc->cb (dcc->cb_cls, serial_id, &dc); @@ -112,15 +110,15 @@ TAH_PG_get_coin_inconsistency ( TALER_AUDITORDB_CoinInconsistencyCallback cb, void *cb_cls) { - printf ("checkpoint pg_0\n"); + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); 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_uint64 (&plimit), + GNUNET_PQ_query_param_end + }; struct CoinInconsistencyContext dcc = { .cb = cb, .cb_cls = cb_cls, @@ -128,7 +126,6 @@ TAH_PG_get_coin_inconsistency ( }; enum GNUNET_DB_QueryStatus qs; - printf ("checkpoint pg_1\n"); PREPARE (pg, "auditor_coin_inconsistency_select_desc", @@ -145,28 +142,30 @@ 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); - printf ("checkpoint pg_5\n"); if (qs > 0) return dcc.qs; 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..92bd38f2a 100644 --- a/src/auditordb/pg_get_denomination_key_validity_withdraw_inconsistency.c +++ b/src/auditordb/pg_get_denomination_key_validity_withdraw_inconsistency.c @@ -104,14 +104,14 @@ TAH_PG_get_denomination_key_validity_withdraw_inconsistency ( cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); 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_uint64 (&plimit), + 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..a4b01d78f 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 @@ -123,12 +121,12 @@ TAH_PG_get_denomination_pending ( TALER_AUDITORDB_DenominationPendingCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); 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_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct DenominationPendingContext dcc = { @@ -141,13 +139,14 @@ TAH_PG_get_denomination_pending ( PREPARE (pg, "auditor_denomination_pending_get_desc", "SELECT" + " row_id, " " 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)" @@ -157,13 +156,14 @@ TAH_PG_get_denomination_pending ( PREPARE (pg, "auditor_denomination_pending_get_asc", "SELECT" + " row_id, " " 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 +172,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 +185,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..8f38bec98 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 @@ -121,12 +118,12 @@ TAH_PG_get_denominations_without_sigs ( TALER_AUDITORDB_DenominationsWithoutSigsCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); 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_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct DenominationsWithoutSigsContext dcc = { @@ -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_emergency.c b/src/auditordb/pg_get_emergency.c index 33a8de1f0..7d12714c4 100644 --- a/src/auditordb/pg_get_emergency.c +++ b/src/auditordb/pg_get_emergency.c @@ -105,14 +105,14 @@ TAH_PG_get_emergency ( TALER_AUDITORDB_EmergencyCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); 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_uint64 (&plimit), + GNUNET_PQ_query_param_end + }; struct EmergencyContext dcc = { .cb = cb, .cb_cls = cb_cls, @@ -136,24 +136,26 @@ TAH_PG_get_emergency ( " ORDER BY row_id DESC" " LIMIT $3" ); - PREPARE (pg, - "auditor_emergency_get_asc", - "SELECT" - " row_id" - ",denompub_h" - ",denom_risk" - ",denom_loss" - ",deposit_start" - ",deposit_end" - ",value" - " FROM auditor_emergency" - " WHERE (row_id > $1)" - " AND ($2 OR suppressed is false)" - " ORDER BY row_id ASC" - " LIMIT $3" - ); + PREPARE (pg, + "auditor_emergency_get_asc", + "SELECT" + " row_id" + ",denompub_h" + ",denom_risk" + ",denom_loss" + ",deposit_start" + ",deposit_end" + ",value" + " FROM auditor_emergency" + " 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_emergency_get_asc" : "auditor_emergency_get_desc", + (limit > 0) ? + "auditor_emergency_get_asc" : + "auditor_emergency_get_desc", params, &emergency_cb, &dcc); diff --git a/src/auditordb/pg_get_emergency_by_count.c b/src/auditordb/pg_get_emergency_by_count.c index b056683c1..589ca31e0 100644 --- a/src/auditordb/pg_get_emergency_by_count.c +++ b/src/auditordb/pg_get_emergency_by_count.c @@ -108,14 +108,14 @@ TAH_PG_get_emergency_by_count ( TALER_AUDITORDB_EmergenciesByCountCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); 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_uint64 (&plimit), + GNUNET_PQ_query_param_end + }; struct EmergencyByCountContext dcc = { .cb = cb, .cb_cls = cb_cls, @@ -140,25 +140,27 @@ TAH_PG_get_emergency_by_count ( " ORDER BY row_id DESC" " LIMIT $3" ); - PREPARE (pg, - "auditor_emergency_by_count_get_asc", - "SELECT" - " row_id" - ",denompub_h" - ",num_issued" - ",num_known" - ",risk" - ",start" - ",deposit_end" - ",value" - " FROM auditor_emergency" - " WHERE (row_id > $1)" - " AND ($2 OR suppressed is false)" - " ORDER BY row_id ASC" - " LIMIT $3" - ); + PREPARE (pg, + "auditor_emergency_by_count_get_asc", + "SELECT" + " row_id" + ",denompub_h" + ",num_issued" + ",num_known" + ",risk" + ",start" + ",deposit_end" + ",value" + " FROM auditor_emergency" + " 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_emergency_by_count_get_asc" : "auditor_emergency_by_count_get_desc", + (limit > 0) ? + "auditor_emergency_by_count_get_asc" + : "auditor_emergency_by_count_get_desc", params, &emergency_by_count_cb, &dcc); diff --git a/src/auditordb/pg_get_exchange_signkeys.c b/src/auditordb/pg_get_exchange_signkeys.c index 0d0ee64dd..1edf45e5c 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 @@ -122,12 +119,12 @@ TAH_PG_get_exchange_signkeys ( TALER_AUDITORDB_ExchangeSignkeysCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); 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_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct ExchangeSignkeysContext dcc = { @@ -140,12 +137,13 @@ TAH_PG_get_exchange_signkeys ( PREPARE (pg, "auditor_exchange_signkeys_get_desc", "SELECT" + " row_id," " 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)" @@ -155,12 +153,13 @@ TAH_PG_get_exchange_signkeys ( PREPARE (pg, "auditor_exchange_signkeys_get_asc", "SELECT" + " row_id," " 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 +168,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 +181,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..535bdb422 100644 --- a/src/auditordb/pg_get_fee_time_inconsistency.c +++ b/src/auditordb/pg_get_fee_time_inconsistency.c @@ -105,14 +105,14 @@ TAH_PG_get_fee_time_inconsistency ( TALER_AUDITORDB_FeeTimeInconsistencyCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); 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_uint64 (&plimit), + 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..d09d66b4b 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 @@ -121,12 +119,12 @@ TAH_PG_get_historic_denomination_revenue ( TALER_AUDITORDB_HistoricDenominationRevenueCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); 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_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct HistoricDenominationRevenueContext dcc = { @@ -139,11 +137,12 @@ TAH_PG_get_historic_denomination_revenue ( PREPARE (pg, "auditor_historic_denomination_revenue_get_desc", "SELECT" + " row_id, " " 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)" @@ -153,11 +152,12 @@ TAH_PG_get_historic_denomination_revenue ( PREPARE (pg, "auditor_historic_denomination_revenue_get_asc", "SELECT" + " row_id, " " 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 +166,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 +179,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..a7e401607 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; @@ -78,11 +75,9 @@ historic_reserve_summary_cb (void *cls, struct GNUNET_PQ_ResultSpec rs[] = { 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_end @@ -120,12 +115,13 @@ TAH_PG_get_historic_reserve_summary ( TALER_AUDITORDB_HistoricReserveSummaryCallback cb, void *cb_cls) { + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); 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_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct HistoricReserveSummaryContext dcc = { @@ -138,10 +134,10 @@ TAH_PG_get_historic_reserve_summary ( PREPARE (pg, "auditor_historic_reserve_summary_get_desc", "SELECT" + " row_id," " start_date," -" end_date," -" reserve_profits," -" suppressed" + " end_date," + " reserve_profits" " FROM auditor_historic_reserve_summary" " WHERE (row_id < $1)" " AND ($2 OR suppressed is false)" @@ -151,10 +147,10 @@ TAH_PG_get_historic_reserve_summary ( PREPARE (pg, "auditor_historic_reserve_summary_get_asc", "SELECT" + " row_id," " start_date," -" end_date," -" reserve_profits," -" suppressed" + " end_date," + " reserve_profits" " FROM auditor_historic_reserve_summary" " WHERE (row_id > $1)" " AND ($2 OR suppressed is false)" @@ -163,8 +159,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 +172,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..f3edf9866 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 @@ -120,12 +117,12 @@ TAH_PG_get_misattribution_in_inconsistency ( TALER_AUDITORDB_MisattributionInInconsistencyCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); 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_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct MisattributionInInconsistencyContext dcc = { @@ -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..f1c5915c5 100644 --- a/src/auditordb/pg_get_purse_not_closed_inconsistencies.c +++ b/src/auditordb/pg_get_purse_not_closed_inconsistencies.c @@ -106,14 +106,14 @@ TAH_PG_get_purse_not_closed_inconsistencies ( TALER_AUDITORDB_PurseNotClosedInconsistenciesCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); 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_uint64 (&plimit), + 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..b93084a29 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 @@ -122,12 +120,12 @@ TAH_PG_get_purses ( TALER_AUDITORDB_PursesCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); 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_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct PursesContext dcc = { @@ -140,12 +138,13 @@ TAH_PG_get_purses ( PREPARE (pg, "auditor_purses_get_desc", "SELECT" + " row_id, " " 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)" @@ -155,12 +154,13 @@ TAH_PG_get_purses ( PREPARE (pg, "auditor_purses_get_asc", "SELECT" + " row_id, " " 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 +180,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..904df0a42 100644 --- a/src/auditordb/pg_get_refreshes_hanging.c +++ b/src/auditordb/pg_get_refreshes_hanging.c @@ -105,13 +105,15 @@ TAH_PG_get_refreshes_hanging ( void *cb_cls) { + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); + 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_uint64 (&plimit), + GNUNET_PQ_query_param_end + }; struct RefreshesHangingContext dcc = { .cb = cb, .cb_cls = cb_cls, @@ -131,20 +133,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..ddbe44c87 100644 --- a/src/auditordb/pg_get_reserve_balance_insufficient_inconsistency.c +++ b/src/auditordb/pg_get_reserve_balance_insufficient_inconsistency.c @@ -107,13 +107,15 @@ TAH_PG_get_reserve_balance_insufficient_inconsistency ( void *cb_cls) { + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); + 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_uint64 (&plimit), + GNUNET_PQ_query_param_end + }; struct ReserveBalanceInsufficientInconsistencyContext dcc = { .cb = cb, .cb_cls = cb_cls, @@ -134,21 +136,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..e55aae76b 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 @@ -120,12 +117,12 @@ TAH_PG_get_reserve_balance_summary_wrong_inconsistency ( TALER_AUDITORDB_ReserveBalanceSummaryWrongInconsistencyCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); 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_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct ReserveBalanceSummaryWrongInconsistencyContext dcc = { @@ -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..8763e4af0 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_string ("account", &dc.account), + GNUNET_PQ_result_spec_string ("diagnostic", &dc.diagnostic), + GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), GNUNET_PQ_result_spec_end @@ -123,12 +121,12 @@ TAH_PG_get_reserve_in_inconsistency ( TALER_AUDITORDB_ReserveInInconsistencyCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); 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_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct ReserveInInconsistencyContext dcc = { @@ -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..6e0c06c46 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 @@ -121,12 +118,12 @@ TAH_PG_get_reserve_not_closed_inconsistency ( TALER_AUDITORDB_ReserveNotClosedInconsistencyCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); 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_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct ReserveNotClosedInconsistencyContext dcc = { @@ -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..5859612ec 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 @@ -128,12 +128,12 @@ TAH_PG_get_reserves ( TALER_AUDITORDB_ReservesCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); 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_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct ReservesContext dcc = { @@ -146,18 +146,19 @@ TAH_PG_get_reserves ( PREPARE (pg, "auditor_reserves_get_desc", "SELECT" + " row_id, " " 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)" @@ -167,18 +168,19 @@ TAH_PG_get_reserves ( PREPARE (pg, "auditor_reserves_get_asc", "SELECT" + " row_id, " " 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 +200,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..ec9838d68 100644 --- a/src/auditordb/pg_get_row_inconsistency.c +++ b/src/auditordb/pg_get_row_inconsistency.c @@ -105,14 +105,14 @@ TAH_PG_get_row_inconsistency ( TALER_AUDITORDB_RowInconsistencyCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); 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_uint64 (&plimit), + 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..e282f7ea3 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 @@ -119,12 +116,12 @@ TAH_PG_get_row_minor_inconsistencies ( TALER_AUDITORDB_RowMinorInconsistenciesCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); 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_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct RowMinorInconsistenciesContext dcc = { @@ -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..42fcc064d 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 @@ -120,12 +117,12 @@ TAH_PG_get_wire_format_inconsistency ( TALER_AUDITORDB_WireFormatInconsistencyCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); 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_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct WireFormatInconsistencyContext dcc = { @@ -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..5f63d8e57 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_string ("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 @@ -120,12 +118,12 @@ TAH_PG_get_wire_out_inconsistency ( TALER_AUDITORDB_WireOutInconsistencyCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); 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_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct WireOutInconsistencyContext dcc = { @@ -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..673b94352 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,12 @@ 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_end @@ -48,17 +44,14 @@ 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" + ") VALUES ($1,$2,$3,$4,$5,$6);" ); 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..9d93a653d 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,10 @@ 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_end @@ -45,17 +41,13 @@ GNUNET_PQ_query_param_bool(dc->suppressed), PREPARE (pg, "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" + ") VALUES ($1,$2,$3,$4);" ); 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..356fdcd94 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,11 @@ 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_end @@ -47,16 +43,13 @@ 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" + ") VALUES ($1,$2,$3,$4,$5);" ); 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..83f34e0f2 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,10 @@ 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_end @@ -46,15 +42,12 @@ 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" + ") VALUES ($1,$2,$3,$4);" ); 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..1db619c04 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,9 @@ 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_end @@ -45,14 +41,11 @@ 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" + ") VALUES ($1,$2,$3);" ); 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..ed950a6c4 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,9 @@ 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_end @@ -44,16 +40,12 @@ GNUNET_PQ_query_param_bool(dc->suppressed), PREPARE (pg, "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" + ") VALUES ($1,$2,$3);" ); 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..3606ae5e3 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,10 @@ 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_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_end @@ -46,17 +41,13 @@ GNUNET_PQ_query_param_bool(dc->suppressed), PREPARE (pg, "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" + ") VALUES ($1,$2,$3,$4);" ); 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_balance_summary_wrong_inconsistency.c b/src/auditordb/pg_insert_reserve_balance_summary_wrong_inconsistency.c index 34419d062..a2bb9ba9c 100644 --- a/src/auditordb/pg_insert_reserve_balance_summary_wrong_inconsistency.c +++ b/src/auditordb/pg_insert_reserve_balance_summary_wrong_inconsistency.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -32,10 +29,9 @@ TAH_PG_insert_reserve_balance_summary_wrong_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->exchange_amount), -TALER_PQ_query_param_amount(pg->conn, &dc->auditor_amount), -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->exchange_amount), + TALER_PQ_query_param_amount (pg->conn, &dc->auditor_amount), GNUNET_PQ_query_param_end @@ -44,16 +40,12 @@ GNUNET_PQ_query_param_bool(dc->suppressed), PREPARE (pg, "auditor_reserve_balance_summary_wrong_inconsistency_insert", "INSERT INTO auditor_reserve_balance_summary_wrong_inconsistency " - "( row_id," -" reserve_pub," -" exchange_amount," -" auditor_amount," -" suppressed" -") VALUES ($1,$2,$3,$4,$5);" + "( reserve_pub," + " exchange_amount," + " auditor_amount" + ") VALUES ($1,$2,$3);" ); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "auditor_reserve_balance_summary_wrong_inconsistency_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..00716418e 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,12 @@ 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_string (dc->account), + GNUNET_PQ_query_param_string (dc->diagnostic), GNUNET_PQ_query_param_end @@ -47,19 +43,15 @@ GNUNET_PQ_query_param_bool(dc->suppressed), PREPARE (pg, "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" + ") VALUES ($1,$2,$3,$4,$5,$6);" ); 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..ff49957cf 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,10 @@ 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_end @@ -45,17 +41,13 @@ GNUNET_PQ_query_param_bool(dc->suppressed), PREPARE (pg, "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" + ") VALUES ($1,$2,$3,$4);" ); 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..f2cbea738 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,16 @@ 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_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_end @@ -52,23 +47,19 @@ GNUNET_PQ_query_param_bool(dc->suppressed), PREPARE (pg, "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" + ") VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10);" ); 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..452ae6762 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,8 @@ 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_end @@ -43,15 +39,11 @@ GNUNET_PQ_query_param_bool(dc->suppressed), PREPARE (pg, "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" + ") VALUES ($1,$2);" ); 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..a16e68b35 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,9 @@ 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_end @@ -44,16 +40,12 @@ GNUNET_PQ_query_param_bool(dc->suppressed), PREPARE (pg, "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" + ") VALUES ($1,$2,$3);" ); 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..828aa3293 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,9 @@ 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_string (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_end @@ -44,16 +40,12 @@ GNUNET_PQ_query_param_bool(dc->suppressed), PREPARE (pg, "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" + ") VALUES ($1,$2,$3);" ); 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/include/taler_auditordb_plugin.h b/src/include/taler_auditordb_plugin.h index fea1f85f4..31923db6b 100644 --- a/src/include/taler_auditordb_plugin.h +++ b/src/include/taler_auditordb_plugin.h @@ -225,7 +225,7 @@ struct TALER_AUDITORDB_AmountArithmeticInconsistency struct TALER_AUDITORDB_CoinInconsistency { unsigned int row_id; - char* operation; // TODO: change to string + char*operation; // TODO: change to string struct TALER_Amount exchange_amount; struct TALER_Amount auditor_amount; struct TALER_CoinSpendPublicKeyP coin_pub; @@ -361,14 +361,14 @@ struct TALER_AUDITORDB_ReserveBalanceInsufficientInconsistency struct TALER_AUDITORDB_ReserveInInconsistency { - unsigned int row_id; - struct TALER_Amount amount_exchange_expected; - struct TALER_Amount amount_wired; - struct TALER_ReservePublicKeyP reserve_pub; - int64_t timestamp; - char * account; - char * diagnostic; - bool suppressed; + unsigned int row_id; + struct TALER_Amount amount_exchange_expected; + struct TALER_Amount amount_wired; + struct TALER_ReservePublicKeyP reserve_pub; + int64_t timestamp; + char *account; + char *diagnostic; + bool suppressed; }; @@ -648,148 +648,147 @@ struct TALER_AUDITORDB_DenominationCirculationData struct TALER_AUDITORDB_DenominationsWithoutSigs { - unsigned int row_id; - struct TALER_DenominationHashP denompub_h; - struct TALER_Amount value; - int64_t start_time; - int64_t end_time; - bool suppressed; + unsigned int row_id; + struct TALER_DenominationHashP denompub_h; + struct TALER_Amount value; + int64_t start_time; + int64_t end_time; + bool suppressed; }; struct TALER_AUDITORDB_MisattributionInInconsistency { - unsigned int row_id; - struct TALER_Amount amount; - int64_t bank_row; - struct TALER_ReservePublicKeyP reserve_pub; - bool suppressed; + unsigned int row_id; + struct TALER_Amount amount; + int64_t bank_row; + struct TALER_ReservePublicKeyP reserve_pub; + bool suppressed; }; struct TALER_AUDITORDB_Reserves { - unsigned int row_id; - int64_t auditor_reserves_rowid; - struct TALER_ReservePublicKeyP reserve_pub; - struct TALER_Amount reserve_balance; - struct TALER_Amount reserve_loss; - struct TALER_Amount withdraw_fee_balance; - struct TALER_Amount close_fee_balance; - struct TALER_Amount purse_fee_balance; - struct TALER_Amount open_fee_balance; - struct TALER_Amount history_fee_balance; - int64_t expiration_date; - char * origin_account; - bool suppressed; + unsigned int row_id; + int64_t auditor_reserves_rowid; + struct TALER_ReservePublicKeyP reserve_pub; + struct TALER_Amount reserve_balance; + struct TALER_Amount reserve_loss; + struct TALER_Amount withdraw_fee_balance; + struct TALER_Amount close_fee_balance; + struct TALER_Amount purse_fee_balance; + struct TALER_Amount open_fee_balance; + struct TALER_Amount history_fee_balance; + int64_t expiration_date; + char *origin_account; + bool suppressed; }; struct TALER_AUDITORDB_Purses { - unsigned int row_id; - int64_t auditor_purses_rowid; - struct TALER_PurseContractPublicKeyP purse_pub; - struct TALER_Amount balance; - struct TALER_Amount target; - int64_t expiration_date; - bool suppressed; + unsigned int row_id; + int64_t auditor_purses_rowid; + struct TALER_PurseContractPublicKeyP purse_pub; + struct TALER_Amount balance; + struct TALER_Amount target; + int64_t expiration_date; + bool suppressed; }; struct TALER_AUDITORDB_HistoricDenominationRevenue { - unsigned int row_id; - struct TALER_DenominationHashP denom_pub_hash; - int64_t revenue_timestamp; - struct TALER_Amount revenue_balance; - struct TALER_Amount loss_balance; - bool suppressed; + unsigned int row_id; + struct TALER_DenominationHashP denom_pub_hash; + int64_t revenue_timestamp; + struct TALER_Amount revenue_balance; + struct TALER_Amount loss_balance; + bool suppressed; }; struct TALER_AUDITORDB_DenominationPending { - unsigned int row_id; - struct TALER_DenominationHashP denom_pub_hash; - struct TALER_Amount denom_balance; - struct TALER_Amount denom_loss; - int64_t num_issued; - struct TALER_Amount denom_risk; - struct TALER_Amount recoup_loss; - bool suppressed; + unsigned int row_id; + struct TALER_DenominationHashP denom_pub_hash; + struct TALER_Amount denom_balance; + struct TALER_Amount denom_loss; + int64_t num_issued; + struct TALER_Amount denom_risk; + struct TALER_Amount recoup_loss; + bool suppressed; }; struct TALER_AUDITORDB_HistoricReserveSummary { - unsigned int row_id; - int64_t start_date; - int64_t end_date; - struct TALER_Amount reserve_profits; - bool suppressed; + unsigned int row_id; + int64_t start_date; + int64_t end_date; + struct TALER_Amount reserve_profits; }; struct TALER_AUDITORDB_ExchangeSignkeys { - unsigned int row_id; - struct TALER_ExchangePublicKeyP exchange_pub; - struct TALER_MasterSignatureP master_sig; - int64_t ep_valid_from; - int64_t ep_expire_sign; - int64_t ep_expire_legal; - bool suppressed; + unsigned int row_id; + struct TALER_ExchangePublicKeyP exchange_pub; + struct TALER_MasterSignatureP master_sig; + int64_t ep_valid_from; + int64_t ep_expire_sign; + int64_t ep_expire_legal; + bool suppressed; }; struct TALER_AUDITORDB_WireFormatInconsistency { - unsigned int row_id; - struct TALER_Amount amount; - int64_t wire_offset; - char * diagnostic; - bool suppressed; + unsigned int row_id; + struct TALER_Amount amount; + int64_t wire_offset; + char *diagnostic; + bool suppressed; }; struct TALER_AUDITORDB_WireOutInconsistency { - unsigned int row_id; - char * destination_account; - struct TALER_Amount expected; - struct TALER_Amount claimed; - bool suppressed; + unsigned int row_id; + char *destination_account; + struct TALER_Amount expected; + struct TALER_Amount claimed; + bool suppressed; }; struct TALER_AUDITORDB_RowMinorInconsistencies { - unsigned int row_id; - char * row_table; - char * diagnostic; - bool suppressed; + unsigned int row_id; + char *row_table; + char *diagnostic; + bool suppressed; }; struct TALER_AUDITORDB_ReserveBalanceSummaryWrongInconsistency { - unsigned int row_id; - struct TALER_ReservePublicKeyP reserve_pub; - struct TALER_Amount exchange_amount; - struct TALER_Amount auditor_amount; - bool suppressed; + unsigned int row_id; + struct TALER_ReservePublicKeyP reserve_pub; + struct TALER_Amount exchange_amount; + struct TALER_Amount auditor_amount; + bool suppressed; }; struct TALER_AUDITORDB_ReserveNotClosedInconsistency { - unsigned int row_id; - struct TALER_ReservePublicKeyP reserve_pub; - struct TALER_Amount balance; - int64_t expiration_time; - char * diagnostic; - bool suppressed; + unsigned int row_id; + struct TALER_ReservePublicKeyP reserve_pub; + struct TALER_Amount balance; + int64_t expiration_time; + char *diagnostic; + bool suppressed; }; @@ -847,89 +846,89 @@ typedef enum GNUNET_GenericReturnValue typedef enum GNUNET_GenericReturnValue (*TALER_AUDITORDB_ReserveInInconsistencyCallback)( - void *cls, - uint64_t serial_id, - const struct TALER_AUDITORDB_ReserveInInconsistency *dc); + void *cls, + uint64_t serial_id, + const struct TALER_AUDITORDB_ReserveInInconsistency *dc); typedef enum GNUNET_GenericReturnValue (*TALER_AUDITORDB_ReserveNotClosedInconsistencyCallback)( - void *cls, - uint64_t serial_id, - const struct TALER_AUDITORDB_ReserveNotClosedInconsistency *dc); + void *cls, + uint64_t serial_id, + const struct TALER_AUDITORDB_ReserveNotClosedInconsistency *dc); typedef enum GNUNET_GenericReturnValue (*TALER_AUDITORDB_DenominationsWithoutSigsCallback)( - void *cls, - uint64_t serial_id, - const struct TALER_AUDITORDB_DenominationsWithoutSigs *dc); + void *cls, + uint64_t serial_id, + const struct TALER_AUDITORDB_DenominationsWithoutSigs *dc); typedef enum GNUNET_GenericReturnValue (*TALER_AUDITORDB_MisattributionInInconsistencyCallback)( - void *cls, - uint64_t serial_id, - const struct TALER_AUDITORDB_MisattributionInInconsistency *dc); + void *cls, + uint64_t serial_id, + const struct TALER_AUDITORDB_MisattributionInInconsistency *dc); typedef enum GNUNET_GenericReturnValue (*TALER_AUDITORDB_ReservesCallback)( - void *cls, - uint64_t serial_id, - const struct TALER_AUDITORDB_Reserves *dc); + void *cls, + uint64_t serial_id, + const struct TALER_AUDITORDB_Reserves *dc); typedef enum GNUNET_GenericReturnValue (*TALER_AUDITORDB_PursesCallback)( - void *cls, - uint64_t serial_id, - const struct TALER_AUDITORDB_Purses *dc); + void *cls, + uint64_t serial_id, + const struct TALER_AUDITORDB_Purses *dc); typedef enum GNUNET_GenericReturnValue (*TALER_AUDITORDB_HistoricDenominationRevenueCallback)( - void *cls, - uint64_t serial_id, - const struct TALER_AUDITORDB_HistoricDenominationRevenue *dc); + void *cls, + uint64_t serial_id, + const struct TALER_AUDITORDB_HistoricDenominationRevenue *dc); typedef enum GNUNET_GenericReturnValue (*TALER_AUDITORDB_DenominationPendingCallback)( - void *cls, - uint64_t serial_id, - const struct TALER_AUDITORDB_DenominationPending *dc); + void *cls, + uint64_t serial_id, + const struct TALER_AUDITORDB_DenominationPending *dc); typedef enum GNUNET_GenericReturnValue (*TALER_AUDITORDB_HistoricReserveSummaryCallback)( - void *cls, - uint64_t serial_id, - const struct TALER_AUDITORDB_HistoricReserveSummary *dc); + void *cls, + uint64_t serial_id, + const struct TALER_AUDITORDB_HistoricReserveSummary *dc); typedef enum GNUNET_GenericReturnValue (*TALER_AUDITORDB_ExchangeSignkeysCallback)( - void *cls, - uint64_t serial_id, - const struct TALER_AUDITORDB_ExchangeSignkeys *dc); + void *cls, + uint64_t serial_id, + const struct TALER_AUDITORDB_ExchangeSignkeys *dc); typedef enum GNUNET_GenericReturnValue (*TALER_AUDITORDB_WireFormatInconsistencyCallback)( - void *cls, - uint64_t serial_id, - const struct TALER_AUDITORDB_WireFormatInconsistency *dc); + void *cls, + uint64_t serial_id, + const struct TALER_AUDITORDB_WireFormatInconsistency *dc); typedef enum GNUNET_GenericReturnValue (*TALER_AUDITORDB_WireOutInconsistencyCallback)( - void *cls, - uint64_t serial_id, - const struct TALER_AUDITORDB_WireOutInconsistency *dc); + void *cls, + uint64_t serial_id, + const struct TALER_AUDITORDB_WireOutInconsistency *dc); typedef enum GNUNET_GenericReturnValue (*TALER_AUDITORDB_ReserveBalanceSummaryWrongInconsistencyCallback)( - void *cls, - uint64_t serial_id, - const struct TALER_AUDITORDB_ReserveBalanceSummaryWrongInconsistency *dc); + void *cls, + uint64_t serial_id, + const struct TALER_AUDITORDB_ReserveBalanceSummaryWrongInconsistency *dc); typedef enum GNUNET_GenericReturnValue (*TALER_AUDITORDB_RowMinorInconsistenciesCallback)( - void *cls, - uint64_t serial_id, - const struct TALER_AUDITORDB_RowMinorInconsistencies *dc); + void *cls, + uint64_t serial_id, + const struct TALER_AUDITORDB_RowMinorInconsistencies *dc); /** * @brief The plugin API, returned from the plugin's "init" function. @@ -1502,527 +1501,456 @@ struct TALER_AUDITORDB_Plugin const struct TALER_AUDITORDB_Generic_Update *gu); + enum GNUNET_DB_QueryStatus + (*update_emergency_by_count)( + void *cls, + const struct TALER_AUDITORDB_Generic_Update *gu); - enum GNUNET_DB_QueryStatus - (*update_emergency_by_count)( - void *cls, - const struct TALER_AUDITORDB_Generic_Update *gu); - - - enum GNUNET_DB_QueryStatus - (*update_row_inconsistency)( - void *cls, - const struct TALER_AUDITORDB_Generic_Update *gu); - - - enum GNUNET_DB_QueryStatus - (*update_purse_not_closed_inconsistencies)( - void *cls, - const struct TALER_AUDITORDB_Generic_Update *gu); - - - enum GNUNET_DB_QueryStatus - (*update_reserve_balance_insufficient_inconsistency)( - void *cls, - const struct TALER_AUDITORDB_Generic_Update *gu); - - - enum GNUNET_DB_QueryStatus - (*update_coin_inconsistency)( - void *cls, - const struct TALER_AUDITORDB_Generic_Update *gu); - - - enum GNUNET_DB_QueryStatus - (*update_progress)( - void *cls, - const struct TALER_AUDITORDB_Generic_Update *gu); - - - enum GNUNET_DB_QueryStatus - (*update_denomination_key_validity_withdraw_inconsistency)( - void *cls, - const struct TALER_AUDITORDB_Generic_Update *gu); - - - enum GNUNET_DB_QueryStatus - (*update_refreshes_hanging)( - void *cls, - const struct TALER_AUDITORDB_Generic_Update *gu); - - - enum GNUNET_DB_QueryStatus - (*update_emergency)( - void *cls, - const struct TALER_AUDITORDB_Generic_Update *gu); - - - enum GNUNET_DB_QueryStatus - (*update_closure_lags)( - void *cls, - const struct TALER_AUDITORDB_Generic_Update *gu); - - - - - - - - enum GNUNET_DB_QueryStatus - (*get_reserve_in_inconsistency)( - void *cls, - int64_t limit, - uint64_t offset, - bool return_suppressed, - TALER_AUDITORDB_ReserveInInconsistencyCallback cb, - void *cb_cls); - - - enum GNUNET_DB_QueryStatus - (*delete_reserve_in_inconsistency)( - void *cls, - uint64_t row_id); - - - enum GNUNET_DB_QueryStatus - (*insert_reserve_in_inconsistency)( - void *cls, - const struct TALER_AUDITORDB_ReserveInInconsistency *dc); - - - enum GNUNET_DB_QueryStatus - (*update_reserve_in_inconsistency)( - void *cls, - const struct TALER_AUDITORDB_Generic_Update *gu); - - - - - - - - - enum GNUNET_DB_QueryStatus - (*get_reserve_not_closed_inconsistency)( - void *cls, - int64_t limit, - uint64_t offset, - bool return_suppressed, - TALER_AUDITORDB_ReserveNotClosedInconsistencyCallback cb, - void *cb_cls); - - - enum GNUNET_DB_QueryStatus - (*delete_reserve_not_closed_inconsistency)( - void *cls, - uint64_t row_id); - - - enum GNUNET_DB_QueryStatus - (*insert_reserve_not_closed_inconsistency)( - void *cls, - const struct TALER_AUDITORDB_ReserveNotClosedInconsistency *dc); - - - enum GNUNET_DB_QueryStatus - (*update_reserve_not_closed_inconsistency)( - void *cls, - const struct TALER_AUDITORDB_Generic_Update *gu); - - - - - - - - - enum GNUNET_DB_QueryStatus - (*get_denominations_without_sigs)( - void *cls, - int64_t limit, - uint64_t offset, - bool return_suppressed, - TALER_AUDITORDB_DenominationsWithoutSigsCallback cb, - void *cb_cls); - - - enum GNUNET_DB_QueryStatus - (*delete_denominations_without_sigs)( - void *cls, - uint64_t row_id); - - - enum GNUNET_DB_QueryStatus - (*insert_denominations_without_sigs)( - void *cls, - const struct TALER_AUDITORDB_DenominationsWithoutSigs *dc); - - - enum GNUNET_DB_QueryStatus - (*update_denominations_without_sigs)( - void *cls, - const struct TALER_AUDITORDB_Generic_Update *gu); - - - - - - - - - enum GNUNET_DB_QueryStatus - (*get_misattribution_in_inconsistency)( - void *cls, - int64_t limit, - uint64_t offset, - bool return_suppressed, - TALER_AUDITORDB_MisattributionInInconsistencyCallback cb, - void *cb_cls); - - - enum GNUNET_DB_QueryStatus - (*delete_misattribution_in_inconsistency)( - void *cls, - uint64_t row_id); - - - enum GNUNET_DB_QueryStatus - (*insert_misattribution_in_inconsistency)( - void *cls, - const struct TALER_AUDITORDB_MisattributionInInconsistency *dc); + enum GNUNET_DB_QueryStatus + (*update_row_inconsistency)( + void *cls, + const struct TALER_AUDITORDB_Generic_Update *gu); - enum GNUNET_DB_QueryStatus - (*update_misattribution_in_inconsistency)( - void *cls, - const struct TALER_AUDITORDB_Generic_Update *gu); + enum GNUNET_DB_QueryStatus + (*update_purse_not_closed_inconsistencies)( + void *cls, + const struct TALER_AUDITORDB_Generic_Update *gu); + enum GNUNET_DB_QueryStatus + (*update_reserve_balance_insufficient_inconsistency)( + void *cls, + const struct TALER_AUDITORDB_Generic_Update *gu); - enum GNUNET_DB_QueryStatus - (*get_reserves)( - void *cls, - int64_t limit, - uint64_t offset, - bool return_suppressed, - TALER_AUDITORDB_ReservesCallback cb, - void *cb_cls); + enum GNUNET_DB_QueryStatus + (*update_coin_inconsistency)( + void *cls, + const struct TALER_AUDITORDB_Generic_Update *gu); - enum GNUNET_DB_QueryStatus - (*delete_reserves)( - void *cls, - uint64_t row_id); + enum GNUNET_DB_QueryStatus + (*update_progress)( + void *cls, + const struct TALER_AUDITORDB_Generic_Update *gu); - enum GNUNET_DB_QueryStatus - (*insert_reserves)( - void *cls, - const struct TALER_AUDITORDB_Reserves *dc); + enum GNUNET_DB_QueryStatus + (*update_denomination_key_validity_withdraw_inconsistency)( + void *cls, + const struct TALER_AUDITORDB_Generic_Update *gu); - enum GNUNET_DB_QueryStatus - (*update_reserves)( - void *cls, - const struct TALER_AUDITORDB_Generic_Update *gu); + enum GNUNET_DB_QueryStatus + (*update_refreshes_hanging)( + void *cls, + const struct TALER_AUDITORDB_Generic_Update *gu); + enum GNUNET_DB_QueryStatus + (*update_emergency)( + void *cls, + const struct TALER_AUDITORDB_Generic_Update *gu); + enum GNUNET_DB_QueryStatus + (*update_closure_lags)( + void *cls, + const struct TALER_AUDITORDB_Generic_Update *gu); + enum GNUNET_DB_QueryStatus + (*get_reserve_in_inconsistency)( + void *cls, + int64_t limit, + uint64_t offset, + bool return_suppressed, + TALER_AUDITORDB_ReserveInInconsistencyCallback cb, + void *cb_cls); - enum GNUNET_DB_QueryStatus - (*get_purses)( - void *cls, - int64_t limit, - uint64_t offset, - bool return_suppressed, - TALER_AUDITORDB_PursesCallback cb, - void *cb_cls); + enum GNUNET_DB_QueryStatus + (*delete_reserve_in_inconsistency)( + void *cls, + uint64_t row_id); - enum GNUNET_DB_QueryStatus - (*delete_purses)( - void *cls, - uint64_t row_id); + enum GNUNET_DB_QueryStatus + (*insert_reserve_in_inconsistency)( + void *cls, + const struct TALER_AUDITORDB_ReserveInInconsistency *dc); - enum GNUNET_DB_QueryStatus - (*insert_purses)( - void *cls, - const struct TALER_AUDITORDB_Purses *dc); + enum GNUNET_DB_QueryStatus + (*update_reserve_in_inconsistency)( + void *cls, + const struct TALER_AUDITORDB_Generic_Update *gu); - enum GNUNET_DB_QueryStatus - (*update_purses)( - void *cls, - const struct TALER_AUDITORDB_Generic_Update *gu); + enum GNUNET_DB_QueryStatus + (*get_reserve_not_closed_inconsistency)( + void *cls, + int64_t limit, + uint64_t offset, + bool return_suppressed, + TALER_AUDITORDB_ReserveNotClosedInconsistencyCallback cb, + void *cb_cls); + enum GNUNET_DB_QueryStatus + (*delete_reserve_not_closed_inconsistency)( + void *cls, + uint64_t row_id); + enum GNUNET_DB_QueryStatus + (*insert_reserve_not_closed_inconsistency)( + void *cls, + const struct TALER_AUDITORDB_ReserveNotClosedInconsistency *dc); + enum GNUNET_DB_QueryStatus + (*update_reserve_not_closed_inconsistency)( + void *cls, + const struct TALER_AUDITORDB_Generic_Update *gu); - enum GNUNET_DB_QueryStatus - (*get_historic_denomination_revenue)( - void *cls, - int64_t limit, - uint64_t offset, - bool return_suppressed, - TALER_AUDITORDB_HistoricDenominationRevenueCallback cb, - void *cb_cls); + enum GNUNET_DB_QueryStatus + (*get_denominations_without_sigs)( + void *cls, + int64_t limit, + uint64_t offset, + bool return_suppressed, + TALER_AUDITORDB_DenominationsWithoutSigsCallback cb, + void *cb_cls); - enum GNUNET_DB_QueryStatus - (*delete_historic_denomination_revenue)( - void *cls, - uint64_t row_id); + enum GNUNET_DB_QueryStatus + (*delete_denominations_without_sigs)( + void *cls, + uint64_t row_id); - enum GNUNET_DB_QueryStatus - (*insert_historic_denomination_revenue)( - void *cls, - const struct TALER_AUDITORDB_HistoricDenominationRevenue *dc); + enum GNUNET_DB_QueryStatus + (*insert_denominations_without_sigs)( + void *cls, + const struct TALER_AUDITORDB_DenominationsWithoutSigs *dc); - enum GNUNET_DB_QueryStatus - (*update_historic_denomination_revenue)( - void *cls, - const struct TALER_AUDITORDB_Generic_Update *gu); + enum GNUNET_DB_QueryStatus + (*update_denominations_without_sigs)( + void *cls, + const struct TALER_AUDITORDB_Generic_Update *gu); + enum GNUNET_DB_QueryStatus + (*get_misattribution_in_inconsistency)( + void *cls, + int64_t limit, + uint64_t offset, + bool return_suppressed, + TALER_AUDITORDB_MisattributionInInconsistencyCallback cb, + void *cb_cls); - enum GNUNET_DB_QueryStatus - (*get_denomination_pending)( - void *cls, - int64_t limit, - uint64_t offset, - bool return_suppressed, - TALER_AUDITORDB_DenominationPendingCallback cb, - void *cb_cls); + enum GNUNET_DB_QueryStatus + (*delete_misattribution_in_inconsistency)( + void *cls, + uint64_t row_id); - enum GNUNET_DB_QueryStatus - (*delete_denomination_pending)( - void *cls, - uint64_t row_id); + enum GNUNET_DB_QueryStatus + (*insert_misattribution_in_inconsistency)( + void *cls, + const struct TALER_AUDITORDB_MisattributionInInconsistency *dc); - enum GNUNET_DB_QueryStatus - (*insert_denomination_pending)( - void *cls, - const struct TALER_AUDITORDB_DenominationPending *dc); + enum GNUNET_DB_QueryStatus + (*update_misattribution_in_inconsistency)( + void *cls, + const struct TALER_AUDITORDB_Generic_Update *gu); - enum GNUNET_DB_QueryStatus - (*update_denomination_pending)( - void *cls, - const struct TALER_AUDITORDB_Generic_Update *gu); + enum GNUNET_DB_QueryStatus + (*get_reserves)( + void *cls, + int64_t limit, + uint64_t offset, + bool return_suppressed, + TALER_AUDITORDB_ReservesCallback cb, + void *cb_cls); + enum GNUNET_DB_QueryStatus + (*delete_reserves)( + void *cls, + uint64_t row_id); + enum GNUNET_DB_QueryStatus + (*insert_reserves)( + void *cls, + const struct TALER_AUDITORDB_Reserves *dc); - enum GNUNET_DB_QueryStatus - (*get_historic_reserve_summary)( - void *cls, - int64_t limit, - uint64_t offset, - bool return_suppressed, - TALER_AUDITORDB_HistoricReserveSummaryCallback cb, - void *cb_cls); + enum GNUNET_DB_QueryStatus + (*update_reserves)( + void *cls, + const struct TALER_AUDITORDB_Generic_Update *gu); - enum GNUNET_DB_QueryStatus - (*delete_historic_reserve_summary)( - void *cls, - uint64_t row_id); + enum GNUNET_DB_QueryStatus + (*get_purses)( + void *cls, + int64_t limit, + uint64_t offset, + bool return_suppressed, + TALER_AUDITORDB_PursesCallback cb, + void *cb_cls); - enum GNUNET_DB_QueryStatus - (*insert_historic_reserve_summary)( - void *cls, - const struct TALER_AUDITORDB_HistoricReserveSummary *dc); + enum GNUNET_DB_QueryStatus + (*delete_purses)( + void *cls, + uint64_t row_id); - enum GNUNET_DB_QueryStatus - (*update_historic_reserve_summary)( - void *cls, - const struct TALER_AUDITORDB_Generic_Update *gu); + enum GNUNET_DB_QueryStatus + (*insert_purses)( + void *cls, + const struct TALER_AUDITORDB_Purses *dc); + enum GNUNET_DB_QueryStatus + (*update_purses)( + void *cls, + const struct TALER_AUDITORDB_Generic_Update *gu); + enum GNUNET_DB_QueryStatus + (*get_historic_denomination_revenue)( + void *cls, + int64_t limit, + uint64_t offset, + bool return_suppressed, + TALER_AUDITORDB_HistoricDenominationRevenueCallback cb, + void *cb_cls); + enum GNUNET_DB_QueryStatus + (*delete_historic_denomination_revenue)( + void *cls, + uint64_t row_id); - enum GNUNET_DB_QueryStatus - (*get_exchange_signkeys)( - void *cls, - int64_t limit, - uint64_t offset, - bool return_suppressed, - TALER_AUDITORDB_ExchangeSignkeysCallback cb, - void *cb_cls); + enum GNUNET_DB_QueryStatus + (*insert_historic_denomination_revenue)( + void *cls, + const struct TALER_AUDITORDB_HistoricDenominationRevenue *dc); - enum GNUNET_DB_QueryStatus - (*delete_exchange_signkeys)( - void *cls, - uint64_t row_id); + enum GNUNET_DB_QueryStatus + (*update_historic_denomination_revenue)( + void *cls, + const struct TALER_AUDITORDB_Generic_Update *gu); - enum GNUNET_DB_QueryStatus - (*insert_exchange_signkeys)( - void *cls, - const struct TALER_AUDITORDB_ExchangeSignkeys *dc); + enum GNUNET_DB_QueryStatus + (*get_denomination_pending)( + void *cls, + int64_t limit, + uint64_t offset, + bool return_suppressed, + TALER_AUDITORDB_DenominationPendingCallback cb, + void *cb_cls); - enum GNUNET_DB_QueryStatus - (*update_exchange_signkeys)( - void *cls, - const struct TALER_AUDITORDB_Generic_Update *gu); + enum GNUNET_DB_QueryStatus + (*delete_denomination_pending)( + void *cls, + uint64_t row_id); + enum GNUNET_DB_QueryStatus + (*insert_denomination_pending)( + void *cls, + const struct TALER_AUDITORDB_DenominationPending *dc); + enum GNUNET_DB_QueryStatus + (*update_denomination_pending)( + void *cls, + const struct TALER_AUDITORDB_Generic_Update *gu); + enum GNUNET_DB_QueryStatus + (*get_historic_reserve_summary)( + void *cls, + int64_t limit, + uint64_t offset, + bool return_suppressed, + TALER_AUDITORDB_HistoricReserveSummaryCallback cb, + void *cb_cls); - enum GNUNET_DB_QueryStatus - (*get_wire_format_inconsistency)( - void *cls, - int64_t limit, - uint64_t offset, - bool return_suppressed, - TALER_AUDITORDB_WireFormatInconsistencyCallback cb, - void *cb_cls); + enum GNUNET_DB_QueryStatus + (*delete_historic_reserve_summary)( + void *cls, + uint64_t row_id); - enum GNUNET_DB_QueryStatus - (*delete_wire_format_inconsistency)( - void *cls, - uint64_t row_id); + enum GNUNET_DB_QueryStatus + (*insert_historic_reserve_summary)( + void *cls, + const struct TALER_AUDITORDB_HistoricReserveSummary *dc); - enum GNUNET_DB_QueryStatus - (*insert_wire_format_inconsistency)( - void *cls, - const struct TALER_AUDITORDB_WireFormatInconsistency *dc); + enum GNUNET_DB_QueryStatus + (*update_historic_reserve_summary)( + void *cls, + const struct TALER_AUDITORDB_Generic_Update *gu); - enum GNUNET_DB_QueryStatus - (*update_wire_format_inconsistency)( - void *cls, - const struct TALER_AUDITORDB_Generic_Update *gu); + enum GNUNET_DB_QueryStatus + (*get_exchange_signkeys)( + void *cls, + int64_t limit, + uint64_t offset, + bool return_suppressed, + TALER_AUDITORDB_ExchangeSignkeysCallback cb, + void *cb_cls); + enum GNUNET_DB_QueryStatus + (*delete_exchange_signkeys)( + void *cls, + uint64_t row_id); + enum GNUNET_DB_QueryStatus + (*insert_exchange_signkeys)( + void *cls, + const struct TALER_AUDITORDB_ExchangeSignkeys *dc); - enum GNUNET_DB_QueryStatus - (*get_wire_out_inconsistency)( - void *cls, - int64_t limit, - uint64_t offset, - bool return_suppressed, - TALER_AUDITORDB_WireOutInconsistencyCallback cb, - void *cb_cls); + enum GNUNET_DB_QueryStatus + (*update_exchange_signkeys)( + void *cls, + const struct TALER_AUDITORDB_Generic_Update *gu); - enum GNUNET_DB_QueryStatus - (*delete_wire_out_inconsistency)( - void *cls, - uint64_t row_id); + enum GNUNET_DB_QueryStatus + (*get_wire_format_inconsistency)( + void *cls, + int64_t limit, + uint64_t offset, + bool return_suppressed, + TALER_AUDITORDB_WireFormatInconsistencyCallback cb, + void *cb_cls); - enum GNUNET_DB_QueryStatus - (*insert_wire_out_inconsistency)( - void *cls, - const struct TALER_AUDITORDB_WireOutInconsistency *dc); + enum GNUNET_DB_QueryStatus + (*delete_wire_format_inconsistency)( + void *cls, + uint64_t row_id); - enum GNUNET_DB_QueryStatus - (*update_wire_out_inconsistency)( - void *cls, - const struct TALER_AUDITORDB_Generic_Update *gu); + enum GNUNET_DB_QueryStatus + (*insert_wire_format_inconsistency)( + void *cls, + const struct TALER_AUDITORDB_WireFormatInconsistency *dc); + enum GNUNET_DB_QueryStatus + (*update_wire_format_inconsistency)( + void *cls, + const struct TALER_AUDITORDB_Generic_Update *gu); + enum GNUNET_DB_QueryStatus + (*get_wire_out_inconsistency)( + void *cls, + int64_t limit, + uint64_t offset, + bool return_suppressed, + TALER_AUDITORDB_WireOutInconsistencyCallback cb, + void *cb_cls); - enum GNUNET_DB_QueryStatus - (*get_reserve_balance_summary_wrong_inconsistency)( - void *cls, - int64_t limit, - uint64_t offset, - bool return_suppressed, - TALER_AUDITORDB_ReserveBalanceSummaryWrongInconsistencyCallback cb, - void *cb_cls); + enum GNUNET_DB_QueryStatus + (*delete_wire_out_inconsistency)( + void *cls, + uint64_t row_id); - enum GNUNET_DB_QueryStatus - (*delete_reserve_balance_summary_wrong_inconsistency)( - void *cls, - uint64_t row_id); + enum GNUNET_DB_QueryStatus + (*insert_wire_out_inconsistency)( + void *cls, + const struct TALER_AUDITORDB_WireOutInconsistency *dc); - enum GNUNET_DB_QueryStatus - (*insert_reserve_balance_summary_wrong_inconsistency)( - void *cls, - const struct TALER_AUDITORDB_ReserveBalanceSummaryWrongInconsistency *dc); + enum GNUNET_DB_QueryStatus + (*update_wire_out_inconsistency)( + void *cls, + const struct TALER_AUDITORDB_Generic_Update *gu); - enum GNUNET_DB_QueryStatus - (*update_reserve_balance_summary_wrong_inconsistency)( - void *cls, - const struct TALER_AUDITORDB_Generic_Update *gu); + enum GNUNET_DB_QueryStatus + (*get_reserve_balance_summary_wrong_inconsistency)( + void *cls, + int64_t limit, + uint64_t offset, + bool return_suppressed, + TALER_AUDITORDB_ReserveBalanceSummaryWrongInconsistencyCallback cb, + void *cb_cls); + enum GNUNET_DB_QueryStatus + (*delete_reserve_balance_summary_wrong_inconsistency)( + void *cls, + uint64_t row_id); + enum GNUNET_DB_QueryStatus + (*insert_reserve_balance_summary_wrong_inconsistency)( + void *cls, + const struct TALER_AUDITORDB_ReserveBalanceSummaryWrongInconsistency *dc); + enum GNUNET_DB_QueryStatus + (*update_reserve_balance_summary_wrong_inconsistency)( + void *cls, + const struct TALER_AUDITORDB_Generic_Update *gu); - enum GNUNET_DB_QueryStatus - (*get_row_minor_inconsistencies)( - void *cls, - int64_t limit, - uint64_t offset, - bool return_suppressed, - TALER_AUDITORDB_RowMinorInconsistenciesCallback cb, - void *cb_cls); + enum GNUNET_DB_QueryStatus + (*get_row_minor_inconsistencies)( + void *cls, + int64_t limit, + uint64_t offset, + bool return_suppressed, + TALER_AUDITORDB_RowMinorInconsistenciesCallback cb, + void *cb_cls); - enum GNUNET_DB_QueryStatus - (*delete_row_minor_inconsistencies)( - void *cls, - uint64_t row_id); + enum GNUNET_DB_QueryStatus + (*delete_row_minor_inconsistencies)( + void *cls, + uint64_t row_id); - enum GNUNET_DB_QueryStatus - (*insert_row_minor_inconsistencies)( - void *cls, - const struct TALER_AUDITORDB_RowMinorInconsistencies *dc); + enum GNUNET_DB_QueryStatus + (*insert_row_minor_inconsistencies)( + void *cls, + const struct TALER_AUDITORDB_RowMinorInconsistencies *dc); - enum GNUNET_DB_QueryStatus - (*update_row_minor_inconsistencies)( - void *cls, - const struct TALER_AUDITORDB_Generic_Update *gu); + enum GNUNET_DB_QueryStatus + (*update_row_minor_inconsistencies)( + void *cls, + const struct TALER_AUDITORDB_Generic_Update *gu); /** |