diff options
Diffstat (limited to 'src/lib/testing_api_cmd_status.c')
-rw-r--r-- | src/lib/testing_api_cmd_status.c | 36 |
1 files changed, 12 insertions, 24 deletions
diff --git a/src/lib/testing_api_cmd_status.c b/src/lib/testing_api_cmd_status.c index 398221a10..2da404fb8 100644 --- a/src/lib/testing_api_cmd_status.c +++ b/src/lib/testing_api_cmd_status.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2014-2018 Taler Systems SA + Copyright (C) 2014-2020 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 @@ -146,6 +146,7 @@ status_run (void *cls, const struct TALER_TESTING_Command *create_reserve; const struct TALER_ReservePrivateKeyP *reserve_priv; struct TALER_ReservePublicKeyP reserve_pub; + const struct TALER_ReservePublicKeyP *reserve_pubp; ss->is = is; GNUNET_assert (NULL != ss->reserve_reference); @@ -163,44 +164,31 @@ status_run (void *cls, /* NOTE: the following line might generate a ERROR log * statements, but it can be ignored. */ - if (GNUNET_OK == TALER_TESTING_get_trait_reserve_priv - (create_reserve, - 0, - &reserve_priv)) + if (GNUNET_OK == + TALER_TESTING_get_trait_reserve_priv (create_reserve, + 0, + &reserve_priv)) { GNUNET_CRYPTO_eddsa_key_get_public (&reserve_priv->eddsa_priv, &reserve_pub.eddsa_pub); + reserve_pubp = &reserve_pub; } else { - const char *transfer_subject; - - if (GNUNET_OK != TALER_TESTING_get_trait_transfer_subject - (create_reserve, - 0, - &transfer_subject)) - { - GNUNET_break (0); - TALER_LOG_ERROR ("The reserve has neither a priv nor a subject line.\n"); - TALER_TESTING_interpreter_fail (is); - return; - } - if (GNUNET_OK != - GNUNET_STRINGS_string_to_data (transfer_subject, - strlen (transfer_subject), - &reserve_pub.eddsa_pub, - sizeof (struct TALER_ReservePublicKeyP))) + TALER_TESTING_get_trait_reserve_pub (create_reserve, + 0, + &reserve_pubp)) { GNUNET_break (0); - TALER_LOG_ERROR ("Transfer subject is not a public key.\n"); + TALER_LOG_ERROR ("The reserve has neither a priv nor a pub.\n"); TALER_TESTING_interpreter_fail (is); return; } } ss->rsh = TALER_EXCHANGE_reserve_status (is->exchange, - &reserve_pub, + reserve_pubp, &reserve_status_cb, ss); } |