donau

Donation authority for GNU Taler (experimental)
Log | Files | Refs | Submodules | README | LICENSE

commit 774d506cd09f0f321ec09890a5505aa3c89464fb
parent 3d2ddee73b9ac0d340403f1fded562a67a01ba3e
Author: Matyja Lukas Adam <lukas.matyja@students.bfh.ch>
Date:   Tue, 16 Jan 2024 13:59:07 +0100

[testing] some changes

Diffstat:
Msrc/include/donau_service.h | 26++++++--------------------
Msrc/lib/donau_api_curl_defaults.c | 1+
Msrc/lib/donau_api_curl_defaults.h | 1+
Msrc/lib/donau_api_handle.c | 9+++++----
Msrc/testing/test_api_cmd_get_donau.c | 27++++++++++++++-------------
Msrc/testing/test_donau_api.c | 2+-
Msrc/testing/testing_api_loop.c | 14+++++++-------
7 files changed, 35 insertions(+), 45 deletions(-)

diff --git a/src/include/donau_service.h b/src/include/donau_service.h @@ -903,20 +903,6 @@ DONAU_charities_get_cancel ( /* ********************* GET /charities/$CHARITY_ID *********************** */ -struct DONAU_CharityHistoryYear -{ - /** - * year - */ - uint32_t year; - - /** - * final donation amount at the end of @a year; - */ - struct TALER_Amount final_amount; -}; - - /** * information of a charity */ @@ -930,22 +916,22 @@ struct DONAU_Charity /** * public key of the charity */ - struct DONAU_CharitySignatureP pub_key; + struct DONAU_CharitySignatureP charity_pub; /** - * Max donation amout for this charitiy and year. + * Max donation amout for this charitiy and @e current_year. */ struct TALER_Amount max_per_year; /** - * donation history + * Current amount of donation receipts for @e current_year. */ - struct DONAU_CharityHistoryYear *donation_history; + struct TALER_Amount receipts_to_date; /** - * number of charity history years + * current year */ - uint32_t num_hist; + uint32_t current_year; }; diff --git a/src/lib/donau_api_curl_defaults.c b/src/lib/donau_api_curl_defaults.c @@ -18,6 +18,7 @@ * @file lib/donau_api_curl_defaults.c * @brief curl easy handle defaults * @author Florian Dold + * @author Lukas Matyja */ #include "donau_api_curl_defaults.h" diff --git a/src/lib/donau_api_curl_defaults.h b/src/lib/donau_api_curl_defaults.h @@ -19,6 +19,7 @@ * @file lib/donau_api_curl_defaults.h * @brief curl easy handle defaults * @author Florian Dold + * @author Lukas Matyja */ #ifndef _TALER_CURL_DEFAULTS_H diff --git a/src/lib/donau_api_handle.c b/src/lib/donau_api_handle.c @@ -588,10 +588,11 @@ DONAU_get_keys ( gkh->cert_cb = cert_cb; gkh->cert_cb_cls = cert_cb_cls; gkh->url = TALER_url_join (url, - "keys"); - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Requesting keys with URL `%s'.\n", - gkh->url); + "keys", + NULL); + // GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + // "Requesting keys with URL `%s'.\n", + // gkh->url); eh = DONAU_curl_easy_get_ (gkh->url); if (NULL == eh) { diff --git a/src/testing/test_api_cmd_get_donau.c b/src/testing/test_api_cmd_get_donau.c @@ -141,7 +141,7 @@ get_donau_run (void *cls, return; } if (! ges->wait_for_keys) - TALER_TESTING_interpreter_next (is); + TALER_TESTING_interpreter_next (is); } @@ -165,6 +165,7 @@ get_donau_cleanup (void *cls, DONAU_keys_decref (ges->keys); ges->keys = NULL; GNUNET_free (ges->donau_url); + ges->donau_url = NULL; GNUNET_free (ges); } @@ -225,19 +226,19 @@ static char * get_donau_base_url ( const struct GNUNET_CONFIGURATION_Handle *cfg) { - char *donau_url; + char *donau_url = "http://localhost:8080/"; - if (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_string (cfg, - "donau", - "BASE_URL", - &donau_url)) - { - GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, - "donau", - "BASE_URL"); - return NULL; - } + // if (GNUNET_OK != + // GNUNET_CONFIGURATION_get_value_string (cfg, + // "donau", + // "BASE_URL", + // &donau_url)) + // { + // GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, + // "donau", + // "BASE_URL"); + // return NULL; + // } return donau_url; } diff --git a/src/testing/test_donau_api.c b/src/testing/test_donau_api.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2014--2024 Taler Systems SA + Copyright (C) 2014-2024 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as diff --git a/src/testing/testing_api_loop.c b/src/testing/testing_api_loop.c @@ -54,13 +54,13 @@ DONAU_TESTING_main (char *const *argv, // GNUNET_break (0); // return 77; //} - if (GNUNET_OK != - TALER_TESTING_cleanup_files_cfg (NULL, - cred->cfg)) - { - GNUNET_break (0); - return 77; - } + // if (GNUNET_OK != + // TALER_TESTING_cleanup_files_cfg (NULL, + // cred->cfg)) + // { + // GNUNET_break (0); + // return 77; + // } ret = TALER_TESTING_loop (main_cb, main_cb_cls); /* TODO: should we free 'cred' resources here? */