summaryrefslogtreecommitdiff
path: root/src/exchangedb/test_exchangedb.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-05-27 15:34:24 +0200
committerChristian Grothoff <christian@grothoff.org>2016-05-27 15:34:24 +0200
commite68d07fc257d4b6fee51f5ed24950368bbea51ad (patch)
treee96c21f94c574ddd1e456a7e54fcd80d0bdf6aa8 /src/exchangedb/test_exchangedb.c
parent5f6f524a52a511a84d4da9fbb15c2478f6e8870f (diff)
downloadexchange-e68d07fc257d4b6fee51f5ed24950368bbea51ad.tar.gz
exchange-e68d07fc257d4b6fee51f5ed24950368bbea51ad.tar.bz2
exchange-e68d07fc257d4b6fee51f5ed24950368bbea51ad.zip
making DB scheme nice
Diffstat (limited to 'src/exchangedb/test_exchangedb.c')
-rw-r--r--src/exchangedb/test_exchangedb.c36
1 files changed, 12 insertions, 24 deletions
diff --git a/src/exchangedb/test_exchangedb.c b/src/exchangedb/test_exchangedb.c
index 8ee2f5ed3..2dee9a7ee 100644
--- a/src/exchangedb/test_exchangedb.c
+++ b/src/exchangedb/test_exchangedb.c
@@ -1376,24 +1376,18 @@ run (void *cls)
/* setup values for wire transfer aggregation data */
memset (&wtid, 42, sizeof (wtid));
- memset (&merchant_pub_wt, 43, sizeof (merchant_pub_wt));
- memset (&h_wire_wt, 44, sizeof (h_wire_wt));
- memset (&h_contract_wt, 45, sizeof (h_contract_wt));
+ merchant_pub_wt = deposit.merchant_pub;
+ h_wire_wt = deposit.h_wire;
+ h_contract_wt = deposit.h_contract;
coin_pub_wt = deposit.coin.coin_pub;
- transaction_id_wt = 47;
+ transaction_id_wt = deposit.transaction_id;
execution_time_wt = GNUNET_TIME_absolute_get ();
- memset (&merchant_pub_wt, 48, sizeof (merchant_pub_wt));
+ coin_value_wt = deposit.amount_with_fee;
+ coin_fee_wt = fee_deposit;
GNUNET_assert (GNUNET_OK ==
- TALER_string_to_amount (CURRENCY "KUDOS:1.000010",
- &coin_value_wt));
- GNUNET_assert (GNUNET_OK ==
- TALER_string_to_amount (CURRENCY "KUDOS:0.000010",
- &coin_fee_wt));
- GNUNET_assert (GNUNET_OK ==
- TALER_string_to_amount (CURRENCY "KUDOS:1.000000",
- &transfer_value_wt));
-
-
+ TALER_amount_subtract (&transfer_value_wt,
+ &coin_value_wt,
+ &coin_fee_wt));
FAILIF (GNUNET_NO !=
plugin->lookup_wire_transfer (plugin->cls,
session,
@@ -1407,7 +1401,7 @@ run (void *cls)
&h_wire_wt,
&coin_pub_wt,
&merchant_pub_wt,
- transaction_id_wt,
+ transaction_id_wt + 1 /* want UNKNOWN transaction here, hence + 1 */,
&cb_wtid_never,
NULL));
/* insert WT data */
@@ -1415,14 +1409,8 @@ run (void *cls)
plugin->insert_aggregation_tracking (plugin->cls,
session,
&wtid_wt,
- &merchant_pub_wt,
- &h_wire_wt,
- &h_contract_wt,
- transaction_id_wt,
- execution_time_wt,
- &coin_pub_wt,
- &coin_value_wt,
- &coin_fee_wt));
+ deposit_rowid,
+ execution_time_wt));
FAILIF (GNUNET_OK !=
plugin->lookup_wire_transfer (plugin->cls,
session,