aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-01-16 22:40:12 +0100
committerChristian Grothoff <christian@grothoff.org>2020-01-16 22:40:12 +0100
commit0305cf5f9eb904e7a3ab3e8d39f4974a92a9a0b3 (patch)
tree8a5d839bb3cfb5e96b430ff6d1eeeed653cc4a6b /src/include
parent0a415262daa93c96a9305df11a6573b49976a8cc (diff)
move function to libtalerexchangedb, as planned
Diffstat (limited to 'src/include')
-rw-r--r--src/include/taler_exchangedb_lib.h97
-rw-r--r--src/include/taler_exchangedb_plugin.h77
-rw-r--r--src/include/taler_testing_lib.h16
3 files changed, 105 insertions, 85 deletions
diff --git a/src/include/taler_exchangedb_lib.h b/src/include/taler_exchangedb_lib.h
index 1681c45aa..f820d1a25 100644
--- a/src/include/taler_exchangedb_lib.h
+++ b/src/include/taler_exchangedb_lib.h
@@ -23,9 +23,8 @@
#ifndef TALER_EXCHANGEDB_LIB_H
#define TALER_EXCHANGEDB_LIB_H
-
#include "taler_signatures.h"
-
+#include "taler_exchangedb_plugin.h"
/**
* Subdirectroy under the exchange's base directory which contains
@@ -40,81 +39,6 @@
#define TALER_EXCHANGEDB_DIR_DENOMINATION_KEYS "denomkeys"
-GNUNET_NETWORK_STRUCT_BEGIN
-
-/**
- * @brief On disk format used for a exchange signing key. Signing keys are used
- * by the exchange to affirm its messages, but not to create coins.
- * Includes the private key followed by the public information about
- * the signing key.
- */
-struct TALER_EXCHANGEDB_PrivateSigningKeyInformationP
-{
- /**
- * Private key part of the exchange's signing key.
- */
- struct TALER_ExchangePrivateKeyP signkey_priv;
-
- /**
- * Signature over @e issue
- */
- struct TALER_MasterSignatureP master_sig;
-
- /**
- * Public information about a exchange signing key.
- */
- struct TALER_ExchangeSigningKeyValidityPS issue;
-
-};
-
-
-/**
- * Information about a denomination key.
- */
-struct TALER_EXCHANGEDB_DenominationKeyInformationP
-{
-
- /**
- * Signature over this struct to affirm the validity of the key.
- */
- struct TALER_MasterSignatureP signature;
-
- /**
- * Signed properties of the denomination key.
- */
- struct TALER_DenominationKeyValidityPS properties;
-};
-
-
-GNUNET_NETWORK_STRUCT_END
-
-
-/**
- * @brief All information about a denomination key (which is used to
- * sign coins into existence).
- */
-struct TALER_EXCHANGEDB_DenominationKeyIssueInformation
-{
- /**
- * The private key of the denomination. Will be NULL if the private
- * key is not available (this is the case after the key has expired
- * for signing coins, but is still valid for depositing coins).
- */
- struct TALER_DenominationPrivateKey denom_priv;
-
- /**
- * Decoded denomination public key (the hash of it is in
- * @e issue, but we sometimes need the full public key as well).
- */
- struct TALER_DenominationPublicKey denom_pub;
-
- /**
- * Signed public information about a denomination key.
- */
- struct TALER_EXCHANGEDB_DenominationKeyInformationP issue;
-};
-
-
/**
* @brief Iterator over signing keys.
*
@@ -525,4 +449,23 @@ TALER_EXCHANGEDB_find_accounts (const struct GNUNET_CONFIGURATION_Handle *cfg,
void *cb_cls);
+/**
+ * Calculate the total value of all transactions performed.
+ * Stores @a off plus the cost of all transactions in @a tl
+ * in @a ret.
+ *
+ * @param tl transaction list to process
+ * @param off offset to use as the starting value
+ * @param[out] ret where the resulting total is to be stored
+ * @return #GNUNET_OK on success, #GNUNET_SYSERR on errors
+ */
+int
+TALER_EXCHANGEDB_calculate_transaction_list_totals (struct
+ TALER_EXCHANGEDB_TransactionList
+ *tl,
+ const struct
+ TALER_Amount *off,
+ struct TALER_Amount *ret);
+
+
#endif
diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h
index 06be27e0f..cb5d6cc68 100644
--- a/src/include/taler_exchangedb_plugin.h
+++ b/src/include/taler_exchangedb_plugin.h
@@ -24,7 +24,82 @@
#include <jansson.h>
#include <gnunet/gnunet_util_lib.h>
#include <gnunet/gnunet_db_lib.h>
-#include "taler_exchangedb_lib.h"
+#include "taler_signatures.h"
+
+
+GNUNET_NETWORK_STRUCT_BEGIN
+
+/**
+ * @brief On disk format used for a exchange signing key. Signing keys are used
+ * by the exchange to affirm its messages, but not to create coins.
+ * Includes the private key followed by the public information about
+ * the signing key.
+ */
+struct TALER_EXCHANGEDB_PrivateSigningKeyInformationP
+{
+ /**
+ * Private key part of the exchange's signing key.
+ */
+ struct TALER_ExchangePrivateKeyP signkey_priv;
+
+ /**
+ * Signature over @e issue
+ */
+ struct TALER_MasterSignatureP master_sig;
+
+ /**
+ * Public information about a exchange signing key.
+ */
+ struct TALER_ExchangeSigningKeyValidityPS issue;
+
+};
+
+
+/**
+ * Information about a denomination key.
+ */
+struct TALER_EXCHANGEDB_DenominationKeyInformationP
+{
+
+ /**
+ * Signature over this struct to affirm the validity of the key.
+ */
+ struct TALER_MasterSignatureP signature;
+
+ /**
+ * Signed properties of the denomination key.
+ */
+ struct TALER_DenominationKeyValidityPS properties;
+};
+
+
+GNUNET_NETWORK_STRUCT_END
+
+
+/**
+ * @brief All information about a denomination key (which is used to
+ * sign coins into existence).
+ */
+struct TALER_EXCHANGEDB_DenominationKeyIssueInformation
+{
+ /**
+ * The private key of the denomination. Will be NULL if the private
+ * key is not available (this is the case after the key has expired
+ * for signing coins, but is still valid for depositing coins).
+ */
+ struct TALER_DenominationPrivateKey denom_priv;
+
+ /**
+ * Decoded denomination public key (the hash of it is in
+ * @e issue, but we sometimes need the full public key as well).
+ */
+ struct TALER_DenominationPublicKey denom_pub;
+
+ /**
+ * Signed public information about a denomination key.
+ */
+ struct TALER_EXCHANGEDB_DenominationKeyInformationP issue;
+};
/**
diff --git a/src/include/taler_testing_lib.h b/src/include/taler_testing_lib.h
index 9b0ca422c..783aa5966 100644
--- a/src/include/taler_testing_lib.h
+++ b/src/include/taler_testing_lib.h
@@ -104,7 +104,7 @@ struct TALER_TESTING_DatabaseConnection
* Database plugin.
*/
struct TALER_EXCHANGEDB_Plugin *plugin;
-
+
/**
* Session with the database.
*/
@@ -1679,6 +1679,7 @@ TALER_TESTING_cmd_serialize_keys (const char *label);
struct TALER_TESTING_Command
TALER_TESTING_cmd_connect_with_state (const char *label,
const char *state_reference);
+
/**
* Make the "insert-deposit" CMD.
*
@@ -1694,12 +1695,13 @@ TALER_TESTING_cmd_connect_with_state (const char *label,
*/
struct TALER_TESTING_Command
TALER_TESTING_cmd_insert_deposit (const char *label,
- const struct TALER_TESTING_DatabaseConnection *dbc,
- const char *merchant_name,
- const char *merchant_account,
- struct GNUNET_TIME_Relative wire_deadline,
- const char *amount_with_fee,
- const char *deposit_fee);
+ const struct
+ TALER_TESTING_DatabaseConnection *dbc,
+ const char *merchant_name,
+ const char *merchant_account,
+ struct GNUNET_TIME_Relative wire_deadline,
+ const char *amount_with_fee,
+ const char *deposit_fee);
/* *** Generic trait logic for implementing traits ********* */