[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-exchange] branch master updated (7654551 -> 56786ae)
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-exchange] branch master updated (7654551 -> 56786ae) |
Date: |
Sun, 07 May 2017 14:21:42 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a change to branch master
in repository exchange.
from 7654551 updating DB schema for new wire history operations and future
auditor checks of wire transfers
new 0e73c0d check json_pack return value, just to be nice
new 56786ae adjust test to work with real bank (now fails)
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
src/bank-lib/bank_api_admin.c | 10 ++++++++++
src/bank-lib/test_bank_api.c | 15 +++++++++++++--
src/exchange-lib/exchange_api_admin.c | 5 +++++
src/exchange-lib/exchange_api_deposit.c | 5 +++++
src/exchange-lib/exchange_api_payback.c | 8 ++++++--
src/exchange-lib/exchange_api_refresh.c | 10 ++++++++++
src/exchange-lib/exchange_api_refund.c | 8 ++++++--
src/exchange-lib/exchange_api_reserve.c | 6 ++++++
src/exchange-lib/exchange_api_track_transaction.c | 5 +++++
src/exchange/taler-exchange-httpd_responses.c | 10 +++++-----
10 files changed, 71 insertions(+), 11 deletions(-)
diff --git a/src/bank-lib/bank_api_admin.c b/src/bank-lib/bank_api_admin.c
index afafbc2..9aa37c4 100644
--- a/src/bank-lib/bank_api_admin.c
+++ b/src/bank-lib/bank_api_admin.c
@@ -158,12 +158,22 @@ TALER_BANK_admin_add_incoming (struct GNUNET_CURL_Context
*ctx,
json_t *admin_obj;
CURL *eh;
+ if (NULL == exchange_base_url)
+ {
+ GNUNET_break (0);
+ return NULL;
+ }
admin_obj = json_pack ("{s:s, s:o, s:o, s:I, s:I}",
"exchange_url", exchange_base_url,
"wtid", GNUNET_JSON_from_data_auto (wtid),
"amount", TALER_JSON_from_amount (amount),
"debit_account", (json_int_t) debit_account_no,
"credit_account", (json_int_t) credit_account_no);
+ if (NULL == admin_obj)
+ {
+ GNUNET_break (0);
+ return NULL;
+ }
aai = GNUNET_new (struct TALER_BANK_AdminAddIncomingHandle);
aai->cb = res_cb;
aai->cb_cls = res_cb_cls;
diff --git a/src/bank-lib/test_bank_api.c b/src/bank-lib/test_bank_api.c
index ee85fa6..2340769 100644
--- a/src/bank-lib/test_bank_api.c
+++ b/src/bank-lib/test_bank_api.c
@@ -48,12 +48,14 @@ run (void *cls)
.details.history.num_results = 5 },
{ .oc = TBI_OC_ADMIN_ADD_INCOMING,
.label = "deposit-1",
+ .details.admin_add_incoming.exchange_base_url = "https://exchange.net/",
/* bogus */
.details.admin_add_incoming.expected_response_code = MHD_HTTP_OK,
.details.admin_add_incoming.credit_account_no = 1,
.details.admin_add_incoming.debit_account_no = 2,
.details.admin_add_incoming.amount = "PUDOS:5.01" },
{ .oc = TBI_OC_ADMIN_ADD_INCOMING,
.label = "deposit-2",
+ .details.admin_add_incoming.exchange_base_url = "https://exchange.net/",
/* bogus */
.details.admin_add_incoming.expected_response_code = MHD_HTTP_OK,
.details.admin_add_incoming.credit_account_no = 1,
.details.admin_add_incoming.debit_account_no = 2,
@@ -168,18 +170,27 @@ main (int argc,
do
{
- fprintf (stderr, ".");
+ fprintf (stderr, ",");
sleep (1);
cnt++;
if (cnt > 30)
break;
+ result = system ("wget -q -t 1 -T 1
http://127.0.0.1:8081/admin/add/incoming -o /dev/null -O /dev/null");
}
- while (0 != system ("wget -q -t 1 -T 1
http://127.0.0.1:8081/admin/add/incoming -o /dev/null -O /dev/null"));
+ while (! ( (WIFEXITED (result)) &&
+ (8 == WEXITSTATUS (result)) ) );
+ /* Note: we are using "GET", so /admin/add/incoming will yield a 405, which
causes wget to return
+ a status code of 8. */
+
fprintf (stderr, "\n");
result = GNUNET_SYSERR;
if (cnt <= 30)
+ {
+ fprintf (stderr,
+ "Ready, running test...\n");
GNUNET_SCHEDULER_run (&run, &result);
+ }
GNUNET_OS_process_kill (bankd,
SIGTERM);
GNUNET_OS_process_kill (bankd_admin,
diff --git a/src/exchange-lib/exchange_api_admin.c
b/src/exchange-lib/exchange_api_admin.c
index e6cb810..6049c54 100644
--- a/src/exchange-lib/exchange_api_admin.c
+++ b/src/exchange-lib/exchange_api_admin.c
@@ -187,6 +187,11 @@ TALER_EXCHANGE_admin_add_incoming (struct
TALER_EXCHANGE_Handle *exchange,
"execution_date", GNUNET_JSON_from_time_abs
(execution_date),
"sender_account_details", sender_account_details,
"transfer_details", transfer_details);
+ if (NULL == admin_obj)
+ {
+ GNUNET_break (0);
+ return NULL;
+ }
aai = GNUNET_new (struct TALER_EXCHANGE_AdminAddIncomingHandle);
aai->exchange = exchange;
aai->cb = res_cb;
diff --git a/src/exchange-lib/exchange_api_deposit.c
b/src/exchange-lib/exchange_api_deposit.c
index 7eb6f5b..72f588f 100644
--- a/src/exchange-lib/exchange_api_deposit.c
+++ b/src/exchange-lib/exchange_api_deposit.c
@@ -463,6 +463,11 @@ TALER_EXCHANGE_deposit (struct TALER_EXCHANGE_Handle
*exchange,
"wire_transfer_deadline", GNUNET_JSON_from_time_abs
(wire_deadline),
"coin_sig", GNUNET_JSON_from_data_auto (coin_sig)
);
+ if (NULL == deposit_obj)
+ {
+ GNUNET_break (0);
+ return NULL;
+ }
dh = GNUNET_new (struct TALER_EXCHANGE_DepositHandle);
dh->exchange = exchange;
diff --git a/src/exchange-lib/exchange_api_payback.c
b/src/exchange-lib/exchange_api_payback.c
index 30cd55c..8096e55 100644
--- a/src/exchange-lib/exchange_api_payback.c
+++ b/src/exchange-lib/exchange_api_payback.c
@@ -57,7 +57,7 @@ struct TALER_EXCHANGE_PaybackHandle
* Denomination key of the coin.
*/
const struct TALER_EXCHANGE_DenomPublicKey *pk;
-
+
/**
* Handle for the request.
*/
@@ -306,7 +306,11 @@ TALER_EXCHANGE_payback (struct TALER_EXCHANGE_Handle
*exchange,
"coin_sig", GNUNET_JSON_from_data_auto (&coin_sig),
"coin_blind_key_secret", GNUNET_JSON_from_data_auto
(blinding_key)
);
- GNUNET_assert (NULL != payback_obj);
+ if (NULL == payback_obj)
+ {
+ GNUNET_break (0);
+ return NULL;
+ }
ph = GNUNET_new (struct TALER_EXCHANGE_PaybackHandle);
ph->coin_pub = pr.coin_pub;
diff --git a/src/exchange-lib/exchange_api_refresh.c
b/src/exchange-lib/exchange_api_refresh.c
index 08f5e2d..84fb3b7 100644
--- a/src/exchange-lib/exchange_api_refresh.c
+++ b/src/exchange-lib/exchange_api_refresh.c
@@ -1337,6 +1337,11 @@ TALER_EXCHANGE_refresh_melt (struct
TALER_EXCHANGE_Handle *exchange,
"melt_coin", melt_coin,
"coin_evs", coin_evs,
"transfer_pubs", transfer_pubs);
+ if (NULL == melt_obj)
+ {
+ GNUNET_break (0);
+ return NULL;
+ }
/* and now we can at last begin the actual request handling */
rmh = GNUNET_new (struct TALER_EXCHANGE_RefreshMeltHandle);
@@ -1723,6 +1728,11 @@ TALER_EXCHANGE_refresh_reveal (struct
TALER_EXCHANGE_Handle *exchange,
GNUNET_JSON_from_data_auto (&md->melt_session_hash),
"transfer_privs",
transfer_privs);
+ if (NULL == reveal_obj)
+ {
+ GNUNET_break (0);
+ return NULL;
+ }
/* finally, we can actually issue the request */
rrh = GNUNET_new (struct TALER_EXCHANGE_RefreshRevealHandle);
diff --git a/src/exchange-lib/exchange_api_refund.c
b/src/exchange-lib/exchange_api_refund.c
index 4a0cac5..dc6d5d7 100644
--- a/src/exchange-lib/exchange_api_refund.c
+++ b/src/exchange-lib/exchange_api_refund.c
@@ -279,8 +279,12 @@ TALER_EXCHANGE_refund (struct TALER_EXCHANGE_Handle
*exchange,
"merchant_pub", GNUNET_JSON_from_data_auto
(&rr.merchant),
"merchant_sig", GNUNET_JSON_from_data_auto
(&merchant_sig)
);
- GNUNET_assert (NULL != refund_obj);
-
+ if (NULL == refund_obj)
+ {
+ GNUNET_break (0);
+ return NULL;
+ }
+
rh = GNUNET_new (struct TALER_EXCHANGE_RefundHandle);
rh->exchange = exchange;
rh->cb = cb;
diff --git a/src/exchange-lib/exchange_api_reserve.c
b/src/exchange-lib/exchange_api_reserve.c
index c7f59c2..89c4fdc 100644
--- a/src/exchange-lib/exchange_api_reserve.c
+++ b/src/exchange-lib/exchange_api_reserve.c
@@ -1015,6 +1015,12 @@ TALER_EXCHANGE_reserve_withdraw (struct
TALER_EXCHANGE_Handle *exchange,
"reserve_pub", GNUNET_JSON_from_data_auto
(&wsh->reserve_pub),
"reserve_sig", GNUNET_JSON_from_data_auto
(&reserve_sig));
GNUNET_free (coin_ev);
+ if (NULL == withdraw_obj)
+ {
+ GNUNET_break (0);
+ return NULL;
+ }
+
wsh->blinding_key = *blinding_key;
wsh->url = MAH_path_to_url (exchange, "/reserve/withdraw");
diff --git a/src/exchange-lib/exchange_api_track_transaction.c
b/src/exchange-lib/exchange_api_track_transaction.c
index 9b63821..34cf4ea 100644
--- a/src/exchange-lib/exchange_api_track_transaction.c
+++ b/src/exchange-lib/exchange_api_track_transaction.c
@@ -303,6 +303,11 @@ TALER_EXCHANGE_track_transaction (struct
TALER_EXCHANGE_Handle *exchange,
"coin_pub", GNUNET_JSON_from_data_auto
(coin_pub),
"merchant_pub", GNUNET_JSON_from_data_auto
(&dtp.merchant),
"merchant_sig", GNUNET_JSON_from_data_auto
(&merchant_sig));
+ if (NULL == deposit_wtid_obj)
+ {
+ GNUNET_break (0);
+ return NULL;
+ }
dwh = GNUNET_new (struct TALER_EXCHANGE_TrackTransactionHandle);
dwh->exchange = exchange;
diff --git a/src/exchange/taler-exchange-httpd_responses.c
b/src/exchange/taler-exchange-httpd_responses.c
index 0d74064..9ce9bb8 100644
--- a/src/exchange/taler-exchange-httpd_responses.c
+++ b/src/exchange/taler-exchange-httpd_responses.c
@@ -48,7 +48,7 @@ TEH_RESPONSE_add_global_headers (struct MHD_Response
*response)
}
-/**
+/**
* Is HTTP body deflate compression supported by the client?
*
* @param connection connection to check
@@ -75,7 +75,7 @@ TEH_RESPONSE_can_compress (struct MHD_Connection *connection)
( (de[strlen ("deflate")] == '\0') ||
(de[strlen ("deflate")] == ',') ) )
return MHD_YES;
- return MHD_NO;
+ return MHD_NO;
}
@@ -525,7 +525,7 @@ static json_t *
compile_transaction_history (const struct TALER_EXCHANGEDB_TransactionList *tl)
{
json_t *history;
-
+
history = json_array ();
if (NULL == history)
{
@@ -650,7 +650,7 @@ compile_transaction_history (const struct
TALER_EXCHANGEDB_TransactionList *tl)
json_decref (history);
return NULL;
}
-
+
GNUNET_assert (0 ==
json_array_append_new (history,
json_pack ("{s:s, s:o, s:o, s:o,
s:o, s:I, s:o}",
@@ -779,7 +779,7 @@ compile_reserve_history (const struct
TALER_EXCHANGEDB_ReserveHistory *rh,
{
struct GNUNET_HashCode h_denom_pub;
struct TALER_Amount value;
-
+
value = pos->details.withdraw->amount_with_fee;
if (0 == (2 & ret))
{
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [taler-exchange] branch master updated (7654551 -> 56786ae),
gnunet <=