fix DB setup
This commit is contained in:
parent
d63447baf6
commit
d779c5ee02
@ -451,8 +451,8 @@ postgres_create_tables (void *cls,
|
|||||||
/* Table for the tracking API, mapping from wire transfer identifiers
|
/* Table for the tracking API, mapping from wire transfer identifiers
|
||||||
to transactions and back */
|
to transactions and back */
|
||||||
SQLEXEC("CREATE TABLE IF NOT EXISTS aggregation_tracking "
|
SQLEXEC("CREATE TABLE IF NOT EXISTS aggregation_tracking "
|
||||||
"(h_contract BYTEA PRIMARY KEY CHECK (LENGTH(h_contract)=64)"
|
"(h_contract BYTEA CHECK (LENGTH(h_contract)=64)"
|
||||||
",h_wire BYTEA PRIMARY KEY CHECK (LENGTH(h_wire)=64)"
|
",h_wire BYTEA CHECK (LENGTH(h_wire)=64)"
|
||||||
",coin_pub BYTEA NOT NULL CHECK (LENGTH(coin_pub)=32)"
|
",coin_pub BYTEA NOT NULL CHECK (LENGTH(coin_pub)=32)"
|
||||||
",merchant_pub BYTEA NOT NULL CHECK (LENGTH(merchant_pub)=32)"
|
",merchant_pub BYTEA NOT NULL CHECK (LENGTH(merchant_pub)=32)"
|
||||||
",transaction_id INT8 NOT NULL"
|
",transaction_id INT8 NOT NULL"
|
||||||
@ -461,9 +461,12 @@ postgres_create_tables (void *cls,
|
|||||||
",coin_amount_val INT8 NOT NULL"
|
",coin_amount_val INT8 NOT NULL"
|
||||||
",coin_amount_frac INT4 NOT NULL"
|
",coin_amount_frac INT4 NOT NULL"
|
||||||
",coin_amount_curr VARCHAR("TALER_CURRENCY_LEN_STR") NOT NULL"
|
",coin_amount_curr VARCHAR("TALER_CURRENCY_LEN_STR") NOT NULL"
|
||||||
",transaction_total_val INT8 NOT NULL"
|
",coin_fee_val INT8 NOT NULL"
|
||||||
",transaction_total_frac INT4 NOT NULL"
|
",coin_fee_frac INT4 NOT NULL"
|
||||||
",transaction_total_curr VARCHAR("TALER_CURRENCY_LEN_STR") NOT NULL"
|
",coin_fee_curr VARCHAR("TALER_CURRENCY_LEN_STR") NOT NULL"
|
||||||
|
",transfer_total_val INT8 NOT NULL"
|
||||||
|
",transfer_total_frac INT4 NOT NULL"
|
||||||
|
",transfer_total_curr VARCHAR("TALER_CURRENCY_LEN_STR") NOT NULL"
|
||||||
")");
|
")");
|
||||||
/* Index for lookup_transactions statement on wtid */
|
/* Index for lookup_transactions statement on wtid */
|
||||||
SQLEXEC_INDEX("CREATE INDEX aggregation_tracking_wtid_index "
|
SQLEXEC_INDEX("CREATE INDEX aggregation_tracking_wtid_index "
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
This file is part of TALER
|
This file is part of TALER
|
||||||
Copyright (C) 2014, 2015 GNUnet e.V.
|
Copyright (C) 2014, 2015, 2016 GNUnet e.V.
|
||||||
|
|
||||||
TALER is free software; you can redistribute it and/or modify it under the
|
TALER is free software; you can redistribute it and/or modify it under the
|
||||||
terms of the GNU General Public License as published by the Free Software
|
terms of the GNU General Public License as published by the Free Software
|
||||||
@ -305,8 +305,10 @@ test_melting (struct TALER_MINTDB_Session *session)
|
|||||||
RND_BLK (&refresh_session);
|
RND_BLK (&refresh_session);
|
||||||
RND_BLK (&session_hash);
|
RND_BLK (&session_hash);
|
||||||
melts = NULL;
|
melts = NULL;
|
||||||
|
dkp = NULL;
|
||||||
new_dkp = NULL;
|
new_dkp = NULL;
|
||||||
new_denom_pubs = NULL;
|
new_denom_pubs = NULL;
|
||||||
|
ret_denom_pubs = NULL;
|
||||||
/* create and test a refresh session */
|
/* create and test a refresh session */
|
||||||
refresh_session.num_oldcoins = MELT_OLD_COINS;
|
refresh_session.num_oldcoins = MELT_OLD_COINS;
|
||||||
refresh_session.num_newcoins = 1;
|
refresh_session.num_newcoins = 1;
|
||||||
@ -324,11 +326,11 @@ test_melting (struct TALER_MINTDB_Session *session)
|
|||||||
sizeof (refresh_session)));
|
sizeof (refresh_session)));
|
||||||
|
|
||||||
/* create a denomination (value: 1; fraction: 100) */
|
/* create a denomination (value: 1; fraction: 100) */
|
||||||
dkp = create_denom_key_pair(512, session,
|
dkp = create_denom_key_pair (512, session,
|
||||||
&value,
|
&value,
|
||||||
&fee_withdraw,
|
&fee_withdraw,
|
||||||
&fee_deposit,
|
&fee_deposit,
|
||||||
&fee_refresh);
|
&fee_refresh);
|
||||||
/* create MELT_OLD_COINS number of refresh melts */
|
/* create MELT_OLD_COINS number of refresh melts */
|
||||||
melts = GNUNET_new_array (MELT_OLD_COINS, struct TALER_MINTDB_RefreshMelt);
|
melts = GNUNET_new_array (MELT_OLD_COINS, struct TALER_MINTDB_RefreshMelt);
|
||||||
for (cnt=0; cnt < MELT_OLD_COINS; cnt++)
|
for (cnt=0; cnt < MELT_OLD_COINS; cnt++)
|
||||||
@ -416,7 +418,8 @@ test_melting (struct TALER_MINTDB_Session *session)
|
|||||||
ret = GNUNET_OK;
|
ret = GNUNET_OK;
|
||||||
|
|
||||||
drop:
|
drop:
|
||||||
destroy_denom_key_pair (dkp);
|
if (NULL != dkp)
|
||||||
|
destroy_denom_key_pair (dkp);
|
||||||
if (NULL != melts)
|
if (NULL != melts)
|
||||||
{
|
{
|
||||||
for (cnt = 0; cnt < MELT_OLD_COINS; cnt++)
|
for (cnt = 0; cnt < MELT_OLD_COINS; cnt++)
|
||||||
|
Loading…
Reference in New Issue
Block a user