aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_insert_deposit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/testing_api_cmd_insert_deposit.c')
-rw-r--r--src/testing/testing_api_cmd_insert_deposit.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/testing/testing_api_cmd_insert_deposit.c b/src/testing/testing_api_cmd_insert_deposit.c
index 356528009..cff2884aa 100644
--- a/src/testing/testing_api_cmd_insert_deposit.c
+++ b/src/testing/testing_api_cmd_insert_deposit.c
@@ -58,6 +58,11 @@ struct InsertDepositState
58 struct GNUNET_TIME_Relative wire_deadline; 58 struct GNUNET_TIME_Relative wire_deadline;
59 59
60 /** 60 /**
61 * When did the exchange receive the deposit?
62 */
63 struct GNUNET_TIME_Absolute exchange_timestamp;
64
65 /**
61 * Amount to deposit, inclusive of deposit fee. 66 * Amount to deposit, inclusive of deposit fee.
62 */ 67 */
63 const char *amount_with_fee; 68 const char *amount_with_fee;
@@ -210,6 +215,7 @@ insert_deposit_run (void *cls,
210 (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != 215 (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
211 ids->dbc->plugin->insert_deposit (ids->dbc->plugin->cls, 216 ids->dbc->plugin->insert_deposit (ids->dbc->plugin->cls,
212 ids->dbc->session, 217 ids->dbc->session,
218 ids->exchange_timestamp,
213 &deposit)) || 219 &deposit)) ||
214 (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS != 220 (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS !=
215 ids->dbc->plugin->commit (ids->dbc->plugin->cls, 221 ids->dbc->plugin->commit (ids->dbc->plugin->cls,
@@ -275,6 +281,7 @@ insert_deposit_traits (void *cls,
275 * @param dbc collects database plugin and session handles. 281 * @param dbc collects database plugin and session handles.
276 * @param merchant_name Human-readable name of the merchant. 282 * @param merchant_name Human-readable name of the merchant.
277 * @param merchant_account merchant's account name (NOT a payto:// URI) 283 * @param merchant_account merchant's account name (NOT a payto:// URI)
284 * @param exchange_timestamp when did the exchange receive the deposit
278 * @param wire_deadline point in time where the aggregator should have 285 * @param wire_deadline point in time where the aggregator should have
279 * wired money to the merchant. 286 * wired money to the merchant.
280 * @param amount_with_fee amount to deposit (inclusive of deposit fee) 287 * @param amount_with_fee amount to deposit (inclusive of deposit fee)
@@ -282,21 +289,24 @@ insert_deposit_traits (void *cls,
282 * @return the command. 289 * @return the command.
283 */ 290 */
284struct TALER_TESTING_Command 291struct TALER_TESTING_Command
285TALER_TESTING_cmd_insert_deposit (const char *label, 292TALER_TESTING_cmd_insert_deposit (
286 const struct 293 const char *label,
287 TALER_TESTING_DatabaseConnection *dbc, 294 const struct TALER_TESTING_DatabaseConnection *dbc,
288 const char *merchant_name, 295 const char *merchant_name,
289 const char *merchant_account, 296 const char *merchant_account,
290 struct GNUNET_TIME_Relative wire_deadline, 297 struct GNUNET_TIME_Absolute exchange_timestamp,
291 const char *amount_with_fee, 298 struct GNUNET_TIME_Relative wire_deadline,
292 const char *deposit_fee) 299 const char *amount_with_fee,
300 const char *deposit_fee)
293{ 301{
294 struct InsertDepositState *ids; 302 struct InsertDepositState *ids;
295 303
304 GNUNET_TIME_round_abs (&exchange_timestamp);
296 ids = GNUNET_new (struct InsertDepositState); 305 ids = GNUNET_new (struct InsertDepositState);
297 ids->dbc = dbc; 306 ids->dbc = dbc;
298 ids->merchant_name = merchant_name; 307 ids->merchant_name = merchant_name;
299 ids->merchant_account = merchant_account; 308 ids->merchant_account = merchant_account;
309 ids->exchange_timestamp = exchange_timestamp;
300 ids->wire_deadline = wire_deadline; 310 ids->wire_deadline = wire_deadline;
301 ids->amount_with_fee = amount_with_fee; 311 ids->amount_with_fee = amount_with_fee;
302 ids->deposit_fee = deposit_fee; 312 ids->deposit_fee = deposit_fee;