From 385b3e77dfa1b6bbaee5d0ec9da9bcbd69e91b70 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 31 Oct 2019 12:59:50 +0100 Subject: tighten formatting rules --- src/exchangedb/exchangedb_accounts.c | 1 + src/exchangedb/exchangedb_plugin.c | 1 - src/exchangedb/exchangedb_signkeys.c | 1 + src/exchangedb/plugin_exchangedb_postgres.c | 25 +++++++++---------------- src/exchangedb/test_exchangedb.c | 2 ++ src/exchangedb/test_exchangedb_auditors.c | 1 - 6 files changed, 13 insertions(+), 18 deletions(-) (limited to 'src/exchangedb') diff --git a/src/exchangedb/exchangedb_accounts.c b/src/exchangedb/exchangedb_accounts.c index f336b53a4..e31509021 100644 --- a/src/exchangedb/exchangedb_accounts.c +++ b/src/exchangedb/exchangedb_accounts.c @@ -139,4 +139,5 @@ TALER_EXCHANGEDB_find_accounts (const struct GNUNET_CONFIGURATION_Handle *cfg, &ctx); } + /* end of exchangedb_accounts.c */ diff --git a/src/exchangedb/exchangedb_plugin.c b/src/exchangedb/exchangedb_plugin.c index 50394c6e3..8e61f860b 100644 --- a/src/exchangedb/exchangedb_plugin.c +++ b/src/exchangedb/exchangedb_plugin.c @@ -83,5 +83,4 @@ TALER_EXCHANGEDB_plugin_unload (struct TALER_EXCHANGEDB_Plugin *plugin) } - /* end of exchangedb_plugin.c */ diff --git a/src/exchangedb/exchangedb_signkeys.c b/src/exchangedb/exchangedb_signkeys.c index 0c46c1ff1..c58423c52 100644 --- a/src/exchangedb/exchangedb_signkeys.c +++ b/src/exchangedb/exchangedb_signkeys.c @@ -194,4 +194,5 @@ TALER_EXCHANGEDB_signing_key_write (const char *exchange_base_dir, return GNUNET_OK; } + /* end of exchangedb_signkeys.c */ diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c index 1dd408752..6ddbead9e 100644 --- a/src/exchangedb/plugin_exchangedb_postgres.c +++ b/src/exchangedb/plugin_exchangedb_postgres.c @@ -230,8 +230,7 @@ postgres_create_tables (void *cls) funds are added and existing funds are withdrawn. The 'expiration_date' can be used to eventually get rid of reserves that have not been used for a very long time (either by refunding the owner or by greedily - grabbing the money, depending on the Exchange's terms of service) */ - GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS reserves" + grabbing the money, depending on the Exchange's terms of service) */GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS reserves" "(reserve_pub BYTEA PRIMARY KEY CHECK(LENGTH(reserve_pub)=32)" ",account_details TEXT NOT NULL " ",current_balance_val INT8 NOT NULL" @@ -292,8 +291,7 @@ postgres_create_tables (void *cls) The 'h_blind_ev' is the hash of the blinded coin. It serves as a primary key, as (broken) clients that use a non-random coin and blinding factor should fail to even withdraw, as otherwise the coins will fail to deposit - (as they really must be unique). */ - GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS reserves_out" + (as they really must be unique). */GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS reserves_out" "(reserve_out_serial_id BIGSERIAL UNIQUE" ",h_blind_ev BYTEA PRIMARY KEY CHECK (LENGTH(h_blind_ev)=64)" ",denom_pub_hash BYTEA NOT NULL REFERENCES denominations (denom_pub_hash)" /* do NOT CASCADE on DELETE, we may keep the denomination key alive! */ @@ -341,8 +339,7 @@ postgres_create_tables (void *cls) index and the index of the new coin, and the envelope of the new coin to be signed, as well as the encrypted information about the private key and the blinding factor for the coin (for verification - in case this newcoin_index is chosen to be revealed) */ - GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS refresh_revealed_coins " + in case this newcoin_index is chosen to be revealed) */GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS refresh_revealed_coins " "(rc BYTEA NOT NULL REFERENCES refresh_commitments (rc) ON DELETE CASCADE" ",newcoin_index INT4 NOT NULL" ",link_sig BYTEA NOT NULL CHECK(LENGTH(link_sig)=64)" @@ -797,8 +794,7 @@ postgres_get_session (void *cls) the coin's denomination information (public key, signature) and the blinded message as well as the reserve that the coin is being withdrawn from and the signature of the message - authorizing the withdrawal. */ - GNUNET_PQ_make_prepare ("insert_withdraw_info", + authorizing the withdrawal. */GNUNET_PQ_make_prepare ("insert_withdraw_info", "INSERT INTO reserves_out " "(h_blind_ev" ",denom_pub_hash" @@ -2207,8 +2203,7 @@ postgres_reserves_in_insert (void *cls, Note that for a non-drained reserve we should not switch, as that opens an attack vector for an adversary who can see the wire transfer subjects (i.e. when using Bitcoin). - */ - } + */} GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Creating reserve %s with expiration in %s\n", @@ -2225,8 +2220,7 @@ postgres_reserves_in_insert (void *cls, before adding the actual transaction to "reserves_in", as for a new reserve it can't be a duplicate 'add' operation, and as the 'add' operation may need the reserve entry - as a foreign key. */ - struct GNUNET_PQ_QueryParam params[] = { + as a foreign key. */struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_auto_from_type (reserve_pub), GNUNET_PQ_query_param_string (sender_account_details), TALER_PQ_query_param_amount (balance), @@ -2283,8 +2277,7 @@ postgres_reserves_in_insert (void *cls, balance; we do this after checking for duplication, as otherwise we might have to actually pay the cost to roll this back for duplicate transactions; like this, we should virtually - never actually have to rollback anything. */ - struct TALER_EXCHANGEDB_Reserve updated_reserve; + never actually have to rollback anything. */struct TALER_EXCHANGEDB_Reserve updated_reserve; updated_reserve.pub = reserve.pub; if (GNUNET_OK != @@ -5711,8 +5704,7 @@ postgres_gc (void *cls) payback and reserves_out tables to known_coins; these are NOT using 'ON DROP CASCADE' and might keep denomination keys alive for a bit longer, thus causing this statement - to fail. */ - (void) GNUNET_PQ_eval_prepared_non_select (conn, + to fail. */(void) GNUNET_PQ_eval_prepared_non_select (conn, "gc_denominations", params_time); GNUNET_PQ_disconnect (conn); @@ -7717,4 +7709,5 @@ libtaler_plugin_exchangedb_postgres_done (void *cls) return NULL; } + /* end of plugin_exchangedb_postgres.c */ diff --git a/src/exchangedb/test_exchangedb.c b/src/exchangedb/test_exchangedb.c index b093df4be..a1e20e83a 100644 --- a/src/exchangedb/test_exchangedb.c +++ b/src/exchangedb/test_exchangedb.c @@ -292,6 +292,7 @@ create_denom_key_pair (unsigned int size, return dkp; } + static struct TALER_Amount value; static struct TALER_Amount fee_withdraw; static struct TALER_Amount fee_deposit; @@ -2257,4 +2258,5 @@ main (int argc, return result; } + /* end of test_exchangedb.c */ diff --git a/src/exchangedb/test_exchangedb_auditors.c b/src/exchangedb/test_exchangedb_auditors.c index e0af3f157..9f1b2d679 100644 --- a/src/exchangedb/test_exchangedb_auditors.c +++ b/src/exchangedb/test_exchangedb_auditors.c @@ -42,7 +42,6 @@ static struct TALER_MasterPublicKeyP want_mpub; static struct TALER_DenominationKeyValidityPS want_dki; - /** * @brief Function called with auditor information. * -- cgit v1.2.3