commit c25419a17238ce074979f6a69b2b6de55020a930
parent a306448e4bb2bdace5fb23777a99940b546bbbad
Author: Thien-Thi Nguyen <ttn@gnuvola.org>
Date: Thu, 27 May 2021 14:23:14 -0400
continue 2021-05-27 "implement specification update #6891"
This change continues 5dea2c74a16191d269c8fc7beead55c2683c887a:
(ReserveData): Add member ‘payto_uri’.
(pre_test_tips): Initialize ‘cls->reserve.payto_uri’ to a plausible value.
(test_insert_reserve): Pass ‘reserve->payto_uri’ to ‘plugin->insert_reserve’.
(lookup_reserve_cb):Add to arglist ‘exchange_url’, ‘payto_uri’.
Add FIXME re ‘exchange_url’, ‘payto_uri’.
Diffstat:
1 file changed, 12 insertions(+), 0 deletions(-)
diff --git a/src/backenddb/test_merchantdb.c b/src/backenddb/test_merchantdb.c
@@ -4377,6 +4377,11 @@ struct ReserveData
const char *exchange_url;
/**
+ * The payto URI
+ */
+ const char *payto_uri;
+
+ /**
* The expiration date
*/
struct GNUNET_TIME_Absolute expiration;
@@ -4402,6 +4407,7 @@ test_insert_reserve (const struct InstanceData *instance,
&reserve->reserve_priv,
&reserve->reserve_pub,
reserve->exchange_url,
+ reserve->payto_uri,
&reserve->initial_amount,
reserve->expiration),
"Insert reserve failed\n");
@@ -4448,6 +4454,8 @@ struct TestLookupReserve_Closure
* @param committed_amount total of tips that the merchant committed to, but that were not
* picked up yet
* @param active true if the reserve is still active (we have the private key)
+ * @param exchange_url base URL of the exchange hosting the reserve, NULL if not @a active
+ * @param payto_uri URI to use to fund the reserve, NULL if not @a active
* @param tips_length length of the @a tips array
* @param tips information about the tips created by this reserve
*
@@ -4462,6 +4470,8 @@ lookup_reserve_cb (void *cls,
const struct TALER_Amount *picked_up_amount,
const struct TALER_Amount *committed_amount,
bool active,
+ const char *exchange_url,
+ const char *payto_uri,
unsigned int tips_length,
const struct TALER_MERCHANTDB_TipDetails *tips)
{
@@ -4481,6 +4491,7 @@ lookup_reserve_cb (void *cls,
cmp->result_matches = 1;
return;
}
+ /* FIXME: What about ‘exchange_url’ and ‘payto_uri’? --ttn */
memset (tip_cmp_results, 0, sizeof (unsigned int) * tips_length);
for (unsigned int i = 0; tips_length > i; ++i)
{
@@ -5301,6 +5312,7 @@ pre_test_tips (struct TestTips_Closure *cls)
TALER_string_to_amount ("EUR:99.99",
&cls->reserve.initial_amount));
cls->reserve.exchange_url = "exch-url";
+ cls->reserve.payto_uri = "payto://other-uri";
cls->reserve.expiration =
GNUNET_TIME_absolute_add (GNUNET_TIME_absolute_get (),
GNUNET_TIME_UNIT_WEEKS);