aboutsummaryrefslogtreecommitdiff
path: root/src/exchange-lib/test_exchange_api_twisted.c
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2018-05-14 14:50:27 +0200
committerMarcello Stanisci <stanisci.m@gmail.com>2018-05-14 22:32:13 +0200
commit08824870e6cb6b91bf43936357361d82f8017dc6 (patch)
treeea0b0fe85d31d901456e984f09968216dd988147 /src/exchange-lib/test_exchange_api_twisted.c
parent6a0be254cc7a630da2f508119573338245277e56 (diff)
downloadexchange-08824870e6cb6b91bf43936357361d82f8017dc6.tar.xz
Triggering doubled /refresh/melt, plus prepare ground for twisting the /refresh/reveal
Diffstat (limited to 'src/exchange-lib/test_exchange_api_twisted.c')
-rw-r--r--src/exchange-lib/test_exchange_api_twisted.c44
1 files changed, 43 insertions, 1 deletions
diff --git a/src/exchange-lib/test_exchange_api_twisted.c b/src/exchange-lib/test_exchange_api_twisted.c
index 8c2492816..3b875cd5e 100644
--- a/src/exchange-lib/test_exchange_api_twisted.c
+++ b/src/exchange-lib/test_exchange_api_twisted.c
@@ -114,7 +114,7 @@ static struct GNUNET_OS_Process *twisterd;
#define CMD_TRANSFER_TO_EXCHANGE(label,amount) \
TALER_TESTING_cmd_fakebank_transfer (label, amount, \
fakebank_url, USER_ACCOUNT_NO, EXCHANGE_ACCOUNT_NO, \
- USER_LOGIN_NAME, USER_LOGIN_PASS, EXCHANGE_URL)
+ USER_LOGIN_NAME, USER_LOGIN_PASS, exchange_url)
/**
* Run wire transfer of funds from some user's account to the
@@ -142,6 +142,48 @@ run (void *cls,
struct TALER_TESTING_Command commands[] = {
+ CMD_TRANSFER_TO_EXCHANGE ("refresh-create-reserve",
+ "EUR:5.01"),
+
+ /**
+ * Make previous command effective.
+ */
+ CMD_EXEC_WIREWATCH ("wirewatch"),
+
+ /**
+ * Withdraw EUR:5.
+ */
+ TALER_TESTING_cmd_withdraw_amount
+ ("refresh-withdraw-coin",
+ is->exchange,
+ "refresh-create-reserve",
+ "EUR:5",
+ MHD_HTTP_OK),
+
+ TALER_TESTING_cmd_deposit
+ ("refresh-deposit-partial",
+ is->exchange,
+ "refresh-withdraw-coin",
+ 0,
+ TALER_TESTING_make_wire_details
+ (42,
+ fakebank_url),
+ "{\"items\":[{\"name\":\"ice cream\",\
+ \"value\":\"EUR:1\"}]}",
+ GNUNET_TIME_UNIT_ZERO,
+ "EUR:1",
+ MHD_HTTP_OK),
+
+ /**
+ * Melt the rest of the coin's value
+ * (EUR:4.00 = 3x EUR:1.03 + 7x EUR:0.13) */
+ TALER_TESTING_cmd_refresh_melt
+ ("refresh-melt",
+ is->exchange,
+ "EUR:4",
+ "refresh-withdraw-coin",
+ MHD_HTTP_OK),
+
/**
* End the suite. Fixme: better to have a label for this
* too, as it shows a "(null)" token on logs.