summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-01-28 14:55:25 +0100
committerChristian Grothoff <christian@grothoff.org>2015-01-28 14:55:25 +0100
commit49d4f24f8d031a9301676196bd6a17ea3e54cb62 (patch)
tree3bb4e1a73fff39eaf68839bba723be63f3ace6ad /src/include
parentea3fac606311d1c14362d387960a4913182b629e (diff)
downloadexchange-49d4f24f8d031a9301676196bd6a17ea3e54cb62.tar.gz
exchange-49d4f24f8d031a9301676196bd6a17ea3e54cb62.tar.bz2
exchange-49d4f24f8d031a9301676196bd6a17ea3e54cb62.zip
misc cleanup, moving TALER_MINT_config_load to libtalerutil
Diffstat (limited to 'src/include')
-rw-r--r--src/include/taler_signatures.h40
-rw-r--r--src/include/taler_util.h19
2 files changed, 56 insertions, 3 deletions
diff --git a/src/include/taler_signatures.h b/src/include/taler_signatures.h
index 90fa421c3..e72c2ed61 100644
--- a/src/include/taler_signatures.h
+++ b/src/include/taler_signatures.h
@@ -29,6 +29,7 @@
#define TALER_SIGNATURES_H
#include <gnunet/gnunet_util_lib.h>
+#include "taler_util.h"
/**
* Purpose for signing public keys signed
@@ -141,6 +142,45 @@ struct TALER_WithdrawRequest
};
+/**
+ * Format used to generate the signature on a request to deposit
+ * a coin into the account of a merchant.
+ */
+struct TALER_DepositRequest
+{
+ /**
+ * Purpose must be #TALER_SIGNATURE_DEPOSIT
+ */
+ struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
+
+ /**
+ * Hash over the contract for which this deposit is made.
+ */
+ struct GNUNET_HashCode h_contract;
+
+ /**
+ * Hash over the wiring information of the merchant.
+ */
+ struct GNUNET_HashCode h_wire;
+
+ /**
+ * Merchant-generated transaction ID to detect duplicate
+ * transactions.
+ */
+ uint64_t transaction_id GNUNET_PACKED;
+
+ /**
+ * Amount to be deposited.
+ */
+ struct TALER_AmountNBO amount;
+
+ /**
+ * The coin's public key.
+ */
+ struct GNUNET_CRYPTO_EcdsaPublicKey coin_pub;
+
+};
+
/**
* FIXME
diff --git a/src/include/taler_util.h b/src/include/taler_util.h
index 2c5faaa52..ab5ee11df 100644
--- a/src/include/taler_util.h
+++ b/src/include/taler_util.h
@@ -73,14 +73,27 @@ void
TALER_gcrypt_init (void);
+/**
+ * Load configuration by parsing all configuration
+ * files in the given directory.
+ *
+ * @param base_dir directory with the configuration files
+ * @return NULL on error, otherwise configuration
+ */
+struct GNUNET_CONFIGURATION_Handle *
+TALER_config_load (const char *base_dir);
+
+
+
/* *********************** Amount management ****************** */
/**
* Number of characters (plus 1 for 0-termination) we use to
- * represent currency names (i.e. EUR, USD, etc.).
+ * represent currency names (i.e. EUR, USD, etc.). We use
+ * 8 for alignment (!).
*/
-#define TALER_CURRENCY_LEN 4
+#define TALER_CURRENCY_LEN 8
GNUNET_NETWORK_STRUCT_BEGIN
@@ -127,7 +140,7 @@ struct TALER_Amount
/**
* Currency string, left adjusted and padded with zeros.
*/
- char currency[4];
+ char currency[TALER_CURRENCY_LEN];
};