tighten formatting rules
This commit is contained in:
parent
325aaddbd6
commit
385b3e77df
@ -49,8 +49,12 @@ nl_assign_brace=remove
|
||||
|
||||
# No extra newlines that cause noisy diffs
|
||||
nl_start_of_file=remove
|
||||
nl_after_func_proto = 2
|
||||
nl_after_func_body = 3
|
||||
# If there's no new line, it's not a text file!
|
||||
nl_end_of_file=add
|
||||
nl_max_blank_in_func = 3
|
||||
nl_max = 3
|
||||
|
||||
sp_inside_paren = remove
|
||||
|
||||
@ -69,6 +73,7 @@ sp_between_ptr_star = remove
|
||||
sp_before_sparen = add
|
||||
|
||||
sp_inside_fparen = remove
|
||||
sp_inside_sparen = remove
|
||||
|
||||
# add space before function call and decl: "foo (x)"
|
||||
sp_func_call_paren = add
|
||||
@ -76,3 +81,15 @@ sp_func_proto_paren = add
|
||||
sp_func_proto_paren_empty = add
|
||||
sp_func_def_paren = add
|
||||
sp_func_def_paren_empty = add
|
||||
|
||||
# We'd want it for "if ( (foo) || (bar) )", but not for "if (m())",
|
||||
# so as uncrustify doesn't give exactly what we want => ignore
|
||||
sp_paren_paren = ignore
|
||||
sp_inside_paren = remove
|
||||
sp_bool = force
|
||||
|
||||
nl_func_type_name = force
|
||||
#nl_branch_else = add
|
||||
nl_else_brace = add
|
||||
nl_elseif_brace = add
|
||||
nl_for_brace = add
|
||||
|
@ -132,7 +132,7 @@ main (int argc,
|
||||
strlen ("http://"))) &&
|
||||
(0 != strncasecmp ("https://",
|
||||
exchange_url,
|
||||
strlen ("https://"))) ) ||
|
||||
strlen ("https://"))) ) ||
|
||||
('/' != exchange_url[strlen (exchange_url) - 1]) )
|
||||
{
|
||||
fprintf (stderr,
|
||||
@ -211,4 +211,5 @@ main (int argc,
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* end of taler-auditor-exchange.c */
|
||||
|
@ -269,7 +269,6 @@ signal_loop (void)
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Function called whenever MHD is done with a request. If the
|
||||
* request was a POST, we may have stored a `struct Buffer *` in the
|
||||
@ -980,4 +979,5 @@ main (int argc,
|
||||
return (GNUNET_SYSERR == ret) ? 1 : 0;
|
||||
}
|
||||
|
||||
|
||||
/* end of taler-auditor-httpd.c */
|
||||
|
@ -36,7 +36,6 @@
|
||||
#define REQUEST_BUFFER_MAX (1024 * 1024)
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Process a POST request containing a JSON object. This function
|
||||
* realizes an MHD POST processor that will (incrementally) process
|
||||
|
@ -439,4 +439,5 @@ main (int argc,
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* end of taler-auditor-sign.c */
|
||||
|
@ -4041,8 +4041,7 @@ refresh_session_cb (void *cls,
|
||||
accepted a forged coin (i.e. emergency situation after
|
||||
private key compromise). In that case, we cannot even
|
||||
subtract the profit we make from the fee from the escrow
|
||||
balance. Tested as part of test-auditor.sh, case #18 */
|
||||
report_amount_arithmetic_inconsistency (
|
||||
balance. Tested as part of test-auditor.sh, case #18 */report_amount_arithmetic_inconsistency (
|
||||
"subtracting refresh fee from escrow balance",
|
||||
rowid,
|
||||
&total_escrow_balance,
|
||||
@ -4225,8 +4224,7 @@ deposit_cb (void *cls,
|
||||
accepted a forged coin (i.e. emergency situation after
|
||||
private key compromise). In that case, we cannot even
|
||||
subtract the profit we make from the fee from the escrow
|
||||
balance. Tested as part of test-auditor.sh, case #18 */
|
||||
report_amount_arithmetic_inconsistency (
|
||||
balance. Tested as part of test-auditor.sh, case #18 */report_amount_arithmetic_inconsistency (
|
||||
"subtracting deposit fee from escrow balance",
|
||||
rowid,
|
||||
&total_escrow_balance,
|
||||
@ -5010,7 +5008,6 @@ analyze_deposit_confirmations (void *cls)
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* *************************** General transaction logic ****************** */
|
||||
|
||||
/**
|
||||
|
@ -624,7 +624,6 @@ report (json_t *array,
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Detect any entries in #reserve_closures that were not yet
|
||||
* observed on the wire transfer side and update the progress
|
||||
|
@ -84,5 +84,4 @@ TALER_AUDITORDB_plugin_unload (struct TALER_AUDITORDB_Plugin *plugin)
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* end of auditordb_plugin.c */
|
||||
|
@ -206,8 +206,7 @@ postgres_create_tables (void *cls)
|
||||
serial ID from the respective tables that we have
|
||||
processed. Thus, we need to select those table entries that are
|
||||
strictly larger (and process in monotonically increasing
|
||||
order). */
|
||||
GNUNET_PQ_make_execute (
|
||||
order). */GNUNET_PQ_make_execute (
|
||||
"CREATE TABLE IF NOT EXISTS auditor_progress_reserve"
|
||||
"(master_pub BYTEA CONSTRAINT master_pub_ref REFERENCES auditor_exchanges(master_pub) ON DELETE CASCADE"
|
||||
",last_reserve_in_serial_id INT8 NOT NULL DEFAULT 0"
|
||||
@ -253,8 +252,7 @@ postgres_create_tables (void *cls)
|
||||
"last_reserve_out_serial_id" marks the last withdrawal from
|
||||
"reserves_out" about this reserve that the auditor is aware of,
|
||||
and "last_reserve_in_serial_id" is the last "reserve_in"
|
||||
operation about this reserve that the auditor is aware of. */
|
||||
GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS auditor_reserves"
|
||||
operation about this reserve that the auditor is aware of. */GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS auditor_reserves"
|
||||
"(reserve_pub BYTEA NOT NULL CHECK(LENGTH(reserve_pub)=32)"
|
||||
",master_pub BYTEA CONSTRAINT master_pub_ref REFERENCES auditor_exchanges(master_pub) ON DELETE CASCADE"
|
||||
",reserve_balance_val INT8 NOT NULL"
|
||||
@ -289,8 +287,7 @@ postgres_create_tables (void *cls)
|
||||
(outstanding as well as issued overall which implies the
|
||||
maximum value at risk). We also count the number of coins
|
||||
issued (withdraw, refresh-reveal) and the number of coins seen
|
||||
at the exchange (refresh-commit, deposit), not just the amounts. */
|
||||
GNUNET_PQ_make_execute (
|
||||
at the exchange (refresh-commit, deposit), not just the amounts. */GNUNET_PQ_make_execute (
|
||||
"CREATE TABLE IF NOT EXISTS auditor_denomination_pending"
|
||||
"(denom_pub_hash BYTEA PRIMARY KEY"
|
||||
" REFERENCES auditor_denominations (denom_pub_hash) ON DELETE CASCADE"
|
||||
@ -309,8 +306,7 @@ postgres_create_tables (void *cls)
|
||||
respective's exchange's master public key); it represents the
|
||||
auditor_balance_summary of the exchange at this point (modulo
|
||||
unexpected historic_loss-style events where denomination keys are
|
||||
compromised) */
|
||||
GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS auditor_balance_summary"
|
||||
compromised) */GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS auditor_balance_summary"
|
||||
"(master_pub BYTEA CONSTRAINT master_pub_ref REFERENCES auditor_exchanges(master_pub) ON DELETE CASCADE"
|
||||
",denom_balance_val INT8 NOT NULL"
|
||||
",denom_balance_frac INT4 NOT NULL"
|
||||
@ -333,8 +329,7 @@ postgres_create_tables (void *cls)
|
||||
coin except for withdraw fees (which are in
|
||||
historic_reserve_revenue); the deposit, melt and refund fees are given
|
||||
individually; the delta to the revenue_balance is from coins that
|
||||
were withdrawn but never deposited prior to expiration. */
|
||||
GNUNET_PQ_make_execute (
|
||||
were withdrawn but never deposited prior to expiration. */GNUNET_PQ_make_execute (
|
||||
"CREATE TABLE IF NOT EXISTS auditor_historic_denomination_revenue"
|
||||
"(master_pub BYTEA CONSTRAINT master_pub_ref REFERENCES auditor_exchanges(master_pub) ON DELETE CASCADE"
|
||||
",denom_pub_hash BYTEA PRIMARY KEY CHECK (LENGTH(denom_pub_hash)=64)"
|
||||
@ -389,8 +384,7 @@ postgres_create_tables (void *cls)
|
||||
the tables overall, we'll need a command-line tool to insert rows
|
||||
into this table and update "auditor_predicted_result" accordingly.
|
||||
(So this table for now just exists as a reminder of what we'll
|
||||
need in the long term.) */
|
||||
GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS auditor_historic_ledger"
|
||||
need in the long term.) */GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS auditor_historic_ledger"
|
||||
"(master_pub BYTEA CONSTRAINT master_pub_ref REFERENCES auditor_exchanges(master_pub) ON DELETE CASCADE"
|
||||
",purpose VARCHAR NOT NULL"
|
||||
",timestamp INT8 NOT NULL"
|
||||
@ -1502,7 +1496,6 @@ postgres_get_deposit_confirmations (void *cls,
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Insert information about a denomination key and in particular
|
||||
* the properties (value, fees, expiration times) the coins signed
|
||||
@ -3586,4 +3579,5 @@ libtaler_plugin_auditordb_postgres_done (void *cls)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/* end of plugin_auditordb_postgres.c */
|
||||
|
@ -581,6 +581,7 @@ run (void *cls)
|
||||
return GNUNET_OK;
|
||||
}
|
||||
|
||||
|
||||
FAILIF (0 >=
|
||||
plugin->select_historic_denom_revenue (plugin->cls,
|
||||
session,
|
||||
@ -644,6 +645,7 @@ run (void *cls)
|
||||
return GNUNET_OK;
|
||||
}
|
||||
|
||||
|
||||
FAILIF (0 >=
|
||||
plugin->select_historic_reserve_revenue (plugin->cls,
|
||||
session,
|
||||
|
@ -251,7 +251,6 @@ handle_history_finished (void *cls,
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Backend of both the /history[-range] requests.
|
||||
*
|
||||
@ -407,7 +406,6 @@ TALER_BANK_history_range (struct GNUNET_CURL_Context *ctx,
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Request the wire transfer history of a bank account.
|
||||
*
|
||||
|
@ -713,6 +713,7 @@ handle_history (struct TALER_FAKEBANK_Handle *h,
|
||||
&TFH_handle_history_advance);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Handle incoming HTTP request for /history-range.
|
||||
*
|
||||
@ -897,6 +898,8 @@ schedule_httpd (struct TALER_FAKEBANK_Handle *h)
|
||||
&run_mhd,
|
||||
h);
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
/**
|
||||
* Schedule MHD. This function should be called initially when an
|
||||
@ -957,6 +960,8 @@ schedule_httpd (struct TALER_FAKEBANK_Handle *h)
|
||||
if (NULL != wws)
|
||||
GNUNET_NETWORK_fdset_destroy (wws);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -188,7 +188,6 @@ struct HistoryArgs
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Type for a function that decides whether or not
|
||||
* the history-building loop should iterate once again.
|
||||
|
@ -299,6 +299,7 @@ TFH_build_history_response (struct MHD_Connection *connection,
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Parse URL history arguments, of _both_ APIs:
|
||||
* /history and /history-range.
|
||||
|
@ -270,4 +270,5 @@ main (int argc, char *const *argv)
|
||||
return global_ret;
|
||||
}
|
||||
|
||||
|
||||
/* end taler-bank-transfer.c */
|
||||
|
@ -226,4 +226,5 @@ main (int argc,
|
||||
return (GNUNET_OK == result) ? 0 : 1;
|
||||
}
|
||||
|
||||
|
||||
/* end of test_bank_api.c */
|
||||
|
@ -178,6 +178,7 @@ run (void *cls,
|
||||
commands);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main (int argc,
|
||||
char *const *argv)
|
||||
|
@ -215,4 +215,5 @@ main (int argc,
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/* end of test_bank_api_twisted.c */
|
||||
|
@ -171,4 +171,5 @@ main (int argc,
|
||||
return (GNUNET_OK == result) ? 0 : 1;
|
||||
}
|
||||
|
||||
|
||||
/* end of test_bank_api_with_fakebank.c */
|
||||
|
@ -1047,4 +1047,5 @@ TBI_run_interpreter (int *resultp,
|
||||
GNUNET_SCHEDULER_add_shutdown (&do_shutdown, is);
|
||||
}
|
||||
|
||||
|
||||
/* end of test_bank_interpeter.c */
|
||||
|
@ -34,7 +34,6 @@
|
||||
#include "taler_fakebank_lib.h"
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* State for a "history" CMD.
|
||||
*/
|
||||
@ -267,7 +266,6 @@ print_expected (struct History *h,
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Tell if the current item is beyond the allowed limit.
|
||||
*
|
||||
@ -338,8 +336,7 @@ build_history (struct TALER_TESTING_Interpreter *is,
|
||||
* @var turns GNUNET_YES whenever either no 'start' value was
|
||||
* given for the history query, or the given value is found
|
||||
* in the list of all the CMDs.
|
||||
*/
|
||||
int ok;
|
||||
*/int ok;
|
||||
const uint64_t *row_id_start = NULL;
|
||||
|
||||
if (NULL != hs->start_row_reference)
|
||||
@ -399,8 +396,7 @@ build_history (struct TALER_TESTING_Interpreter *is,
|
||||
* The following command allows us to skip over those CMDs
|
||||
* that do not offer a "row_id" trait. Such skipped CMDs are
|
||||
* not interesting for building a history.
|
||||
*/
|
||||
if (GNUNET_OK != TALER_TESTING_get_trait_uint64 (pos,
|
||||
*/if (GNUNET_OK != TALER_TESTING_get_trait_uint64 (pos,
|
||||
0,
|
||||
&row_id))
|
||||
continue;
|
||||
@ -533,8 +529,7 @@ build_history (struct TALER_TESTING_Interpreter *is,
|
||||
* Warning: this zeroing is superfluous, as
|
||||
* total doesn't get incremented if 'start'
|
||||
* was given and couldn't be found.
|
||||
*/
|
||||
total = 0;
|
||||
*/total = 0;
|
||||
ok = GNUNET_YES;
|
||||
continue;
|
||||
}
|
||||
@ -598,8 +593,7 @@ build_history (struct TALER_TESTING_Interpreter *is,
|
||||
* _both_ the credit and the debit roles, but _only if_
|
||||
* the audit goes on both directions.. This needs more
|
||||
* explaination!
|
||||
*/
|
||||
if ( ( (0 != (hs->direction & TALER_BANK_DIRECTION_CREDIT)) &&
|
||||
*/if ( ( (0 != (hs->direction & TALER_BANK_DIRECTION_CREDIT)) &&
|
||||
(hs->account_no == *credit_account_no)) &&
|
||||
( (0 != (hs->direction & TALER_BANK_DIRECTION_DEBIT)) &&
|
||||
(hs->account_no == *debit_account_no)) )
|
||||
@ -775,6 +769,7 @@ check_result (struct TALER_TESTING_Interpreter *is,
|
||||
return GNUNET_OK;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This callback will (1) check that the HTTP response code
|
||||
* is acceptable and (2) that the history is consistent. The
|
||||
@ -1191,4 +1186,5 @@ TALER_TESTING_cmd_bank_history_range_with_dates
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* end of testing_api_cmd_history.c */
|
||||
|
@ -183,6 +183,7 @@ reject_traits (void *cls,
|
||||
index);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create a "reject" CMD.
|
||||
*
|
||||
|
@ -120,6 +120,7 @@ TALER_TESTING_has_in_name (const char *prog_name,
|
||||
return strstr (prog_name + name_pos, marker) != NULL;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Start the (Python) bank process. Assume the port
|
||||
* is available and the database is clean. Use the "prepare
|
||||
|
@ -645,8 +645,8 @@ parallel_benchmark (TALER_TESTING_Main main_cb,
|
||||
if (MODE_EXCHANGE == mode)
|
||||
(void) getchar ();
|
||||
|
||||
if ( (GNUNET_YES == linger) && ( ((mode == MODE_BOTH)|| (mode ==
|
||||
MODE_CLIENT) ) ) )
|
||||
if ( (GNUNET_YES == linger) && ( ((mode == MODE_BOTH) || (mode ==
|
||||
MODE_CLIENT) ) ) )
|
||||
{
|
||||
printf ("press ENTER to stop\n");
|
||||
(void) getchar ();
|
||||
|
@ -286,4 +286,5 @@ main (int argc, char *const *argv)
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* end of taler-exchange-keycheck.c */
|
||||
|
@ -1483,4 +1483,5 @@ main (int argc,
|
||||
return global_ret;
|
||||
}
|
||||
|
||||
|
||||
/* end of taler-exchange-keyup.c */
|
||||
|
@ -446,4 +446,5 @@ main (int argc,
|
||||
return global_ret;
|
||||
}
|
||||
|
||||
|
||||
/* end of taler-wire.c */
|
||||
|
@ -291,7 +291,6 @@ static unsigned int aggregation_limit =
|
||||
TALER_EXCHANGEDB_MATCHING_DEPOSITS_LIMIT;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Advance the "af" pointer in @a wp to point to the
|
||||
* currently valid record.
|
||||
@ -1968,4 +1967,5 @@ main (int argc,
|
||||
return global_ret;
|
||||
}
|
||||
|
||||
|
||||
/* end of taler-exchange-aggregator.c */
|
||||
|
@ -839,6 +839,7 @@ connection_done (void *cls,
|
||||
"kill");
|
||||
}
|
||||
|
||||
|
||||
/* end of HAVE_DEVELOPER */
|
||||
#endif
|
||||
|
||||
@ -1026,7 +1027,6 @@ write_stats ()
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The main function of the taler-exchange-httpd server ("the exchange").
|
||||
*
|
||||
@ -1261,4 +1261,5 @@ main (int argc,
|
||||
return (GNUNET_SYSERR == ret) ? 1 : 0;
|
||||
}
|
||||
|
||||
|
||||
/* end of taler-exchange-httpd.c */
|
||||
|
@ -262,7 +262,6 @@ struct ResponseFactoryContext
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Snapshot of the (coin and signing) keys (including private keys) of
|
||||
* the exchange. There can be multiple instances of this struct, as it is
|
||||
@ -327,7 +326,6 @@ struct TEH_KS_StateHandle
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Exchange key state. This is the long-term, read-only internal global state,
|
||||
* which the various threads "lock" to use in read-only ways. We eventually
|
||||
@ -346,7 +344,6 @@ static struct TEH_KS_StateHandle *internal_key_state;
|
||||
static pthread_mutex_t internal_key_state_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
|
||||
|
||||
/* ************************** Clean up logic *********************** */
|
||||
|
||||
|
||||
|
@ -36,7 +36,6 @@
|
||||
#define REQUEST_BUFFER_MAX (1024 * 1024)
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Process a POST request containing a JSON object. This function
|
||||
* realizes an MHD POST processor that will (incrementally) process
|
||||
|
@ -698,8 +698,7 @@ TEH_RESPONSE_compile_transaction_history (const struct
|
||||
the denomination key's RSA signature over coin_pub, but as the
|
||||
wallet should really already have this information (and cannot
|
||||
check or do anything with it anyway if it doesn't), it seems
|
||||
strictly unnecessary. */
|
||||
if (0 !=
|
||||
strictly unnecessary. */if (0 !=
|
||||
json_array_append_new (history,
|
||||
json_pack ("{s:s, s:o, s:o, s:o, s:o, s:o}",
|
||||
"type", "OLD-COIN-PAYBACK",
|
||||
@ -801,8 +800,7 @@ TEH_RESPONSE_compile_transaction_history (const struct
|
||||
hash and the denomination key's RSA signature over coin_pub, but as
|
||||
the wallet should really already have this information (and cannot
|
||||
check or do anything with it anyway if it doesn't), it seems
|
||||
strictly unnecessary. */
|
||||
if (0 !=
|
||||
strictly unnecessary. */if (0 !=
|
||||
json_array_append_new (history,
|
||||
json_pack ("{s:s, s:o, s:o, s:o, s:o, s:o}",
|
||||
"type", "PAYBACK-REFRESH",
|
||||
@ -1172,4 +1170,5 @@ TEH_RESPONSE_reply_transaction_unknown (struct MHD_Connection *connection,
|
||||
"code", (json_int_t) ec);
|
||||
}
|
||||
|
||||
|
||||
/* end of taler-exchange-httpd_responses.c */
|
||||
|
@ -176,5 +176,4 @@ TEH_wire_cleanup ()
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* end of taler-exchange-httpd_wire.c */
|
||||
|
@ -735,4 +735,5 @@ main (int argc,
|
||||
return global_ret;
|
||||
}
|
||||
|
||||
|
||||
/* end of taler-exchange-wirewatch.c */
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include "taler_fakebank_lib.h"
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Commands for the interpreter.
|
||||
*/
|
||||
@ -351,6 +350,7 @@ maint_child_death (void *cls)
|
||||
interpreter (state);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Setup (fake) information about a coin used in deposit.
|
||||
*
|
||||
@ -1333,4 +1333,5 @@ main (int argc,
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/* end of test_taler_exchange_aggregator.c */
|
||||
|
@ -857,4 +857,5 @@ main (int argc,
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/* end of test_taler_exchange_wirewatch.c */
|
||||
|
@ -139,4 +139,5 @@ TALER_EXCHANGEDB_find_accounts (const struct GNUNET_CONFIGURATION_Handle *cfg,
|
||||
&ctx);
|
||||
}
|
||||
|
||||
|
||||
/* end of exchangedb_accounts.c */
|
||||
|
@ -83,5 +83,4 @@ TALER_EXCHANGEDB_plugin_unload (struct TALER_EXCHANGEDB_Plugin *plugin)
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* end of exchangedb_plugin.c */
|
||||
|
@ -194,4 +194,5 @@ TALER_EXCHANGEDB_signing_key_write (const char *exchange_base_dir,
|
||||
return GNUNET_OK;
|
||||
}
|
||||
|
||||
|
||||
/* end of exchangedb_signkeys.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 */
|
||||
|
@ -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 */
|
||||
|
@ -42,7 +42,6 @@ static struct TALER_MasterPublicKeyP want_mpub;
|
||||
static struct TALER_DenominationKeyValidityPS want_dki;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief Function called with auditor information.
|
||||
*
|
||||
|
@ -1462,7 +1462,6 @@ struct TALER_AUDITORDB_Plugin
|
||||
void *cb_cls);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Insert information about the predicted exchange's bank
|
||||
* account balance.
|
||||
|
@ -237,7 +237,6 @@ struct TALER_MasterSignatureP
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief Type of public keys for Taler coins. The same key material is used
|
||||
* for EdDSA and ECDHE operations.
|
||||
|
@ -74,5 +74,4 @@ void
|
||||
TALER_curl_easy_post_finished (struct TEAH_PostContext *ctx);
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -1681,7 +1681,6 @@ TALER_EXCHANGE_track_transaction_cancel (struct
|
||||
dwh);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Convenience function. Verifies a coin's transaction history as
|
||||
* returned by the exchange.
|
||||
@ -1777,5 +1776,4 @@ void
|
||||
TALER_EXCHANGE_payback_cancel (struct TALER_EXCHANGE_PaybackHandle *ph);
|
||||
|
||||
|
||||
|
||||
#endif /* _TALER_EXCHANGE_SERVICE_H */
|
||||
|
@ -2173,7 +2173,6 @@ struct TALER_EXCHANGEDB_Plugin
|
||||
struct TALER_EXCHANGEDB_Session *session);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Store information about an outgoing wire transfer that was executed.
|
||||
*
|
||||
|
@ -81,7 +81,6 @@ TALER_FAKEBANK_make_transfer (struct TALER_FAKEBANK_Handle *h,
|
||||
const char *exchange_base_url);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Check that the @a want_amount was transferred from the @a
|
||||
* want_debit to the @a want_credit account. If so, set the @a subject
|
||||
|
@ -956,7 +956,6 @@ struct TALER_MasterWireDetailsPS
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief Information signed by the exchange's master
|
||||
* key stating the wire fee to be paid per wire transfer.
|
||||
|
@ -199,4 +199,5 @@ struct TALER_TESTING_Command
|
||||
TALER_TESTING_cmd_bank_reject (const char *label,
|
||||
const char *bank_url,
|
||||
const char *deposit_reference);
|
||||
|
||||
#endif
|
||||
|
@ -388,8 +388,6 @@ struct TALER_TESTING_Interpreter
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* A command to be run by the interpreter.
|
||||
*/
|
||||
@ -486,7 +484,6 @@ TALER_TESTING_interpreter_get_current_label (struct
|
||||
TALER_TESTING_Interpreter *is);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get connection handle to the fakebank.
|
||||
*
|
||||
@ -1275,7 +1272,6 @@ TALER_TESTING_cmd_check_bank_transfer (const char *label,
|
||||
uint64_t credit_account);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Define a "bank check" CMD that takes the input
|
||||
* data from another CMD that offers it.
|
||||
@ -1585,7 +1581,6 @@ struct TALER_TESTING_Trait
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* "end" trait. Because traits are offered into arrays,
|
||||
* this type of trait is used to mark the end of such arrays;
|
||||
@ -2077,6 +2072,7 @@ TALER_TESTING_get_trait_peer_key (const struct TALER_TESTING_Command *cmd,
|
||||
unsigned int index,
|
||||
const struct
|
||||
GNUNET_CRYPTO_EddsaPrivateKey **priv);
|
||||
|
||||
// FIXME: private get_trait_merchant_priv instead, rather have
|
||||
// more traits with precise types than this!
|
||||
|
||||
@ -2094,6 +2090,7 @@ struct TALER_TESTING_Trait
|
||||
TALER_TESTING_make_trait_peer_key (unsigned int index,
|
||||
const struct
|
||||
GNUNET_CRYPTO_EddsaPrivateKey *priv);
|
||||
|
||||
// FIXME: private get_trait_merchant_priv instead, rather have
|
||||
// more traits with precise types than this!
|
||||
|
||||
|
@ -193,7 +193,8 @@ TALER_buffer_write_fstr (struct TALER_Buffer *buf, const char *fmt, ...);
|
||||
* @param args format argument list
|
||||
*/
|
||||
void
|
||||
TALER_buffer_write_vfstr (struct TALER_Buffer *buf, const char *fmt, va_list args);
|
||||
TALER_buffer_write_vfstr (struct TALER_Buffer *buf, const char *fmt, va_list
|
||||
args);
|
||||
|
||||
|
||||
/**
|
||||
@ -360,10 +361,10 @@ TALER_url_absolute_raw (const char *proto,
|
||||
*/
|
||||
char *
|
||||
TALER_url_absolute_raw_va (const char *proto,
|
||||
const char *host,
|
||||
const char *prefix,
|
||||
const char *path,
|
||||
va_list args);
|
||||
const char *host,
|
||||
const char *prefix,
|
||||
const char *path,
|
||||
va_list args);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -53,7 +53,6 @@ TALER_JSON_hash (const json_t *json,
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Extract the Taler error code from the given @a json object.
|
||||
* Note that #TALER_EC_NONE is returned if no "code" is present.
|
||||
@ -80,4 +79,5 @@ TALER_JSON_get_error_code (const json_t *json)
|
||||
return TALER_EC_INVALID;
|
||||
}
|
||||
|
||||
|
||||
/* End of json/json.c */
|
||||
|
@ -47,7 +47,6 @@ TALER_JSON_from_amount (const struct TALER_Amount *amount)
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Convert a TALER amount to a JSON object.
|
||||
*
|
||||
|
@ -68,4 +68,5 @@ main (int argc,
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* end of test_json.c */
|
||||
|
@ -56,4 +56,5 @@ main (int argc,
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* end of test_json_wire.c */
|
||||
|
@ -258,6 +258,7 @@ decode_version_json (const json_t *resp_obj,
|
||||
return GNUNET_OK;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initiate download of /version from the auditor.
|
||||
*
|
||||
|
@ -224,10 +224,8 @@ TALER_EXCHANGE_verify_coin_history (const char *currency,
|
||||
for the exchange to lie here, so not checking is probably OK
|
||||
(an auditor ought to check, though). Then again, we similarly
|
||||
had no reason to check the merchant's signature (other than a
|
||||
well-formendess check). */
|
||||
/* TODO: check that deposit fee and coin value match
|
||||
our expectations from /keys! */
|
||||
add = GNUNET_NO;
|
||||
well-formendess check). *//* TODO: check that deposit fee and coin value match
|
||||
our expectations from /keys! */add = GNUNET_NO;
|
||||
}
|
||||
else if (0 == strcasecmp (type,
|
||||
"PAYBACK"))
|
||||
@ -297,8 +295,7 @@ TALER_EXCHANGE_verify_coin_history (const char *currency,
|
||||
However, for the implementation, we first *add* up all of
|
||||
these negative amounts, as we might get refunds before
|
||||
deposits from a semi-evil exchange. Then, at the end, we do
|
||||
the subtraction by calculating "total = total - rtotal" */
|
||||
GNUNET_assert (GNUNET_NO == add);
|
||||
the subtraction by calculating "total = total - rtotal" */GNUNET_assert (GNUNET_NO == add);
|
||||
if (GNUNET_OK !=
|
||||
TALER_amount_add (&rtotal,
|
||||
&rtotal,
|
||||
@ -353,4 +350,5 @@ TALER_EXCHANGE_get_exchange_signing_key_info (const struct
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/* end of exchange_api_common.c */
|
||||
|
@ -1138,6 +1138,7 @@ TALER_EXCHANGE_set_now (struct TALER_EXCHANGE_Handle *exchange,
|
||||
exchange->now = now;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Unset the fake now to be used when requesting "/keys".
|
||||
*
|
||||
@ -1389,6 +1390,7 @@ TEAH_handle_reset (struct TALER_EXCHANGE_Handle *h)
|
||||
h->state = MHS_INIT;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if the handle is ready to process requests.
|
||||
*
|
||||
@ -1926,7 +1928,6 @@ TALER_EXCHANGE_connect
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Initiate download of /keys from the exchange.
|
||||
*
|
||||
|
@ -617,14 +617,14 @@ deserialize_melt_data (const char *buf,
|
||||
&buf[off],
|
||||
buf_size - off,
|
||||
&ok);
|
||||
for (unsigned int i = 0; (i<md->num_fresh_coins)&&(GNUNET_YES == ok); i++)
|
||||
for (unsigned int i = 0; (i<md->num_fresh_coins) && (GNUNET_YES == ok); i++)
|
||||
off += deserialize_denomination_key (&md->fresh_pks[i],
|
||||
&buf[off],
|
||||
buf_size - off,
|
||||
&ok);
|
||||
|
||||
for (unsigned int i = 0; i<TALER_CNC_KAPPA; i++)
|
||||
for (unsigned int j = 0; (j<md->num_fresh_coins)&&(GNUNET_YES == ok); j++)
|
||||
for (unsigned int j = 0; (j<md->num_fresh_coins) && (GNUNET_YES == ok); j++)
|
||||
off += deserialize_fresh_coin (&md->fresh_coins[i][j],
|
||||
&buf[off],
|
||||
buf_size - off,
|
||||
|
@ -203,8 +203,7 @@ parse_refresh_link_ok (struct TALER_EXCHANGE_RefreshLinkHandle *rlh,
|
||||
loop once for 'session=0' in most cases.
|
||||
|
||||
num_coins tracks the size of the 1d array we return,
|
||||
whilst 'i' and 'session' track the 2d array. */
|
||||
for (session = 0; session<json_array_size (json); session++)
|
||||
whilst 'i' and 'session' track the 2d array. */for (session = 0; session<json_array_size (json); session++)
|
||||
{
|
||||
json_t *jsona;
|
||||
struct GNUNET_JSON_Specification spec[] = {
|
||||
|
@ -233,8 +233,7 @@ parse_reserve_history (struct TALER_EXCHANGE_Handle *exchange,
|
||||
isn't listed twice by the exchange. We use the
|
||||
"uuid" array to remember the hashes of all
|
||||
purposes, and compare the hashes to find
|
||||
duplicates. */
|
||||
GNUNET_CRYPTO_hash (&withdraw_purpose,
|
||||
duplicates. */GNUNET_CRYPTO_hash (&withdraw_purpose,
|
||||
ntohl (withdraw_purpose.purpose.size),
|
||||
&uuid[uuid_off]);
|
||||
for (i = 0; i<uuid_off; i++)
|
||||
|
@ -203,8 +203,7 @@ run (void *cls,
|
||||
* test-suite gave a account number of _424_ to the user at
|
||||
* this step; to type less, here the _42_ number is reused.
|
||||
* Does this change the tests semantics?
|
||||
*/
|
||||
CMD_TRANSFER_TO_EXCHANGE ("refresh-create-reserve-1",
|
||||
*/CMD_TRANSFER_TO_EXCHANGE ("refresh-create-reserve-1",
|
||||
"EUR:5.01"),
|
||||
/**
|
||||
* Make previous command effective.
|
||||
@ -265,8 +264,7 @@ run (void *cls,
|
||||
* fresh merchant public key! NOTE: this comment comes
|
||||
* "verbatim" from the old test-suite, and IMO does not explain
|
||||
* a lot!
|
||||
*/
|
||||
CMD_EXEC_AGGREGATOR ("run-aggregator"),
|
||||
*/CMD_EXEC_AGGREGATOR ("run-aggregator"),
|
||||
|
||||
/**
|
||||
* Check all the transfers took place.
|
||||
@ -490,8 +488,7 @@ run (void *cls,
|
||||
* These commands should close the reserve because the aggregator
|
||||
* is given a config file that ovverrides the reserve expiration
|
||||
* time (making it now-ish)
|
||||
*/
|
||||
CMD_TRANSFER_TO_EXCHANGE ("short-lived-reserve",
|
||||
*/CMD_TRANSFER_TO_EXCHANGE ("short-lived-reserve",
|
||||
"EUR:5.01"),
|
||||
TALER_TESTING_cmd_exec_wirewatch ("short-lived-aggregation",
|
||||
CONFIG_FILE_EXPIRE_RESERVE_NOW),
|
||||
@ -503,8 +500,7 @@ run (void *cls,
|
||||
* then have the rest paid back. Check deposit of other coin
|
||||
* fails. (Do not use EUR:5 here as the EUR:5 coin was
|
||||
* revoked and we did not bother to create a new one...)
|
||||
*/
|
||||
CMD_TRANSFER_TO_EXCHANGE ("payback-create-reserve-2",
|
||||
*/CMD_TRANSFER_TO_EXCHANGE ("payback-create-reserve-2",
|
||||
"EUR:2.02"),
|
||||
/**
|
||||
* Make previous command effective.
|
||||
@ -795,4 +791,5 @@ main (int argc,
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* end of test_auditor_api.c */
|
||||
|
@ -160,4 +160,5 @@ main (int argc,
|
||||
return global_ret;
|
||||
}
|
||||
|
||||
|
||||
/* end of test_auditor_api_version.c */
|
||||
|
@ -248,8 +248,7 @@ run (void *cls,
|
||||
* contract terms' hashes. So since the contract terms are
|
||||
* exactly the same as the previous command,
|
||||
* how can a different id be generated?
|
||||
*/
|
||||
TALER_TESTING_cmd_deposit
|
||||
*/TALER_TESTING_cmd_deposit
|
||||
("deposit-double-1", "withdraw-coin-1", 0,
|
||||
TALER_TESTING_make_wire_details (43,
|
||||
fakebank_url),
|
||||
@ -277,8 +276,7 @@ run (void *cls,
|
||||
* test-suite gave a account number of _424_ to the user at
|
||||
* this step; to type less, here the _42_ number is reused.
|
||||
* Does this change the tests semantics?
|
||||
*/
|
||||
CMD_TRANSFER_TO_EXCHANGE ("refresh-create-reserve-1",
|
||||
*/CMD_TRANSFER_TO_EXCHANGE ("refresh-create-reserve-1",
|
||||
"EUR:5.01"),
|
||||
|
||||
/**
|
||||
@ -298,8 +296,7 @@ run (void *cls,
|
||||
* Try to partially spend (deposit) 1 EUR of the 5 EUR coin
|
||||
* (in full) (merchant would receive EUR:0.99 due to 1 ct
|
||||
* deposit fee)
|
||||
*/
|
||||
TALER_TESTING_cmd_deposit
|
||||
*/TALER_TESTING_cmd_deposit
|
||||
("refresh-deposit-partial",
|
||||
"refresh-withdraw-coin-1", 0,
|
||||
TALER_TESTING_make_wire_details (42,
|
||||
@ -381,8 +378,7 @@ run (void *cls,
|
||||
* Try resolving a deposit's WTID, as we never triggered
|
||||
* execution of transactions, the answer should be that
|
||||
* the exchange knows about the deposit, but has no WTID yet.
|
||||
*/
|
||||
TALER_TESTING_cmd_track_transaction
|
||||
*/TALER_TESTING_cmd_track_transaction
|
||||
("deposit-wtid-found",
|
||||
"deposit-simple", 0, MHD_HTTP_ACCEPTED, NULL),
|
||||
|
||||
@ -390,8 +386,7 @@ run (void *cls,
|
||||
* Try resolving a deposit's WTID for a failed deposit.
|
||||
* As the deposit failed, the answer should be that the
|
||||
* exchange does NOT know about the deposit.
|
||||
*/
|
||||
TALER_TESTING_cmd_track_transaction
|
||||
*/TALER_TESTING_cmd_track_transaction
|
||||
("deposit-wtid-failing",
|
||||
"deposit-double-2", 0, MHD_HTTP_NOT_FOUND, NULL),
|
||||
|
||||
@ -399,8 +394,7 @@ run (void *cls,
|
||||
* Try resolving an undefined (all zeros) WTID; this
|
||||
* should fail as obviously the exchange didn't use that
|
||||
* WTID value for any transaction.
|
||||
*/
|
||||
TALER_TESTING_cmd_track_transfer_empty
|
||||
*/TALER_TESTING_cmd_track_transfer_empty
|
||||
("wire-deposit-failing",
|
||||
NULL, 0, MHD_HTTP_NOT_FOUND),
|
||||
|
||||
@ -410,8 +404,7 @@ run (void *cls,
|
||||
* fresh merchant public key! NOTE: this comment comes
|
||||
* "verbatim" from the old test-suite, and IMO does not explain
|
||||
* a lot!
|
||||
*/
|
||||
CMD_EXEC_AGGREGATOR ("run-aggregator"),
|
||||
*/CMD_EXEC_AGGREGATOR ("run-aggregator"),
|
||||
|
||||
/**
|
||||
* Check all the transfers took place.
|
||||
@ -560,9 +553,7 @@ run (void *cls,
|
||||
* the preliminary transfer (used to withdraw) from the
|
||||
* fakebank and the second to actually check there are not
|
||||
* other transfers around.
|
||||
*/
|
||||
|
||||
TALER_TESTING_cmd_check_bank_transfer
|
||||
*/TALER_TESTING_cmd_check_bank_transfer
|
||||
("check_bank_transfer-pre-refund", exchange_url,
|
||||
"EUR:5.01", 42, 2),
|
||||
|
||||
@ -657,8 +648,7 @@ run (void *cls,
|
||||
* Run transfers. This will do the transfer as refund deadline
|
||||
* was 0, except of course because the refund succeeded, the
|
||||
* transfer should no longer be done.
|
||||
*/
|
||||
CMD_EXEC_AGGREGATOR ("run-aggregator-3b"),
|
||||
*/CMD_EXEC_AGGREGATOR ("run-aggregator-3b"),
|
||||
|
||||
/* check that aggregator didn't do anything, as expected */
|
||||
TALER_TESTING_cmd_check_bank_empty
|
||||
@ -729,8 +719,7 @@ run (void *cls,
|
||||
* These commands should close the reserve because
|
||||
* the aggregator is given a config file that ovverrides
|
||||
* the reserve expiration time (making it now-ish)
|
||||
*/
|
||||
CMD_TRANSFER_TO_EXCHANGE
|
||||
*/CMD_TRANSFER_TO_EXCHANGE
|
||||
("short-lived-reserve",
|
||||
"EUR:5.01"),
|
||||
|
||||
@ -773,8 +762,7 @@ run (void *cls,
|
||||
* then have the rest paid back. Check deposit of other coin
|
||||
* fails. (Do not use EUR:5 here as the EUR:5 coin was
|
||||
* revoked and we did not bother to create a new one...)
|
||||
*/
|
||||
CMD_TRANSFER_TO_EXCHANGE ("payback-create-reserve-2",
|
||||
*/CMD_TRANSFER_TO_EXCHANGE ("payback-create-reserve-2",
|
||||
"EUR:2.02"),
|
||||
|
||||
/* Make previous command effective. */
|
||||
@ -1008,4 +996,5 @@ main (int argc,
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* end of test_exchange_api.c */
|
||||
|
@ -124,4 +124,5 @@ main (int argc,
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* end of test_exchange_api_keys_cherry_picking_new.c */
|
||||
|
@ -166,8 +166,7 @@ run (void *cls,
|
||||
* key set. The new KS will have only one key, because the
|
||||
* current lookahead_sign == 60 seconds and the key's withdraw
|
||||
* duration is 80 seconds.
|
||||
*/
|
||||
TALER_TESTING_cmd_exec_keyup_with_now
|
||||
*/TALER_TESTING_cmd_exec_keyup_with_now
|
||||
("keyup-1",
|
||||
CONFIG_FILE,
|
||||
TTH_parse_time (JAN2030)),
|
||||
@ -175,8 +174,7 @@ run (void *cls,
|
||||
* Should return 1 new key, + the original one. NOTE: the
|
||||
* original DK will never be 'cancelled' as for the current
|
||||
* libtalerexchange logic, so it must always be counted.
|
||||
*/
|
||||
TALER_TESTING_cmd_check_keys_with_now
|
||||
*/TALER_TESTING_cmd_check_keys_with_now
|
||||
("check-keys-2",
|
||||
2, /* generation */
|
||||
2,
|
||||
@ -204,9 +202,7 @@ run (void *cls,
|
||||
* very initial setup, and 1 from the 'keyup-1' CMD)
|
||||
* ----
|
||||
* 46
|
||||
*/
|
||||
|
||||
TALER_TESTING_cmd_check_keys_with_now
|
||||
*/TALER_TESTING_cmd_check_keys_with_now
|
||||
("check-keys-3",
|
||||
3,
|
||||
NDKS_RIGHT_BEFORE_SERIALIZATION,
|
||||
@ -269,4 +265,5 @@ main (int argc,
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* end of test_exchange_api_keys_cherry_picking.c */
|
||||
|
@ -132,4 +132,5 @@ main (int argc,
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* end of test_exchange_api_overlapping_keys_bug.c */
|
||||
|
@ -134,8 +134,7 @@ run (void *cls,
|
||||
* Try to partially spend (deposit) 1 EUR of the 5 EUR coin
|
||||
* (in full) (merchant would receive EUR:0.99 due to 1 ct
|
||||
* deposit fee)
|
||||
*/
|
||||
TALER_TESTING_cmd_deposit
|
||||
*/TALER_TESTING_cmd_deposit
|
||||
("deposit-partial",
|
||||
"withdraw-coin-1", 0,
|
||||
TALER_TESTING_make_wire_details (42,
|
||||
@ -278,4 +277,5 @@ main (int argc,
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* end of test_exchange_api_revocation.c */
|
||||
|
@ -213,8 +213,7 @@ run (void *cls,
|
||||
* NOTE: not all CMDs actually need the twister,
|
||||
* so it may be better to move those into the "main"
|
||||
* lib test suite.
|
||||
*/
|
||||
struct TALER_TESTING_Command refund[] = {
|
||||
*/struct TALER_TESTING_Command refund[] = {
|
||||
|
||||
CMD_TRANSFER_TO_EXCHANGE
|
||||
("create-reserve-r1",
|
||||
@ -328,6 +327,7 @@ run (void *cls,
|
||||
fakebank_url);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Kill, wait, and destroy convenience function.
|
||||
*
|
||||
@ -341,6 +341,7 @@ purge_process (struct GNUNET_OS_Process *process)
|
||||
GNUNET_OS_process_destroy (process);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main (int argc,
|
||||
char *const *argv)
|
||||
@ -395,4 +396,5 @@ main (int argc,
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* end of test_exchange_api_twisted.c */
|
||||
|
@ -172,6 +172,7 @@ check_bank_transfer_run (void *cls,
|
||||
TALER_TESTING_interpreter_next (is);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Free the state of a "bank check" CMD.
|
||||
*
|
||||
@ -189,6 +190,7 @@ check_bank_transfer_cleanup
|
||||
GNUNET_free (bcs);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Offer internal data from a "bank check" CMD state.
|
||||
*
|
||||
@ -230,7 +232,6 @@ check_bank_transfer_traits (void *cls,
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Make a "bank check" CMD. It checks whether a
|
||||
* particular wire transfer has been made or not.
|
||||
@ -273,6 +274,7 @@ TALER_TESTING_cmd_check_bank_transfer
|
||||
return cmd;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Cleanup the state, only defined to respect the API.
|
||||
*
|
||||
@ -287,6 +289,7 @@ check_bank_empty_cleanup
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Run the command.
|
||||
*
|
||||
|
@ -136,6 +136,7 @@ batch_traits (void *cls,
|
||||
index);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create a "batch" command. Such command takes a
|
||||
* end_CMD-terminated array of CMDs and executed them.
|
||||
@ -179,6 +180,7 @@ TALER_TESTING_cmd_batch (const char *label,
|
||||
return cmd;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Advance internal pointer to next command.
|
||||
*
|
||||
@ -200,7 +202,6 @@ TALER_TESTING_cmd_batch_next
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Test if this command is a batch command.
|
||||
*
|
||||
|
@ -141,8 +141,7 @@ check_keys_run (void *cls,
|
||||
* a "maybe" basis, so it can get quite hard to track /keys
|
||||
* request. Rather, this CMD should just check if /keys was
|
||||
* requested AT LEAST n times before going ahead with checks.
|
||||
*/
|
||||
if (is->key_generation > cks->generation)
|
||||
*/if (is->key_generation > cks->generation)
|
||||
{
|
||||
/* We got /keys too often, strange. Fatal. May theoretically
|
||||
happen if somehow we were really unlucky and /keys expired
|
||||
@ -237,6 +236,7 @@ TALER_TESTING_cmd_check_keys_with_last_denom
|
||||
return cmd;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Make a "check keys" command. This type of command
|
||||
* checks whether the number of denomination keys from
|
||||
@ -321,7 +321,6 @@ TALER_TESTING_cmd_check_keys_with_now
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Make a "check keys" command that forcedly does NOT cherry pick;
|
||||
* just redownload the whole /keys. Then checks whether the number
|
||||
|
@ -485,6 +485,7 @@ deposit_traits (void *cls,
|
||||
index);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create a "deposit" command.
|
||||
*
|
||||
|
@ -163,4 +163,5 @@ TALER_TESTING_cmd_exec_aggregator (const char *label,
|
||||
return cmd;
|
||||
}
|
||||
|
||||
|
||||
/* end of testing_api_cmd_exec_aggregator.c */
|
||||
|
@ -229,4 +229,5 @@ TALER_TESTING_cmd_exec_auditor_sign (const char *label,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* end of testing_api_cmd_exec_auditor-sign.c */
|
||||
|
@ -201,6 +201,7 @@ TALER_TESTING_cmd_exec_keyup_with_now
|
||||
return cmd;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Make the "keyup" CMD.
|
||||
*
|
||||
@ -229,4 +230,5 @@ TALER_TESTING_cmd_exec_keyup (const char *label,
|
||||
return cmd;
|
||||
}
|
||||
|
||||
|
||||
/* end of testing_api_cmd_exec_keyup.c */
|
||||
|
@ -31,7 +31,6 @@
|
||||
#include "taler_testing_lib.h"
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* State for a "wirewatch" CMD.
|
||||
*/
|
||||
@ -165,4 +164,5 @@ TALER_TESTING_cmd_exec_wirewatch (const char *label,
|
||||
return cmd;
|
||||
}
|
||||
|
||||
|
||||
/* end of testing_api_cmd_exec_wirewatch.c */
|
||||
|
@ -417,6 +417,7 @@ fakebank_transfer_cleanup (void *cls,
|
||||
GNUNET_free (fts);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Offer internal data from a "fakebank transfer" CMD to other
|
||||
* commands.
|
||||
@ -766,4 +767,5 @@ TALER_TESTING_cmd_fakebank_transfer_retry (struct TALER_TESTING_Command cmd)
|
||||
return cmd;
|
||||
}
|
||||
|
||||
|
||||
/* end of testing_api_cmd_fakebank_transfer.c */
|
||||
|
@ -485,6 +485,7 @@ revoke_traits (void *cls,
|
||||
index);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Run the "revoke" command. The core of the function
|
||||
* is to call the "keyup" utility passing it the base32
|
||||
|
@ -884,7 +884,8 @@ refresh_melt_run (void *cls,
|
||||
rms->noreveal_index = UINT16_MAX;
|
||||
for (num_fresh_coins = 0;
|
||||
NULL != melt_fresh_amounts[num_fresh_coins];
|
||||
num_fresh_coins++);
|
||||
num_fresh_coins++)
|
||||
;
|
||||
rms->num_fresh_coins = num_fresh_coins;
|
||||
rms->fresh_pks = GNUNET_new_array
|
||||
(num_fresh_coins,
|
||||
|
@ -224,4 +224,5 @@ TALER_TESTING_cmd_wait_service (const char *label,
|
||||
return cmd;
|
||||
}
|
||||
|
||||
|
||||
/* end of testing_api_cmd_sleep.c */
|
||||
|
@ -126,9 +126,7 @@ reserve_status_cb
|
||||
* "reserve history update trait" which returns information about
|
||||
* how the command changes the history (provided only by commands
|
||||
* that change reserve balances)?
|
||||
*/
|
||||
|
||||
TALER_TESTING_interpreter_next (ss->is);
|
||||
*/TALER_TESTING_interpreter_next (ss->is);
|
||||
}
|
||||
|
||||
|
||||
|
@ -589,9 +589,7 @@ track_transfer_cb
|
||||
* or any operation that could provide wire-details. (2)
|
||||
* Total amount for this transfer matches the one from any
|
||||
* referenced command that could provide one.
|
||||
*/
|
||||
|
||||
if (NULL != tts->wire_details_reference)
|
||||
*/if (NULL != tts->wire_details_reference)
|
||||
{
|
||||
const struct TALER_TESTING_Command *wire_details_cmd;
|
||||
const json_t *wire_details;
|
||||
@ -674,6 +672,7 @@ track_transfer_cb
|
||||
TALER_TESTING_interpreter_next (is);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Run the command.
|
||||
*
|
||||
@ -727,6 +726,7 @@ track_transfer_run (void *cls,
|
||||
GNUNET_assert (NULL != tts->tth);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Make a "track transfer" CMD where no "expected"-arguments,
|
||||
* except the HTTP response code, are given. The best use case
|
||||
@ -769,6 +769,7 @@ TALER_TESTING_cmd_track_transfer_empty
|
||||
return cmd;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Make a "track transfer" command, specifying which amount and
|
||||
* wire fee are expected.
|
||||
@ -814,4 +815,5 @@ TALER_TESTING_cmd_track_transfer
|
||||
return cmd;
|
||||
}
|
||||
|
||||
|
||||
/* end of testing_api_cmd_track.c */
|
||||
|
@ -201,6 +201,7 @@ wire_cleanup (void *cls,
|
||||
GNUNET_free (ws);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create a "wire" command.
|
||||
*
|
||||
|
@ -32,7 +32,6 @@
|
||||
#include "backoff.h"
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* State for a "withdraw" CMD.
|
||||
*/
|
||||
|
@ -1077,4 +1077,5 @@ TALER_TESTING_prepare_fakebank (const char *config_filename,
|
||||
return fakebank_url;
|
||||
}
|
||||
|
||||
|
||||
/* end of testing_api_helpers.c */
|
||||
|
@ -491,7 +491,8 @@ TALER_TESTING_run2 (struct TALER_TESTING_Interpreter *is,
|
||||
is->timeout_task = NULL;
|
||||
}
|
||||
/* get the number of commands */
|
||||
for (i = 0; NULL != commands[i].label; i++);
|
||||
for (i = 0; NULL != commands[i].label; i++)
|
||||
;
|
||||
is->commands = GNUNET_new_array (i + 1,
|
||||
struct TALER_TESTING_Command);
|
||||
memcpy (is->commands,
|
||||
@ -831,4 +832,5 @@ TALER_TESTING_setup (TALER_TESTING_Main main_cb,
|
||||
return is.result;
|
||||
}
|
||||
|
||||
|
||||
/* end of testing_api_loop.c */
|
||||
|
@ -54,7 +54,6 @@ TALER_TESTING_get_trait_blinding_key
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Offer blinding key.
|
||||
*
|
||||
@ -77,4 +76,5 @@ TALER_TESTING_make_trait_blinding_key
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* end of testing_api_trait_blinding_key.c */
|
||||
|
@ -79,4 +79,5 @@ TALER_TESTING_make_trait_cmd
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* end of testing_api_trait_cmd.c */
|
||||
|
@ -75,4 +75,5 @@ TALER_TESTING_make_trait_coin_priv
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* end of testing_api_trait_coin_priv.c */
|
||||
|
@ -75,4 +75,5 @@ TALER_TESTING_make_trait_denom_pub
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* end of testing_api_trait_denom_pub.c */
|
||||
|
@ -74,4 +74,5 @@ TALER_TESTING_make_trait_exchange_pub
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* end of testing_api_trait_exchange_pub.c */
|
||||
|
@ -74,4 +74,5 @@ TALER_TESTING_make_trait_exchange_sig
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* end of testing_api_trait_exchange_sig.c */
|
||||
|
@ -76,4 +76,5 @@ TALER_TESTING_make_trait_fresh_coins
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* end of testing_api_trait_fresh_coin.c */
|
||||
|
@ -74,6 +74,7 @@ TALER_TESTING_make_trait_exchange_keys
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Obtain wire details from @a cmd.
|
||||
*
|
||||
@ -119,4 +120,5 @@ TALER_TESTING_make_trait_wire_details
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* end of testing_api_trait_json.c */
|
||||
|
@ -54,6 +54,7 @@ TALER_TESTING_get_trait_peer_key
|
||||
index);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Offer private key, typically done when CMD_1 needs it to
|
||||
* sign a request.
|
||||
@ -100,6 +101,7 @@ TALER_TESTING_get_trait_peer_key_pub
|
||||
index);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Offer public key.
|
||||
*
|
||||
|
@ -73,6 +73,7 @@ TALER_TESTING_make_trait_uint
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Obtain a "number" value from @a cmd, 64-bit version.
|
||||
*
|
||||
@ -94,6 +95,7 @@ TALER_TESTING_get_trait_uint64
|
||||
index);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Offer number trait, 64-bit version.
|
||||
*
|
||||
@ -113,4 +115,5 @@ TALER_TESTING_make_trait_uint64
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* end of testing_api_trait_number.c */
|
||||
|
@ -80,4 +80,5 @@ TALER_TESTING_make_trait_process
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* end of testing_api_trait_process.c */
|
||||
|
@ -73,4 +73,5 @@ TALER_TESTING_make_trait_reserve_priv
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* end of testing_api_trait_reserve_priv.c */
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user