select_all_purse_deletions_above_serial_id.h (3757B)
1 /* 2 This file is part of TALER 3 Copyright (C) 2025 Taler Systems SA 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 src/include/exchange-database/select_all_purse_deletions_above_serial_id.h 18 * @brief implementation of the select_all_purse_deletions_above_serial_id function for Postgres 19 * @author Christian Grothoff 20 */ 21 #ifndef EXCHANGE_DATABASE_SELECT_ALL_PURSE_DELETIONS_ABOVE_SERIAL_ID_H 22 #define EXCHANGE_DATABASE_SELECT_ALL_PURSE_DELETIONS_ABOVE_SERIAL_ID_H 23 24 #include "taler/taler_util.h" 25 #include "taler/taler_json_lib.h" 26 #include "exchangedb_lib.h" 27 28 29 /** 30 * Function called with details about purse deletions that have been made, with 31 * the goal of auditing the purse's execution. 32 * 33 * @param cls closure 34 * @param rowid unique serial ID for the deposit in our DB 35 * @param purse_pub public key of the purse 36 * @param purse_sig signature affirming deletion of the purse 37 * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop 38 */ 39 #ifndef TALER_EXCHANGEDB_ALL_PURSE_DELETIONS_RESULT_CLOSURE 40 /** 41 * Type of the closure for #TALER_EXCHANGEDB_AllPurseDeletionsCallback. 42 */ 43 #define TALER_EXCHANGEDB_ALL_PURSE_DELETIONS_RESULT_CLOSURE void 44 #endif 45 typedef enum GNUNET_GenericReturnValue 46 (*TALER_EXCHANGEDB_AllPurseDeletionsCallback)( 47 TALER_EXCHANGEDB_ALL_PURSE_DELETIONS_RESULT_CLOSURE *cls, 48 uint64_t rowid, 49 const struct TALER_PurseContractPublicKeyP *purse_pub, 50 const struct TALER_PurseContractSignatureP *purse_sig); 51 52 53 /* Callback typedefs */ 54 /** 55 * Function called with details about purse deletions that have been made, with 56 * the goal of auditing the purse's execution. 57 * 58 * @param cls closure 59 * @param rowid unique serial ID for the deposit in our DB 60 * @param purse_pub public key of the purse 61 * @param purse_sig signature affirming deletion of the purse 62 * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop 63 */ 64 typedef enum GNUNET_GenericReturnValue 65 (*TALER_EXCHANGEDB_AllPurseDeletionsCallback)( 66 TALER_EXCHANGEDB_ALL_PURSE_DELETIONS_RESULT_CLOSURE *cls, 67 uint64_t rowid, 68 const struct TALER_PurseContractPublicKeyP *purse_pub, 69 const struct TALER_PurseContractSignatureP *purse_sig); 70 71 /** 72 * Select all purse deletions above @a serial_id in monotonically increasing 73 * order. 74 * 75 * @param pg the database context 76 * @param serial_id highest serial ID to exclude (select strictly larger) 77 * @param cb function to call on each result 78 * @param cb_cls closure for @a cb 79 * @return transaction status code 80 */ 81 enum GNUNET_DB_QueryStatus 82 TALER_EXCHANGEDB_select_all_purse_deletions_above_serial_id (struct 83 TALER_EXCHANGEDB_PostgresContext 84 *pg, 85 uint64_t serial_id, 86 TALER_EXCHANGEDB_AllPurseDeletionsCallback 87 cb, 88 TALER_EXCHANGEDB_ALL_PURSE_DELETIONS_RESULT_CLOSURE 89 *cb_cls); 90 91 #endif