From 963a06c0aa9bba4dec67e41c442548141e5f6186 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 30 Oct 2021 19:28:11 +0200 Subject: fix more FTBFS issues --- src/include/taler_exchange_service.h | 6 ++- src/include/taler_exchangedb_plugin.h | 71 ++++++++++++++++++++--------------- 2 files changed, 45 insertions(+), 32 deletions(-) (limited to 'src/include') diff --git a/src/include/taler_exchange_service.h b/src/include/taler_exchange_service.h index 72c233258..7f3436cce 100644 --- a/src/include/taler_exchange_service.h +++ b/src/include/taler_exchange_service.h @@ -889,7 +889,8 @@ typedef void * @param amount the amount to be deposited * @param wire_deadline execution date, until which the merchant would like the exchange to settle the balance (advisory, the exchange cannot be * forced to settle in the past or upon very short notice, but of course a well-behaved exchange will limit aggregation based on the advice received) - * @param wire_details the merchant’s account details, in a format supported by the exchange + * @param merchant_payto_uri the merchant’s account details, in the payto://-format supported by the exchange + * @param wire_salt salt used to hash the @a merchant_payto_uri * @param h_contract_terms hash of the contact of the merchant with the customer (further details are never disclosed to the exchange) * @param extension_details extension-specific details about the deposit relevant to the exchange * @param coin_pub coin’s public key @@ -910,7 +911,8 @@ TALER_EXCHANGE_deposit ( struct TALER_EXCHANGE_Handle *exchange, const struct TALER_Amount *amount, struct GNUNET_TIME_Absolute wire_deadline, - const json_t *wire_details, + const char *merchant_payto_uri, + const struct TALER_WireSalt *wire_salt, const struct TALER_PrivateContractHash *h_contract_terms, const json_t *extension_details, const struct TALER_CoinSpendPublicKeyP *coin_pub, diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h index 8b01ee650..73a18ca6a 100644 --- a/src/include/taler_exchangedb_plugin.h +++ b/src/include/taler_exchangedb_plugin.h @@ -981,18 +981,15 @@ struct TALER_EXCHANGEDB_Deposit struct TALER_PrivateContractHash h_contract_terms; /** - * Hash of the (canonical) representation of @e wire, used - * to check the signature on the request. Generated by - * the exchange from the detailed wire data provided by the - * merchant. + * Salt used by the merchant to compute "h_wire". */ - struct TALER_MerchantWireHash h_wire; + struct TALER_WireSalt wire_salt; /** - * Detailed information about the receiver for executing the transaction. - * Includes URL in payto://-format and salt. + * Information about the receiver for executing the transaction. URI in + * payto://-format. */ - json_t *receiver_wire_account; + char *receiver_wire_account; /** * Additional details for extensions relevant for this @@ -1071,14 +1068,6 @@ struct TALER_EXCHANGEDB_DepositListEntry */ struct TALER_PrivateContractHash h_contract_terms; - /** - * Hash of the (canonical) representation of @e wire, used - * to check the signature on the request. Generated by - * the exchange from the detailed wire data provided by the - * merchant. - */ - struct TALER_MerchantWireHash h_wire; - /** * Hash of the public denomination key used to sign the coin. */ @@ -1086,9 +1075,14 @@ struct TALER_EXCHANGEDB_DepositListEntry /** * Detailed information about the receiver for executing the transaction. - * Includes URL in payto://-format and salt. + * URL in payto://-format. */ - json_t *receiver_wire_account; + char *receiver_wire_account; + + /** + * Salt used to compute h_wire from the @e receiver_wire_account. + */ + struct TALER_WireSalt wire_salt; /** * Time when this request was generated. Used, for example, to @@ -1545,17 +1539,9 @@ typedef enum GNUNET_GenericReturnValue void *cls, uint64_t rowid, struct GNUNET_TIME_Absolute exchange_timestamp, - struct GNUNET_TIME_Absolute wallet_timestamp, - const struct TALER_MerchantPublicKeyP *merchant_pub, + const struct TALER_EXCHANGEDB_Deposit *deposit, const struct TALER_DenominationPublicKey *denom_pub, - const struct TALER_CoinSpendPublicKeyP *coin_pub, - const struct TALER_CoinSpendSignatureP *coin_sig, - const struct TALER_Amount *amount_with_fee, - const struct TALER_PrivateContractHash *h_contract_terms, - struct GNUNET_TIME_Absolute refund_deadline, - struct GNUNET_TIME_Absolute wire_deadline, - const json_t *receiver_wire_account, - int done); + bool done); /** @@ -2627,7 +2613,6 @@ struct TALER_EXCHANGEDB_Plugin * * @param cls the @e cls of this struct with the plugin-specific state * @param deposit deposit to search for - * @param check_extras whether to check extra fields or not * @param[out] deposit_fee set to the deposit fee the exchange charged * @param[out] exchange_timestamp set to the time when the exchange received the deposit * @return 1 if we know this operation, @@ -2637,11 +2622,37 @@ struct TALER_EXCHANGEDB_Plugin enum GNUNET_DB_QueryStatus (*have_deposit)(void *cls, const struct TALER_EXCHANGEDB_Deposit *deposit, - int check_extras, struct TALER_Amount *deposit_fee, struct GNUNET_TIME_Absolute *exchange_timestamp); + /** + * Check if we have the specified deposit already in the database. + * + * @param cls the `struct PostgresClosure` with the plugin-specific state + * @param h_contract_terms contract to check for + * @param h_wire wire hash to check for + * @param coin_pub public key of the coin to check for + * @param merchant merchant public key to check for + * @param refund_deadline expected refund deadline + * @param[out] deposit_fee set to the deposit fee the exchange charged + * @param[out] exchange_timestamp set to the time when the exchange received the deposit + * @return 1 if we know this operation, + * 0 if this exact deposit is unknown to us, + * otherwise transaction error status + */ + enum GNUNET_DB_QueryStatus + (*have_deposit2)( + void *cls, + const struct TALER_PrivateContractHash *h_contract_terms, + const struct TALER_MerchantWireHash *h_wire, + const struct TALER_CoinSpendPublicKeyP *coin_pub, + const struct TALER_MerchantPublicKeyP *merchant, + struct GNUNET_TIME_Absolute refund_deadline, + struct TALER_Amount *deposit_fee, + struct GNUNET_TIME_Absolute *exchange_timestamp); + + /** * Insert information about deposited coin into the database. * -- cgit v1.2.3