From 70035b1683e70cd09bbb43d7736139a72fed0b5a Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 6 Dec 2023 19:16:05 +0900 Subject: expand fakebank /config to return currency spec and other new fields --- src/bank-lib/fakebank_tbi.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'src') diff --git a/src/bank-lib/fakebank_tbi.c b/src/bank-lib/fakebank_tbi.c index 27b930d9f..95e3a8c2e 100644 --- a/src/bank-lib/fakebank_tbi.c +++ b/src/bank-lib/fakebank_tbi.c @@ -49,6 +49,11 @@ TALER_FAKEBANK_tbi_main_ (struct TALER_FAKEBANK_Handle *h, (0 == strcasecmp (method, MHD_HTTP_METHOD_GET)) ) { + struct TALER_Amount zero; + + GNUNET_assert (GNUNET_OK == + TALER_amount_set_zero (h->currency, + &zero)); return TALER_MHD_REPLY_JSON_PACK ( connection, MHD_HTTP_OK, @@ -56,6 +61,40 @@ TALER_FAKEBANK_tbi_main_ (struct TALER_FAKEBANK_Handle *h, "0:0:0"), GNUNET_JSON_pack_string ("currency", h->currency), + GNUNET_JSON_pack_bool ("allow_conversion", + false), + GNUNET_JSON_pack_bool ("allow_registrations", + true), + GNUNET_JSON_pack_bool ("allow_deletions", + false), + GNUNET_JSON_pack_bool ("allow_edit_name", + false), + GNUNET_JSON_pack_bool ("allow_edit_cashout_payto_uri", + false), + TALER_JSON_pack_amount ("default_debit_threshold", + &zero), + GNUNET_JSON_pack_array_steal ("supported_tan_channels", + json_array ()), + GNUNET_JSON_pack_object_steal ( + "currency_specification", + GNUNET_JSON_PACK ( + GNUNET_JSON_pack_string ("name", + h->currency), + GNUNET_JSON_pack_string ("currency", + h->currency), + GNUNET_JSON_pack_uint64 ("num_fractional_input_digits", + 2), + GNUNET_JSON_pack_uint64 ("num_fractional_normal_digits", + 2), + GNUNET_JSON_pack_uint64 ("num_fractional_trailing_zero_digits", + 2), + GNUNET_JSON_pack_object_steal ( + "alt_unit_names", + GNUNET_JSON_PACK ( + GNUNET_JSON_pack_string ("0", + h->currency))), + GNUNET_JSON_pack_string ("name", + h->currency))), GNUNET_JSON_pack_string ("name", "taler-bank-integration")); } -- cgit v1.2.3 From 381c5efb612e5393bb5a4e85420de8096b95a6e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= Date: Wed, 6 Dec 2023 12:37:51 +0100 Subject: [policy extensions] mark out work for #7999+#8001 --- src/exchange/taler-exchange-httpd_extensions.c | 44 ++++++++++++++++++++++-- src/exchangedb/pg_add_policy_fulfillment_proof.c | 10 ++++-- 2 files changed, 49 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/exchange/taler-exchange-httpd_extensions.c b/src/exchange/taler-exchange-httpd_extensions.c index dd0fada76..d62a618ae 100644 --- a/src/exchange/taler-exchange-httpd_extensions.c +++ b/src/exchange/taler-exchange-httpd_extensions.c @@ -23,6 +23,7 @@ #include "taler-exchange-httpd_keys.h" #include "taler-exchange-httpd_responses.h" #include "taler-exchange-httpd_extensions.h" +#include "taler_extensions_policy.h" #include "taler_json_lib.h" #include "taler_mhd_lib.h" #include "taler_extensions.h" @@ -256,11 +257,16 @@ policy_fulfillment_transaction ( { struct TALER_PolicyFulfillmentTransactionData *fulfillment = cls; + /* FIXME[oec]: use connection and mhd_ret? */ + (void) connection; + (void) mhd_ret; + return TEH_plugin->add_policy_fulfillment_proof (TEH_plugin->cls, fulfillment); } +/* FIXME[oec]-#7999: In this handler: do we transition correctly between states? */ MHD_RESULT TEH_extensions_post_handler ( struct TEH_RequestContext *rc, @@ -338,14 +344,48 @@ TEH_extensions_post_handler ( qs = TEH_plugin->get_policy_details (TEH_plugin->cls, &hcs[idx], &policy_details[idx]); - if (qs < 0) + if (0 > qs) + { + GNUNET_free (hcs); + GNUNET_free (policy_details); + return TALER_MHD_reply_with_error (rc->connection, + MHD_HTTP_BAD_REQUEST, + TALER_EC_EXCHANGE_GENERIC_OPERATION_UNKNOWN, + "a policy_hash_code couldn't be found"); + } + + /* We proceed according to the state of fulfillment */ + switch (policy_details[idx].fulfillment_state) { - error_msg = "a policy_hash_code couldn't be found"; + case TALER_PolicyFulfillmentReady: + break; + case TALER_PolicyFulfillmentInsufficient: + error_msg = "a policy is not yet fully funded"; + ret = GNUNET_SYSERR; + break; + case TALER_PolicyFulfillmentTimeout: + error_msg = "a policy is has already timed out"; + ret = GNUNET_SYSERR; break; + case TALER_PolicyFulfillmentSuccess: + /* FIXME[oec]-#8001: Idempotency handling. */ + GNUNET_break (0); + break; + case TALER_PolicyFulfillmentFailure: + /* FIXME[oec]-#7999: What to do in the failure case? */ + GNUNET_break (0); + break; + default: + /* Unknown state */ + GNUNET_assert (0); } + + if (GNUNET_OK != ret) + break; } GNUNET_free (hcs); + if (GNUNET_OK != ret) { GNUNET_free (policy_details); diff --git a/src/exchangedb/pg_add_policy_fulfillment_proof.c b/src/exchangedb/pg_add_policy_fulfillment_proof.c index 0fd6b1c92..93d070712 100644 --- a/src/exchangedb/pg_add_policy_fulfillment_proof.c +++ b/src/exchangedb/pg_add_policy_fulfillment_proof.c @@ -55,6 +55,7 @@ TEH_PG_add_policy_fulfillment_proof ( enum GNUNET_DB_QueryStatus qs; struct PostgresClosure *pg = cls; size_t count = fulfillment->details_count; + /* FIXME: this seems to be prone to VLA attacks */ struct GNUNET_HashCode hcs[count]; /* Create the sorted policy_hash_codes */ @@ -84,8 +85,7 @@ TEH_PG_add_policy_fulfillment_proof ( GNUNET_PQ_query_param_timestamp (&fulfillment->timestamp), TALER_PQ_query_param_json (fulfillment->proof), GNUNET_PQ_query_param_auto_from_type (&fulfillment->h_proof), - GNUNET_PQ_query_param_fixed_size (hcs, - count * sizeof(struct GNUNET_HashCode)), + TALER_PQ_query_param_array_hash_code (count, hcs, pg->conn), GNUNET_PQ_query_param_end }; struct GNUNET_PQ_ResultSpec rs[] = { @@ -132,7 +132,6 @@ TEH_PG_add_policy_fulfillment_proof ( GNUNET_PQ_query_param_end }; - // FIXME-Oec: review if this is the intended logic here! PREPARE (pg, "update_policy_details", "UPDATE policy_details SET" @@ -151,5 +150,10 @@ TEH_PG_add_policy_fulfillment_proof ( } } + /* + * FIXME[oec]-#7999: When all policies of a deposit are fulfilled, + * unblock it and trigger a wire-transfer. + */ + return qs; } -- cgit v1.2.3 From 423fa3cc9bd45de2cad0d0919aecf3df6a614a58 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 7 Dec 2023 22:37:28 +0900 Subject: -fix linker issues --- src/kyclogic/Makefile.am | 1 + src/lib/Makefile.am | 1 + src/util/Makefile.am | 1 + 3 files changed, 3 insertions(+) (limited to 'src') diff --git a/src/kyclogic/Makefile.am b/src/kyclogic/Makefile.am index d43d4a6c1..fae865bad 100644 --- a/src/kyclogic/Makefile.am +++ b/src/kyclogic/Makefile.am @@ -78,6 +78,7 @@ libtaler_plugin_kyclogic_template_la_LIBADD = \ $(LTLIBINTL) libtaler_plugin_kyclogic_template_la_LDFLAGS = \ $(TALER_PLUGIN_LDFLAGS) \ + -lgnunetcurl \ -lgnunetutil \ $(XLIB) diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index 230dfba21..1291fd3a4 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -87,6 +87,7 @@ libtalerexchange_la_LIBADD = \ -lgnunetjson \ -lgnunetutil \ -ljansson \ + -lm \ $(LIBGNURLCURL_LIBS) \ $(XLIB) diff --git a/src/util/Makefile.am b/src/util/Makefile.am index 4ebd6397c..2a0304e03 100644 --- a/src/util/Makefile.am +++ b/src/util/Makefile.am @@ -115,6 +115,7 @@ libtalerutil_la_LIBADD = \ -ljansson \ $(LIBGCRYPT_LIBS) \ -lmicrohttpd $(XLIB) \ + -lunistring \ -lz \ -lm -- cgit v1.2.3 From fb84cf969877d5b23d831b30cbaac5ddfa7d3017 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 7 Dec 2023 22:45:20 +0900 Subject: -fix potential uninitialized variable in fakebank logic --- src/bank-lib/fakebank_tbr_get_history.c | 2 ++ src/bank-lib/fakebank_twg_history.c | 4 ++++ 2 files changed, 6 insertions(+) (limited to 'src') diff --git a/src/bank-lib/fakebank_tbr_get_history.c b/src/bank-lib/fakebank_tbr_get_history.c index e81e00894..79678636a 100644 --- a/src/bank-lib/fakebank_tbr_get_history.c +++ b/src/bank-lib/fakebank_tbr_get_history.c @@ -149,6 +149,7 @@ TALER_FAKEBANK_tbr_get_history_incoming ( if (GNUNET_TIME_relative_is_zero (hc->ha.lp_timeout) && (0 < hc->ha.delta)) { + acc_payto_uri = hc->acc->payto_uri; GNUNET_assert (0 == pthread_mutex_unlock (&h->big_lock)); if (overflow) @@ -160,6 +161,7 @@ TALER_FAKEBANK_tbr_get_history_incoming ( } if (h->in_shutdown) { + acc_payto_uri = hc->acc->payto_uri; GNUNET_assert (0 == pthread_mutex_unlock (&h->big_lock)); goto finish; diff --git a/src/bank-lib/fakebank_twg_history.c b/src/bank-lib/fakebank_twg_history.c index 1d70ed127..35cc6587f 100644 --- a/src/bank-lib/fakebank_twg_history.c +++ b/src/bank-lib/fakebank_twg_history.c @@ -147,6 +147,7 @@ TALER_FAKEBANK_twg_get_debit_history_ ( if ( (GNUNET_TIME_relative_is_zero (hc->ha.lp_timeout)) && (0 < hc->ha.delta)) { + acc_payto_uri = hc->acc->payto_uri; GNUNET_assert (0 == pthread_mutex_unlock (&h->big_lock)); if (overflow) @@ -160,6 +161,7 @@ TALER_FAKEBANK_twg_get_debit_history_ ( } if (h->in_shutdown) { + acc_payto_uri = hc->acc->payto_uri; GNUNET_assert (0 == pthread_mutex_unlock (&h->big_lock)); goto finish; @@ -400,6 +402,7 @@ TALER_FAKEBANK_twg_get_credit_history_ ( if (GNUNET_TIME_relative_is_zero (hc->ha.lp_timeout) && (0 < hc->ha.delta)) { + acc_payto_uri = hc->acc->payto_uri; GNUNET_assert (0 == pthread_mutex_unlock (&h->big_lock)); if (overflow) @@ -411,6 +414,7 @@ TALER_FAKEBANK_twg_get_credit_history_ ( } if (h->in_shutdown) { + acc_payto_uri = hc->acc->payto_uri; GNUNET_assert (0 == pthread_mutex_unlock (&h->big_lock)); goto finish; -- cgit v1.2.3 From 5c21cd8d9d9512365334eaf8ea7a5e3dc0f2cbb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= Date: Sat, 9 Dec 2023 12:47:04 +0100 Subject: use local variable as accumulator in batch-deposit --- src/exchange/taler-exchange-httpd_batch-deposit.c | 50 +++++++++++++++-------- src/util/exchange_signatures.c | 3 +- 2 files changed, 36 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/exchange/taler-exchange-httpd_batch-deposit.c b/src/exchange/taler-exchange-httpd_batch-deposit.c index 9f66a99a4..835a974fc 100644 --- a/src/exchange/taler-exchange-httpd_batch-deposit.c +++ b/src/exchange/taler-exchange-httpd_batch-deposit.c @@ -60,16 +60,24 @@ struct BatchDepositContext */ struct TALER_EXCHANGEDB_BatchDeposit bd; + /** - * Additional details for policy extension relevant for this - * deposit operation, possibly NULL! + * Total amount that is accumulated with this deposit, + * without fee. */ - json_t *policy_json; + struct TALER_Amount accumulated_total_without_fee; /** - * Hash over the merchant's payto://-URI with the wire salt. + * True, if no policy was present in the request. Then + * @e policy_json is NULL and @e h_policy will be all zero. */ - struct TALER_MerchantWireHashP h_wire; + bool has_no_policy; + + /** + * Additional details for policy extension relevant for this + * deposit operation, possibly NULL! + */ + json_t *policy_json; /** * If @e policy_json was present, the corresponding policy extension @@ -83,6 +91,11 @@ struct BatchDepositContext */ struct TALER_ExtensionPolicyHashP h_policy; + /** + * Hash over the merchant's payto://-URI with the wire salt. + */ + struct TALER_MerchantWireHashP h_wire; + /** * When @e policy_details are persisted, this contains the id of the record * in the policy_details table. @@ -121,11 +134,11 @@ reply_batch_deposit_success ( &TEH_keys_exchange_sign_, &bd->h_contract_terms, &dc->h_wire, - NULL != dc->policy_json ? &dc->h_policy : NULL, + dc->has_no_policy ? NULL : &dc->h_policy, dc->exchange_timestamp, bd->wire_deadline, bd->refund_deadline, - &dc->policy_details.accumulated_total, /* excludes fees */ + &dc->accumulated_total_without_fee, bd->num_cdis, csigs, &dc->bd.merchant_pub, @@ -176,13 +189,13 @@ batch_deposit_transaction (void *cls, /* If the deposit has a policy associated to it, persist it. This will * insert or update the record. */ - if (NULL != dc->policy_json) + if (! dc->has_no_policy) { qs = TEH_plugin->persist_policy_details ( TEH_plugin->cls, &dc->policy_details, &dc->bd.policy_details_serial_id, - &dc->policy_details.accumulated_total, + &dc->accumulated_total_without_fee, &dc->policy_details.fulfillment_state); if (qs < 0) return qs; @@ -237,13 +250,13 @@ batch_deposit_transaction (void *cls, in_conflict ? "in conflict" : "no conflict"); if (in_conflict) { - /* FIXME: #7267 conflicting contract != insufficient funds */ + /* FIXME: #8002 conflicting contract != insufficient funds */ *mhd_ret = TEH_RESPONSE_reply_coin_insufficient_funds ( connection, TALER_EC_EXCHANGE_DEPOSIT_CONFLICTING_CONTRACT, - &bd->cdis[0 /* SEE FIXME-#7267 Oec above! */].coin.denom_pub_hash, - &bd->cdis[0 /* SEE FIXME-#7267 Oec above! */].coin.coin_pub); + &bd->cdis[0 /* SEE FIXME-#8002 Oec above! */].coin.denom_pub_hash, + &bd->cdis[0 /* SEE FIXME-#8002 Oec above! */].coin.coin_pub); return GNUNET_DB_STATUS_HARD_ERROR; } if (! balance_ok) @@ -495,7 +508,7 @@ TEH_handler_batch_deposit (struct TEH_RequestContext *rc, GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_json ("policy", &dc.policy_json), - NULL), + &dc.has_no_policy), GNUNET_JSON_spec_timestamp ("timestamp", &bd->wallet_timestamp), GNUNET_JSON_spec_mark_optional ( @@ -571,8 +584,12 @@ TEH_handler_batch_deposit (struct TEH_RequestContext *rc, &bd->wire_salt, &dc.h_wire); + GNUNET_assert (GNUNET_OK == + TALER_amount_set_zero (TEH_currency, + &dc.accumulated_total_without_fee)); + /* handle policy, if present */ - if (NULL != dc.policy_json) + if (! dc.has_no_policy) { const char *error_hint = NULL; @@ -641,10 +658,11 @@ TEH_handler_batch_deposit (struct TEH_RequestContext *rc, &amount_without_fee, &cdis[i].amount_with_fee, &deposit_fees[i])); + GNUNET_assert (0 <= TALER_amount_add ( - &dc.policy_details.accumulated_total, - &dc.policy_details.accumulated_total, + &dc.accumulated_total_without_fee, + &dc.accumulated_total_without_fee, &amount_without_fee)); } if (GNUNET_OK != res) diff --git a/src/util/exchange_signatures.c b/src/util/exchange_signatures.c index bc5fe439f..aaefb5cec 100644 --- a/src/util/exchange_signatures.c +++ b/src/util/exchange_signatures.c @@ -120,7 +120,8 @@ TALER_exchange_online_deposit_confirmation_sign ( .exchange_timestamp = GNUNET_TIME_timestamp_hton (exchange_timestamp), .wire_deadline = GNUNET_TIME_timestamp_hton (wire_deadline), .refund_deadline = GNUNET_TIME_timestamp_hton (refund_deadline), - .merchant_pub = *merchant_pub + .merchant_pub = *merchant_pub, + .h_policy = {{{0}}} }; struct GNUNET_HashContext *hc; -- cgit v1.2.3 From 9454b655454317cc129eecc61009ffc7c2a9925b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= Date: Sat, 9 Dec 2023 13:57:00 +0100 Subject: [wip, #7267] added correct response for age commitment conflict during deposit --- src/exchange/taler-exchange-httpd_db.c | 11 +++++------ src/exchange/taler-exchange-httpd_responses.c | 22 ++++++++++++++++++++++ src/exchange/taler-exchange-httpd_responses.h | 21 +++++++++++++++++++++ 3 files changed, 48 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/exchange/taler-exchange-httpd_db.c b/src/exchange/taler-exchange-httpd_db.c index 5660074ee..a00a97856 100644 --- a/src/exchange/taler-exchange-httpd_db.c +++ b/src/exchange/taler-exchange-httpd_db.c @@ -37,14 +37,14 @@ TEH_make_coin_known (const struct TALER_CoinPublicInfo *coin, { enum TALER_EXCHANGEDB_CoinKnownStatus cks; struct TALER_DenominationHashP h_denom_pub; - struct TALER_AgeCommitmentHash age_hash; + struct TALER_AgeCommitmentHash h_age_commitment; /* make sure coin is 'known' in database */ cks = TEH_plugin->ensure_coin_known (TEH_plugin->cls, coin, known_coin_id, &h_denom_pub, - &age_hash); + &h_age_commitment); switch (cks) { case TALER_EXCHANGEDB_CKS_ADDED: @@ -70,13 +70,12 @@ TEH_make_coin_known (const struct TALER_CoinPublicInfo *coin, &coin->coin_pub); return GNUNET_DB_STATUS_HARD_ERROR; case TALER_EXCHANGEDB_CKS_AGE_CONFLICT: - /* FIXME: insufficient_funds != Age conflict! See issue #7267, need new - * strategy for evidence gathering */ - *mhd_ret = TEH_RESPONSE_reply_coin_insufficient_funds ( + *mhd_ret = TEH_RESPONSE_reply_coin_age_commitment_conflict ( connection, TALER_EC_EXCHANGE_GENERIC_COIN_CONFLICTING_AGE_HASH, &h_denom_pub, - &coin->coin_pub); + &coin->coin_pub, + &h_age_commitment); return GNUNET_DB_STATUS_HARD_ERROR; } GNUNET_assert (0); diff --git a/src/exchange/taler-exchange-httpd_responses.c b/src/exchange/taler-exchange-httpd_responses.c index 322da3877..c1aa9db6f 100644 --- a/src/exchange/taler-exchange-httpd_responses.c +++ b/src/exchange/taler-exchange-httpd_responses.c @@ -177,6 +177,28 @@ TEH_RESPONSE_reply_coin_insufficient_funds ( } +MHD_RESULT +TEH_RESPONSE_reply_coin_age_commitment_conflict ( + struct MHD_Connection *connection, + enum TALER_ErrorCode ec, + const struct TALER_DenominationHashP *h_denom_pub, + const struct TALER_CoinSpendPublicKeyP *coin_pub, + const struct TALER_AgeCommitmentHash *h_age_commitment_hash) +{ + return TALER_MHD_REPLY_JSON_PACK ( + connection, + TALER_ErrorCode_get_http_status_safe (ec), + TALER_JSON_pack_ec (ec), + GNUNET_JSON_pack_data_auto ("coin_pub", + coin_pub), + GNUNET_JSON_pack_data_auto ("h_denom_pub", + h_denom_pub), + GNUNET_JSON_pack_data_auto ("h_age_commitment_hash", + h_age_commitment_hash) + ); +} + + MHD_RESULT TEH_RESPONSE_reply_reserve_insufficient_balance ( struct MHD_Connection *connection, diff --git a/src/exchange/taler-exchange-httpd_responses.h b/src/exchange/taler-exchange-httpd_responses.h index 8adf1136b..5fe106e17 100644 --- a/src/exchange/taler-exchange-httpd_responses.h +++ b/src/exchange/taler-exchange-httpd_responses.h @@ -159,6 +159,27 @@ TEH_RESPONSE_reply_coin_insufficient_funds ( const struct TALER_DenominationHashP *h_denom_pub, const struct TALER_CoinSpendPublicKeyP *coin_pub); +/** + * Send proof that a request is invalid to client because of + * a conflicting value for the age commitment hash of a coin. + * This function will create a message with the conflicting + * hash value for the age commitment of the given coin. + * + * @param connection connection to the client + * @param ec error code to return + * @param h_denom_pub hash of the denomination of the coin + * @param coin_pub public key of the coin + * @param h_age_commitment hash of the age commitment as found in the database + * @return MHD result code + */ +MHD_RESULT +TEH_RESPONSE_reply_coin_age_commitment_conflict ( + struct MHD_Connection *connection, + enum TALER_ErrorCode ec, + const struct TALER_DenominationHashP *h_denom_pub, + const struct TALER_CoinSpendPublicKeyP *coin_pub, + const struct TALER_AgeCommitmentHash *h_age_commitment); + /** * Fundamental details about a purse. */ -- cgit v1.2.3 From cfb64f939df1a3ee24d03fe9d7fcc60d9772ed42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= Date: Sat, 9 Dec 2023 13:57:23 +0100 Subject: mark out #8002 --- src/exchangedb/exchange_do_deposit.sql | 1 + src/exchangedb/pg_do_deposit.c | 1 + 2 files changed, 2 insertions(+) (limited to 'src') diff --git a/src/exchangedb/exchange_do_deposit.sql b/src/exchangedb/exchange_do_deposit.sql index 1156c7de5..7116117ff 100644 --- a/src/exchangedb/exchange_do_deposit.sql +++ b/src/exchangedb/exchange_do_deposit.sql @@ -142,6 +142,7 @@ THEN IF NOT FOUND THEN -- Deposit exists, but with *strange* differences. Not allowed. + -- FIXME #8002: Surely we need to provide the client more data in this case. out_conflict=TRUE; RETURN; END IF; diff --git a/src/exchangedb/pg_do_deposit.c b/src/exchangedb/pg_do_deposit.c index 0ba45b628..64e7886a7 100644 --- a/src/exchangedb/pg_do_deposit.c +++ b/src/exchangedb/pg_do_deposit.c @@ -83,6 +83,7 @@ TEH_PG_do_deposit ( GNUNET_PQ_result_spec_uint32 ("insufficient_balance_coin_index", bad_balance_index), balance_ok), + /* FIXME #8002: We need more data to communicate the conflict to the client */ GNUNET_PQ_result_spec_bool ("conflicted", ctr_conflict), GNUNET_PQ_result_spec_end -- cgit v1.2.3 From 25f93cf043632f520954aa2adcc8afa38a5c92f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= Date: Sat, 9 Dec 2023 13:57:40 +0100 Subject: mark out #7999 --- src/exchangedb/exchange_do_insert_or_update_policy_details.sql | 6 +++--- src/include/taler_extensions_policy.h | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/exchangedb/exchange_do_insert_or_update_policy_details.sql b/src/exchangedb/exchange_do_insert_or_update_policy_details.sql index 53cd2989e..85e52d3d3 100644 --- a/src/exchangedb/exchange_do_insert_or_update_policy_details.sql +++ b/src/exchangedb/exchange_do_insert_or_update_policy_details.sql @@ -93,14 +93,14 @@ BEGIN -- Set the fulfillment_state according to the values. -- For now, we only update the state when it was INSUFFICIENT. - -- FIXME: What to do in case of Failure or other state? - IF (out_fullfillment_state = 1) -- INSUFFICIENT + -- FIXME[oec] #7999: What to do in case of Failure or other state? + IF (out_fullfillment_state = 2) -- INSUFFICIENT THEN IF (out_accumulated_total.val >= cur_commitment.val OR (out_accumulated_total.val = cur_commitment.val AND out_accumulated_total.frac >= cur_commitment.frac)) THEN - out_fulfillment_state = 2; -- READY + out_fulfillment_state = 3; -- READY END IF; END IF; diff --git a/src/include/taler_extensions_policy.h b/src/include/taler_extensions_policy.h index 7750f58f1..b10c0d8a2 100644 --- a/src/include/taler_extensions_policy.h +++ b/src/include/taler_extensions_policy.h @@ -28,6 +28,8 @@ /* * @brief Describes the states of fulfillment of a policy bound to a deposit + * NOTE: These values must be in sync with their use in stored procedures, f.e. + * exchange_do_insert_or_update_policy_details. */ enum TALER_PolicyFulfillmentState { -- cgit v1.2.3 From 1a9f82e0e5e85e81f3381d32730855d4c4880c56 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 10 Dec 2023 00:55:23 +0900 Subject: -also set debit threshold for admin --- src/testing/taler-unified-setup.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/testing/taler-unified-setup.sh b/src/testing/taler-unified-setup.sh index 479a125fa..958421666 100755 --- a/src/testing/taler-unified-setup.sh +++ b/src/testing/taler-unified-setup.sh @@ -329,6 +329,12 @@ then -c "$CONF" \ "$AUSER" "$APASS" \ &> libeufin-bank-passwd.log + libeufin-bank \ + edit-account \ + -c "$CONF" \ + --debit_threshold="$CURRENCY:1000000" \ + "$AUSER" \ + &> libeufin-bank-debit-threshold.log echo " OK" fi -- cgit v1.2.3