From 15e8697ece7d1b32e4f1d8377dfb6afc38898a21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= Date: Fri, 14 Oct 2022 19:00:57 +0200 Subject: [PATCH] -added missing files to last commit --- src/exchange/taler-exchange-httpd.c | 1 + .../taler-exchange-httpd_batch-deposit.c | 6 +- .../taler-exchange-httpd_extensions.c | 2 +- src/exchangedb/test_exchangedb.c | 2 +- src/include/taler_extensions_policy.h | 113 +++++++++--------- 5 files changed, 63 insertions(+), 61 deletions(-) diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c index 1cbaee969..d7b59cc96 100644 --- a/src/exchange/taler-exchange-httpd.c +++ b/src/exchange/taler-exchange-httpd.c @@ -1041,6 +1041,7 @@ handle_post_auditors (struct TEH_RequestContext *rc, root); } + /** * Handle incoming HTTP request. * diff --git a/src/exchange/taler-exchange-httpd_batch-deposit.c b/src/exchange/taler-exchange-httpd_batch-deposit.c index 14267e2af..6393ff973 100644 --- a/src/exchange/taler-exchange-httpd_batch-deposit.c +++ b/src/exchange/taler-exchange-httpd_batch-deposit.c @@ -272,8 +272,10 @@ batch_deposit_transaction (void *cls, qs = TEH_plugin->persist_policy_details (TEH_plugin->cls, &dc->policy_details, &dc->policy_details_serial_id, - &dc->policy_details.accumulated_total, - &dc->policy_details.fulfillment_state); + &dc->policy_details. + accumulated_total, + &dc->policy_details. + fulfillment_state); if (qs < 0) return qs; } diff --git a/src/exchange/taler-exchange-httpd_extensions.c b/src/exchange/taler-exchange-httpd_extensions.c index 8e8f0e019..2b6e703c0 100644 --- a/src/exchange/taler-exchange-httpd_extensions.c +++ b/src/exchange/taler-exchange-httpd_extensions.c @@ -373,7 +373,7 @@ TEH_extensions_post_handler ( .proof = root, .timestamp = GNUNET_TIME_timestamp_get (), .details = policy_details, - .details_count = policy_details_count + .details_count = policy_details_count }; if (GNUNET_OK != diff --git a/src/exchangedb/test_exchangedb.c b/src/exchangedb/test_exchangedb.c index e0ad23b24..9dc4a5b00 100644 --- a/src/exchangedb/test_exchangedb.c +++ b/src/exchangedb/test_exchangedb.c @@ -1500,7 +1500,7 @@ run (void *cls) &deposit, known_coin_id, &h_payto, - NULL, /* no policy_details_serial_id */ + NULL, /* no policy_details_serial_id */ &deposit_timestamp, &balance_ok, &in_conflict)); diff --git a/src/include/taler_extensions_policy.h b/src/include/taler_extensions_policy.h index cd75f2d4d..4e92d37d3 100644 --- a/src/include/taler_extensions_policy.h +++ b/src/include/taler_extensions_policy.h @@ -61,57 +61,57 @@ TALER_policy_fulfillment_state_str (enum TALER_PolicyFulfillmentState state); /* @brief Details of a policy for a deposit request */ struct TALER_PolicyDetails { - /* Hash code that should be used for the .policy_hash_code field when - * this policy is saved in the policy_details table. */ - struct GNUNET_HashCode hash_code; + /* Hash code that should be used for the .policy_hash_code field when + * this policy is saved in the policy_details table. */ + struct GNUNET_HashCode hash_code; - /* Content of the policy in its original JSON form */ - const json_t *policy_json; + /* Content of the policy in its original JSON form */ + const json_t *policy_json; - /* When the deadline is meat and the policy is still in "Ready" state, - * a timeout-handler will transfer the amount - * (total_amount - policy_fee - refreshable_amount) - * to the payto-URI from the corresponding deposit. The value - * amount_refreshable will be refreshable by the owner of the - * associated deposits's coins */ - struct GNUNET_TIME_Timestamp deadline; + /* When the deadline is meat and the policy is still in "Ready" state, + * a timeout-handler will transfer the amount + * (total_amount - policy_fee - refreshable_amount) + * to the payto-URI from the corresponding deposit. The value + * amount_refreshable will be refreshable by the owner of the + * associated deposits's coins */ + struct GNUNET_TIME_Timestamp deadline; - /* The amount to which this policy commits to. It must be at least as - * large as @e policy_fee. */ - struct TALER_Amount commitment; + /* The amount to which this policy commits to. It must be at least as + * large as @e policy_fee. */ + struct TALER_Amount commitment; - /* The total sum of contributions from coins so far to fund this - * policy. It must be at least as large as @commitment in order to be - * sufficiently funded. */ - struct TALER_Amount accumulated_total; + /* The total sum of contributions from coins so far to fund this + * policy. It must be at least as large as @commitment in order to be + * sufficiently funded. */ + struct TALER_Amount accumulated_total; - /* The fee from the exchange for handling the policy. It is due when - * the state changes to Timeout or Success. */ - struct TALER_Amount policy_fee; + /* The fee from the exchange for handling the policy. It is due when + * the state changes to Timeout or Success. */ + struct TALER_Amount policy_fee; - /* The amount that will be transfered to the payto-URIs from the - * corresponding deposits when the fulfillment state changes to Timeout - * or Success. Note that a fulfillment handler can alter this upon - * arrival of a proof of fulfillment. The remaining amount - * (accumulated_amount - policy_amount - transferable_amount) */ - struct TALER_Amount transferable_amount; + /* The amount that will be transfered to the payto-URIs from the + * corresponding deposits when the fulfillment state changes to Timeout + * or Success. Note that a fulfillment handler can alter this upon + * arrival of a proof of fulfillment. The remaining amount + * (accumulated_amount - policy_amount - transferable_amount) */ + struct TALER_Amount transferable_amount; - /* The state of fulfillment of a policy. - * - If the state is Insufficient, the client is required to call - * /deposit -maybe multiple times- with enough coins and the same - * policy details in order to reach the required amount. The state is - * then changed to Ready. - * - If the state changes to Timeout or Success, a handler will transfer - * the amount (total_amount - policy_fee - refreshable_amount) to the - * payto-URI from the corresponding deposit. The value - * amount_refreshable will be refreshable by the owner of the - * associated deposits's coins. */ - enum TALER_PolicyFulfillmentState fulfillment_state; + /* The state of fulfillment of a policy. + * - If the state is Insufficient, the client is required to call + * /deposit -maybe multiple times- with enough coins and the same + * policy details in order to reach the required amount. The state is + * then changed to Ready. + * - If the state changes to Timeout or Success, a handler will transfer + * the amount (total_amount - policy_fee - refreshable_amount) to the + * payto-URI from the corresponding deposit. The value + * amount_refreshable will be refreshable by the owner of the + * associated deposits's coins. */ + enum TALER_PolicyFulfillmentState fulfillment_state; - /* If there is a proof of fulfillment, the row ID from the - * policy_fulfillment table */ - uint64_t policy_fulfillment_id; - bool no_policy_fulfillment_id; + /* If there is a proof of fulfillment, the row ID from the + * policy_fulfillment table */ + uint64_t policy_fulfillment_id; + bool no_policy_fulfillment_id; }; /* @@ -120,27 +120,26 @@ struct TALER_PolicyDetails */ struct TALER_PolicyFulfillmentTransactionData { - /* The incoming proof, provided by a client */ - const json_t *proof; + /* The incoming proof, provided by a client */ + const json_t *proof; - /* The Hash of the proof */ - struct GNUNET_HashCode h_proof; + /* The Hash of the proof */ + struct GNUNET_HashCode h_proof; - /* The timestamp of retrieval of the proof */ - struct GNUNET_TIME_Timestamp timestamp; + /* The timestamp of retrieval of the proof */ + struct GNUNET_TIME_Timestamp timestamp; - /* The ID of the proof in the policy_fulfillment table. Will be set - * during the transaction. Needed to fill the table - * policy_details_fulfillments. */ - uint64_t fulfillment_id; + /* The ID of the proof in the policy_fulfillment table. Will be set + * during the transaction. Needed to fill the table + * policy_details_fulfillments. */ + uint64_t fulfillment_id; - /* The list of policy details. Will be updated by the policy handler */ - struct TALER_PolicyDetails *details; - size_t details_count; + /* The list of policy details. Will be updated by the policy handler */ + struct TALER_PolicyDetails *details; + size_t details_count; }; - /* * @brief Extracts policy details from the deposit's policy options and the policy extensions *