From c30c7cde4d5e9eafe66a1ac08b13f4d73df13482 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 22 Apr 2022 23:43:15 +0200 Subject: add purses_deposit to build --- src/exchange/Makefile.am | 1 + src/exchange/taler-exchange-httpd_metrics.h | 3 ++- src/exchange/taler-exchange-httpd_purses_deposit.c | 18 +++++++++++++++--- 3 files changed, 18 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/exchange/Makefile.am b/src/exchange/Makefile.am index 0fbdb8e80..b698753c0 100644 --- a/src/exchange/Makefile.am +++ b/src/exchange/Makefile.am @@ -105,6 +105,7 @@ taler_exchange_httpd_SOURCES = \ taler-exchange-httpd_metrics.c taler-exchange-httpd_metrics.h \ taler-exchange-httpd_mhd.c taler-exchange-httpd_mhd.h \ taler-exchange-httpd_purses_create.c taler-exchange-httpd_purses_create.h \ + taler-exchange-httpd_purses_deposit.c taler-exchange-httpd_purses_deposit.h \ taler-exchange-httpd_purses_merge.c taler-exchange-httpd_purses_merge.h \ taler-exchange-httpd_recoup.c taler-exchange-httpd_recoup.h \ taler-exchange-httpd_recoup-refresh.c taler-exchange-httpd_recoup-refresh.h \ diff --git a/src/exchange/taler-exchange-httpd_metrics.h b/src/exchange/taler-exchange-httpd_metrics.h index ac9e5b505..1e08c6ac7 100644 --- a/src/exchange/taler-exchange-httpd_metrics.h +++ b/src/exchange/taler-exchange-httpd_metrics.h @@ -38,7 +38,8 @@ enum TEH_MetricTypeRequest TEH_MT_REQUEST_PURSE_CREATE = 4, TEH_MT_REQUEST_PURSE_MERGE = 5, TEH_MT_REQUEST_RESERVE_PURSE = 6, - TEH_MT_REQUEST_COUNT = 7 /* MUST BE LAST! */ + TEH_MT_REQUEST_PURSE_DEPOSIT = 7, + TEH_MT_REQUEST_COUNT = 8 /* MUST BE LAST! */ }; /** diff --git a/src/exchange/taler-exchange-httpd_purses_deposit.c b/src/exchange/taler-exchange-httpd_purses_deposit.c index 193953a4e..2c0991e00 100644 --- a/src/exchange/taler-exchange-httpd_purses_deposit.c +++ b/src/exchange/taler-exchange-httpd_purses_deposit.c @@ -96,6 +96,16 @@ struct PurseDepositContext */ struct GNUNET_TIME_Timestamp purse_expiration; + /** + * Key with the merge capability (needed for signing). + */ + struct TALER_PurseMergePublicKeyP merge_pub; + + /** + * Hash of the contract (needed for signing). + */ + struct TALER_PrivateContractHashP h_contract_terms; + /** * Our current time. */ @@ -134,13 +144,15 @@ reply_deposit_success (struct MHD_Connection *connection, enum TALER_ErrorCode ec; if (TALER_EC_NONE != - (ec = TALER_exchange_online_purse_deposited_sign ( + (ec = TALER_exchange_online_purse_created_sign ( &TEH_keys_exchange_sign_, pcc->exchange_timestamp, pcc->purse_expiration, &pcc->amount, &pcc->deposit_total, pcc->purse_pub, + &pcc->merge_pub, + &pcc->h_contract_terms, &pub, &sig))) { @@ -183,7 +195,6 @@ deposit_transaction (void *cls, { struct PurseDepositContext *pcc = cls; enum GNUNET_DB_QueryStatus qs; - bool in_conflict = true; for (unsigned int i = 0; inum_coins; i++) { @@ -539,7 +550,8 @@ TEH_handler_purses_deposit ( "deposits"); } /* FIXME: fetch basic purse properties - (min age, purse_expiration, amount) from + (min age, purse_expiration, amount, merge_pub, + h_contract_terms) from DB. Generate 404 or 410 (Gone) replies if applicable. */ -- cgit v1.2.3