From c20f955ae43a57208b40d9a7978a7f089592ad60 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 9 Dec 2015 15:36:34 +0100 Subject: towards /deposit/wtid handling (more skeleton work) --- src/include/taler_crypto_lib.h | 12 +++++++++++ src/include/taler_mintdb_plugin.h | 42 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) (limited to 'src/include') diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h index a3c21b386..7a4bcb831 100644 --- a/src/include/taler_crypto_lib.h +++ b/src/include/taler_crypto_lib.h @@ -101,6 +101,18 @@ struct TALER_MerchantPrivateKeyP }; +/** + * @brief Type of signatures made by merchants. + */ +struct TALER_MerchantSignatureP +{ + /** + * Taler uses EdDSA for merchants. + */ + struct GNUNET_CRYPTO_EddsaSignature eddsa_sig; +}; + + /** * @brief Type of transfer public keys used during refresh * operations. diff --git a/src/include/taler_mintdb_plugin.h b/src/include/taler_mintdb_plugin.h index d83cf9d44..d9a1c6c85 100644 --- a/src/include/taler_mintdb_plugin.h +++ b/src/include/taler_mintdb_plugin.h @@ -568,6 +568,23 @@ typedef void const struct TALER_EncryptedLinkSecretP *shared_secret_enc); +/** + * Function called with the results of the lookup of the + * wire transfer identifier information. + * + * @param cls closure + * @param wtid base32-encoded wire transfer identifier, NULL + * if the transaction was not yet done + * @param execution_time when was the transaction done, or + * when we expect it to be done (if @a wtid was NULL); + * #GNUNET_TIME_UNIT_FOREVER_ABS if the /deposit is unknown + * to the mint + */ +typedef void +(*TALER_MINTDB_DepositWtidCallback)(void *cls, + const char *wtid, + struct GNUNET_TIME_Absolute execution_time); + /** * @brief The plugin API, returned from the plugin's "init" function. * The argument given to "init" is simply a configuration handle. @@ -1177,6 +1194,31 @@ struct TALER_MINTDB_Plugin struct TALER_MINTDB_TransactionList *list); + /** + * Try to find the wire transfer details for a deposit operation. + * If we did not execute the deposit yet, return when it is supposed + * to be executed. + * + * @param cls closure + * @param h_contract hash of the contract + * @param h_wire hash of merchant wire details + * @param coin_pub public key of deposited coin + * @param merchant_pub merchant public key + * @param transaction_id transaction identifier + * @param cb function to call with the result + * @param cb_cls closure to pass to @a cb + * @return #GNUNET_OK on success, #GNUNET_SYSERR on DB errors + */ + int + (*wire_lookup_deposit_wtid)(void *cls, + const struct GNUNET_HashCode *h_contract, + const struct GNUNET_HashCode *h_wire, + const struct TALER_CoinSpendPublicKeyP *coin_pub, + const struct TALER_MerchantPublicKeyP *merchant_pub, + uint64_t transaction_id, + TALER_MINTDB_DepositWtidCallback cb, + void *cb_cls); + }; -- cgit v1.2.3