summaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_withdraw.c
diff options
context:
space:
mode:
authorLucien Heuzeveldt <lucienclaude.heuzeveldt@students.bfh.ch>2022-01-08 20:41:01 +0100
committerGian Demarmels <gian@demarmels.org>2022-02-04 15:35:31 +0100
commit9074e66ebc8b73ecc98500f32af52088fd7f0722 (patch)
treee5e270bea1e2b3de44e915b428df01866a93203e /src/testing/testing_api_cmd_withdraw.c
parent4c7aa097840eb3254a6823177abcc90fa7ccf0d0 (diff)
downloadexchange-9074e66ebc8b73ecc98500f32af52088fd7f0722.tar.gz
exchange-9074e66ebc8b73ecc98500f32af52088fd7f0722.tar.bz2
exchange-9074e66ebc8b73ecc98500f32af52088fd7f0722.zip
implement withdraw (nonce reuse check missing)
Diffstat (limited to 'src/testing/testing_api_cmd_withdraw.c')
-rw-r--r--src/testing/testing_api_cmd_withdraw.c32
1 files changed, 25 insertions, 7 deletions
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.