diff --git a/src/exchange-lib/testing_api_cmd_status.c b/src/exchange-lib/testing_api_cmd_status.c index f8186131e..77a5cbf9a 100644 --- a/src/exchange-lib/testing_api_cmd_status.c +++ b/src/exchange-lib/testing_api_cmd_status.c @@ -167,23 +167,42 @@ status_run (void *cls, return; } - 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_break (0); - TALER_TESTING_interpreter_fail (is); - return; + GNUNET_CRYPTO_eddsa_key_get_public (&reserve_priv->eddsa_priv, + &reserve_pub.eddsa_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; + + } + + GNUNET_STRINGS_string_to_data + (transfer_subject, + strlen (transfer_subject), + &reserve_pub.eddsa_pub, + sizeof (struct TALER_ReservePublicKeyP)); } - GNUNET_CRYPTO_eddsa_key_get_public (&reserve_priv->eddsa_priv, - &reserve_pub.eddsa_pub); - ss->rsh - = TALER_EXCHANGE_reserve_status (ss->exchange, - &reserve_pub, - &reserve_status_cb, - ss); + ss->rsh = TALER_EXCHANGE_reserve_status (ss->exchange, + &reserve_pub, + &reserve_status_cb, + ss); }