exchange

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

iterate_auditor_denominations.h (3126B)


      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 src/include/exchange-database/iterate_auditor_denominations.h
     18  * @brief implementation of the iterate_auditor_denominations function for Postgres
     19  * @author Christian Grothoff
     20  */
     21 #ifndef EXCHANGE_DATABASE_ITERATE_AUDITOR_DENOMINATIONS_H
     22 #define EXCHANGE_DATABASE_ITERATE_AUDITOR_DENOMINATIONS_H
     23 
     24 #include "taler/taler_json_lib.h"
     25 #include "exchangedb_lib.h"
     26 
     27 
     28 /**
     29  * Function called with information about the denominations
     30  * audited by the exchange's auditors.
     31  *
     32  * @param cls closure with a `struct TEH_KeyStateHandle *`
     33  * @param auditor_pub the public key of an auditor
     34  * @param h_denom_pub hash of a denomination key audited by this auditor
     35  * @param auditor_sig signature from the auditor affirming this
     36  */
     37 typedef void
     38 (*TALER_EXCHANGEDB_AuditorDenominationsCallback)(
     39   void *cls,
     40   const struct TALER_AuditorPublicKeyP *auditor_pub,
     41   const struct TALER_DenominationHashP *h_denom_pub,
     42   const struct TALER_AuditorSignatureP *auditor_sig);
     43 
     44 
     45 /* Callback typedefs */
     46 /**
     47  * Function called with information about the denominations
     48  * audited by the exchange's auditors.
     49  *
     50  * @param cls closure with a `struct TEH_KeyStateHandle *`
     51  * @param auditor_pub the public key of an auditor
     52  * @param h_denom_pub hash of a denomination key audited by this auditor
     53  * @param auditor_sig signature from the auditor affirming this
     54  */
     55 typedef void
     56 (*TALER_EXCHANGEDB_AuditorDenominationsCallback)(
     57   void *cls,
     58   const struct TALER_AuditorPublicKeyP *auditor_pub,
     59   const struct TALER_DenominationHashP *h_denom_pub,
     60   const struct TALER_AuditorSignatureP *auditor_sig);
     61 
     62 /**
     63  * Function called to invoke @a cb on every denomination with an active
     64  * auditor. Disabled auditors and denominations without auditor are
     65  * skipped. Runs in its own read-only transaction.
     66  *
     67  * @param pg the database context
     68  * @param cb function to call on each active auditor
     69  * @param cb_cls closure for @a cb
     70  * @return transaction status code
     71  */
     72 enum GNUNET_DB_QueryStatus
     73 TALER_EXCHANGEDB_iterate_auditor_denominations (struct
     74                                                 TALER_EXCHANGEDB_PostgresContext
     75                                                 *pg
     76                                                 ,
     77                                                 TALER_EXCHANGEDB_AuditorDenominationsCallback
     78                                                 cb,
     79                                                 void *cb_cls);
     80 
     81 #endif