mintdb postgres: add deposit fee to the denominations
This commit is contained in:
parent
d49a0d6567
commit
126a747f82
@ -196,6 +196,9 @@ postgres_create_tables (void *cls,
|
|||||||
",fee_withdraw_val INT8 NOT NULL"
|
",fee_withdraw_val INT8 NOT NULL"
|
||||||
",fee_withdraw_frac INT4 NOT NULL"
|
",fee_withdraw_frac INT4 NOT NULL"
|
||||||
",fee_withdraw_curr VARCHAR("TALER_CURRENCY_LEN_STR") 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_val INT8 NOT NULL"
|
||||||
",fee_refresh_frac INT4 NOT NULL"
|
",fee_refresh_frac INT4 NOT NULL"
|
||||||
",fee_refresh_curr VARCHAR("TALER_CURRENCY_LEN_STR") 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 */
|
",coin_curr" /* assuming same currency for fees */
|
||||||
",fee_withdraw_val"
|
",fee_withdraw_val"
|
||||||
",fee_withdraw_frac"
|
",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_val"
|
||||||
",fee_refresh_frac"
|
",fee_refresh_frac"
|
||||||
",fee_refresh_curr" /* must match coin_currency */
|
",fee_refresh_curr" /* must match coin_curr */
|
||||||
") VALUES "
|
") VALUES "
|
||||||
"($1, $2, $3, $4, $5, $6,"
|
"($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);
|
14, NULL);
|
||||||
PREPARE ("get_reserve",
|
PREPARE ("get_reserve",
|
||||||
"SELECT "
|
"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_auto_from_type (&issue->expire_legal.abs_value_us__),
|
||||||
TALER_PQ_query_param_amount_nbo (&issue->value),
|
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_withdraw),
|
||||||
|
TALER_PQ_query_param_amount_nbo (&issue->fee_deposit),
|
||||||
TALER_PQ_query_param_amount_nbo (&issue->fee_refresh),
|
TALER_PQ_query_param_amount_nbo (&issue->fee_refresh),
|
||||||
TALER_PQ_query_param_end
|
TALER_PQ_query_param_end
|
||||||
};
|
};
|
||||||
|
@ -139,6 +139,7 @@ test_known_coins (struct TALER_MINTDB_Session *session)
|
|||||||
dki.issue.fee_withdraw.value = 0;
|
dki.issue.fee_withdraw.value = 0;
|
||||||
dki.issue.fee_withdraw.fraction = htonl (100);
|
dki.issue.fee_withdraw.fraction = htonl (100);
|
||||||
(void) strcpy (dki.issue.fee_withdraw.currency, CURRENCY);
|
(void) strcpy (dki.issue.fee_withdraw.currency, CURRENCY);
|
||||||
|
dki.issue.fee_deposit = dki.issue.fee_withdraw;
|
||||||
dki.issue.fee_refresh = dki.issue.fee_withdraw;
|
dki.issue.fee_refresh = dki.issue.fee_withdraw;
|
||||||
FAILIF (GNUNET_OK !=
|
FAILIF (GNUNET_OK !=
|
||||||
plugin->insert_denomination (plugin->cls,
|
plugin->insert_denomination (plugin->cls,
|
||||||
@ -308,6 +309,7 @@ run (void *cls,
|
|||||||
dki.issue.fee_withdraw.value = 0;
|
dki.issue.fee_withdraw.value = 0;
|
||||||
dki.issue.fee_withdraw.fraction = htonl (100);
|
dki.issue.fee_withdraw.fraction = htonl (100);
|
||||||
(void) strcpy (dki.issue.fee_withdraw.currency, CURRENCY);
|
(void) strcpy (dki.issue.fee_withdraw.currency, CURRENCY);
|
||||||
|
dki.issue.fee_deposit = dki.issue.fee_withdraw;
|
||||||
dki.issue.fee_refresh = dki.issue.fee_withdraw;
|
dki.issue.fee_refresh = dki.issue.fee_withdraw;
|
||||||
FAILIF (GNUNET_OK !=
|
FAILIF (GNUNET_OK !=
|
||||||
plugin->insert_denomination (plugin->cls,
|
plugin->insert_denomination (plugin->cls,
|
||||||
|
Loading…
Reference in New Issue
Block a user