summaryrefslogtreecommitdiff
path: root/src/mintdb/perf_taler_mintdb_interpreter.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mintdb/perf_taler_mintdb_interpreter.h')
-rw-r--r--src/mintdb/perf_taler_mintdb_interpreter.h110
1 files changed, 75 insertions, 35 deletions
diff --git a/src/mintdb/perf_taler_mintdb_interpreter.h b/src/mintdb/perf_taler_mintdb_interpreter.h
index 49f06b6ea..b69e39ebe 100644
--- a/src/mintdb/perf_taler_mintdb_interpreter.h
+++ b/src/mintdb/perf_taler_mintdb_interpreter.h
@@ -38,7 +38,7 @@
/**
- *
+ * Prints @ _label to stdout
*/
#define PERF_TALER_MINTDB_INIT_CMD_DEBUG(_label) \
{ \
@@ -46,6 +46,7 @@
.label = _label, \
.exposed_type = PERF_TALER_MINTDB_NONE \
}
+
/**
* The begining of a loop
* @param _label the name of the loop
@@ -85,6 +86,10 @@
/**
* Commits the duration between @a _label_start and @a _label_stop
* to Gauger with @a _description explaining
+ * @param _label_start label of the start of the measurment
+ * @param _label_stop label of the end of the measurment
+ * @param _description description of the measure displayed in gauger
+ * @param _divide number of measurments in the interval
*/
#define PERF_TALER_MINTDB_INIT_CMD_GAUGER(_label, _label_start, _label_stop, _description, _divide) \
{ \
@@ -150,26 +155,26 @@
.label_save = _label_save \
} \
}
+
/**
- * Insert a deposit into the database
+ * Inserts informations about a denomination key in the database
*/
-#define PERF_TALER_MINTDB_INIT_CMD_INSERT_DEPOSIT(_label) \
+#define PERF_TALER_MINTDB_INIT_CMD_INSERT_DENOMINATION(_label) \
{ \
- .command = PERF_TALER_MINTDB_CMD_INSERT_DEPOSIT,\
+ .command = PERF_TALER_MINTDB_CMD_INSERT_DENOMINATION, \
.label = _label, \
- .exposed_type = PERF_TALER_MINTDB_DEPOSIT, \
+ .exposed_type = PERF_TALER_MINTDB_DENOMINATION_INFO, \
}
/**
- * Check if a deposit is in the database
- * @param _label_deposit Label of the deposit to use
+ * Polls the database about informations regarding a specific denomination key
*/
-#define PERF_TALER_MINTDB_INIT_CMD_GET_DEPOSIT(_label, _label_deposit) \
+#define PERF_TALER_MINTDB_INIT_CMD_GET_DENOMINATION(_label, _label_source) \
{ \
- .command = PERF_TALER_MINTDB_CMD_GET_DEPOSIT, \
+ .command = PERF_TALER_MINTDB_CMD_GET_DENOMINATION, \
.label = _label, \
.exposed_type = PERF_TALER_MINTDB_NONE, \
- .details.get_deposit.label_source = _label_deposit \
+ .details.get_denomination.label_source = _label_source, \
}
/**
@@ -177,8 +182,8 @@
*/
#define PERF_TALER_MINTDB_INIT_CMD_INSERT_RESERVE(_label) \
{ \
- .command = PERF_TALER_MINTDB_CMD_INSERT_RESERVE \
- .label = _label \
+ .command = PERF_TALER_MINTDB_CMD_INSERT_RESERVE, \
+ .label = _label, \
.exposed_type = PERF_TALER_MINTDB_RESERVE \
}
@@ -189,7 +194,7 @@
*/
#define PERF_TALER_MINTDB_INIT_CMD_GET_RESERVE(_label, _label_source) \
{ \
- .command = PERF_TALER_MINTDB_CMD_GET_RESERVE \
+ .command = PERF_TALER_MINTDB_CMD_GET_RESERVE, \
.label = _label, \
.exposed_type = PERF_TALER_MINTDB_NONE, \
.details.get_reserve.label_source = _label_source \
@@ -197,46 +202,57 @@
/**
- * Inserts informations about a withdrawal in the database
+ * Insert a deposit into the database
+ * @param _label_dki source to use for the denomination key
*/
-#define PERF_TALER_MINTDB_INIT_CMD_INSERT_WITHDRAW(_label) \
+#define PERF_TALER_MINTDB_INIT_CMD_INSERT_DEPOSIT(_label, _label_dki) \
{ \
- .command = PERF_TALER_MINTDB_CMD_INSERT_WITHDRAW, \
+ .command = PERF_TALER_MINTDB_CMD_INSERT_DEPOSIT,\
.label = _label, \
- .exposed_type = PERF_TALER_MINTDB_BLINDCOIN, \
-}\
+ .exposed_type = PERF_TALER_MINTDB_DEPOSIT, \
+ .details.insert_deposit.label_dki = _label_dki, \
+}
/**
- * Polls the database about informations regarding a secific withdrawal
+ * Check if a deposit is in the database
+ * @param _label_deposit Label of the deposit to use
*/
-#define PERF_TALER_MINTDB_INIT_CMD_GET_WITHDRAW(_label, _label_source) \
+#define PERF_TALER_MINTDB_INIT_CMD_GET_DEPOSIT(_label, _label_deposit) \
{ \
- .command = PERF_TALER_MINTDB_CMD_GET_WITHDRAW, \
+ .command = PERF_TALER_MINTDB_CMD_GET_DEPOSIT, \
.label = _label, \
.exposed_type = PERF_TALER_MINTDB_NONE, \
- .details.get_withdraw.label_source = _label_source, \
+ .details.get_deposit.label_source = _label_deposit \
}
+
/**
- * Inserts informations about a denomination key in the database
+ * Inserts informations about a withdrawal in the database
+ * @param _label_dki denomination key used to sign the coin
+ * @param _label_reserve reserve used to emmit the coin
*/
-#define PERF_TALER_MINTDB_INIT_CMD_INSERT_DENOMINATION(_label) \
+#define PERF_TALER_MINTDB_INIT_CMD_INSERT_WITHDRAW(_label, _label_dki, _label_reserve) \
{ \
.command = PERF_TALER_MINTDB_CMD_INSERT_WITHDRAW, \
.label = _label, \
- .exposed_type = PERF_TALER_MINTDB_DENOMINATION_KEY, \
+ .exposed_type = PERF_TALER_MINTDB_BLINDCOIN, \
+ .details.insert_withdraw = {\
+ .label_dki = _label_dki, \
+ .label_reserve = _label_reserve, \
+ } \
}
+
/**
- * Polls the database about informations regarding a specific denomination key
+ * Polls the database about informations regarding a secific withdrawal
*/
-#define PERF_TALER_MINTDB_INIT_CMD_GET_DENOMINATION(_label, _label_source) \
+#define PERF_TALER_MINTDB_INIT_CMD_GET_WITHDRAW(_label, _label_source) \
{ \
- .command = PERF_TALER_MINTDB_CMD_GET_DENOMINATION, \
+ .command = PERF_TALER_MINTDB_CMD_GET_WITHDRAW, \
.label = _label, \
.exposed_type = PERF_TALER_MINTDB_NONE, \
- .details.get_denomination.label_source = _label_source, \
+ .details.get_withdraw.label_source = _label_source, \
}
@@ -446,6 +462,18 @@ struct PERF_TALER_MINTDB_CMD_load_array_details
/**
+ * Data used by the command insert_deposit
+ */
+struct PERF_TALER_MINTDB_CMD_insert_deposit_details
+{
+ /**
+ * Label of the source where the reserve used to create the coin is
+ */
+ const char *label_dki;
+};
+
+
+/**
* Extra data requiered for the GET_DEPOSIT command
*/
struct PERF_TALER_MINTDB_CMD_get_deposit_details
@@ -479,6 +507,22 @@ struct PERF_TALER_MINTDB_CMD_get_denomination_details
/**
+ * Extra data related to the get withdraw command
+ */
+struct PERF_TALER_MINTDB_CMD_insert_withdraw_details
+{
+ /**
+ * label of the denomination key used to sign the coin
+ */
+ const char *label_dki;
+
+ /**
+ * label of the reserve the money to mint the coin comes from
+ */
+ const char *label_reserve;
+};
+
+/**
* Extra data requiered for refreshing coins
*/
struct PERF_TALER_MINTDB_CMD_refresh_coin_details
@@ -500,10 +544,12 @@ union PERF_TALER_MINTDB_CMD_Details
struct PERF_TALER_MINTDB_CMD_gauger_details gauger;
struct PERF_TALER_MINTDB_CMD_save_array_details save_array;
struct PERF_TALER_MINTDB_CMD_load_array_details load_array;
+ struct PERF_TALER_MINTDB_CMD_insert_deposit_details insert_deposit;
struct PERF_TALER_MINTDB_CMD_get_deposit_details get_deposit;
struct PERF_TALER_MINTDB_CMD_get_reserve_details get_reserve;
struct PERF_TALER_MINTDB_CMD_get_denomination_details get_denomination;
struct PERF_TALER_MINTDB_CMD_refresh_coin_details refresh;
+ struct PERF_TALER_MINTDB_CMD_insert_withdraw_details insert_withdraw;
};
@@ -536,12 +582,6 @@ struct PERF_TALER_MINTDB_Cmd
* Data easily accessible
*/
union PERF_TALER_MINTDB_Data exposed;
-
- /**
- * GNUNET_YES if the exposed value hav been saved during last loop iteration
- * GNUNET_NO if it hasn't
- */
- unsigned int exposed_saved;
};