diff options
Diffstat (limited to 'src/testing/testing_api_cmd_truth_store.c')
-rw-r--r-- | src/testing/testing_api_cmd_truth_store.c | 43 |
1 files changed, 15 insertions, 28 deletions
diff --git a/src/testing/testing_api_cmd_truth_store.c b/src/testing/testing_api_cmd_truth_store.c index 141ef20..f7a6ece 100644 --- a/src/testing/testing_api_cmd_truth_store.c +++ b/src/testing/testing_api_cmd_truth_store.c @@ -3,14 +3,14 @@ Copyright (C) 2020 Anastasis SARL Anastasis is free software; you can redistribute it and/or modify it under the - terms of the GNU Lesser General Public License as published by the Free Software + terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. Anastasis is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. + A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU Affero General Public License along with + You should have received a copy of the GNU General Public License along with Anastasis; see the file COPYING.GPL. If not, see <http://www.gnu.org/licenses/> */ /** @@ -125,16 +125,11 @@ truth_store_cb (void *cls, struct TruthStoreState *tss = cls; tss->tso = NULL; - if ( (NULL == ud) || - (ud->http_status != tss->http_status) ) + if (ud->http_status != tss->http_status) { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Unexpected response code %u to command %s in %s:%u\n", - (NULL != ud) ? ud->http_status : 0, - tss->is->commands[tss->is->ip].label, - __FILE__, - __LINE__); - TALER_TESTING_interpreter_fail (tss->is); + TALER_TESTING_unexpected_status (tss->is, + ud->http_status, + tss->http_status); return; } switch (ud->us) @@ -205,7 +200,6 @@ truth_store_run (void *cls, if (GNUNET_OK != ANASTASIS_TESTING_get_trait_truth_uuid (ref, - 0, &uuid)) { GNUNET_break (0); @@ -215,7 +209,6 @@ truth_store_run (void *cls, tss->uuid = *uuid; if (GNUNET_OK != ANASTASIS_TESTING_get_trait_eks (ref, - 0, &eks)) { GNUNET_break (0); @@ -275,7 +268,7 @@ truth_store_run (void *cls, GNUNET_free (t); } tss->tso = ANASTASIS_truth_store ( - is->ctx, + TALER_TESTING_interpreter_get_context (is), tss->anastasis_url, &tss->uuid, tss->method, @@ -335,7 +328,7 @@ truth_store_cleanup (void *cls, * @param index index number of the object to extract. * @return #GNUNET_OK on success */ -static int +static enum GNUNET_GenericReturnValue truth_store_traits (void *cls, const void **ret, const char *trait, @@ -343,18 +336,12 @@ truth_store_traits (void *cls, { struct TruthStoreState *tss = cls; struct TALER_TESTING_Trait traits[] = { - ANASTASIS_TESTING_make_trait_truth_uuid (0, - &tss->uuid), - ANASTASIS_TESTING_make_trait_truth_key (0, - &tss->key), - ANASTASIS_TESTING_make_trait_eks (0, - &tss->encrypted_keyshare), - ANASTASIS_TESTING_make_trait_payment_secret (0, - &tss->payment_secret_response), - TALER_TESTING_make_trait_url (TALER_TESTING_UT_TALER_URL, - tss->pay_uri), - TALER_TESTING_make_trait_string (0, - tss->filename), + ANASTASIS_TESTING_make_trait_truth_uuid (&tss->uuid), + ANASTASIS_TESTING_make_trait_truth_key (&tss->key), + ANASTASIS_TESTING_make_trait_eks (&tss->encrypted_keyshare), + ANASTASIS_TESTING_make_trait_payment_secret (&tss->payment_secret_response), + TALER_TESTING_make_trait_payto_uri (tss->pay_uri), + ANASTASIS_TESTING_make_trait_filename (tss->filename), TALER_TESTING_trait_end () }; |