exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

select_all_purse_decisions_above_serial_id.h (3203B)


      1 /*
      2    This file is part of TALER
      3    Copyright (C) 2022 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 select_all_purse_decisions_above_serial_id.h
     18  * @brief implementation of the select_all_purse_decisions_above_serial_id function for Postgres
     19  * @author Christian Grothoff
     20  */
     21 #ifndef EXCHANGE_DATABASE_SELECT_ALL_PURSE_DECISIONS_ABOVE_SERIAL_ID_H
     22 #define EXCHANGE_DATABASE_SELECT_ALL_PURSE_DECISIONS_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 decisions 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 refunded true if decision was to refund
     37  * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
     38  */
     39 typedef enum GNUNET_GenericReturnValue
     40 (*TALER_EXCHANGEDB_AllPurseDecisionCallback)(
     41   void *cls,
     42   uint64_t rowid,
     43   const struct TALER_PurseContractPublicKeyP *purse_pub,
     44   bool refunded);
     45 
     46 
     47 /* Callback typedefs */
     48 /**
     49  * Function called with details about purse decisions that have been made, with
     50  * the goal of auditing the purse's execution.
     51  *
     52  * @param cls closure
     53  * @param rowid unique serial ID for the deposit in our DB
     54  * @param purse_pub public key of the purse
     55  * @param refunded true if decision was to refund
     56  * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop
     57  */
     58 typedef enum GNUNET_GenericReturnValue
     59 (*TALER_EXCHANGEDB_AllPurseDecisionCallback)(
     60   void *cls,
     61   uint64_t rowid,
     62   const struct TALER_PurseContractPublicKeyP *purse_pub,
     63   bool refunded);
     64 
     65 /**
     66  * Select purse decisions above @a serial_id in monotonically increasing
     67  * order.
     68  *
     69  * @param pg the database context
     70  * @param serial_id highest serial ID to exclude (select strictly larger)
     71  * @param cb function to call on each result
     72  * @param cb_cls closure for @a cb
     73  * @return transaction status code
     74  */
     75 enum GNUNET_DB_QueryStatus
     76 TALER_EXCHANGEDB_select_all_purse_decisions_above_serial_id (struct
     77                                                              TALER_EXCHANGEDB_PostgresContext
     78                                                              *pg,
     79                                                              uint64_t serial_id,
     80                                                              TALER_EXCHANGEDB_AllPurseDecisionCallback
     81                                                              cb,
     82                                                              void *cb_cls);
     83 
     84 
     85 #endif