pg_lookup_wire_fee_by_time.h (2814B)
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 exchangedb/pg_lookup_wire_fee_by_time.h 18 * @brief implementation of the lookup_wire_fee_by_time function for Postgres 19 * @author Christian Grothoff 20 */ 21 #ifndef PG_LOOKUP_WIRE_FEE_BY_TIME_H 22 #define PG_LOOKUP_WIRE_FEE_BY_TIME_H 23 24 #include "taler/taler_util.h" 25 #include "taler/taler_json_lib.h" 26 #include "taler/taler_exchangedb_plugin.h" 27 28 29 /** 30 * Lookup information about known wire fees. Finds all applicable 31 * fees in the given range. If they are identical, returns the 32 * respective @a fees. If any of the fees 33 * differ between @a start_time and @a end_time, the transaction 34 * succeeds BUT returns an invalid amount for both fees. 35 * 36 * @param cls closure 37 * @param wire_method the wire method to lookup fees for 38 * @param start_time starting time of fee 39 * @param end_time end time of fee 40 * @param[out] fees wire fees for that time period; if 41 * different fees exists within this time 42 * period, an 'invalid' amount is returned. 43 * @return transaction status code 44 */ 45 enum GNUNET_DB_QueryStatus 46 TEH_PG_lookup_wire_fee_by_time ( 47 void *cls, 48 const char *wire_method, 49 struct GNUNET_TIME_Timestamp start_time, 50 struct GNUNET_TIME_Timestamp end_time, 51 struct TALER_WireFeeSet *fees); 52 53 /** 54 * Lookup information about known wire fees. Finds all applicable 55 * fees in the given range. If they are identical, returns the 56 * respective @a fees. If any of the fees 57 * differ between @a start_time and @a end_time, the transaction 58 * succeeds BUT returns an invalid amount for both fees. 59 * 60 * @param cls closure 61 * @param wire_method the wire method to lookup fees for 62 * @param start_time starting time of fee 63 * @param end_time end time of fee 64 * @param[out] fees wire fees for that time period; if 65 * different fees exists within this time 66 * period, an 'invalid' amount is returned. 67 * @return transaction status code 68 */ 69 enum GNUNET_DB_QueryStatus 70 TEH_PG_lookup_wire_fee_by_time ( 71 void *cls, 72 const char *wire_method, 73 struct GNUNET_TIME_Timestamp start_time, 74 struct GNUNET_TIME_Timestamp end_time, 75 struct TALER_WireFeeSet *fees); 76 77 #endif