diff options
Diffstat (limited to 'src/mint/taler-mint-httpd_db.h')
-rw-r--r-- | src/mint/taler-mint-httpd_db.h | 66 |
1 files changed, 27 insertions, 39 deletions
diff --git a/src/mint/taler-mint-httpd_db.h b/src/mint/taler-mint-httpd_db.h index 1829f3d37..a479576da 100644 --- a/src/mint/taler-mint-httpd_db.h +++ b/src/mint/taler-mint-httpd_db.h | |||
@@ -17,9 +17,6 @@ | |||
17 | * @file mint/taler-mint_httpd_db.h | 17 | * @file mint/taler-mint_httpd_db.h |
18 | * @brief Mint-specific database access | 18 | * @brief Mint-specific database access |
19 | * @author Chrisitan Grothoff | 19 | * @author Chrisitan Grothoff |
20 | * | ||
21 | * TODO: | ||
22 | * - revisit and document `struct Deposit` members. | ||
23 | */ | 20 | */ |
24 | #ifndef TALER_MINT_HTTPD_DB_H | 21 | #ifndef TALER_MINT_HTTPD_DB_H |
25 | #define TALER_MINT_HTTPD_DB_H | 22 | #define TALER_MINT_HTTPD_DB_H |
@@ -29,46 +26,13 @@ | |||
29 | #include <gnunet/gnunet_util_lib.h> | 26 | #include <gnunet/gnunet_util_lib.h> |
30 | #include "taler_util.h" | 27 | #include "taler_util.h" |
31 | #include "taler_rsa.h" | 28 | #include "taler_rsa.h" |
29 | #include "taler-mint-httpd_keys.h" | ||
30 | #include "mint.h" | ||
32 | 31 | ||
33 | 32 | ||
34 | /** | ||
35 | * Specification for a /deposit operation. | ||
36 | */ | ||
37 | struct Deposit | ||
38 | { | ||
39 | /* FIXME: should be TALER_CoinPublicInfo */ | ||
40 | struct GNUNET_CRYPTO_EddsaPublicKey coin_pub; | ||
41 | |||
42 | struct TALER_RSA_PublicKeyBinaryEncoded denom_pub; | ||
43 | |||
44 | struct TALER_RSA_Signature coin_sig; | ||
45 | |||
46 | struct TALER_RSA_Signature ubsig; | ||
47 | |||
48 | /** | ||
49 | * Type of the deposit (also purpose of the signature). Either | ||
50 | * #TALER_SIGNATURE_DEPOSIT or #TALER_SIGNATURE_INCREMENTAL_DEPOSIT. | ||
51 | */ | ||
52 | struct TALER_RSA_SignaturePurpose purpose; | ||
53 | |||
54 | uint64_t transaction_id; | ||
55 | |||
56 | struct TALER_AmountNBO amount; | ||
57 | |||
58 | struct GNUNET_CRYPTO_EddsaPublicKey merchant_pub; | ||
59 | |||
60 | struct GNUNET_HashCode h_contract; | ||
61 | |||
62 | struct GNUNET_HashCode h_wire; | ||
63 | |||
64 | /* TODO: uint16_t wire_size */ | ||
65 | char wire[]; /* string encoded wire JSON object */ | ||
66 | |||
67 | }; | ||
68 | |||
69 | 33 | ||
70 | /** | 34 | /** |
71 | * Execute a deposit. The validity of the coin and signature | 35 | * Execute a /deposit. The validity of the coin and signature |
72 | * have already been checked. The database must now check that | 36 | * have already been checked. The database must now check that |
73 | * the coin is not (double or over) spent, and execute the | 37 | * the coin is not (double or over) spent, and execute the |
74 | * transaction (record details, generate success or failure response). | 38 | * transaction (record details, generate success or failure response). |
@@ -82,4 +46,28 @@ TALER_MINT_db_execute_deposit (struct MHD_Connection *connection, | |||
82 | const struct Deposit *deposit); | 46 | const struct Deposit *deposit); |
83 | 47 | ||
84 | 48 | ||
49 | /** | ||
50 | * Execute a /withdraw/status. | ||
51 | * | ||
52 | * @param connection the MHD connection to handle | ||
53 | * @param reserve_pub public key of the reserve to check | ||
54 | * @return MHD result code | ||
55 | */ | ||
56 | int | ||
57 | TALER_MINT_db_execute_withdraw_status (struct MHD_Connection *connection, | ||
58 | const struct GNUNET_CRYPTO_EddsaPublicKey *reserve_pub); | ||
59 | |||
60 | |||
61 | /** | ||
62 | * Execute a /withdraw/sign. | ||
63 | * | ||
64 | * @param connection the MHD connection to handle | ||
65 | * @param wsrd details about the withdraw request | ||
66 | * @return MHD result code | ||
67 | */ | ||
68 | int | ||
69 | TALER_MINT_db_execute_withdraw_sign (struct MHD_Connection *connection, | ||
70 | const struct TALER_WithdrawRequest *wsrd); | ||
71 | |||
72 | |||
85 | #endif /* _NEURO_MINT_DB_H */ | 73 | #endif /* _NEURO_MINT_DB_H */ |