summaryrefslogtreecommitdiff
path: root/src/backenddb/plugin_merchantdb_postgres.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backenddb/plugin_merchantdb_postgres.c')
-rw-r--r--src/backenddb/plugin_merchantdb_postgres.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c
index 834b73a3..39f42aef 100644
--- a/src/backenddb/plugin_merchantdb_postgres.c
+++ b/src/backenddb/plugin_merchantdb_postgres.c
@@ -4210,9 +4210,7 @@ RETRY:
* @param master_pub public key of the exchange
* @param wire_method the wire method
* @param contract_date date of the contract to use for the lookup
- * @param[out] wire_fee wire fee charged
- * @param[out] closing_fee closing fee charged (irrelevant for us,
- * but needed to check signature)
+ * @param[out] fees wire fees charged
* @param[out] start_date start of fee being used
* @param[out] end_date end of fee being used
* @param[out] master_sig signature of exchange over fee structure
@@ -4223,8 +4221,7 @@ postgres_lookup_wire_fee (void *cls,
const struct TALER_MasterPublicKeyP *master_pub,
const char *wire_method,
struct GNUNET_TIME_Timestamp contract_date,
- struct TALER_Amount *wire_fee,
- struct TALER_Amount *closing_fee,
+ struct TALER_WireFeeSet *fees,
struct GNUNET_TIME_Timestamp *start_date,
struct GNUNET_TIME_Timestamp *end_date,
struct TALER_MasterSignatureP *master_sig)
@@ -4239,9 +4236,11 @@ postgres_lookup_wire_fee (void *cls,
};
struct GNUNET_PQ_ResultSpec rs[] = {
TALER_PQ_RESULT_SPEC_AMOUNT ("wire_fee",
- wire_fee),
+ &fees->wire),
TALER_PQ_RESULT_SPEC_AMOUNT ("closing_fee",
- closing_fee),
+ &fees->closing),
+ TALER_PQ_RESULT_SPEC_AMOUNT ("wad_fee",
+ &fees->wad),
GNUNET_PQ_result_spec_timestamp ("start_date",
start_date),
GNUNET_PQ_result_spec_timestamp ("end_date",
@@ -5036,9 +5035,7 @@ postgres_lookup_transfers (void *cls,
* @param cls closure
* @param master_pub public key of the exchange
* @param h_wire_method hash of wire method
- * @param wire_fee wire fee charged
- * @param closing_fee closing fee charged (irrelevant for us,
- * but needed to check signature)
+ * @param fees the fee charged
* @param start_date start of fee being used
* @param end_date end of fee being used
* @param master_sig signature of exchange over fee structure
@@ -5049,8 +5046,7 @@ postgres_store_wire_fee_by_exchange (
void *cls,
const struct TALER_MasterPublicKeyP *master_pub,
const struct GNUNET_HashCode *h_wire_method,
- const struct TALER_Amount *wire_fee,
- const struct TALER_Amount *closing_fee,
+ const struct TALER_WireFeeSet *fees,
struct GNUNET_TIME_Timestamp start_date,
struct GNUNET_TIME_Timestamp end_date,
const struct TALER_MasterSignatureP *master_sig)
@@ -5059,8 +5055,9 @@ postgres_store_wire_fee_by_exchange (
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (master_pub),
GNUNET_PQ_query_param_auto_from_type (h_wire_method),
- TALER_PQ_query_param_amount (wire_fee),
- TALER_PQ_query_param_amount (closing_fee),
+ TALER_PQ_query_param_amount (&fees->wire),
+ TALER_PQ_query_param_amount (&fees->closing),
+ TALER_PQ_query_param_amount (&fees->wad),
GNUNET_PQ_query_param_timestamp (&start_date),
GNUNET_PQ_query_param_timestamp (&end_date),
GNUNET_PQ_query_param_auto_from_type (master_sig),
@@ -5073,7 +5070,7 @@ postgres_store_wire_fee_by_exchange (
"Storing wire fee for %s starting at %s of %s\n",
TALER_B2S (master_pub),
GNUNET_TIME_timestamp2s (start_date),
- TALER_amount2s (wire_fee));
+ TALER_amount2s (&fees->wire));
return GNUNET_PQ_eval_prepared_non_select (pg->conn,
"insert_wire_fee",
params);
@@ -8567,6 +8564,8 @@ postgres_connect (void *cls)
",wire_fee_frac"
",closing_fee_val"
",closing_fee_frac"
+ ",wad_fee_val"
+ ",wad_fee_frac"
",start_date"
",end_date"
",master_sig"
@@ -8879,12 +8878,14 @@ postgres_connect (void *cls)
",wire_fee_frac"
",closing_fee_val"
",closing_fee_frac"
+ ",wad_fee_val"
+ ",wad_fee_frac"
",start_date"
",end_date"
",master_sig)"
" VALUES "
- "($1, $2, $3, $4, $5, $6, $7, $8, $9)",
- 9),
+ "($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)",
+ 11),
/* For postgres_insert_reserve() */
GNUNET_PQ_make_prepare ("insert_reserve",
"INSERT INTO merchant_tip_reserves"