exchange

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

iterate_denominations.h (2603B)


      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_denominations.h
     18  * @brief implementation of the iterate_denominations function for Postgres
     19  * @author Christian Grothoff
     20  */
     21 #ifndef EXCHANGE_DATABASE_ITERATE_DENOMINATIONS_H
     22 #define EXCHANGE_DATABASE_ITERATE_DENOMINATIONS_H
     23 
     24 #include "taler/taler_json_lib.h"
     25 #include "exchangedb_lib.h"
     26 
     27 
     28 /**
     29  * Signature of a function called with information about the exchange's
     30  * denomination keys.
     31  *
     32  * @param cls closure with a `struct TEH_KeyStateHandle *`
     33  * @param denom_pub public key of the denomination
     34  * @param h_denom_pub hash of @a denom_pub
     35  * @param meta meta data information about the denomination type (value, expirations, fees)
     36  * @param master_sig master signature affirming the validity of this denomination
     37  * @param recoup_possible true if the key was revoked and clients can currently recoup
     38  *        coins of this denomination
     39  */
     40 typedef void
     41 (*TALER_EXCHANGEDB_DenominationsCallback)(
     42   void *cls,
     43   const struct TALER_DenominationPublicKey *denom_pub,
     44   const struct TALER_DenominationHashP *h_denom_pub,
     45   const struct TALER_EXCHANGEDB_DenominationKeyMetaData *meta,
     46   const struct TALER_MasterSignatureP *master_sig,
     47   bool recoup_possible);
     48 
     49 
     50 /**
     51  * Function called to invoke @a cb on every known denomination key (revoked
     52  * and non-revoked) that has been signed by the master key. Runs in its own
     53  * read-only transaction.
     54  *
     55  *
     56  * @param pg the database context
     57  * @param cb function to call on each denomination key
     58  * @param cb_cls closure for @a cb
     59  * @return transaction status code
     60  */
     61 enum GNUNET_DB_QueryStatus
     62 TALER_EXCHANGEDB_iterate_denominations (struct
     63                                         TALER_EXCHANGEDB_PostgresContext *pg,
     64                                         TALER_EXCHANGEDB_DenominationsCallback
     65                                         cb,
     66                                         void *cb_cls);
     67 
     68 #endif