Line data Source code
1 : /*
2 : This file is part of GNUnet
3 : Copyright (C) 2020, 2021, 2022 Taler Systems SA
4 :
5 : GNUnet is free software: you can redistribute it and/or modify it
6 : under the terms of the GNU Affero General Public License as published
7 : by the Free Software Foundation, either version 3 of the License,
8 : or (at your option) any later version.
9 :
10 : GNUnet is distributed in the hope that it will be useful, but
11 : WITHOUT ANY WARRANTY; without even the implied warranty of
12 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 : Affero General Public License for more details.
14 :
15 : You should have received a copy of the GNU Affero General Public License
16 : along with this program. If not, see <http://www.gnu.org/licenses/>.
17 :
18 : SPDX-License-Identifier: AGPL3.0-or-later
19 : */
20 : /**
21 : * @file exchangedb/irbt_callbacks.c
22 : * @brief callbacks used by postgres_insert_records_by_table, to be
23 : * inlined into the plugin
24 : * @author Christian Grothoff
25 : */
26 :
27 :
28 : /**
29 : * Function called with denominations records to insert into table.
30 : *
31 : * @param pg plugin context
32 : * @param td record to insert
33 : */
34 : static enum GNUNET_DB_QueryStatus
35 0 : irbt_cb_table_denominations (struct PostgresClosure *pg,
36 : const struct TALER_EXCHANGEDB_TableData *td)
37 : {
38 : struct TALER_DenominationHashP denom_hash;
39 0 : struct GNUNET_PQ_QueryParam params[] = {
40 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
41 0 : GNUNET_PQ_query_param_auto_from_type (&denom_hash),
42 0 : GNUNET_PQ_query_param_uint32 (
43 : &td->details.denominations.denom_type),
44 0 : GNUNET_PQ_query_param_uint32 (
45 : &td->details.denominations.age_mask),
46 0 : TALER_PQ_query_param_denom_pub (
47 : &td->details.denominations.denom_pub),
48 0 : GNUNET_PQ_query_param_auto_from_type (
49 : &td->details.denominations.master_sig),
50 0 : GNUNET_PQ_query_param_timestamp (
51 : &td->details.denominations.valid_from),
52 0 : GNUNET_PQ_query_param_timestamp (
53 : &td->details.denominations.expire_withdraw),
54 0 : GNUNET_PQ_query_param_timestamp (
55 : &td->details.denominations.expire_deposit),
56 0 : GNUNET_PQ_query_param_timestamp (
57 : &td->details.denominations.expire_legal),
58 0 : TALER_PQ_query_param_amount (&td->details.denominations.coin),
59 0 : TALER_PQ_query_param_amount (
60 : &td->details.denominations.fees.withdraw),
61 0 : TALER_PQ_query_param_amount (
62 : &td->details.denominations.fees.deposit),
63 0 : TALER_PQ_query_param_amount (
64 : &td->details.denominations.fees.refresh),
65 0 : TALER_PQ_query_param_amount (
66 : &td->details.denominations.fees.refund),
67 : GNUNET_PQ_query_param_end
68 : };
69 :
70 0 : TALER_denom_pub_hash (
71 : &td->details.denominations.denom_pub,
72 : &denom_hash);
73 :
74 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
75 : "insert_into_table_denominations",
76 : params);
77 : }
78 :
79 :
80 : /**
81 : * Function called with denomination_revocations records to insert into table.
82 : *
83 : * @param pg plugin context
84 : * @param td record to insert
85 : */
86 : static enum GNUNET_DB_QueryStatus
87 0 : irbt_cb_table_denomination_revocations (
88 : struct PostgresClosure *pg,
89 : const struct TALER_EXCHANGEDB_TableData *td)
90 : {
91 0 : struct GNUNET_PQ_QueryParam params[] = {
92 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
93 0 : GNUNET_PQ_query_param_auto_from_type (
94 : &td->details.denomination_revocations.master_sig),
95 0 : GNUNET_PQ_query_param_uint64 (
96 : &td->details.denomination_revocations.denominations_serial),
97 : GNUNET_PQ_query_param_end
98 : };
99 :
100 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
101 : "insert_into_table_denomination_revocations",
102 : params);
103 : }
104 :
105 :
106 : /**
107 : * Function called with denominations records to insert into table.
108 : *
109 : * @param pg plugin context
110 : * @param td record to insert
111 : */
112 : static enum GNUNET_DB_QueryStatus
113 0 : irbt_cb_table_wire_targets (struct PostgresClosure *pg,
114 : const struct TALER_EXCHANGEDB_TableData *td)
115 : {
116 : struct TALER_PaytoHashP payto_hash;
117 0 : struct GNUNET_PQ_QueryParam params[] = {
118 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
119 0 : GNUNET_PQ_query_param_auto_from_type (&payto_hash),
120 0 : GNUNET_PQ_query_param_string (
121 0 : td->details.wire_targets.payto_uri),
122 : GNUNET_PQ_query_param_end
123 : };
124 :
125 0 : TALER_payto_hash (
126 0 : td->details.wire_targets.payto_uri,
127 : &payto_hash);
128 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
129 : "insert_into_table_wire_targets",
130 : params);
131 : }
132 :
133 :
134 : /**
135 : * Function called with reserves records to insert into table.
136 : *
137 : * @param pg plugin context
138 : * @param td record to insert
139 : */
140 : static enum GNUNET_DB_QueryStatus
141 0 : irbt_cb_table_reserves (struct PostgresClosure *pg,
142 : const struct TALER_EXCHANGEDB_TableData *td)
143 : {
144 0 : struct GNUNET_PQ_QueryParam params[] = {
145 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
146 0 : GNUNET_PQ_query_param_auto_from_type (&td->details.reserves.reserve_pub),
147 0 : GNUNET_PQ_query_param_timestamp (&td->details.reserves.expiration_date),
148 0 : GNUNET_PQ_query_param_timestamp (&td->details.reserves.gc_date),
149 : GNUNET_PQ_query_param_end
150 : };
151 :
152 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
153 : "insert_into_table_reserves",
154 : params);
155 : }
156 :
157 :
158 : /**
159 : * Function called with reserves_in records to insert into table.
160 : *
161 : * @param pg plugin context
162 : * @param td record to insert
163 : */
164 : static enum GNUNET_DB_QueryStatus
165 0 : irbt_cb_table_reserves_in (struct PostgresClosure *pg,
166 : const struct TALER_EXCHANGEDB_TableData *td)
167 : {
168 0 : struct GNUNET_PQ_QueryParam params[] = {
169 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
170 0 : GNUNET_PQ_query_param_uint64 (&td->details.reserves_in.wire_reference),
171 0 : TALER_PQ_query_param_amount (&td->details.reserves_in.credit),
172 0 : GNUNET_PQ_query_param_auto_from_type (
173 : &td->details.reserves_in.sender_account_h_payto),
174 0 : GNUNET_PQ_query_param_string (
175 0 : td->details.reserves_in.exchange_account_section),
176 0 : GNUNET_PQ_query_param_timestamp (
177 : &td->details.reserves_in.execution_date),
178 0 : GNUNET_PQ_query_param_auto_from_type (&td->details.reserves_in.reserve_pub),
179 : GNUNET_PQ_query_param_end
180 : };
181 :
182 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
183 : "insert_into_table_reserves_in",
184 : params);
185 : }
186 :
187 :
188 : /**
189 : * Function called with reserves_close records to insert into table.
190 : *
191 : * @param pg plugin context
192 : * @param td record to insert
193 : */
194 : static enum GNUNET_DB_QueryStatus
195 0 : irbt_cb_table_reserves_close (struct PostgresClosure *pg,
196 : const struct TALER_EXCHANGEDB_TableData *td)
197 : {
198 0 : struct GNUNET_PQ_QueryParam params[] = {
199 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
200 0 : GNUNET_PQ_query_param_timestamp (
201 : &td->details.reserves_close.execution_date),
202 0 : GNUNET_PQ_query_param_auto_from_type (
203 : &td->details.reserves_close.wtid),
204 0 : GNUNET_PQ_query_param_auto_from_type (
205 : &td->details.reserves_close.sender_account_h_payto),
206 0 : TALER_PQ_query_param_amount (&td->details.reserves_close.amount),
207 0 : TALER_PQ_query_param_amount (&td->details.reserves_close.closing_fee),
208 0 : GNUNET_PQ_query_param_auto_from_type (
209 : &td->details.reserves_close.reserve_pub),
210 : GNUNET_PQ_query_param_end
211 : };
212 :
213 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
214 : "insert_into_table_reserves_close",
215 : params);
216 : }
217 :
218 :
219 : /**
220 : * Function called with reserves_out records to insert into table.
221 : *
222 : * @param pg plugin context
223 : * @param td record to insert
224 : */
225 : static enum GNUNET_DB_QueryStatus
226 0 : irbt_cb_table_reserves_out (struct PostgresClosure *pg,
227 : const struct TALER_EXCHANGEDB_TableData *td)
228 : {
229 0 : struct GNUNET_PQ_QueryParam params[] = {
230 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
231 0 : GNUNET_PQ_query_param_auto_from_type (
232 : &td->details.reserves_out.h_blind_ev),
233 0 : GNUNET_PQ_query_param_uint64 (
234 : &td->details.reserves_out.denominations_serial),
235 0 : TALER_PQ_query_param_blinded_denom_sig (
236 : &td->details.reserves_out.denom_sig),
237 0 : GNUNET_PQ_query_param_uint64 (
238 : &td->details.reserves_out.reserve_uuid),
239 0 : GNUNET_PQ_query_param_auto_from_type (
240 : &td->details.reserves_out.reserve_sig),
241 0 : GNUNET_PQ_query_param_timestamp (
242 : &td->details.reserves_out.execution_date),
243 0 : TALER_PQ_query_param_amount (
244 : &td->details.reserves_out.amount_with_fee),
245 : GNUNET_PQ_query_param_end
246 : };
247 :
248 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
249 : "insert_into_table_reserves_out",
250 : params);
251 : }
252 :
253 :
254 : /**
255 : * Function called with auditors records to insert into table.
256 : *
257 : * @param pg plugin context
258 : * @param td record to insert
259 : */
260 : static enum GNUNET_DB_QueryStatus
261 0 : irbt_cb_table_auditors (struct PostgresClosure *pg,
262 : const struct TALER_EXCHANGEDB_TableData *td)
263 : {
264 0 : struct GNUNET_PQ_QueryParam params[] = {
265 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
266 0 : GNUNET_PQ_query_param_auto_from_type (&td->details.auditors.auditor_pub),
267 0 : GNUNET_PQ_query_param_string (td->details.auditors.auditor_name),
268 0 : GNUNET_PQ_query_param_string (td->details.auditors.auditor_url),
269 0 : GNUNET_PQ_query_param_bool (td->details.auditors.is_active),
270 0 : GNUNET_PQ_query_param_timestamp (&td->details.auditors.last_change),
271 : GNUNET_PQ_query_param_end
272 : };
273 :
274 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
275 : "insert_into_table_auditors",
276 : params);
277 : }
278 :
279 :
280 : /**
281 : * Function called with auditor_denom_sigs records to insert into table.
282 : *
283 : * @param pg plugin context
284 : * @param td record to insert
285 : */
286 : static enum GNUNET_DB_QueryStatus
287 0 : irbt_cb_table_auditor_denom_sigs (struct PostgresClosure *pg,
288 : const struct TALER_EXCHANGEDB_TableData *td)
289 : {
290 0 : struct GNUNET_PQ_QueryParam params[] = {
291 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
292 0 : GNUNET_PQ_query_param_uint64 (&td->details.auditor_denom_sigs.auditor_uuid),
293 0 : GNUNET_PQ_query_param_uint64 (
294 : &td->details.auditor_denom_sigs.denominations_serial),
295 0 : GNUNET_PQ_query_param_auto_from_type (
296 : &td->details.auditor_denom_sigs.auditor_sig),
297 : GNUNET_PQ_query_param_end
298 : };
299 :
300 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
301 : "insert_into_table_auditor_denom_sigs",
302 : params);
303 : }
304 :
305 :
306 : /**
307 : * Function called with exchange_sign_keys records to insert into table.
308 : *
309 : * @param pg plugin context
310 : * @param td record to insert
311 : */
312 : static enum GNUNET_DB_QueryStatus
313 0 : irbt_cb_table_exchange_sign_keys (struct PostgresClosure *pg,
314 : const struct TALER_EXCHANGEDB_TableData *td)
315 : {
316 0 : struct GNUNET_PQ_QueryParam params[] = {
317 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
318 0 : GNUNET_PQ_query_param_auto_from_type (
319 : &td->details.exchange_sign_keys.exchange_pub),
320 0 : GNUNET_PQ_query_param_auto_from_type (
321 : &td->details.exchange_sign_keys.master_sig),
322 0 : GNUNET_PQ_query_param_timestamp (
323 : &td->details.exchange_sign_keys.meta.start),
324 0 : GNUNET_PQ_query_param_timestamp (
325 : &td->details.exchange_sign_keys.meta.expire_sign),
326 0 : GNUNET_PQ_query_param_timestamp (
327 : &td->details.exchange_sign_keys.meta.expire_legal),
328 : GNUNET_PQ_query_param_end
329 : };
330 :
331 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
332 : "insert_into_table_exchange_sign_keys",
333 : params);
334 : }
335 :
336 :
337 : /**
338 : * Function called with signkey_revocations records to insert into table.
339 : *
340 : * @param pg plugin context
341 : * @param td record to insert
342 : */
343 : static enum GNUNET_DB_QueryStatus
344 0 : irbt_cb_table_signkey_revocations (struct PostgresClosure *pg,
345 : const struct TALER_EXCHANGEDB_TableData *td)
346 : {
347 0 : struct GNUNET_PQ_QueryParam params[] = {
348 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
349 0 : GNUNET_PQ_query_param_uint64 (&td->details.signkey_revocations.esk_serial),
350 0 : GNUNET_PQ_query_param_auto_from_type (
351 : &td->details.signkey_revocations.master_sig),
352 : GNUNET_PQ_query_param_end
353 : };
354 :
355 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
356 : "insert_into_table_signkey_revocations",
357 : params);
358 : }
359 :
360 :
361 : /**
362 : * Function called with known_coins records to insert into table.
363 : *
364 : * @param pg plugin context
365 : * @param td record to insert
366 : */
367 : static enum GNUNET_DB_QueryStatus
368 0 : irbt_cb_table_known_coins (struct PostgresClosure *pg,
369 : const struct TALER_EXCHANGEDB_TableData *td)
370 : {
371 0 : struct GNUNET_PQ_QueryParam params[] = {
372 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
373 0 : GNUNET_PQ_query_param_auto_from_type (
374 : &td->details.known_coins.coin_pub),
375 0 : TALER_PQ_query_param_denom_sig (
376 : &td->details.known_coins.denom_sig),
377 0 : GNUNET_PQ_query_param_uint64 (
378 : &td->details.known_coins.denominations_serial),
379 : GNUNET_PQ_query_param_end
380 : };
381 :
382 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
383 : "insert_into_table_known_coins",
384 : params);
385 : }
386 :
387 :
388 : /**
389 : * Function called with refresh_commitments records to insert into table.
390 : *
391 : * @param pg plugin context
392 : * @param td record to insert
393 : */
394 : static enum GNUNET_DB_QueryStatus
395 0 : irbt_cb_table_refresh_commitments (struct PostgresClosure *pg,
396 : const struct TALER_EXCHANGEDB_TableData *td)
397 : {
398 0 : struct GNUNET_PQ_QueryParam params[] = {
399 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
400 0 : GNUNET_PQ_query_param_auto_from_type (&td->details.refresh_commitments.rc),
401 0 : GNUNET_PQ_query_param_auto_from_type (
402 : &td->details.refresh_commitments.old_coin_sig),
403 0 : TALER_PQ_query_param_amount (
404 : &td->details.refresh_commitments.amount_with_fee),
405 0 : GNUNET_PQ_query_param_uint32 (
406 : &td->details.refresh_commitments.noreveal_index),
407 0 : GNUNET_PQ_query_param_auto_from_type (
408 : &td->details.refresh_commitments.old_coin_pub),
409 : GNUNET_PQ_query_param_end
410 : };
411 :
412 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
413 : "insert_into_table_refresh_commitments",
414 : params);
415 : }
416 :
417 :
418 : /**
419 : * Function called with refresh_revealed_coins records to insert into table.
420 : *
421 : * @param pg plugin context
422 : * @param td record to insert
423 : */
424 : static enum GNUNET_DB_QueryStatus
425 0 : irbt_cb_table_refresh_revealed_coins (
426 : struct PostgresClosure *pg,
427 : const struct TALER_EXCHANGEDB_TableData *td)
428 : {
429 : struct GNUNET_HashCode h_coin_ev;
430 0 : struct GNUNET_PQ_QueryParam params[] = {
431 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
432 0 : GNUNET_PQ_query_param_uint32 (
433 : &td->details.refresh_revealed_coins.freshcoin_index),
434 0 : GNUNET_PQ_query_param_auto_from_type (
435 : &td->details.refresh_revealed_coins.link_sig),
436 0 : GNUNET_PQ_query_param_fixed_size (
437 0 : td->details.refresh_revealed_coins.coin_ev,
438 : td->details.refresh_revealed_coins.
439 : coin_ev_size),
440 0 : GNUNET_PQ_query_param_auto_from_type (&h_coin_ev),
441 0 : TALER_PQ_query_param_blinded_denom_sig (
442 : &td->details.refresh_revealed_coins.ev_sig),
443 0 : TALER_PQ_query_param_exchange_withdraw_values (
444 : &td->details.refresh_revealed_coins.ewv),
445 0 : GNUNET_PQ_query_param_uint64 (
446 : &td->details.refresh_revealed_coins.denominations_serial),
447 0 : GNUNET_PQ_query_param_uint64 (
448 : &td->details.refresh_revealed_coins.melt_serial_id),
449 : GNUNET_PQ_query_param_end
450 : };
451 :
452 0 : GNUNET_CRYPTO_hash (td->details.refresh_revealed_coins.coin_ev,
453 : td->details.refresh_revealed_coins.coin_ev_size,
454 : &h_coin_ev);
455 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
456 : "insert_into_table_refresh_revealed_coins",
457 : params);
458 : }
459 :
460 :
461 : /**
462 : * Function called with refresh_transfer_keys records to insert into table.
463 : *
464 : * @param pg plugin context
465 : * @param td record to insert
466 : */
467 : static enum GNUNET_DB_QueryStatus
468 0 : irbt_cb_table_refresh_transfer_keys (
469 : struct PostgresClosure *pg,
470 : const struct TALER_EXCHANGEDB_TableData *td)
471 : {
472 0 : struct GNUNET_PQ_QueryParam params[] = {
473 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
474 0 : GNUNET_PQ_query_param_auto_from_type (
475 : &td->details.refresh_transfer_keys.tp),
476 0 : GNUNET_PQ_query_param_fixed_size (
477 0 : &td->details.refresh_transfer_keys.tprivs[0],
478 : (TALER_CNC_KAPPA - 1)
479 : * sizeof (struct TALER_TransferPrivateKeyP)),
480 0 : GNUNET_PQ_query_param_uint64 (
481 : &td->details.refresh_transfer_keys.melt_serial_id),
482 : GNUNET_PQ_query_param_end
483 : };
484 :
485 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
486 : "insert_into_table_refresh_transfer_keys",
487 : params);
488 : }
489 :
490 :
491 : /**
492 : * Function called with deposits records to insert into table.
493 : *
494 : * @param pg plugin context
495 : * @param td record to insert
496 : */
497 : static enum GNUNET_DB_QueryStatus
498 0 : irbt_cb_table_deposits (struct PostgresClosure *pg,
499 : const struct TALER_EXCHANGEDB_TableData *td)
500 : {
501 0 : struct GNUNET_PQ_QueryParam params[] = {
502 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
503 0 : GNUNET_PQ_query_param_uint64 (&td->details.deposits.shard),
504 0 : GNUNET_PQ_query_param_uint64 (&td->details.deposits.known_coin_id),
505 0 : GNUNET_PQ_query_param_auto_from_type (
506 : &td->details.deposits.coin_pub),
507 0 : TALER_PQ_query_param_amount (&td->details.deposits.amount_with_fee),
508 0 : GNUNET_PQ_query_param_timestamp (&td->details.deposits.wallet_timestamp),
509 0 : GNUNET_PQ_query_param_timestamp (
510 : &td->details.deposits.exchange_timestamp),
511 0 : GNUNET_PQ_query_param_timestamp (&td->details.deposits.refund_deadline),
512 0 : GNUNET_PQ_query_param_timestamp (&td->details.deposits.wire_deadline),
513 0 : GNUNET_PQ_query_param_auto_from_type (&td->details.deposits.merchant_pub),
514 0 : GNUNET_PQ_query_param_auto_from_type (
515 : &td->details.deposits.h_contract_terms),
516 0 : GNUNET_PQ_query_param_auto_from_type (&td->details.deposits.coin_sig),
517 0 : GNUNET_PQ_query_param_auto_from_type (&td->details.deposits.wire_salt),
518 0 : GNUNET_PQ_query_param_auto_from_type (
519 : &td->details.deposits.wire_target_h_payto),
520 0 : GNUNET_PQ_query_param_bool (td->details.deposits.extension_blocked),
521 0 : 0 == td->details.deposits.extension_details_serial_id
522 0 : ? GNUNET_PQ_query_param_null ()
523 0 : : GNUNET_PQ_query_param_uint64 (
524 : &td->details.deposits.extension_details_serial_id),
525 : GNUNET_PQ_query_param_end
526 : };
527 :
528 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
529 : "insert_into_table_deposits",
530 : params);
531 : }
532 :
533 :
534 : /**
535 : * Function called with refunds records to insert into table.
536 : *
537 : * @param pg plugin context
538 : * @param td record to insert
539 : */
540 : static enum GNUNET_DB_QueryStatus
541 0 : irbt_cb_table_refunds (struct PostgresClosure *pg,
542 : const struct TALER_EXCHANGEDB_TableData *td)
543 : {
544 0 : struct GNUNET_PQ_QueryParam params[] = {
545 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
546 0 : GNUNET_PQ_query_param_auto_from_type (&td->details.refunds.coin_pub),
547 0 : GNUNET_PQ_query_param_auto_from_type (&td->details.refunds.merchant_sig),
548 0 : GNUNET_PQ_query_param_uint64 (&td->details.refunds.rtransaction_id),
549 0 : TALER_PQ_query_param_amount (&td->details.refunds.amount_with_fee),
550 0 : GNUNET_PQ_query_param_uint64 (&td->details.refunds.deposit_serial_id),
551 : GNUNET_PQ_query_param_end
552 : };
553 :
554 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
555 : "insert_into_table_refunds",
556 : params);
557 : }
558 :
559 :
560 : /**
561 : * Function called with wire_out records to insert into table.
562 : *
563 : * @param pg plugin context
564 : * @param td record to insert
565 : */
566 : static enum GNUNET_DB_QueryStatus
567 0 : irbt_cb_table_wire_out (struct PostgresClosure *pg,
568 : const struct TALER_EXCHANGEDB_TableData *td)
569 : {
570 0 : struct GNUNET_PQ_QueryParam params[] = {
571 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
572 0 : GNUNET_PQ_query_param_timestamp (&td->details.wire_out.execution_date),
573 0 : GNUNET_PQ_query_param_auto_from_type (&td->details.wire_out.wtid_raw),
574 0 : GNUNET_PQ_query_param_auto_from_type (
575 : &td->details.wire_out.wire_target_h_payto),
576 0 : GNUNET_PQ_query_param_string (
577 0 : td->details.wire_out.exchange_account_section),
578 0 : TALER_PQ_query_param_amount (&td->details.wire_out.amount),
579 : GNUNET_PQ_query_param_end
580 : };
581 :
582 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
583 : "insert_into_table_wire_out",
584 : params);
585 : }
586 :
587 :
588 : /**
589 : * Function called with aggregation_tracking records to insert into table.
590 : *
591 : * @param pg plugin context
592 : * @param td record to insert
593 : */
594 : static enum GNUNET_DB_QueryStatus
595 0 : irbt_cb_table_aggregation_tracking (struct PostgresClosure *pg,
596 : const struct TALER_EXCHANGEDB_TableData *td)
597 : {
598 0 : struct GNUNET_PQ_QueryParam params[] = {
599 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
600 0 : GNUNET_PQ_query_param_uint64 (
601 : &td->details.aggregation_tracking.deposit_serial_id),
602 0 : GNUNET_PQ_query_param_auto_from_type (
603 : &td->details.aggregation_tracking.wtid_raw),
604 : GNUNET_PQ_query_param_end
605 : };
606 :
607 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
608 : "insert_into_table_aggregation_tracking",
609 : params);
610 : }
611 :
612 :
613 : /**
614 : * Function called with wire_fee records to insert into table.
615 : *
616 : * @param pg plugin context
617 : * @param td record to insert
618 : */
619 : static enum GNUNET_DB_QueryStatus
620 0 : irbt_cb_table_wire_fee (struct PostgresClosure *pg,
621 : const struct TALER_EXCHANGEDB_TableData *td)
622 : {
623 0 : struct GNUNET_PQ_QueryParam params[] = {
624 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
625 0 : GNUNET_PQ_query_param_string (td->details.wire_fee.wire_method),
626 0 : GNUNET_PQ_query_param_timestamp (&td->details.wire_fee.start_date),
627 0 : GNUNET_PQ_query_param_timestamp (&td->details.wire_fee.end_date),
628 0 : TALER_PQ_query_param_amount (&td->details.wire_fee.fees.wire),
629 0 : TALER_PQ_query_param_amount (&td->details.wire_fee.fees.closing),
630 0 : TALER_PQ_query_param_amount (&td->details.wire_fee.fees.wad),
631 0 : GNUNET_PQ_query_param_auto_from_type (&td->details.wire_fee.master_sig),
632 : GNUNET_PQ_query_param_end
633 : };
634 :
635 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
636 : "insert_into_table_wire_fee",
637 : params);
638 : }
639 :
640 :
641 : /**
642 : * Function called with wire_fee records to insert into table.
643 : *
644 : * @param pg plugin context
645 : * @param td record to insert
646 : */
647 : static enum GNUNET_DB_QueryStatus
648 0 : irbt_cb_table_global_fee (struct PostgresClosure *pg,
649 : const struct TALER_EXCHANGEDB_TableData *td)
650 : {
651 0 : struct GNUNET_PQ_QueryParam params[] = {
652 0 : GNUNET_PQ_query_param_uint64 (
653 : &td->serial),
654 0 : GNUNET_PQ_query_param_timestamp (
655 : &td->details.global_fee.start_date),
656 0 : GNUNET_PQ_query_param_timestamp (
657 : &td->details.global_fee.end_date),
658 0 : TALER_PQ_query_param_amount (
659 : &td->details.global_fee.fees.history),
660 0 : TALER_PQ_query_param_amount (
661 : &td->details.global_fee.fees.kyc),
662 0 : TALER_PQ_query_param_amount (
663 : &td->details.global_fee.fees.account),
664 0 : TALER_PQ_query_param_amount (
665 : &td->details.global_fee.fees.purse),
666 0 : GNUNET_PQ_query_param_relative_time (
667 : &td->details.global_fee.purse_timeout),
668 0 : GNUNET_PQ_query_param_relative_time (
669 : &td->details.global_fee.kyc_timeout),
670 0 : GNUNET_PQ_query_param_relative_time (
671 : &td->details.global_fee.history_expiration),
672 0 : GNUNET_PQ_query_param_uint32 (
673 : &td->details.global_fee.purse_account_limit),
674 0 : GNUNET_PQ_query_param_auto_from_type (
675 : &td->details.global_fee.master_sig),
676 : GNUNET_PQ_query_param_end
677 : };
678 :
679 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
680 : "insert_into_table_global_fee",
681 : params);
682 : }
683 :
684 :
685 : /**
686 : * Function called with recoup records to insert into table.
687 : *
688 : * @param pg plugin context
689 : * @param td record to insert
690 : */
691 : static enum GNUNET_DB_QueryStatus
692 0 : irbt_cb_table_recoup (struct PostgresClosure *pg,
693 : const struct TALER_EXCHANGEDB_TableData *td)
694 : {
695 0 : struct GNUNET_PQ_QueryParam params[] = {
696 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
697 0 : GNUNET_PQ_query_param_auto_from_type (&td->details.recoup.coin_sig),
698 0 : GNUNET_PQ_query_param_auto_from_type (&td->details.recoup.coin_blind),
699 0 : TALER_PQ_query_param_amount (&td->details.recoup.amount),
700 0 : GNUNET_PQ_query_param_timestamp (&td->details.recoup.timestamp),
701 0 : GNUNET_PQ_query_param_auto_from_type (
702 : &td->details.recoup.coin_pub),
703 0 : GNUNET_PQ_query_param_uint64 (&td->details.recoup.reserve_out_serial_id),
704 : GNUNET_PQ_query_param_end
705 : };
706 :
707 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
708 : "insert_into_table_recoup",
709 : params);
710 : }
711 :
712 :
713 : /**
714 : * Function called with recoup_refresh records to insert into table.
715 : *
716 : * @param pg plugin context
717 : * @param td record to insert
718 : */
719 : static enum GNUNET_DB_QueryStatus
720 0 : irbt_cb_table_recoup_refresh (struct PostgresClosure *pg,
721 : const struct TALER_EXCHANGEDB_TableData *td)
722 : {
723 0 : struct GNUNET_PQ_QueryParam params[] = {
724 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
725 0 : GNUNET_PQ_query_param_auto_from_type (&td->details.recoup_refresh.coin_sig),
726 0 : GNUNET_PQ_query_param_auto_from_type (
727 : &td->details.recoup_refresh.coin_blind),
728 0 : TALER_PQ_query_param_amount (&td->details.recoup_refresh.amount),
729 0 : GNUNET_PQ_query_param_timestamp (&td->details.recoup_refresh.timestamp),
730 0 : GNUNET_PQ_query_param_uint64 (&td->details.recoup_refresh.known_coin_id),
731 0 : GNUNET_PQ_query_param_auto_from_type (
732 : &td->details.recoup.coin_pub),
733 0 : GNUNET_PQ_query_param_uint64 (&td->details.recoup_refresh.rrc_serial),
734 : GNUNET_PQ_query_param_end
735 : };
736 :
737 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
738 : "insert_into_table_recoup_refresh",
739 : params);
740 : }
741 :
742 :
743 : /**
744 : * Function called with extensions records to insert into table.
745 : *
746 : * @param pg plugin context
747 : * @param td record to insert
748 : */
749 : static enum GNUNET_DB_QueryStatus
750 0 : irbt_cb_table_extensions (struct PostgresClosure *pg,
751 : const struct TALER_EXCHANGEDB_TableData *td)
752 : {
753 0 : struct GNUNET_PQ_QueryParam params[] = {
754 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
755 0 : GNUNET_PQ_query_param_string (td->details.extensions.name),
756 0 : NULL == td->details.extensions.config ?
757 0 : GNUNET_PQ_query_param_null () :
758 0 : GNUNET_PQ_query_param_string (td->details.extensions.config),
759 : GNUNET_PQ_query_param_end
760 : };
761 :
762 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
763 : "insert_into_table_extensions",
764 : params);
765 : }
766 :
767 :
768 : /**
769 : * Function called with extension_details records to insert into table.
770 : *
771 : * @param pg plugin context
772 : * @param td record to insert
773 : */
774 : static enum GNUNET_DB_QueryStatus
775 0 : irbt_cb_table_extension_details (struct PostgresClosure *pg,
776 : const struct TALER_EXCHANGEDB_TableData *td)
777 : {
778 0 : struct GNUNET_PQ_QueryParam params[] = {
779 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
780 : NULL ==
781 0 : td->details.extension_details.extension_options ?
782 0 : GNUNET_PQ_query_param_null () :
783 0 : GNUNET_PQ_query_param_string (
784 0 : td->details.extension_details.extension_options),
785 : GNUNET_PQ_query_param_end
786 : };
787 :
788 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
789 : "insert_into_table_extension_details",
790 : params);
791 : }
792 :
793 :
794 : /**
795 : * Function called with purse_requests records to insert into table.
796 : *
797 : * @param pg plugin context
798 : * @param td record to insert
799 : */
800 : static enum GNUNET_DB_QueryStatus
801 0 : irbt_cb_table_purse_requests (struct PostgresClosure *pg,
802 : const struct TALER_EXCHANGEDB_TableData *td)
803 : {
804 0 : struct GNUNET_PQ_QueryParam params[] = {
805 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
806 0 : GNUNET_PQ_query_param_auto_from_type (
807 : &td->details.purse_requests.purse_pub),
808 0 : GNUNET_PQ_query_param_auto_from_type (
809 : &td->details.purse_requests.merge_pub),
810 0 : GNUNET_PQ_query_param_timestamp (
811 : &td->details.purse_requests.purse_creation),
812 0 : GNUNET_PQ_query_param_timestamp (
813 : &td->details.purse_requests.purse_expiration),
814 0 : GNUNET_PQ_query_param_auto_from_type (
815 : &td->details.purse_requests.h_contract_terms),
816 0 : GNUNET_PQ_query_param_uint32 (&td->details.purse_requests.age_limit),
817 0 : GNUNET_PQ_query_param_uint32 (&td->details.purse_requests.flags),
818 0 : TALER_PQ_query_param_amount (&td->details.purse_requests.amount_with_fee),
819 0 : TALER_PQ_query_param_amount (&td->details.purse_requests.purse_fee),
820 0 : GNUNET_PQ_query_param_auto_from_type (
821 : &td->details.purse_requests.purse_sig),
822 : GNUNET_PQ_query_param_end
823 : };
824 :
825 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
826 : "insert_into_table_purse_requests",
827 : params);
828 : }
829 :
830 :
831 : /**
832 : * Function called with purse_refunds records to insert into table.
833 : *
834 : * @param pg plugin context
835 : * @param td record to insert
836 : */
837 : static enum GNUNET_DB_QueryStatus
838 0 : irbt_cb_table_purse_refunds (struct PostgresClosure *pg,
839 : const struct TALER_EXCHANGEDB_TableData *td)
840 : {
841 0 : struct GNUNET_PQ_QueryParam params[] = {
842 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
843 0 : GNUNET_PQ_query_param_auto_from_type (
844 : &td->details.purse_refunds.purse_pub),
845 : GNUNET_PQ_query_param_end
846 : };
847 :
848 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
849 : "insert_into_table_purse_refunds",
850 : params);
851 : }
852 :
853 :
854 : /**
855 : * Function called with purse_merges records to insert into table.
856 : *
857 : * @param pg plugin context
858 : * @param td record to insert
859 : */
860 : static enum GNUNET_DB_QueryStatus
861 0 : irbt_cb_table_purse_merges (struct PostgresClosure *pg,
862 : const struct TALER_EXCHANGEDB_TableData *td)
863 : {
864 0 : struct GNUNET_PQ_QueryParam params[] = {
865 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
866 0 : GNUNET_PQ_query_param_uint64 (&td->details.purse_merges.partner_serial_id),
867 0 : GNUNET_PQ_query_param_auto_from_type (
868 : &td->details.purse_merges.reserve_pub),
869 0 : GNUNET_PQ_query_param_auto_from_type (&td->details.purse_merges.purse_pub),
870 0 : GNUNET_PQ_query_param_auto_from_type (&td->details.purse_merges.merge_sig),
871 0 : GNUNET_PQ_query_param_timestamp (&td->details.purse_merges.merge_timestamp),
872 : GNUNET_PQ_query_param_end
873 : };
874 :
875 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
876 : "insert_into_table_purse_merges",
877 : params);
878 : }
879 :
880 :
881 : /**
882 : * Function called with purse_deposits records to insert into table.
883 : *
884 : * @param pg plugin context
885 : * @param td record to insert
886 : */
887 : static enum GNUNET_DB_QueryStatus
888 0 : irbt_cb_table_purse_deposits (struct PostgresClosure *pg,
889 : const struct TALER_EXCHANGEDB_TableData *td)
890 : {
891 0 : struct GNUNET_PQ_QueryParam params[] = {
892 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
893 0 : GNUNET_PQ_query_param_uint64 (
894 : &td->details.purse_deposits.partner_serial_id),
895 0 : GNUNET_PQ_query_param_auto_from_type (
896 : &td->details.purse_deposits.purse_pub),
897 0 : GNUNET_PQ_query_param_auto_from_type (&td->details.purse_deposits.coin_pub),
898 0 : TALER_PQ_query_param_amount (&td->details.purse_deposits.amount_with_fee),
899 0 : GNUNET_PQ_query_param_auto_from_type (&td->details.purse_deposits.coin_sig),
900 : GNUNET_PQ_query_param_end
901 : };
902 :
903 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
904 : "insert_into_table_purse_deposits",
905 : params);
906 : }
907 :
908 :
909 : /**
910 : * Function called with account_mergers records to insert into table.
911 : *
912 : * @param pg plugin context
913 : * @param td record to insert
914 : */
915 : static enum GNUNET_DB_QueryStatus
916 0 : irbt_cb_table_account_mergers (struct PostgresClosure *pg,
917 : const struct TALER_EXCHANGEDB_TableData *td)
918 : {
919 0 : struct GNUNET_PQ_QueryParam params[] = {
920 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
921 0 : GNUNET_PQ_query_param_auto_from_type (
922 : &td->details.account_merges.reserve_pub),
923 0 : GNUNET_PQ_query_param_auto_from_type (
924 : &td->details.account_merges.reserve_sig),
925 0 : GNUNET_PQ_query_param_auto_from_type (
926 : &td->details.account_merges.purse_pub),
927 : GNUNET_PQ_query_param_end
928 : };
929 :
930 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
931 : "insert_into_table_account_mergers",
932 : params);
933 : }
934 :
935 :
936 : /**
937 : * Function called with history_requests records to insert into table.
938 : *
939 : * @param pg plugin context
940 : * @param td record to insert
941 : */
942 : static enum GNUNET_DB_QueryStatus
943 0 : irbt_cb_table_history_requests (struct PostgresClosure *pg,
944 : const struct TALER_EXCHANGEDB_TableData *td)
945 : {
946 0 : struct GNUNET_PQ_QueryParam params[] = {
947 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
948 0 : GNUNET_PQ_query_param_auto_from_type (
949 : &td->details.history_requests.reserve_pub),
950 0 : GNUNET_PQ_query_param_timestamp (
951 : &td->details.history_requests.request_timestamp),
952 0 : GNUNET_PQ_query_param_auto_from_type (
953 : &td->details.history_requests.reserve_sig),
954 0 : TALER_PQ_query_param_amount (
955 : &td->details.history_requests.history_fee),
956 : GNUNET_PQ_query_param_end
957 : };
958 :
959 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
960 : "insert_into_table_history_requests",
961 : params);
962 : }
963 :
964 :
965 : /**
966 : * Function called with close_requests records to insert into table.
967 : *
968 : * @param pg plugin context
969 : * @param td record to insert
970 : */
971 : static enum GNUNET_DB_QueryStatus
972 0 : irbt_cb_table_close_requests (struct PostgresClosure *pg,
973 : const struct TALER_EXCHANGEDB_TableData *td)
974 : {
975 0 : struct GNUNET_PQ_QueryParam params[] = {
976 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
977 0 : GNUNET_PQ_query_param_auto_from_type (
978 : &td->details.close_requests.reserve_pub),
979 0 : GNUNET_PQ_query_param_timestamp (
980 : &td->details.close_requests.close_timestamp),
981 0 : GNUNET_PQ_query_param_auto_from_type (
982 : &td->details.close_requests.reserve_sig),
983 0 : TALER_PQ_query_param_amount (
984 : &td->details.close_requests.close),
985 : GNUNET_PQ_query_param_end
986 : };
987 :
988 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
989 : "insert_into_table_close_requests",
990 : params);
991 : }
992 :
993 :
994 : /**
995 : * Function called with wads_out records to insert into table.
996 : *
997 : * @param pg plugin context
998 : * @param td record to insert
999 : */
1000 : static enum GNUNET_DB_QueryStatus
1001 0 : irbt_cb_table_wads_out (struct PostgresClosure *pg,
1002 : const struct TALER_EXCHANGEDB_TableData *td)
1003 : {
1004 0 : struct GNUNET_PQ_QueryParam params[] = {
1005 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
1006 0 : GNUNET_PQ_query_param_auto_from_type (&td->details.wads_out.wad_id),
1007 0 : GNUNET_PQ_query_param_uint64 (&td->details.wads_out.partner_serial_id),
1008 0 : TALER_PQ_query_param_amount (&td->details.wads_out.amount),
1009 0 : GNUNET_PQ_query_param_timestamp (&td->details.wads_out.execution_time),
1010 : GNUNET_PQ_query_param_end
1011 : };
1012 :
1013 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
1014 : "insert_into_table_wads_out",
1015 : params);
1016 : }
1017 :
1018 :
1019 : /**
1020 : * Function called with wads_out_entries records to insert into table.
1021 : *
1022 : * @param pg plugin context
1023 : * @param td record to insert
1024 : */
1025 : static enum GNUNET_DB_QueryStatus
1026 0 : irbt_cb_table_wads_out_entries (struct PostgresClosure *pg,
1027 : const struct TALER_EXCHANGEDB_TableData *td)
1028 : {
1029 0 : struct GNUNET_PQ_QueryParam params[] = {
1030 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
1031 0 : GNUNET_PQ_query_param_uint64 (
1032 : &td->details.wads_out_entries.wad_out_serial_id),
1033 0 : GNUNET_PQ_query_param_auto_from_type (
1034 : &td->details.wads_out_entries.reserve_pub),
1035 0 : GNUNET_PQ_query_param_auto_from_type (
1036 : &td->details.wads_out_entries.purse_pub),
1037 0 : GNUNET_PQ_query_param_auto_from_type (
1038 : &td->details.wads_out_entries.h_contract),
1039 0 : GNUNET_PQ_query_param_timestamp (
1040 : &td->details.wads_out_entries.purse_expiration),
1041 0 : GNUNET_PQ_query_param_timestamp (
1042 : &td->details.wads_out_entries.merge_timestamp),
1043 0 : TALER_PQ_query_param_amount (
1044 : &td->details.wads_out_entries.amount_with_fee),
1045 0 : TALER_PQ_query_param_amount (
1046 : &td->details.wads_out_entries.wad_fee),
1047 0 : TALER_PQ_query_param_amount (
1048 : &td->details.wads_out_entries.deposit_fees),
1049 0 : GNUNET_PQ_query_param_auto_from_type (
1050 : &td->details.wads_out_entries.reserve_sig),
1051 0 : GNUNET_PQ_query_param_auto_from_type (
1052 : &td->details.wads_out_entries.purse_sig),
1053 : GNUNET_PQ_query_param_end
1054 : };
1055 :
1056 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
1057 : "insert_into_table_wads_out_entries",
1058 : params);
1059 : }
1060 :
1061 :
1062 : /**
1063 : * Function called with wads_in records to insert into table.
1064 : *
1065 : * @param pg plugin context
1066 : * @param td record to insert
1067 : */
1068 : static enum GNUNET_DB_QueryStatus
1069 0 : irbt_cb_table_wads_in (struct PostgresClosure *pg,
1070 : const struct TALER_EXCHANGEDB_TableData *td)
1071 : {
1072 0 : struct GNUNET_PQ_QueryParam params[] = {
1073 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
1074 0 : GNUNET_PQ_query_param_auto_from_type (&td->details.wads_in.wad_id),
1075 0 : GNUNET_PQ_query_param_string (td->details.wads_in.origin_exchange_url),
1076 0 : TALER_PQ_query_param_amount (&td->details.wads_in.amount),
1077 0 : GNUNET_PQ_query_param_timestamp (&td->details.wads_in.arrival_time),
1078 : GNUNET_PQ_query_param_end
1079 : };
1080 :
1081 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
1082 : "insert_into_table_wads_in",
1083 : params);
1084 : }
1085 :
1086 :
1087 : /**
1088 : * Function called with wads_in_entries records to insert into table.
1089 : *
1090 : * @param pg plugin context
1091 : * @param td record to insert
1092 : */
1093 : static enum GNUNET_DB_QueryStatus
1094 0 : irbt_cb_table_wads_in_entries (struct PostgresClosure *pg,
1095 : const struct TALER_EXCHANGEDB_TableData *td)
1096 : {
1097 0 : struct GNUNET_PQ_QueryParam params[] = {
1098 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
1099 0 : GNUNET_PQ_query_param_auto_from_type (
1100 : &td->details.wads_in_entries.reserve_pub),
1101 0 : GNUNET_PQ_query_param_auto_from_type (
1102 : &td->details.wads_in_entries.purse_pub),
1103 0 : GNUNET_PQ_query_param_auto_from_type (
1104 : &td->details.wads_in_entries.h_contract),
1105 0 : GNUNET_PQ_query_param_timestamp (
1106 : &td->details.wads_in_entries.purse_expiration),
1107 0 : GNUNET_PQ_query_param_timestamp (
1108 : &td->details.wads_in_entries.merge_timestamp),
1109 0 : TALER_PQ_query_param_amount (
1110 : &td->details.wads_in_entries.amount_with_fee),
1111 0 : TALER_PQ_query_param_amount (
1112 : &td->details.wads_in_entries.wad_fee),
1113 0 : TALER_PQ_query_param_amount (
1114 : &td->details.wads_in_entries.deposit_fees),
1115 0 : GNUNET_PQ_query_param_auto_from_type (
1116 : &td->details.wads_in_entries.reserve_sig),
1117 0 : GNUNET_PQ_query_param_auto_from_type (
1118 : &td->details.wads_in_entries.purse_sig),
1119 : GNUNET_PQ_query_param_end
1120 : };
1121 :
1122 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
1123 : "insert_into_table_wads_in_entries",
1124 : params);
1125 : }
1126 :
1127 :
1128 : /**
1129 : * Function called with profit_drains records to insert into table.
1130 : *
1131 : * @param pg plugin context
1132 : * @param td record to insert
1133 : */
1134 : static enum GNUNET_DB_QueryStatus
1135 0 : irbt_cb_table_profit_drains (struct PostgresClosure *pg,
1136 : const struct TALER_EXCHANGEDB_TableData *td)
1137 : {
1138 0 : struct GNUNET_PQ_QueryParam params[] = {
1139 0 : GNUNET_PQ_query_param_uint64 (&td->serial),
1140 0 : GNUNET_PQ_query_param_auto_from_type (
1141 : &td->details.profit_drains.wtid),
1142 0 : GNUNET_PQ_query_param_string (
1143 0 : td->details.profit_drains.account_section),
1144 0 : GNUNET_PQ_query_param_string (
1145 0 : td->details.profit_drains.payto_uri),
1146 0 : GNUNET_PQ_query_param_timestamp (
1147 : &td->details.profit_drains.trigger_date),
1148 0 : TALER_PQ_query_param_amount (
1149 : &td->details.profit_drains.amount),
1150 0 : GNUNET_PQ_query_param_auto_from_type (
1151 : &td->details.profit_drains.master_sig),
1152 : GNUNET_PQ_query_param_end
1153 : };
1154 :
1155 0 : return GNUNET_PQ_eval_prepared_non_select (pg->conn,
1156 : "insert_into_table_profit_drains",
1157 : params);
1158 : }
1159 :
1160 :
1161 : /* end of irbt_callbacks.c */
|