diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-11-20 13:09:16 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-11-20 13:09:16 +0100 |
commit | a5a3b2ea9ab6fa47d06531b34599237b62742443 (patch) | |
tree | 87679716402bd973db830d2f76c9c9e51bfae1c7 /src/testing/testing_api_cmd_auditor_deposit_confirmation.c | |
parent | 303f105985bd31f23d3b1ba9c86b77a23f142abf (diff) | |
download | exchange-a5a3b2ea9ab6fa47d06531b34599237b62742443.tar.xz |
add taler-auditor-offline test command, fixes test_auditor_api warnings
Diffstat (limited to 'src/testing/testing_api_cmd_auditor_deposit_confirmation.c')
-rw-r--r-- | src/testing/testing_api_cmd_auditor_deposit_confirmation.c | 27 |
1 files changed, 9 insertions, 18 deletions
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, |