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 (2921B)


      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 #ifndef TALER_EXCHANGEDB_DENOMINATIONS_RESULT_CLOSURE
     41 /**
     42  * Type of the closure for #TALER_EXCHANGEDB_DenominationsCallback.
     43  */
     44 #define TALER_EXCHANGEDB_DENOMINATIONS_RESULT_CLOSURE void
     45 #endif
     46 typedef void
     47 (*TALER_EXCHANGEDB_DenominationsCallback)(
     48   TALER_EXCHANGEDB_DENOMINATIONS_RESULT_CLOSURE *cls,
     49   const struct TALER_DenominationPublicKey *denom_pub,
     50   const struct TALER_DenominationHashP *h_denom_pub,
     51   const struct TALER_EXCHANGEDB_DenominationKeyMetaData *meta,
     52   const struct TALER_MasterSignatureP *master_sig,
     53   bool recoup_possible);
     54 
     55 
     56 /**
     57  * Function called to invoke @a cb on every known denomination key (revoked
     58  * and non-revoked) that has been signed by the master key. Runs in its own
     59  * read-only transaction.
     60  *
     61  *
     62  * @param pg the database context
     63  * @param cb function to call on each denomination key
     64  * @param cb_cls closure for @a cb
     65  * @return transaction status code
     66  */
     67 enum GNUNET_DB_QueryStatus
     68 TALER_EXCHANGEDB_iterate_denominations (struct
     69                                         TALER_EXCHANGEDB_PostgresContext *pg,
     70                                         TALER_EXCHANGEDB_DenominationsCallback
     71                                         cb,
     72                                         TALER_EXCHANGEDB_DENOMINATIONS_RESULT_CLOSURE
     73                                         *cb_cls);
     74 
     75 #endif