diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-12-19 12:12:50 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-12-19 12:12:50 +0100 |
commit | 5f57dbbc7b1e1ed21fff24daa537b949727b7966 (patch) | |
tree | 76b0cbdb74cea37e85363de794ae2580808fe866 /src/backend | |
parent | 7fc151fbb8080395579888e1cb384ccd35a36daa (diff) | |
download | merchant-5f57dbbc7b1e1ed21fff24daa537b949727b7966.tar.gz merchant-5f57dbbc7b1e1ed21fff24daa537b949727b7966.tar.bz2 merchant-5f57dbbc7b1e1ed21fff24daa537b949727b7966.zip |
-introduce new types for tip identifiers and tip pickups
Diffstat (limited to 'src/backend')
6 files changed, 17 insertions, 17 deletions
diff --git a/src/backend/taler-merchant-httpd_get-tips-ID.c b/src/backend/taler-merchant-httpd_get-tips-ID.c index 4b4b2858..f427b168 100644 --- a/src/backend/taler-merchant-httpd_get-tips-ID.c +++ b/src/backend/taler-merchant-httpd_get-tips-ID.c @@ -30,7 +30,7 @@ char * TMH_make_taler_tip_uri (struct MHD_Connection *con, - const struct GNUNET_HashCode *tip_id, + const struct TALER_TipIdentifierP *tip_id, const char *instance_id) { const char *host; @@ -92,7 +92,7 @@ TMH_make_taler_tip_uri (struct MHD_Connection *con, char * TMH_make_tip_status_url (struct MHD_Connection *con, - const struct GNUNET_HashCode *tip_id, + const struct TALER_TipIdentifierP *tip_id, const char *instance_id) { const char *host; @@ -155,7 +155,7 @@ TMH_get_tips_ID (const struct TMH_RequestHandler *rh, struct MHD_Connection *connection, struct TMH_HandlerContext *hc) { - struct GNUNET_HashCode tip_id; + struct TALER_TipIdentifierP tip_id; enum GNUNET_DB_QueryStatus qs; struct TALER_Amount total_authorized; struct TALER_Amount total_picked_up; @@ -165,7 +165,7 @@ TMH_get_tips_ID (const struct TMH_RequestHandler *rh, if (GNUNET_OK != GNUNET_CRYPTO_hash_from_string (hc->infix, - &tip_id)) + &tip_id.hash)) { /* tip_id has wrong encoding */ GNUNET_break_op (0); diff --git a/src/backend/taler-merchant-httpd_get-tips-ID.h b/src/backend/taler-merchant-httpd_get-tips-ID.h index 725d305c..bd50da6f 100644 --- a/src/backend/taler-merchant-httpd_get-tips-ID.h +++ b/src/backend/taler-merchant-httpd_get-tips-ID.h @@ -34,7 +34,7 @@ */ char * TMH_make_taler_tip_uri (struct MHD_Connection *con, - const struct GNUNET_HashCode *tip_id, + const struct TALER_TipIdentifierP *tip_id, const char *instance_id); /** @@ -48,7 +48,7 @@ TMH_make_taler_tip_uri (struct MHD_Connection *con, */ char * TMH_make_tip_status_url (struct MHD_Connection *con, - const struct GNUNET_HashCode *tip_id, + const struct TALER_TipIdentifierP *tip_id, const char *instance_id); /** diff --git a/src/backend/taler-merchant-httpd_post-tips-ID-pickup.c b/src/backend/taler-merchant-httpd_post-tips-ID-pickup.c index c60ba021..03b232d4 100644 --- a/src/backend/taler-merchant-httpd_post-tips-ID-pickup.c +++ b/src/backend/taler-merchant-httpd_post-tips-ID-pickup.c @@ -144,13 +144,13 @@ struct PickupContext /** * Which tip is being picked up? */ - struct GNUNET_HashCode tip_id; + struct TALER_TipIdentifierP tip_id; /** * What is the ID of the pickup operation? (Basically a * hash over the key inputs). */ - struct GNUNET_HashCode pickup_id; + struct TALER_PickupIdentifierP pickup_id; /** * Array of our planchets. @@ -636,7 +636,7 @@ TMH_post_tips_ID_pickup (const struct TMH_RequestHandler *rh, GNUNET_assert (NULL != hc->infix); if (GNUNET_OK != GNUNET_CRYPTO_hash_from_string (hc->infix, - &pc->tip_id)) + &pc->tip_id.hash)) { /* tip_id has wrong encoding */ GNUNET_break_op (0); @@ -722,7 +722,7 @@ TMH_post_tips_ID_pickup (const struct TMH_RequestHandler *rh, pd->coin_ev_size); } GNUNET_CRYPTO_hash_context_finish (hc, - &pc->pickup_id); + &pc->pickup_id.hash); } } @@ -804,7 +804,7 @@ RETRY: sigs); GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Lookup pickup `%s' resulted in %d\n", - GNUNET_h2s (&pc->pickup_id), + GNUNET_h2s (&pc->pickup_id.hash), qs); if (qs > GNUNET_DB_STATUS_SUCCESS_ONE_RESULT) qs = GNUNET_DB_STATUS_SUCCESS_ONE_RESULT; @@ -830,7 +830,7 @@ RETRY: } GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Lookup pickup `%s' initiated withdraw #%u\n", - GNUNET_h2s (&pc->pickup_id), + GNUNET_h2s (&pc->pickup_id.hash), i); try_withdraw (pc, exchange_url, diff --git a/src/backend/taler-merchant-httpd_private-get-tips-ID.c b/src/backend/taler-merchant-httpd_private-get-tips-ID.c index 0460b3c7..9b2e0de2 100644 --- a/src/backend/taler-merchant-httpd_private-get-tips-ID.c +++ b/src/backend/taler-merchant-httpd_private-get-tips-ID.c @@ -33,7 +33,7 @@ TMH_private_get_tips_ID (const struct TMH_RequestHandler *rh, struct MHD_Connection *connection, struct TMH_HandlerContext *hc) { - struct GNUNET_HashCode tip_id; + struct TALER_TipIdentifierP tip_id; struct TALER_Amount total_authorized; struct TALER_Amount total_picked_up; char *reason; @@ -48,7 +48,7 @@ TMH_private_get_tips_ID (const struct TMH_RequestHandler *rh, GNUNET_assert (NULL != hc->infix); if (GNUNET_OK != GNUNET_CRYPTO_hash_from_string (hc->infix, - &tip_id)) + &tip_id.hash)) { /* tip_id has wrong encoding */ GNUNET_break_op (0); diff --git a/src/backend/taler-merchant-httpd_private-get-tips.c b/src/backend/taler-merchant-httpd_private-get-tips.c index e222daae..4f358be2 100644 --- a/src/backend/taler-merchant-httpd_private-get-tips.c +++ b/src/backend/taler-merchant-httpd_private-get-tips.c @@ -33,7 +33,7 @@ static void add_tip (void *cls, uint64_t row_id, - struct GNUNET_HashCode tip_id, + struct TALER_TipIdentifierP tip_id, struct TALER_Amount amount) { json_t *pa = cls; diff --git a/src/backend/taler-merchant-httpd_private-post-reserves-ID-authorize-tip.c b/src/backend/taler-merchant-httpd_private-post-reserves-ID-authorize-tip.c index 1b69fa21..0072007d 100644 --- a/src/backend/taler-merchant-httpd_private-post-reserves-ID-authorize-tip.c +++ b/src/backend/taler-merchant-httpd_private-post-reserves-ID-authorize-tip.c @@ -45,7 +45,7 @@ authorize_tip (const struct TMH_RequestHandler *rh, { enum TALER_ErrorCode ec; struct GNUNET_TIME_Timestamp expiration; - struct GNUNET_HashCode tip_id; + struct TALER_TipIdentifierP tip_id; const char *justification; const char *next_url; struct TALER_Amount amount; @@ -119,7 +119,7 @@ authorize_tip (const struct TMH_RequestHandler *rh, struct GNUNET_CRYPTO_HashAsciiEncoded hash_enc; MHD_RESULT res; - GNUNET_CRYPTO_hash_to_enc (&tip_id, + GNUNET_CRYPTO_hash_to_enc (&tip_id.hash, &hash_enc); taler_tip_uri = TMH_make_taler_tip_uri (connection, &tip_id, |