From aedd2014ec50e2b52cad76d9c40c218ed0c9ccfc Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 24 Apr 2022 15:29:50 +0200 Subject: -misc p2p fixes --- src/testing/testing_api_cmd_purse_create_deposit.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'src/testing/testing_api_cmd_purse_create_deposit.c') diff --git a/src/testing/testing_api_cmd_purse_create_deposit.c b/src/testing/testing_api_cmd_purse_create_deposit.c index 13b2dffa6..ef98c9055 100644 --- a/src/testing/testing_api_cmd_purse_create_deposit.c +++ b/src/testing/testing_api_cmd_purse_create_deposit.c @@ -259,17 +259,23 @@ deposit_run (void *cls, GNUNET_CRYPTO_eddsa_key_create (&ds->purse_priv.eddsa_priv); GNUNET_CRYPTO_eddsa_key_create (&ds->merge_priv.eddsa_priv); GNUNET_CRYPTO_ecdhe_key_create (&ds->contract_priv.ecdhe_priv); - ds->purse_expiration - = GNUNET_TIME_relative_to_timestamp (ds->rel_expiration); GNUNET_CRYPTO_eddsa_key_get_public (&ds->purse_priv.eddsa_priv, &ds->purse_pub.eddsa_pub); + + ds->purse_expiration = + GNUNET_TIME_absolute_to_timestamp ( + GNUNET_TIME_relative_to_absolute (ds->rel_expiration)); + GNUNET_assert (0 == + json_object_set_new ( + ds->contract_terms, + "pay_deadline", + GNUNET_JSON_from_timestamp (ds->purse_expiration))); ds->dh = TALER_EXCHANGE_purse_create_with_deposit ( is->exchange, &ds->purse_priv, &ds->merge_priv, &ds->contract_priv, ds->contract_terms, - ds->purse_expiration, ds->num_coin_references, deposits, ds->upload_contract, @@ -361,7 +367,6 @@ TALER_TESTING_cmd_purse_create_with_deposit ( ...) { struct PurseCreateDepositState *ds; - struct GNUNET_TIME_Timestamp pay_deadline; ds = GNUNET_new (struct PurseCreateDepositState); ds->rel_expiration = purse_expiration; @@ -378,14 +383,6 @@ TALER_TESTING_cmd_purse_create_with_deposit ( label); GNUNET_assert (0); } - pay_deadline = - GNUNET_TIME_absolute_to_timestamp ( - GNUNET_TIME_relative_to_absolute (purse_expiration)); - GNUNET_assert (0 == - json_object_set_new ( - ds->contract_terms, - "pay_deadline", - GNUNET_JSON_from_timestamp (pay_deadline))); { va_list ap; unsigned int i; -- cgit v1.2.3