From 9074e66ebc8b73ecc98500f32af52088fd7f0722 Mon Sep 17 00:00:00 2001 From: Lucien Heuzeveldt Date: Sat, 8 Jan 2022 20:41:01 +0100 Subject: implement withdraw (nonce reuse check missing) --- src/testing/testing_api_cmd_withdraw.c | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) (limited to 'src/testing/testing_api_cmd_withdraw.c') diff --git a/src/testing/testing_api_cmd_withdraw.c b/src/testing/testing_api_cmd_withdraw.c index e07eac341..2a98765f4 100644 --- a/src/testing/testing_api_cmd_withdraw.c +++ b/src/testing/testing_api_cmd_withdraw.c @@ -266,13 +266,6 @@ reserve_withdraw_cb (void *cls, switch (wr->hr.http_status) { case MHD_HTTP_OK: - // TODO: remove - // temporary make test successful when CS - if (TALER_DENOMINATION_CS == ws->cipher) - { - break; - } - TALER_denom_sig_deep_copy (&ws->sig, &wr->details.success.sig); if (0 != ws->total_backoff.rel_value_us) @@ -661,6 +654,8 @@ TALER_TESTING_cmd_withdraw_amount_reuse_key ( const char *coin_ref, unsigned int expected_response_code) { + // TODO: ATM this is hardcoded to RSA denominations + // (use TALER_TESTING_cmd_withdraw_cs_amount for Clause Schnorr) struct TALER_TESTING_Command cmd; cmd = TALER_TESTING_cmd_withdraw_amount (label, @@ -676,6 +671,29 @@ TALER_TESTING_cmd_withdraw_amount_reuse_key ( } +struct TALER_TESTING_Command +TALER_TESTING_cmd_withdraw_cs_amount_reuse_key ( + const char *label, + const char *reserve_reference, + const char *amount, + const char *coin_ref, + unsigned int expected_response_code) +{ + struct TALER_TESTING_Command cmd; + + cmd = TALER_TESTING_cmd_withdraw_cs_amount (label, + reserve_reference, + amount, + expected_response_code); + { + struct WithdrawState *ws = cmd.cls; + + ws->reuse_coin_key_ref = coin_ref; + } + return cmd; +} + + /** * Create withdraw command, letting the caller specify the * amount by a denomination key. -- cgit v1.2.3