summaryrefslogtreecommitdiff
path: root/src/exchangedb/test_exchangedb.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-03-03 23:52:08 +0100
committerChristian Grothoff <christian@grothoff.org>2022-03-03 23:52:08 +0100
commit1643b745af309f754959621fa2a631c899ba1975 (patch)
tree19d6252ad82a78e432b8c969b948a7e0cb36c33b /src/exchangedb/test_exchangedb.c
parentf951cdef8ced141326887c1a996e8546774514f6 (diff)
downloadexchange-1643b745af309f754959621fa2a631c899ba1975.tar.gz
exchange-1643b745af309f754959621fa2a631c899ba1975.tar.bz2
exchange-1643b745af309f754959621fa2a631c899ba1975.zip
use 32 byte hash for hpayto, use that for joins on queries to better align queries with partitions
Diffstat (limited to 'src/exchangedb/test_exchangedb.c')
-rw-r--r--src/exchangedb/test_exchangedb.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/exchangedb/test_exchangedb.c b/src/exchangedb/test_exchangedb.c
index 7ca1839ff..10390b7fc 100644
--- a/src/exchangedb/test_exchangedb.c
+++ b/src/exchangedb/test_exchangedb.c
@@ -616,6 +616,10 @@ static uint64_t deposit_rowid;
*/
static uint64_t wire_target_row;
+/**
+ * Here #deposit_cb() will store the hash of the payto URI.
+ */
+static struct TALER_PaytoHashP wire_target_h_payto;
/**
* Function called with details about deposits that
@@ -662,6 +666,8 @@ deposit_cb (void *cls,
{
deposit_rowid = rowid;
wire_target_row = wire_target;
+ TALER_payto_hash (payto_uri,
+ &wire_target_h_payto);
result = 9;
}
return GNUNET_DB_STATUS_SUCCESS_ONE_RESULT;
@@ -1048,6 +1054,10 @@ audit_wire_cb (void *cls,
static enum GNUNET_GenericReturnValue
test_wire_out (const struct TALER_EXCHANGEDB_Deposit *deposit)
{
+ struct TALER_PaytoHashP h_payto;
+
+ TALER_payto_hash (deposit->receiver_wire_account,
+ &h_payto);
auditor_row_cnt = 0;
memset (&wire_out_wtid,
42,
@@ -1127,7 +1137,7 @@ test_wire_out (const struct TALER_EXCHANGEDB_Deposit *deposit)
plugin->store_wire_transfer_out (plugin->cls,
wire_out_date,
&wire_out_wtid,
- kyc.payment_target_uuid,
+ &h_payto,
"my-config-section",
&wire_out_amount));
}
@@ -2267,7 +2277,7 @@ run (void *cls)
FAILIF (8 == result);
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->iterate_matching_deposits (plugin->cls,
- wire_target_row,
+ &wire_target_h_payto,
&deposit.merchant_pub,
&matching_deposit_cb,
&deposit,