From a5a3b2ea9ab6fa47d06531b34599237b62742443 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 20 Nov 2021 13:09:16 +0100 Subject: add taler-auditor-offline test command, fixes test_auditor_api warnings --- .../testing_api_cmd_auditor_deposit_confirmation.c | 27 ++++++++-------------- 1 file changed, 9 insertions(+), 18 deletions(-) (limited to 'src/testing/testing_api_cmd_auditor_deposit_confirmation.c') diff --git a/src/testing/testing_api_cmd_auditor_deposit_confirmation.c b/src/testing/testing_api_cmd_auditor_deposit_confirmation.c index 54b5dd6c3..df32b352b 100644 --- a/src/testing/testing_api_cmd_auditor_deposit_confirmation.c +++ b/src/testing/testing_api_cmd_auditor_deposit_confirmation.c @@ -207,7 +207,8 @@ deposit_confirmation_run (void *cls, const struct GNUNET_TIME_Absolute *exchange_timestamp = NULL; struct GNUNET_TIME_Absolute timestamp; const struct GNUNET_TIME_Absolute *wire_deadline; - struct GNUNET_TIME_Absolute refund_deadline; + struct GNUNET_TIME_Absolute refund_deadline + = GNUNET_TIME_UNIT_ZERO_ABS; struct TALER_Amount amount_without_fee; struct TALER_CoinSpendPublicKeyP coin_pub; const struct TALER_MerchantPrivateKeyP *merchant_priv; @@ -283,10 +284,14 @@ deposit_confirmation_run (void *cls, GNUNET_assert (GNUNET_OK == TALER_string_to_amount (dcs->amount_without_fee, &amount_without_fee)); - /* timestamp is mandatory */ { struct GNUNET_JSON_Specification spec[] = { - TALER_JSON_spec_absolute_time ("timestamp", ×tamp), + /* timestamp is mandatory */ + TALER_JSON_spec_absolute_time ("timestamp", + ×tamp), + GNUNET_JSON_spec_mark_optional ( + TALER_JSON_spec_absolute_time ("refund_deadline", + &refund_deadline)), GNUNET_JSON_spec_end () }; @@ -299,22 +304,8 @@ deposit_confirmation_run (void *cls, TALER_TESTING_interpreter_fail (is); return; } - } - /* refund deadline is optional, defaults to zero */ - { - struct GNUNET_JSON_Specification spec[] = { - TALER_JSON_spec_absolute_time ("refund_deadline", - &refund_deadline), - GNUNET_JSON_spec_end () - }; - - if (GNUNET_OK != - GNUNET_JSON_parse (contract_terms, - spec, - NULL, NULL)) - { + if (0 == refund_deadline.abs_value_us) refund_deadline = timestamp; - } } dcs->dc = TALER_AUDITOR_deposit_confirmation (dcs->auditor, &h_wire, -- cgit v1.2.3