donau

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

commit 3bd0baca6426730c3a2abc8e396721b074cfadb5
parent 44e5b73349237f81bf472983cb83b3fea90db263
Author: Matyja Lukas Adam <lukas.matyja@students.bfh.ch>
Date:   Wed, 29 May 2024 01:05:20 +0200

some changes

Diffstat:
Msrc/include/donau_testing_lib.h | 4++--
Msrc/testing/test_donau_api.c | 12++++++------
Msrc/testing/testing_api_cmd_donation_statement_get.c | 47+++++++++++++++++++++++++----------------------
3 files changed, 33 insertions(+), 30 deletions(-)

diff --git a/src/include/donau_testing_lib.h b/src/include/donau_testing_lib.h @@ -160,8 +160,8 @@ TALER_TESTING_cmd_submit_receipts (const char *label, */ struct TALER_TESTING_Command TALER_TESTING_cmd_donation_statement_get (const char *label, - uint64_t year, - unsigned int expected_response_code); + uint64_t year, + unsigned int expected_response_code); /** diff --git a/src/testing/test_donau_api.c b/src/testing/test_donau_api.c @@ -95,13 +95,13 @@ run (void *cls, "7560001010000", // tax id "1234", // salt for tax id hash MHD_HTTP_CREATED), - TALER_TESTING_cmd_submit_receipts ("submit-receipts", - "issue-receipts", // cmd trait reference - 2024, - MHD_HTTP_OK), + TALER_TESTING_cmd_submit_receipts ("submit-receipts", + "issue-receipts", // cmd trait reference + 2024, + MHD_HTTP_OK), TALER_TESTING_cmd_donation_statement_get ("donation-statement", - 2024, - MHD_HTTP_OK), + 2024, + MHD_HTTP_OK), TALER_TESTING_cmd_charity_delete ("delete-charity", "post-charity", // cmd trait reference &bearer, diff --git a/src/testing/testing_api_cmd_donation_statement_get.c b/src/testing/testing_api_cmd_donation_statement_get.c @@ -104,32 +104,35 @@ status_run (void *cls, ss->is = is; /* Get charity salted tax id hash from trait */ { - const struct TALER_TESTING_Command *issue_receipts_cmd; - const struct DONAU_HashDonorTaxId *h_donor_tax_id; - - issue_receipts_cmd = TALER_TESTING_interpreter_lookup_command (is, - "issue-receipts"); - - if (GNUNET_OK != - TALER_TESTING_get_trait_salted_tax_id_hash (issue_receipts_cmd, - &h_donor_tax_id)) - { - GNUNET_break (0); - TALER_TESTING_interpreter_fail (is); - return; - } - ss->donation_statement.h_donor_tax_id = (struct DONAU_HashDonorTaxId*) h_donor_tax_id; + const struct TALER_TESTING_Command *issue_receipts_cmd; + const struct DONAU_HashDonorTaxId *h_donor_tax_id; + + issue_receipts_cmd = TALER_TESTING_interpreter_lookup_command (is, + "issue-receipts"); + + if (GNUNET_OK != + TALER_TESTING_get_trait_salted_tax_id_hash (issue_receipts_cmd, + &h_donor_tax_id)) + { + GNUNET_break (0); + TALER_TESTING_interpreter_fail (is); + return; + } + ss->donation_statement.h_donor_tax_id = (struct + DONAU_HashDonorTaxId*) + h_donor_tax_id; } ss->dsgh = DONAU_donation_statement_get ( TALER_TESTING_interpreter_get_context (is), - TALER_TESTING_get_donau_url (is), + TALER_TESTING_get_donau_url (is), ss->donation_statement.year, ss->donation_statement.h_donor_tax_id, &charity_status_cb, ss); } + /** * Cleanup the state from a "reserve status" CMD, and possibly * cancel a pending operation thereof. @@ -145,10 +148,10 @@ status_cleanup (void *cls, if (NULL != ss->dsgh) { - // log incomplete command - TALER_TESTING_command_incomplete (ss->is, - cmd->label); - DONAU_donation_statement_get_cancel (ss->dsgh); + // log incomplete command + TALER_TESTING_command_incomplete (ss->is, + cmd->label); + DONAU_donation_statement_get_cancel (ss->dsgh); ss->dsgh = NULL; } GNUNET_free (ss); @@ -157,8 +160,8 @@ status_cleanup (void *cls, struct TALER_TESTING_Command TALER_TESTING_cmd_donation_statement_get (const char *label, - uint64_t year, - unsigned int expected_response_code) + uint64_t year, + unsigned int expected_response_code) { struct StatusState *ss; ss = GNUNET_new (struct StatusState);