From 1643b745af309f754959621fa2a631c899ba1975 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 3 Mar 2022 23:52:08 +0100 Subject: use 32 byte hash for hpayto, use that for joins on queries to better align queries with partitions --- src/exchangedb/test_exchangedb.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/exchangedb/test_exchangedb.c') 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, -- cgit v1.2.3