diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-04-02 22:34:45 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-04-02 22:34:45 +0200 |
commit | b988eb92fc9ea7fca8db7895e52af67a1a9231d7 (patch) | |
tree | 188215ef24455fbedab1428424d9bf0aef0be7ef /src/exchangedb/plugin_exchangedb_postgres.c | |
parent | b95522c1ddf6e32a35dbec2123c24363316a9514 (diff) |
implement tests for extended DB API
Diffstat (limited to 'src/exchangedb/plugin_exchangedb_postgres.c')
-rw-r--r-- | src/exchangedb/plugin_exchangedb_postgres.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c index 3095529d9..df0c1a5fc 100644 --- a/src/exchangedb/plugin_exchangedb_postgres.c +++ b/src/exchangedb/plugin_exchangedb_postgres.c @@ -516,7 +516,7 @@ postgres_create_tables (void *cls) /* Table for /payback information */ SQLEXEC("CREATE TABLE IF NOT EXISTS payback " "(reserve_pub BYTEA NOT NULL REFERENCES reserves (reserve_pub) ON DELETE CASCADE" - ",coin_pub BYTEA NOT NULL REFERENCES known_coins (coin_pub) ON DELETE CASCADE" + ",coin_pub BYTEA NOT NULL CHECK (LENGTH(coin_pub)=32)" ",coin_sig BYTEA NOT NULL CHECK(LENGTH(coin_sig)=64)" ",coin_blind BYTEA NOT NULL CHECK(LENGTH(coin_blind)=32)" ",amount_val INT8 NOT NULL" @@ -1454,8 +1454,6 @@ postgres_prepare (PGconn *db_conn) " WHERE payback.coin_pub=$1", 1, NULL); - - /* Used in #postgres_get_reserve_by_h_blind() */ PREPARE ("reserve_by_h_blind", "SELECT" @@ -5625,7 +5623,7 @@ postgres_select_wire_out_above_serial_id (void *cls, * @param cls closure * @param session database connection * @param reserve_pub public key of the reserve that is being refunded - * @param coin information about the coin + * @param coin_pub public key of the coin * @param coin_sig signature of the coin of type #TALER_SIGNATURE_WALLET_COIN_PAYBACK * @param coin_blind blinding key of the coin * @param amount total amount to be paid back @@ -5639,7 +5637,7 @@ static int postgres_insert_payback_request (void *cls, struct TALER_EXCHANGEDB_Session *session, const struct TALER_ReservePublicKeyP *reserve_pub, - const struct TALER_CoinPublicInfo *coin, + const struct TALER_CoinSpendPublicKeyP *coin_pub, const struct TALER_CoinSpendSignatureP *coin_sig, const struct TALER_DenominationBlindingKeyP *coin_blind, const struct TALER_Amount *amount, @@ -5652,7 +5650,7 @@ postgres_insert_payback_request (void *cls, struct TALER_EXCHANGEDB_Reserve reserve; struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_auto_from_type (reserve_pub), - GNUNET_PQ_query_param_auto_from_type (&coin->coin_pub), + GNUNET_PQ_query_param_auto_from_type (coin_pub), GNUNET_PQ_query_param_auto_from_type (coin_sig), GNUNET_PQ_query_param_auto_from_type (coin_blind), TALER_PQ_query_param_amount (amount), |