aboutsummaryrefslogtreecommitdiff
path: root/src/include/taler_exchangedb_plugin.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/taler_exchangedb_plugin.h')
-rw-r--r--src/include/taler_exchangedb_plugin.h85
1 files changed, 71 insertions, 14 deletions
diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h
index 43f6b73e8..3a6ba6514 100644
--- a/src/include/taler_exchangedb_plugin.h
+++ b/src/include/taler_exchangedb_plugin.h
@@ -149,7 +149,25 @@ struct TALER_EXCHANGEDB_DenominationKeyInformation
GNUNET_NETWORK_STRUCT_BEGIN
/**
- * Signature of events signalling a reserve got funding.
+ * Events signalling that a coin deposit status
+ * changed.
+ */
+struct TALER_CoinDepositEventP
+{
+ /**
+ * Of type #TALER_DBEVENT_EXCHANGE_DEPOSIT_STATUS_CHANGED.
+ */
+ struct GNUNET_DB_EventHeaderP header;
+
+ /**
+ * Public key of the merchant.
+ */
+ struct TALER_MerchantPublicKeyP merchant_pub;
+
+};
+
+/**
+ * Events signalling a reserve got funding.
*/
struct TALER_ReserveEventP
{
@@ -760,7 +778,7 @@ struct TALER_EXCHANGEDB_TableData
struct TALER_ReserveSignatureP reserve_sig;
uint32_t noreveal_index;
struct GNUNET_TIME_Absolute timestamp;
- } withdraw_age_commitments;
+ } age_withdraw_commitments;
struct
{
@@ -769,10 +787,9 @@ struct TALER_EXCHANGEDB_TableData
uint64_t denominations_serial;
void *coin_ev;
size_t coin_ev_size;
- struct TALER_ExchangeWithdrawValues ewv;
// h_coin_ev omitted, to be recomputed!
struct TALER_BlindedDenominationSignature ev_sig;
- } withdraw_age_revealed_coins;
+ } age_withdraw_revealed_coins;
} details;
@@ -1200,8 +1217,9 @@ struct TALER_EXCHANGEDB_AgeWithdrawCommitment
struct TALER_ReservePublicKeyP reserve_pub;
/**
- * Signature confirming the age withdrawal, matching @e reserve_pub, @e
- * maximum_age_group and @e h_commitment and @e total_amount_with_fee.
+ * Signature confirming the age withdrawal commitment, matching @e
+ * reserve_pub, @e maximum_age_group and @e h_commitment and @e
+ * total_amount_with_fee.
*/
struct TALER_ReserveSignatureP reserve_sig;
@@ -2737,6 +2755,28 @@ struct TALER_EXCHANGEDB_CsRevealFreshCoinData
uint32_t coin_off;
};
+/**
+ * Information about a coin that was revealed to the exchange
+ * during reveal.
+ */
+struct TALER_EXCHANGEDB_AgeWithdrawRevealedCoin
+{
+ /**
+ * Hash of the public denomination key of the coin.
+ */
+ struct TALER_DenominationHashP h_denom_pub;
+
+ /**
+ * Signature generated by the exchange over the coin (in blinded format).
+ */
+ struct TALER_BlindedDenominationSignature coin_sig;
+
+ /**
+ * Blinded hash of the new coin
+ */
+ struct TALER_BlindedCoinHashP h_coin_ev;
+};
+
/**
* Generic KYC status for some operation.
@@ -2859,6 +2899,9 @@ typedef enum GNUNET_GenericReturnValue
*
* @param cls closure
* @param payto_uri the exchange bank account URI
+ * @param conversion_url URL of a conversion service, NULL if there is no conversion
+ * @param debit_restrictions JSON array with debit restrictions on the account
+ * @param credit_restrictions JSON array with credit restrictions on the account
* @param master_sig master key signature affirming that this is a bank
* account of the exchange (of purpose #TALER_SIGNATURE_MASTER_WIRE_DETAILS)
*/
@@ -2866,6 +2909,9 @@ typedef void
(*TALER_EXCHANGEDB_WireAccountCallback)(
void *cls,
const char *payto_uri,
+ const char *conversion_url,
+ const json_t *debit_restrictions,
+ const json_t *credit_restrictions,
const struct TALER_MasterSignatureP *master_sig);
@@ -3810,19 +3856,18 @@ struct TALER_EXCHANGEDB_Plugin
* age restriction enabled in a given age-withdraw operation and the relevant
* information we learned or created in the reveal steop
*
- * @param cls the `struct PostgresClosure` with the plugin-specific state
- * @param h_commitment The hash of the original age-withdraw commitment, which is a key into the withdraw_age_commitments table
- * @param num_coins number of coins to generate, size of the @a coin_evs array
- * TODO: oec
+ * @param cls The `struct PostgresClosure` with the plugin-specific state
+ * @param h_commitment The hash of the original age-withdraw commitment, which is a key into the age_withdraw_commitments table
+ * @param num_awrcs Number of coins to generate, size of the @a coin_evs array
+ * @param awrcs Array of @a num_awrcs information about coins to be created
* @return query execution status
*/
enum GNUNET_DB_QueryStatus
(*insert_age_withdraw_reveal)(
void *cls,
- uint64_t h_commitment,
- uint32_t num_coins
- /* TODO: oec */
- );
+ const struct TALER_AgeWithdrawCommitmentHashP *h_commitment,
+ uint32_t num_awrcs,
+ const struct TALER_EXCHANGEDB_AgeWithdrawRevealedCoin *awrcs);
/**
* Lookup in the database for the fresh coins with age-restriction that
@@ -5523,6 +5568,9 @@ struct TALER_EXCHANGEDB_Plugin
*
* @param cls closure
* @param payto_uri wire account of the exchange
+ * @param conversion_url URL of a conversion service, NULL if there is no conversion
+ * @param debit_restrictions JSON array with debit restrictions on the account
+ * @param credit_restrictions JSON array with credit restrictions on the account
* @param start_date date when the account was added by the offline system
* (only to be used for replay detection)
* @param master_sig public signature affirming the existence of the account,
@@ -5532,6 +5580,9 @@ struct TALER_EXCHANGEDB_Plugin
enum GNUNET_DB_QueryStatus
(*insert_wire)(void *cls,
const char *payto_uri,
+ const char *conversion_url,
+ json_t *debit_restrictions,
+ json_t *credit_restrictions,
struct GNUNET_TIME_Timestamp start_date,
const struct TALER_MasterSignatureP *master_sig);
@@ -5541,6 +5592,9 @@ struct TALER_EXCHANGEDB_Plugin
*
* @param cls closure
* @param payto_uri account the update is about
+ * @param conversion_url URL of a conversion service, NULL if there is no conversion
+ * @param debit_restrictions JSON array with debit restrictions on the account; NULL allowed if not @a enabled
+ * @param credit_restrictions JSON array with credit restrictions on the account; NULL allowed if not @a enabled
* @param change_date date when the account status was last changed
* (only to be used for replay detection)
* @param enabled true to enable, false to disable (the actual change)
@@ -5549,6 +5603,9 @@ struct TALER_EXCHANGEDB_Plugin
enum GNUNET_DB_QueryStatus
(*update_wire)(void *cls,
const char *payto_uri,
+ const char *conversion_url,
+ json_t *debit_restrictions,
+ json_t *credit_restrictions,
struct GNUNET_TIME_Timestamp change_date,
bool enabled);