commit 1e5a506bacdec7a2fe972aaa476a3bb53d965dc7
parent cdebedf64b2b11f97ef72058a51852254ad1612f
Author: bohdan-potuzhnyi <bohdan.potuzhnyi@gmail.com>
Date: Tue, 24 Jun 2025 10:03:46 +0200
h_issue bag fix, still some subtests fails
Diffstat:
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/lib/taler_merchant_pay_service.c b/src/lib/taler_merchant_pay_service.c
@@ -421,6 +421,7 @@ TALER_MERCHANT_order_pay_cancel1 (struct TALER_MERCHANT_OrderPayHandle *ph)
GNUNET_CURL_job_cancel (ph->job);
TALER_curl_easy_post_finished (&ph->post_ctx);
json_decref (ph->body);
+ if (ph->tokens_evs) json_decref (ph->tokens_evs);
if (ph->wallet_data) json_decref (ph->wallet_data);
GNUNET_free (ph->url);
GNUNET_free (ph->merchant_url);
@@ -679,7 +680,7 @@ TALER_MERCHANT_order_pay_start (struct TALER_MERCHANT_OrderPayHandle *ph)
&fee,
&ph->h_wire,
&ph->h_contract_terms,
- (NULL != &ph->wallet_data)
+ (NULL != ph->wallet_data)
? &ph->wallet_data_hash
: NULL,
c->h_age_commitment,
@@ -703,7 +704,7 @@ TALER_MERCHANT_order_pay_start (struct TALER_MERCHANT_OrderPayHandle *ph)
json_t *je = GNUNET_JSON_PACK(TALER_JSON_pack_amount("contribution", &pc.amount_with_fee),
GNUNET_JSON_pack_data_auto("coin_pub", &pc.coin_pub),
GNUNET_JSON_pack_string("exchange_url", pc.exchange_url),
- GNUNET_JSON_pack_data_auto("h_denom", &h_denom),
+ GNUNET_JSON_pack_data_auto("h_denom", &h_denom_pub),
TALER_JSON_pack_denom_sig("ub_sig", &pc.denom_sig),
GNUNET_JSON_pack_data_auto("coin_sig", &pc.coin_sig));
json_array_append_new(arr, je);
@@ -749,14 +750,21 @@ TALER_MERCHANT_order_pay_start (struct TALER_MERCHANT_OrderPayHandle *ph)
if (ph->input_tokens.num_tokens > 0) {
struct TALER_MERCHANT_UsedToken ut[ph->input_tokens.num_tokens];
for (unsigned i = 0; i < ph->input_tokens.num_tokens; i++) {
+
const struct TALER_MERCHANT_UseToken *in = &ph->input_tokens.tokens[i];
struct TALER_MERCHANT_UsedToken *t = &ut[i];
+
TALER_wallet_token_use_sign (&ph->h_contract_terms,
&ph->wallet_data_hash,
&in->token_priv,
&t->token_sig);
+
t->ub_sig = in->ub_sig;
t->issue_pub = in->issue_pub;
+
+ // Seems like we miss this function
+ //
+ //WHY can't we iliminate the second loop, makes no sense to keep it...
}
json_t *arr = json_array ();
@@ -765,7 +773,8 @@ TALER_MERCHANT_order_pay_start (struct TALER_MERCHANT_OrderPayHandle *ph)
json_t *je = GNUNET_JSON_PACK (
GNUNET_JSON_pack_data_auto ("token_sig", &t->token_sig),
GNUNET_JSON_pack_data_auto ("ub_sig", &t->ub_sig),
- //TODO: We are missing the h_issue here
+ GNUNET_JSON_pack_data_auto ("h_issue",
+ &t->issue_pub.public_key->pub_key_hash),
GNUNET_JSON_pack_data_auto ("issue_pub", &t->issue_pub)
);
json_array_append_new (arr, je);