aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb/perf_taler_exchangedb_init.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchangedb/perf_taler_exchangedb_init.h')
-rw-r--r--src/exchangedb/perf_taler_exchangedb_init.h215
1 files changed, 0 insertions, 215 deletions
diff --git a/src/exchangedb/perf_taler_exchangedb_init.h b/src/exchangedb/perf_taler_exchangedb_init.h
deleted file mode 100644
index f20b35c5b..000000000
--- a/src/exchangedb/perf_taler_exchangedb_init.h
+++ /dev/null
@@ -1,215 +0,0 @@
1/*
2 This file is part of TALER
3 Copyright (C) 2014, 2015 GNUnet e.V.
4
5 TALER is free software; you can redistribute it and/or modify it under the
6 terms of the GNU General Public License as published by the Free Software
7 Foundation; either version 3, or (at your option) any later version.
8
9 TALER is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License along with
14 TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
15 */
16/**
17 * @file exchangedb/perf_taler_exchangedb_init.h
18 * @brief Heler function for creating dummy inputs for the exchange database
19 * @author Nicolas Fournier
20 */
21#ifndef __PERF_TALER_EXCHANGEDB_INIT_H___
22#define __PERF_TALER_EXCHANGEDB_INIT_H___
23
24#include "taler_exchangedb_plugin.h"
25
26
27#define CURRENCY "EUR"
28
29/**
30 * All information about a reserve
31 */
32struct PERF_TALER_EXCHANGEDB_Reserve
33{
34 /**
35 * Information about a rserve available to the Exchange
36 */
37 struct TALER_EXCHANGEDB_Reserve reserve;
38
39 /**
40 * Private key of a reserve
41 */
42 struct GNUNET_CRYPTO_EddsaPrivateKey private;
43};
44
45
46/**
47 * All informations about a coin
48 */
49struct PERF_TALER_EXCHANGEDB_Coin
50{
51 /**
52 * Blinded coin, known by the exchange
53 */
54 struct TALER_EXCHANGEDB_CollectableBlindcoin blind;
55
56 /**
57 * Public key of the coin and othes informations
58 */
59 struct TALER_CoinPublicInfo public_info;
60
61 /**
62 * Private key of the coin
63 */
64 struct GNUNET_CRYPTO_EddsaPrivateKey priv;
65};
66
67
68/**
69 * Generate a dummy DenominationKeyInformation for testing purposes
70 * @return a dummy denomination key
71 */
72struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *
73PERF_TALER_EXCHANGEDB_denomination_init (void);
74
75
76/**
77 * Copies the given denomination
78 * @param reserve the deposit copy
79 * @return a copy of @a deposit; NULL if error
80 */
81struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *
82PERF_TALER_EXCHANGEDB_denomination_copy (const struct
83 TALER_EXCHANGEDB_DenominationKeyIssueInformation
84 *dki);
85
86
87/**
88 * Free memory of a DenominationKeyIssueInformation
89 * @param dki pointer to the struct to free
90 */
91int
92PERF_TALER_EXCHANGEDB_denomination_free (struct
93 TALER_EXCHANGEDB_DenominationKeyIssueInformation
94 *dki);
95
96
97/**
98 * Generate a dummy reserve for testing
99 * @return a reserve with 1000 EUR in it
100 */
101struct PERF_TALER_EXCHANGEDB_Reserve *
102PERF_TALER_EXCHANGEDB_reserve_init (void);
103
104
105/**
106 * Copies the given reserve
107 * @param reserve the reserve to copy
108 * @return a copy of @a reserve; NULL if error
109 */
110struct PERF_TALER_EXCHANGEDB_Reserve *
111PERF_TALER_EXCHANGEDB_reserve_copy (const struct
112 PERF_TALER_EXCHANGEDB_Reserve *reserve);
113
114
115/**
116 * Free memory of a reserve
117 * @param reserve pointer to the structure to be freed
118 */
119int
120PERF_TALER_EXCHANGEDB_reserve_free (struct
121 PERF_TALER_EXCHANGEDB_Reserve *reserve);
122
123
124/**
125 * Generate a dummy deposit for testing purposes
126 * @param dki the denomination key used to sign the key
127 */
128struct TALER_EXCHANGEDB_Deposit *
129PERF_TALER_EXCHANGEDB_deposit_init (const struct
130 PERF_TALER_EXCHANGEDB_Coin *coin);
131
132
133/**
134 * Copies the given deposit
135 * @param reserve the deposit copy
136 * @return a copy of @a deposit; NULL if error
137 */
138struct TALER_EXCHANGEDB_Deposit *
139PERF_TALER_EXCHANGEDB_deposit_copy (const struct
140 TALER_EXCHANGEDB_Deposit *deposit);
141
142
143/**
144 * Free memory of a deposit
145 * @param deposit pointer to the structure to free
146 */
147int
148PERF_TALER_EXCHANGEDB_deposit_free (struct TALER_EXCHANGEDB_Deposit *deposit);
149
150
151/**
152 * Generate a coin for testing purpuses
153 * @param dki denomination key used to sign the coin
154 * @param reserve reserve providing the money for the coin
155 * @return a randomly generated CollectableBlindcoin
156 */
157struct PERF_TALER_EXCHANGEDB_Coin *
158PERF_TALER_EXCHANGEDB_coin_init (const struct
159 TALER_EXCHANGEDB_DenominationKeyIssueInformation
160 *dki,
161 const struct
162 PERF_TALER_EXCHANGEDB_Reserve *reserve);
163
164
165/**
166 * Copies the given coin
167 * @param coin the coin to copy
168 * @return a copy of coin; NULL if error
169 */
170struct PERF_TALER_EXCHANGEDB_Coin *
171PERF_TALER_EXCHANGEDB_coin_copy (const struct PERF_TALER_EXCHANGEDB_Coin *coin);
172
173
174/**
175 * Liberate memory of @a coin
176 * @param coin pointer to the structure to free
177 */
178int
179PERF_TALER_EXCHANGEDB_coin_free (struct PERF_TALER_EXCHANGEDB_Coin *coin);
180
181
182/**
183 * Create a melt operation
184 *
185 * @param rc the commitment of the refresh session
186 * @param dki the denomination the melted coin uses
187 * @return a pointer to a #TALER_EXCHANGEDB_RefreshMelt
188 */
189struct TALER_EXCHANGEDB_RefreshMelt *
190PERF_TALER_EXCHANGEDB_refresh_melt_init (struct TALER_RefreshCommitmentP *rc,
191 struct PERF_TALER_EXCHANGEDB_Coin *coin);
192
193
194/**
195 * Copies the internals of a #TALER_EXCHANGEDB_RefreshMelt
196 *
197 * @param melt the refresh melt to copy
198 * @return an copy of @ melt
199 */
200struct TALER_EXCHANGEDB_RefreshMelt *
201PERF_TALER_EXCHANGEDB_refresh_melt_copy (const struct
202 TALER_EXCHANGEDB_RefreshMelt *melt);
203
204
205/**
206 * Free the internal memory of a #TALER_EXCHANGEDB_RefreshMelt
207 *
208 * @param melt the #TALER_EXCHANGEDB_RefreshMelt to free
209 * @return #GNUNET_OK if the operation was successful, #GNUNET_SYSERROR
210 */
211int
212PERF_TALER_EXCHANGEDB_refresh_melt_free (struct
213 TALER_EXCHANGEDB_RefreshMelt *melt);
214
215#endif