diff options
Diffstat (limited to 'src/stasis/plugin_anastasis_postgres.c')
-rw-r--r-- | src/stasis/plugin_anastasis_postgres.c | 47 |
1 files changed, 21 insertions, 26 deletions
diff --git a/src/stasis/plugin_anastasis_postgres.c b/src/stasis/plugin_anastasis_postgres.c index 147045f..9f4b969 100644 --- a/src/stasis/plugin_anastasis_postgres.c +++ b/src/stasis/plugin_anastasis_postgres.c @@ -161,29 +161,26 @@ prepare_statements (void *cls) "INSERT INTO anastasis_recdoc_payment " "(user_id" ",post_counter" - ",amount_val" - ",amount_frac" + ",amount" ",payment_identifier" ",creation_date" ") VALUES " - "($1, $2, $3, $4, $5, $6);"), + "($1, $2, $3, $4, $5);"), GNUNET_PQ_make_prepare ("challenge_payment_insert", "INSERT INTO anastasis_challenge_payment " "(truth_uuid" - ",amount_val" - ",amount_frac" + ",amount" ",payment_identifier" ",creation_date" ") VALUES " - "($1, $2, $3, $4, $5);"), + "($1, $2, $3, $4);"), GNUNET_PQ_make_prepare ("truth_payment_insert", "INSERT INTO anastasis_truth_payment " "(truth_uuid" - ",amount_val" - ",amount_frac" + ",amount" ",expiration" ") VALUES " - "($1, $2, $3, $4);"), + "($1, $2, $3);"), GNUNET_PQ_make_prepare ("recdoc_payment_done", "UPDATE anastasis_recdoc_payment " "SET" @@ -220,8 +217,7 @@ prepare_statements (void *cls) "SELECT" " creation_date" ",post_counter" - ",amount_val" - ",amount_frac" + ",amount" ",paid" " FROM anastasis_recdoc_payment" " WHERE payment_identifier=$1;"), @@ -234,8 +230,7 @@ prepare_statements (void *cls) GNUNET_PQ_make_prepare ("challenge_payment_select", "SELECT" " creation_date" - ",amount_val" - ",amount_frac" + ",amount" ",paid" " FROM anastasis_challenge_payment" " WHERE payment_identifier=$1" @@ -246,8 +241,7 @@ prepare_statements (void *cls) "SELECT" " creation_date" ",payment_identifier" - ",amount_val" - ",amount_frac" + ",amount" " FROM anastasis_challenge_payment" " WHERE" " paid=FALSE" @@ -261,8 +255,7 @@ prepare_statements (void *cls) "SELECT" " user_id" ",payment_identifier" - ",amount_val" - ",amount_frac" + ",amount" " FROM anastasis_recdoc_payment" " WHERE paid=FALSE;"), GNUNET_PQ_make_prepare ("gc_accounts", @@ -295,8 +288,7 @@ prepare_statements (void *cls) "($1, $2, $3, $4, $5, $6);"), GNUNET_PQ_make_prepare ("test_auth_iban_payment", "SELECT" - " credit_val" - ",credit_frac" + " credit" ",wire_subject" " FROM anastasis_auth_iban_in" " WHERE debit_account_details=$1" @@ -305,13 +297,12 @@ prepare_statements (void *cls) "INSERT INTO anastasis_auth_iban_in " "(wire_reference" ",wire_subject" - ",credit_val" - ",credit_frac" + ",credit" ",debit_account_details" ",credit_account_details" ",execution_date" ") VALUES " - "($1, $2, $3, $4, $5, $6, $7);"), + "($1, $2, $3, $4, $5, $6);"), GNUNET_PQ_make_prepare ("recovery_document_insert", "INSERT INTO anastasis_recoverydocument " "(user_id" @@ -1403,7 +1394,8 @@ postgres_record_recdoc_payment ( struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_auto_from_type (account_pub), GNUNET_PQ_query_param_uint32 (&post_counter), - TALER_PQ_query_param_amount (amount), + TALER_PQ_query_param_amount (pg->conn, + amount), GNUNET_PQ_query_param_auto_from_type (payment_secret), GNUNET_PQ_query_param_timestamp (&now), GNUNET_PQ_query_param_end @@ -1506,7 +1498,8 @@ postgres_record_truth_upload_payment ( duration); struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_auto_from_type (uuid), - TALER_PQ_query_param_amount (amount), + TALER_PQ_query_param_amount (pg->conn, + amount), GNUNET_PQ_query_param_timestamp (&exp), GNUNET_PQ_query_param_end }; @@ -1573,7 +1566,8 @@ postgres_record_challenge_payment ( struct GNUNET_TIME_Timestamp now = GNUNET_TIME_timestamp_get (); struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_auto_from_type (truth_uuid), - TALER_PQ_query_param_amount (amount), + TALER_PQ_query_param_amount (pg->conn, + amount), GNUNET_PQ_query_param_auto_from_type (payment_secret), GNUNET_PQ_query_param_timestamp (&now), GNUNET_PQ_query_param_end @@ -1640,7 +1634,8 @@ postgres_record_auth_iban_payment ( struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_uint64 (&wire_reference), GNUNET_PQ_query_param_string (wire_subject), - TALER_PQ_query_param_amount (amount), + TALER_PQ_query_param_amount (pg->conn, + amount), GNUNET_PQ_query_param_string (debit_account), GNUNET_PQ_query_param_string (credit_account), GNUNET_PQ_query_param_timestamp (&execution_date), |