diff options
author | Cedric Zwahlen <cedric.zwahlen@students.bfh.ch> | 2024-05-04 23:39:12 +0200 |
---|---|---|
committer | Cedric Zwahlen <cedric.zwahlen@students.bfh.ch> | 2024-05-04 23:39:12 +0200 |
commit | ce23b10249ca6b7df8e0c9b8e952232a2801c24e (patch) | |
tree | d3c61079eec77e02f0ce874be74beb2396636fef | |
parent | 028e8d833015855870d006462f9a812f78beaafc (diff) | |
download | exchange-ce23b10249ca6b7df8e0c9b8e952232a2801c24e.tar.gz exchange-ce23b10249ca6b7df8e0c9b8e952232a2801c24e.tar.bz2 exchange-ce23b10249ca6b7df8e0c9b8e952232a2801c24e.zip |
Fix bugs
-rw-r--r-- | src/auditor/taler-auditor-httpd_deposit-confirmation-get.c | 47 | ||||
-rw-r--r-- | src/auditordb/pg_get_balances.c | 4 | ||||
-rw-r--r-- | src/auditordb/pg_insert_deposit_confirmation.c | 2 |
3 files changed, 50 insertions, 3 deletions
diff --git a/src/auditor/taler-auditor-httpd_deposit-confirmation-get.c b/src/auditor/taler-auditor-httpd_deposit-confirmation-get.c index bc47af579..59b8ecfda 100644 --- a/src/auditor/taler-auditor-httpd_deposit-confirmation-get.c +++ b/src/auditor/taler-auditor-httpd_deposit-confirmation-get.c @@ -48,9 +48,52 @@ add_deposit_confirmation (void *cls, json_t *list = cls;
json_t *obj;
+ json_t *coin_pubs_json = json_array ();
+ json_t *coin_sigs_json = json_array ();
+
+ for (int i = 0; dc->num_coins > i; i++)
+ {
+
+ int sz_pub = sizeof(dc->coin_pubs[0]) * 9;
+ char *o_pub = malloc (sz_pub);
+ GNUNET_STRINGS_data_to_string (&dc->coin_pubs[i], sizeof(dc->coin_pubs[0]),
+ o_pub, sz_pub);
+ json_t *pub = json_string (o_pub);
+ json_array_append_new (coin_pubs_json, pub);
+ free (o_pub);
+
+
+ int sz_sig = sizeof(dc->coin_sigs[0]) * 9;
+ char *o_sig = malloc (sz_sig);
+ GNUNET_STRINGS_data_to_string (&dc->coin_sigs[i], sizeof(dc->coin_sigs[0]),
+ o_sig, sz_sig);
+ json_t *sig = json_string (o_sig);
+ json_array_append_new (coin_sigs_json, sig);
+ free (o_sig);
+
+ }
+
obj = GNUNET_JSON_PACK (
- GNUNET_JSON_pack_data_auto ("dc",
- dc));
+
+ GNUNET_JSON_pack_int64 ("deposit_confirmation_serial_id", serial_id),
+ GNUNET_JSON_pack_data_auto ("h_contract_terms", &dc->h_contract_terms),
+ GNUNET_JSON_pack_data_auto ("h_policy", &dc->h_policy),
+ GNUNET_JSON_pack_data_auto ("h_wire", &dc->h_wire),
+ GNUNET_JSON_pack_int64 ("exchange_timestamp", &dc->exchange_timestamp),
+ GNUNET_JSON_pack_int64 ("refund_deadline", &dc->refund_deadline),
+ GNUNET_JSON_pack_int64 ("wire_deadline", &dc->wire_deadline),
+ TALER_JSON_pack_amount ("total_without_fee", &dc->total_without_fee),
+
+ GNUNET_JSON_pack_array_steal ("coin_pubs", coin_pubs_json),
+ GNUNET_JSON_pack_array_steal ("coin_sigs", coin_sigs_json),
+
+ GNUNET_JSON_pack_data_auto ("merchant_pub", &dc->merchant),
+ GNUNET_JSON_pack_data_auto ("exchange_sig", &dc->exchange_sig),
+ GNUNET_JSON_pack_data_auto ("exchange_pub", &dc->exchange_pub),
+ GNUNET_JSON_pack_data_auto ("master_sig", &dc->master_sig)
+
+ );
+
GNUNET_break (0 ==
json_array_append_new (list,
obj));
diff --git a/src/auditordb/pg_get_balances.c b/src/auditordb/pg_get_balances.c index ae1e484f4..717114254 100644 --- a/src/auditordb/pg_get_balances.c +++ b/src/auditordb/pg_get_balances.c @@ -70,6 +70,10 @@ balances_cb (void *cls, { uint64_t serial_id; + enum TALER_DbEventType ev; + + ev = TALER_DBEVENT_AUDITOR_NEW_PROGRESS; + struct TALER_AUDITORDB_Balances dc; struct GNUNET_PQ_ResultSpec rs[] = { diff --git a/src/auditordb/pg_insert_deposit_confirmation.c b/src/auditordb/pg_insert_deposit_confirmation.c index 1b5205782..dbca04fe1 100644 --- a/src/auditordb/pg_insert_deposit_confirmation.c +++ b/src/auditordb/pg_insert_deposit_confirmation.c @@ -56,7 +56,7 @@ TAH_PG_insert_deposit_confirmation ( PREPARE (pg, "auditor_deposit_confirmation_insert", - "INSERT INTO deposit_confirmations " + "INSERT INTO auditor_deposit_confirmations " "(h_contract_terms" ",h_policy" ",h_wire" |