aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSree Harsha Totakura <sreeharsha@totakura.in>2015-05-25 22:47:00 +0200
committerSree Harsha Totakura <sreeharsha@totakura.in>2015-05-25 22:47:00 +0200
commit126a747f82e7894445775eead9ef2191e99f09c1 (patch)
treeaab2afd857177584794a2b7bb01dd7e25ac5b89f
parentd49a0d6567e35450fe227ab4ba335af6285b63eb (diff)
mintdb postgres: add deposit fee to the denominations
-rw-r--r--src/mintdb/plugin_mintdb_postgres.c13
-rw-r--r--src/mintdb/test_mintdb.c2
2 files changed, 12 insertions, 3 deletions
diff --git a/src/mintdb/plugin_mintdb_postgres.c b/src/mintdb/plugin_mintdb_postgres.c
index 35861c9c8..35aab98bd 100644
--- a/src/mintdb/plugin_mintdb_postgres.c
+++ b/src/mintdb/plugin_mintdb_postgres.c
@@ -196,6 +196,9 @@ postgres_create_tables (void *cls,
",fee_withdraw_val INT8 NOT NULL"
",fee_withdraw_frac INT4 NOT NULL"
",fee_withdraw_curr VARCHAR("TALER_CURRENCY_LEN_STR") NOT NULL"
+ ",fee_deposit_val INT8 NOT NULL"
+ ",fee_deposit_frac INT4 NOT NULL"
+ ",fee_deposit_curr VARCHAR("TALER_CURRENCY_LEN_STR") NOT NULL"
",fee_refresh_val INT8 NOT NULL"
",fee_refresh_frac INT4 NOT NULL"
",fee_refresh_curr VARCHAR("TALER_CURRENCY_LEN_STR") NOT NULL"
@@ -393,13 +396,16 @@ postgres_prepare (PGconn *db_conn)
",coin_curr" /* assuming same currency for fees */
",fee_withdraw_val"
",fee_withdraw_frac"
- ",fee_withdraw_curr" /* must match coin_currency */
+ ",fee_withdraw_curr" /* must match coin_curr */
+ ",fee_deposit_val"
+ ",fee_deposit_frac"
+ ",fee_deposit_curr" /* must match coin_curr */
",fee_refresh_val"
",fee_refresh_frac"
- ",fee_refresh_curr" /* must match coin_currency */
+ ",fee_refresh_curr" /* must match coin_curr */
") VALUES "
"($1, $2, $3, $4, $5, $6,"
- "$7, $8, $9, $10, $11, $12, $13, $14);",
+ "$7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17);",
14, NULL);
PREPARE ("get_reserve",
"SELECT "
@@ -845,6 +851,7 @@ postgres_insert_denomination (void *cls,
TALER_PQ_query_param_auto_from_type (&issue->expire_legal.abs_value_us__),
TALER_PQ_query_param_amount_nbo (&issue->value),
TALER_PQ_query_param_amount_nbo (&issue->fee_withdraw),
+ TALER_PQ_query_param_amount_nbo (&issue->fee_deposit),
TALER_PQ_query_param_amount_nbo (&issue->fee_refresh),
TALER_PQ_query_param_end
};
diff --git a/src/mintdb/test_mintdb.c b/src/mintdb/test_mintdb.c
index 8a7e8cade..b93965665 100644
--- a/src/mintdb/test_mintdb.c
+++ b/src/mintdb/test_mintdb.c
@@ -139,6 +139,7 @@ test_known_coins (struct TALER_MINTDB_Session *session)
dki.issue.fee_withdraw.value = 0;
dki.issue.fee_withdraw.fraction = htonl (100);
(void) strcpy (dki.issue.fee_withdraw.currency, CURRENCY);
+ dki.issue.fee_deposit = dki.issue.fee_withdraw;
dki.issue.fee_refresh = dki.issue.fee_withdraw;
FAILIF (GNUNET_OK !=
plugin->insert_denomination (plugin->cls,
@@ -308,6 +309,7 @@ run (void *cls,
dki.issue.fee_withdraw.value = 0;
dki.issue.fee_withdraw.fraction = htonl (100);
(void) strcpy (dki.issue.fee_withdraw.currency, CURRENCY);
+ dki.issue.fee_deposit = dki.issue.fee_withdraw;
dki.issue.fee_refresh = dki.issue.fee_withdraw;
FAILIF (GNUNET_OK !=
plugin->insert_denomination (plugin->cls,