reindenting with uncrustify
This commit is contained in:
parent
52bbfe926b
commit
b46fe9aa21
@ -369,8 +369,7 @@ conv_cancel (enum TALER_BANK_Direction direction)
|
|||||||
* called.
|
* called.
|
||||||
*/
|
*/
|
||||||
struct TALER_BANK_HistoryHandle *
|
struct TALER_BANK_HistoryHandle *
|
||||||
TALER_BANK_history_range
|
TALER_BANK_history_range (struct GNUNET_CURL_Context *ctx,
|
||||||
(struct GNUNET_CURL_Context *ctx,
|
|
||||||
const char *bank_base_url,
|
const char *bank_base_url,
|
||||||
const struct TALER_BANK_AuthenticationData *auth,
|
const struct TALER_BANK_AuthenticationData *auth,
|
||||||
uint64_t account_number,
|
uint64_t account_number,
|
||||||
|
@ -56,6 +56,26 @@ static struct GNUNET_OS_Process *bankd;
|
|||||||
*/
|
*/
|
||||||
static int WITH_FAKEBANK;
|
static int WITH_FAKEBANK;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Transfer @a amount from @a src account to @a dst using
|
||||||
|
* @a subject and the @a label for the command.
|
||||||
|
*/
|
||||||
|
#define TRANSFER(label,amount,src,dst,subject) \
|
||||||
|
TALER_TESTING_cmd_fakebank_transfer_with_subject (label, \
|
||||||
|
amount, \
|
||||||
|
bank_url, \
|
||||||
|
src, \
|
||||||
|
dst, \
|
||||||
|
AUTHS[src \
|
||||||
|
- 1].details.basic. \
|
||||||
|
username, \
|
||||||
|
AUTHS[src \
|
||||||
|
- 1].details.basic. \
|
||||||
|
password, \
|
||||||
|
subject, \
|
||||||
|
"http://exchange.net/")
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main function that will tell the interpreter what commands to
|
* Main function that will tell the interpreter what commands to
|
||||||
* run.
|
* run.
|
||||||
@ -70,9 +90,7 @@ run (void *cls,
|
|||||||
"Bank serves at `%s'\n",
|
"Bank serves at `%s'\n",
|
||||||
bank_url);
|
bank_url);
|
||||||
extern struct TALER_BANK_AuthenticationData AUTHS[];
|
extern struct TALER_BANK_AuthenticationData AUTHS[];
|
||||||
|
|
||||||
struct TALER_TESTING_Command commands[] = {
|
struct TALER_TESTING_Command commands[] = {
|
||||||
|
|
||||||
TALER_TESTING_cmd_bank_history ("history-0",
|
TALER_TESTING_cmd_bank_history ("history-0",
|
||||||
bank_url,
|
bank_url,
|
||||||
BANK_ACCOUNT_NUMBER,
|
BANK_ACCOUNT_NUMBER,
|
||||||
@ -80,20 +98,13 @@ run (void *cls,
|
|||||||
GNUNET_YES,
|
GNUNET_YES,
|
||||||
NULL,
|
NULL,
|
||||||
1),
|
1),
|
||||||
|
|
||||||
/* WARNING: old API has expected http response code among
|
/* WARNING: old API has expected http response code among
|
||||||
* the parameters, although it was always set as '200 OK' */
|
* the parameters, although it was always set as '200 OK' */
|
||||||
TALER_TESTING_cmd_fakebank_transfer_with_subject
|
TRANSFER ("debit-1",
|
||||||
("debit-1",
|
|
||||||
"KUDOS:5.01",
|
"KUDOS:5.01",
|
||||||
bank_url,
|
|
||||||
EXCHANGE_ACCOUNT_NUMBER,
|
EXCHANGE_ACCOUNT_NUMBER,
|
||||||
BANK_ACCOUNT_NUMBER,
|
BANK_ACCOUNT_NUMBER,
|
||||||
AUTHS[EXCHANGE_ACCOUNT_NUMBER - 1].details.basic.username,
|
"subject 1"),
|
||||||
AUTHS[EXCHANGE_ACCOUNT_NUMBER - 1].details.basic.password,
|
|
||||||
"subject 1",
|
|
||||||
"http://exchange.com/"),
|
|
||||||
|
|
||||||
TALER_TESTING_cmd_bank_history ("history-1c",
|
TALER_TESTING_cmd_bank_history ("history-1c",
|
||||||
bank_url,
|
bank_url,
|
||||||
BANK_ACCOUNT_NUMBER,
|
BANK_ACCOUNT_NUMBER,
|
||||||
@ -101,7 +112,6 @@ run (void *cls,
|
|||||||
GNUNET_YES,
|
GNUNET_YES,
|
||||||
NULL,
|
NULL,
|
||||||
5),
|
5),
|
||||||
|
|
||||||
TALER_TESTING_cmd_bank_history ("history-1d",
|
TALER_TESTING_cmd_bank_history ("history-1d",
|
||||||
bank_url,
|
bank_url,
|
||||||
BANK_ACCOUNT_NUMBER,
|
BANK_ACCOUNT_NUMBER,
|
||||||
@ -109,29 +119,16 @@ run (void *cls,
|
|||||||
GNUNET_YES,
|
GNUNET_YES,
|
||||||
NULL,
|
NULL,
|
||||||
5),
|
5),
|
||||||
|
TRANSFER ("debit-2",
|
||||||
TALER_TESTING_cmd_fakebank_transfer_with_subject
|
|
||||||
("debit-2",
|
|
||||||
"KUDOS:3.21",
|
"KUDOS:3.21",
|
||||||
bank_url,
|
|
||||||
EXCHANGE_ACCOUNT_NUMBER, // debit account.
|
|
||||||
USER_ACCOUNT_NUMBER,
|
|
||||||
AUTHS[EXCHANGE_ACCOUNT_NUMBER - 1].details.basic.username,
|
|
||||||
AUTHS[EXCHANGE_ACCOUNT_NUMBER - 1].details.basic.password,
|
|
||||||
"subject 2",
|
|
||||||
"http://exchange.org/"),
|
|
||||||
|
|
||||||
TALER_TESTING_cmd_fakebank_transfer_with_subject
|
|
||||||
("credit-2",
|
|
||||||
"KUDOS:3.22",
|
|
||||||
bank_url,
|
|
||||||
USER_ACCOUNT_NUMBER, // debit account.
|
|
||||||
EXCHANGE_ACCOUNT_NUMBER,
|
EXCHANGE_ACCOUNT_NUMBER,
|
||||||
AUTHS[USER_ACCOUNT_NUMBER - 1].details.basic.username,
|
USER_ACCOUNT_NUMBER,
|
||||||
AUTHS[USER_ACCOUNT_NUMBER - 1].details.basic.password,
|
"subject 2"),
|
||||||
"credit 2",
|
TRANSFER ("credit-2",
|
||||||
"http://exchange.org/"),
|
"KUDOS:3.22",
|
||||||
|
USER_ACCOUNT_NUMBER,
|
||||||
|
EXCHANGE_ACCOUNT_NUMBER,
|
||||||
|
"credit 2"),
|
||||||
TALER_TESTING_cmd_bank_history ("history-2b",
|
TALER_TESTING_cmd_bank_history ("history-2b",
|
||||||
bank_url,
|
bank_url,
|
||||||
EXCHANGE_ACCOUNT_NUMBER,
|
EXCHANGE_ACCOUNT_NUMBER,
|
||||||
@ -139,7 +136,6 @@ run (void *cls,
|
|||||||
GNUNET_YES,
|
GNUNET_YES,
|
||||||
NULL,
|
NULL,
|
||||||
5),
|
5),
|
||||||
|
|
||||||
TALER_TESTING_cmd_bank_history ("history-2bi",
|
TALER_TESTING_cmd_bank_history ("history-2bi",
|
||||||
bank_url,
|
bank_url,
|
||||||
EXCHANGE_ACCOUNT_NUMBER,
|
EXCHANGE_ACCOUNT_NUMBER,
|
||||||
@ -147,22 +143,14 @@ run (void *cls,
|
|||||||
GNUNET_YES,
|
GNUNET_YES,
|
||||||
"debit-1",
|
"debit-1",
|
||||||
5),
|
5),
|
||||||
|
TRANSFER ("credit-for-reject-1",
|
||||||
TALER_TESTING_cmd_fakebank_transfer_with_subject
|
|
||||||
("credit-for-reject-1",
|
|
||||||
"KUDOS:1.01",
|
"KUDOS:1.01",
|
||||||
bank_url,
|
|
||||||
BANK_ACCOUNT_NUMBER,
|
BANK_ACCOUNT_NUMBER,
|
||||||
EXCHANGE_ACCOUNT_NUMBER,
|
EXCHANGE_ACCOUNT_NUMBER,
|
||||||
AUTHS[BANK_ACCOUNT_NUMBER - 1].details.basic.username,
|
"subject 3"),
|
||||||
AUTHS[BANK_ACCOUNT_NUMBER - 1].details.basic.password,
|
|
||||||
"subject 3",
|
|
||||||
"http://exchange.net/"),
|
|
||||||
|
|
||||||
TALER_TESTING_cmd_bank_reject ("reject-1",
|
TALER_TESTING_cmd_bank_reject ("reject-1",
|
||||||
bank_url,
|
bank_url,
|
||||||
"credit-for-reject-1"),
|
"credit-for-reject-1"),
|
||||||
|
|
||||||
TALER_TESTING_cmd_bank_history ("history-r1",
|
TALER_TESTING_cmd_bank_history ("history-r1",
|
||||||
bank_url,
|
bank_url,
|
||||||
BANK_ACCOUNT_NUMBER,
|
BANK_ACCOUNT_NUMBER,
|
||||||
@ -170,7 +158,6 @@ run (void *cls,
|
|||||||
GNUNET_YES,
|
GNUNET_YES,
|
||||||
NULL,
|
NULL,
|
||||||
5),
|
5),
|
||||||
|
|
||||||
TALER_TESTING_cmd_bank_history ("history-r1c",
|
TALER_TESTING_cmd_bank_history ("history-r1c",
|
||||||
bank_url,
|
bank_url,
|
||||||
BANK_ACCOUNT_NUMBER,
|
BANK_ACCOUNT_NUMBER,
|
||||||
@ -179,11 +166,6 @@ run (void *cls,
|
|||||||
GNUNET_YES,
|
GNUNET_YES,
|
||||||
NULL,
|
NULL,
|
||||||
5),
|
5),
|
||||||
|
|
||||||
/**
|
|
||||||
* End the suite. Fixme: better to have a label for this
|
|
||||||
* too, as it shows a "(null)" token on logs.
|
|
||||||
*/
|
|
||||||
TALER_TESTING_cmd_end ()
|
TALER_TESTING_cmd_end ()
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -213,8 +195,7 @@ main (int argc,
|
|||||||
if (GNUNET_YES == WITH_FAKEBANK)
|
if (GNUNET_YES == WITH_FAKEBANK)
|
||||||
{
|
{
|
||||||
TALER_LOG_DEBUG ("Running against the Fakebank.\n");
|
TALER_LOG_DEBUG ("Running against the Fakebank.\n");
|
||||||
if (NULL == (bank_url = TALER_TESTING_prepare_fakebank
|
if (NULL == (bank_url = TALER_TESTING_prepare_fakebank (CONFIG_FILE,
|
||||||
(CONFIG_FILE,
|
|
||||||
"account-1")))
|
"account-1")))
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
@ -224,15 +205,13 @@ main (int argc,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
TALER_LOG_DEBUG ("Running against the Pybank.\n");
|
TALER_LOG_DEBUG ("Running against the Pybank.\n");
|
||||||
if (NULL == (bank_url = TALER_TESTING_prepare_bank
|
if (NULL == (bank_url = TALER_TESTING_prepare_bank (CONFIG_FILE)))
|
||||||
(CONFIG_FILE)))
|
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
return 77;
|
return 77;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL == (bankd = TALER_TESTING_run_bank
|
if (NULL == (bankd = TALER_TESTING_run_bank (CONFIG_FILE,
|
||||||
(CONFIG_FILE,
|
|
||||||
bank_url)))
|
bank_url)))
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
|
@ -180,8 +180,7 @@ main (int argc,
|
|||||||
return 77;
|
return 77;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL == (bankd = TALER_TESTING_run_bank
|
if (NULL == (bankd = TALER_TESTING_run_bank (CONFIG_FILE,
|
||||||
(CONFIG_FILE,
|
|
||||||
bank_url)))
|
bank_url)))
|
||||||
{
|
{
|
||||||
GNUNET_break (0);
|
GNUNET_break (0);
|
||||||
|
@ -2150,7 +2150,7 @@ TEH_KS_loop (void)
|
|||||||
ret = GNUNET_SYSERR;
|
ret = GNUNET_SYSERR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
read_again:
|
read_again:
|
||||||
errno = 0;
|
errno = 0;
|
||||||
res = read (reload_pipe[0],
|
res = read (reload_pipe[0],
|
||||||
&c,
|
&c,
|
||||||
|
@ -115,7 +115,7 @@ handle_link_data (void *cls,
|
|||||||
root))
|
root))
|
||||||
goto fail;
|
goto fail;
|
||||||
return;
|
return;
|
||||||
fail:
|
fail:
|
||||||
ctx->ec = TALER_EC_JSON_ALLOCATION_FAILURE;
|
ctx->ec = TALER_EC_JSON_ALLOCATION_FAILURE;
|
||||||
json_decref (ctx->mlist);
|
json_decref (ctx->mlist);
|
||||||
ctx->mlist = NULL;
|
ctx->mlist = NULL;
|
||||||
|
@ -597,7 +597,7 @@ TEH_REFRESH_handler_refresh_melt (struct TEH_RequestHandler *rh,
|
|||||||
&rmc);
|
&rmc);
|
||||||
|
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (NULL != key_state)
|
if (NULL != key_state)
|
||||||
{
|
{
|
||||||
TEH_KS_release (key_state);
|
TEH_KS_release (key_state);
|
||||||
|
@ -816,7 +816,7 @@ handle_refresh_reveal_json (struct MHD_Connection *connection,
|
|||||||
} /* end for (retries...) */
|
} /* end for (retries...) */
|
||||||
GNUNET_break (MHD_NO != res);
|
GNUNET_break (MHD_NO != res);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
GNUNET_break (MHD_NO != res);
|
GNUNET_break (MHD_NO != res);
|
||||||
/* free resources */
|
/* free resources */
|
||||||
if (NULL != rctx->ev_sigs)
|
if (NULL != rctx->ev_sigs)
|
||||||
|
@ -294,7 +294,7 @@ TALER_EXCHANGEDB_auditor_write (const char *filename,
|
|||||||
auditor_url,
|
auditor_url,
|
||||||
wsize))
|
wsize))
|
||||||
ret = GNUNET_OK;
|
ret = GNUNET_OK;
|
||||||
cleanup:
|
cleanup:
|
||||||
eno = errno;
|
eno = errno;
|
||||||
if (NULL != fh)
|
if (NULL != fh)
|
||||||
(void) GNUNET_DISK_file_close (fh);
|
(void) GNUNET_DISK_file_close (fh);
|
||||||
|
@ -227,7 +227,7 @@ TALER_EXCHANGEDB_denomination_key_write (const char *filename,
|
|||||||
if (wrote != priv_enc_size)
|
if (wrote != priv_enc_size)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
ret = GNUNET_OK;
|
ret = GNUNET_OK;
|
||||||
cleanup:
|
cleanup:
|
||||||
GNUNET_free_non_null (priv_enc);
|
GNUNET_free_non_null (priv_enc);
|
||||||
if (NULL != fh)
|
if (NULL != fh)
|
||||||
(void) GNUNET_DISK_file_close (fh);
|
(void) GNUNET_DISK_file_close (fh);
|
||||||
|
@ -4103,7 +4103,7 @@ postgres_get_refresh_reveal (void *cls,
|
|||||||
&tp);
|
&tp);
|
||||||
GNUNET_PQ_cleanup_result (rs);
|
GNUNET_PQ_cleanup_result (rs);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
for (unsigned int i = 0; i < grctx.rrcs_len; i++)
|
for (unsigned int i = 0; i < grctx.rrcs_len; i++)
|
||||||
{
|
{
|
||||||
struct TALER_EXCHANGEDB_RefreshRevealedCoin *rrc = &grctx.rrcs[i];
|
struct TALER_EXCHANGEDB_RefreshRevealedCoin *rrc = &grctx.rrcs[i];
|
||||||
|
@ -136,7 +136,7 @@ test_wire_prepare (struct TALER_EXCHANGEDB_Session *session)
|
|||||||
&dead_prepare_cb,
|
&dead_prepare_cb,
|
||||||
NULL));
|
NULL));
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
drop:
|
drop:
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,7 +171,7 @@ check_reserve (struct TALER_EXCHANGEDB_Session *session,
|
|||||||
FAILIF (0 != strcmp (currency, reserve.balance.currency));
|
FAILIF (0 != strcmp (currency, reserve.balance.currency));
|
||||||
|
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
drop:
|
drop:
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -668,7 +668,7 @@ test_melting (struct TALER_EXCHANGEDB_Session *session)
|
|||||||
|
|
||||||
|
|
||||||
ret = GNUNET_OK;
|
ret = GNUNET_OK;
|
||||||
drop:
|
drop:
|
||||||
if (NULL != revealed_coins)
|
if (NULL != revealed_coins)
|
||||||
{
|
{
|
||||||
for (unsigned int cnt = 0; cnt < MELT_NEW_COINS; cnt++)
|
for (unsigned int cnt = 0; cnt < MELT_NEW_COINS; cnt++)
|
||||||
@ -1306,7 +1306,7 @@ test_wire_out (struct TALER_EXCHANGEDB_Session *session,
|
|||||||
FAILIF (1 != auditor_row_cnt);
|
FAILIF (1 != auditor_row_cnt);
|
||||||
|
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
drop:
|
drop:
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1340,7 +1340,7 @@ payback_cb (void *cls,
|
|||||||
FAILIF (0 != GNUNET_memcmp (cb,
|
FAILIF (0 != GNUNET_memcmp (cb,
|
||||||
coin_blind));
|
coin_blind));
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
drop:
|
drop:
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2190,7 +2190,7 @@ run (void *cls)
|
|||||||
|
|
||||||
result = 0;
|
result = 0;
|
||||||
|
|
||||||
drop:
|
drop:
|
||||||
if ( (0 != result) &&
|
if ( (0 != result) &&
|
||||||
(NULL != session) )
|
(NULL != session) )
|
||||||
plugin->rollback (plugin->cls,
|
plugin->rollback (plugin->cls,
|
||||||
|
@ -155,7 +155,7 @@ main (int argc,
|
|||||||
&auditor_cb,
|
&auditor_cb,
|
||||||
NULL));
|
NULL));
|
||||||
ret = 0;
|
ret = 0;
|
||||||
EXITIF_exit:
|
EXITIF_exit:
|
||||||
if (NULL != tmpdir)
|
if (NULL != tmpdir)
|
||||||
{
|
{
|
||||||
(void) GNUNET_DISK_directory_remove (tmpdir);
|
(void) GNUNET_DISK_directory_remove (tmpdir);
|
||||||
|
@ -193,7 +193,7 @@ main (int argc,
|
|||||||
enc_size));
|
enc_size));
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
EXITIF_exit:
|
EXITIF_exit:
|
||||||
GNUNET_free_non_null (enc);
|
GNUNET_free_non_null (enc);
|
||||||
GNUNET_free_non_null (tmpfile);
|
GNUNET_free_non_null (tmpfile);
|
||||||
if (NULL != tmpdir)
|
if (NULL != tmpdir)
|
||||||
|
@ -86,7 +86,7 @@ main (int argc,
|
|||||||
&ski_iter,
|
&ski_iter,
|
||||||
&ski));
|
&ski));
|
||||||
ret = 0;
|
ret = 0;
|
||||||
EXITIF_exit:
|
EXITIF_exit:
|
||||||
if (NULL != tmpfile)
|
if (NULL != tmpfile)
|
||||||
{
|
{
|
||||||
(void) GNUNET_DISK_directory_remove (tmpfile);
|
(void) GNUNET_DISK_directory_remove (tmpfile);
|
||||||
|
@ -519,7 +519,7 @@ parse_json_denomkey (struct TALER_EXCHANGE_DenomPublicKey *denom_key,
|
|||||||
sizeof (struct GNUNET_HashCode));
|
sizeof (struct GNUNET_HashCode));
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
|
|
||||||
EXITIF_exit:
|
EXITIF_exit:
|
||||||
GNUNET_JSON_parse_free (spec);
|
GNUNET_JSON_parse_free (spec);
|
||||||
return GNUNET_SYSERR;
|
return GNUNET_SYSERR;
|
||||||
}
|
}
|
||||||
@ -1061,7 +1061,7 @@ decode_keys_json (const json_t *resp_obj,
|
|||||||
&pub.eddsa_pub));
|
&pub.eddsa_pub));
|
||||||
}
|
}
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
EXITIF_exit:
|
EXITIF_exit:
|
||||||
|
|
||||||
*vc = TALER_EXCHANGE_VC_PROTOCOL_ERROR;
|
*vc = TALER_EXCHANGE_VC_PROTOCOL_ERROR;
|
||||||
if (NULL != hash_context)
|
if (NULL != hash_context)
|
||||||
|
@ -164,7 +164,7 @@ TALER_string_to_amount (const char *str,
|
|||||||
}
|
}
|
||||||
return GNUNET_OK;
|
return GNUNET_OK;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
/* set currency to 'invalid' to prevent accidental use */
|
/* set currency to 'invalid' to prevent accidental use */
|
||||||
memset (denom->currency,
|
memset (denom->currency,
|
||||||
0,
|
0,
|
||||||
|
Loading…
Reference in New Issue
Block a user