aboutsummaryrefslogtreecommitdiff
path: root/src/exchange-lib
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2018-06-28 10:38:42 +0200
committerMarcello Stanisci <stanisci.m@gmail.com>2018-06-28 10:38:42 +0200
commit48cccb62ca8ccd27216c6d42b2eee5e4689a7922 (patch)
tree0bb1cada690ab781fa3b6d92868e47d4052d143c /src/exchange-lib
parentf033320300081607fd8f8861324ea1fc8fa2efd1 (diff)
Reproducing [1] as a test case.
[1] https://gnunet.org/bugs/view.php?id=5366#c13087
Diffstat (limited to 'src/exchange-lib')
-rw-r--r--src/exchange-lib/test_exchange_api_new.c54
-rw-r--r--src/exchange-lib/testing_api_cmd_deposit.c3
2 files changed, 57 insertions, 0 deletions
diff --git a/src/exchange-lib/test_exchange_api_new.c b/src/exchange-lib/test_exchange_api_new.c
index 3b50d70d1..b0819f81b 100644
--- a/src/exchange-lib/test_exchange_api_new.c
+++ b/src/exchange-lib/test_exchange_api_new.c
@@ -457,6 +457,57 @@ run (void *cls,
};
+ /**
+ * This block checks whether a wire deadline
+ * very far in the future does NOT get aggregated now.
+ */
+ struct TALER_TESTING_Command unaggregation[] = {
+
+ TALER_TESTING_cmd_check_bank_empty
+ ("far-future-aggregation-a"),
+
+ CMD_TRANSFER_TO_EXCHANGE ("create-reserve-unaggregated",
+ "EUR:5.01"),
+
+ CMD_EXEC_WIREWATCH ("wirewatch-unaggregated"),
+
+ /* "consume" reserve creation transfer. */
+ TALER_TESTING_cmd_check_bank_transfer
+ ("check_bank_transfer-unaggregated",
+ exchange_url,
+ "EUR:5.01",
+ 42,
+ 2),
+
+ TALER_TESTING_cmd_withdraw_amount
+ ("withdraw-coin-unaggregated",
+ is->exchange,
+ "create-reserve-unaggregated",
+ "EUR:5",
+ MHD_HTTP_OK),
+
+ TALER_TESTING_cmd_deposit
+ ("deposit-unaggregated",
+ is->exchange,
+ "withdraw-coin-unaggregated",
+ 0,
+ TALER_TESTING_make_wire_details
+ (43,
+ fakebank_url),
+ "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}",
+ GNUNET_TIME_UNIT_FOREVER_REL,
+ "EUR:5",
+ MHD_HTTP_OK),
+
+ CMD_EXEC_AGGREGATOR ("aggregation-attempt"),
+
+ TALER_TESTING_cmd_check_bank_empty
+ ("far-future-aggregation-b"),
+
+ TALER_TESTING_cmd_end ()
+ };
+
+
struct TALER_TESTING_Command refund[] = {
/**
@@ -839,6 +890,9 @@ run (void *cls,
TALER_TESTING_cmd_batch ("track",
track),
+ TALER_TESTING_cmd_batch ("unaggregation",
+ unaggregation),
+
TALER_TESTING_cmd_batch ("refund",
refund),
diff --git a/src/exchange-lib/testing_api_cmd_deposit.c b/src/exchange-lib/testing_api_cmd_deposit.c
index d5c0542a3..07895c1fe 100644
--- a/src/exchange-lib/testing_api_cmd_deposit.c
+++ b/src/exchange-lib/testing_api_cmd_deposit.c
@@ -225,6 +225,9 @@ deposit_run (void *cls,
ds->merchant_priv.eddsa_priv = *merchant_priv;
GNUNET_free (merchant_priv);
+ /* FIXME: this looks very odd: why take times as relatives,
+ * just to convert them to absolutes soon after? */
+
if (0 != ds->refund_deadline.rel_value_us)
{
refund_deadline = GNUNET_TIME_relative_to_absolute