commit 1a15cd29e87f27a29c69f385725baf33022a6e60
parent 20933b3950d56b0e04f2fcdea16ac37fd83b767d
Author: Florian Dold <florian.dold@gmail.com>
Date: Fri, 27 Mar 2020 20:01:31 +0530
deposit command: create merchant key in a more appropriate place
Diffstat:
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/src/testing/testing_api_cmd_deposit.c b/src/testing/testing_api_cmd_deposit.c
@@ -277,7 +277,6 @@ deposit_run (void *cls,
const struct TALER_DenominationSignature *denom_pub_sig;
struct TALER_CoinSpendSignatureP coin_sig;
struct GNUNET_TIME_Absolute wire_deadline;
- struct GNUNET_CRYPTO_EddsaPrivateKey *merchant_priv;
struct TALER_MerchantPublicKeyP merchant_pub;
struct GNUNET_HashCode h_contract_terms;
@@ -308,12 +307,6 @@ deposit_run (void *cls,
ds->merchant_priv = ods->merchant_priv;
ds->command_initialized = GNUNET_YES;
}
- else
- {
- merchant_priv = GNUNET_CRYPTO_eddsa_key_create ();
- ds->merchant_priv.eddsa_priv = *merchant_priv;
- GNUNET_free (merchant_priv);
- }
GNUNET_assert (ds->coin_reference);
coin_cmd = TALER_TESTING_interpreter_lookup_command
(is,
@@ -561,6 +554,7 @@ TALER_TESTING_cmd_deposit (const char *label,
{
struct DepositState *ds;
json_t *wire_details;
+ struct GNUNET_CRYPTO_EddsaPrivateKey *merchant_priv;
wire_details = TALER_TESTING_make_wire_details (target_account_payto);
ds = GNUNET_new (struct DepositState);
@@ -570,6 +564,9 @@ TALER_TESTING_cmd_deposit (const char *label,
ds->contract_terms = json_loads (contract_terms,
JSON_REJECT_DUPLICATES,
NULL);
+ merchant_priv = GNUNET_CRYPTO_eddsa_key_create ();
+ ds->merchant_priv.eddsa_priv = *merchant_priv;
+ GNUNET_free (merchant_priv);
if (NULL == ds->contract_terms)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,