diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-04-08 23:54:52 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-04-08 23:54:52 +0200 |
commit | 549fec36b9d28d1b49d26ffcbb099f41f42b8ce6 (patch) | |
tree | 472515d802192ffffc1ea68330d71ad3ad46df38 /src/lib | |
parent | 8eb027085c388296e6885139638f4bba255c69f5 (diff) | |
download | merchant-549fec36b9d28d1b49d26ffcbb099f41f42b8ce6.tar.gz merchant-549fec36b9d28d1b49d26ffcbb099f41f42b8ce6.tar.bz2 merchant-549fec36b9d28d1b49d26ffcbb099f41f42b8ce6.zip |
adapt to exchange API change
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/merchant_api_pay.c | 10 | ||||
-rw-r--r-- | src/lib/testing_api_cmd_pay.c | 2 | ||||
-rw-r--r-- | src/lib/testing_api_cmd_pay_abort.c | 2 | ||||
-rw-r--r-- | src/lib/testing_api_cmd_refund_lookup.c | 7 | ||||
-rw-r--r-- | src/lib/testing_api_cmd_track_transfer.c | 6 |
5 files changed, 14 insertions, 13 deletions
diff --git a/src/lib/merchant_api_pay.c b/src/lib/merchant_api_pay.c index fb9dbb45..97a0b444 100644 --- a/src/lib/merchant_api_pay.c +++ b/src/lib/merchant_api_pay.c @@ -257,7 +257,7 @@ check_coin_history (const struct TALER_MERCHANT_PaidCoin *pc, GNUNET_break_op (0); return GNUNET_SYSERR; } - if (GNUNET_OK != + if (0 > TALER_amount_add (&spent_plus_contrib, &spent, &pc->amount_with_fee)) @@ -610,7 +610,7 @@ request_pay_generic ( const struct TALER_MERCHANT_PaidCoin *pc = &coins[i]; struct TALER_Amount fee; - if (GNUNET_SYSERR == + if (0 > TALER_amount_subtract (&fee, &pc->amount_with_fee, &pc->amount_without_fee)) @@ -628,11 +628,11 @@ request_pay_generic ( } else { - if ( (GNUNET_OK != + if ( (0 > TALER_amount_add (&total_fee, &total_fee, &fee)) || - (GNUNET_OK != + (0 > TALER_amount_add (&total_amount, &total_amount, &pc->amount_with_fee)) ) @@ -825,7 +825,7 @@ prepare_pay_generic (struct GNUNET_CURL_Context *ctx, &dr.coin_pub.eddsa_pub); TALER_amount_hton (&dr.amount_with_fee, &coin->amount_with_fee); - if (GNUNET_SYSERR == + if (0 > TALER_amount_subtract (&fee, &coin->amount_with_fee, &coin->amount_without_fee)) diff --git a/src/lib/testing_api_cmd_pay.c b/src/lib/testing_api_cmd_pay.c index 1855d378..02bdf408 100644 --- a/src/lib/testing_api_cmd_pay.c +++ b/src/lib/testing_api_cmd_pay.c @@ -236,7 +236,7 @@ build_coins (struct TALER_MERCHANT_PayCoin **pc, TALER_TESTING_find_pk (is->keys, &icoin->denom_value))); - GNUNET_assert (GNUNET_SYSERR != + GNUNET_assert (0 <= TALER_amount_subtract (&icoin->amount_without_fee, &icoin->denom_value, &dpk->fee_deposit)); diff --git a/src/lib/testing_api_cmd_pay_abort.c b/src/lib/testing_api_cmd_pay_abort.c index 6db46eb2..5911dd1d 100644 --- a/src/lib/testing_api_cmd_pay_abort.c +++ b/src/lib/testing_api_cmd_pay_abort.c @@ -188,7 +188,7 @@ build_coins (struct TALER_MERCHANT_PayCoin **pc, TALER_TESTING_find_pk (is->keys, &icoin->denom_value))); - GNUNET_assert (GNUNET_SYSERR != + GNUNET_assert (0 <= TALER_amount_subtract (&icoin->amount_without_fee, &icoin->denom_value, &dpk->fee_deposit)); diff --git a/src/lib/testing_api_cmd_refund_lookup.c b/src/lib/testing_api_cmd_refund_lookup.c index 986f72f1..c677fe5b 100644 --- a/src/lib/testing_api_cmd_refund_lookup.c +++ b/src/lib/testing_api_cmd_refund_lookup.c @@ -260,9 +260,10 @@ refund_lookup_cb (void *cls, /* Can be NULL: not all coins are involved in refund */ if (NULL == iamount) continue; - GNUNET_assert (GNUNET_OK == TALER_amount_add (&acc, - &acc, - iamount)); + GNUNET_assert (0 <= + TALER_amount_add (&acc, + &acc, + iamount)); } GNUNET_free (coin_reference_dup); diff --git a/src/lib/testing_api_cmd_track_transfer.c b/src/lib/testing_api_cmd_track_transfer.c index 195d50b3..b0dfc478 100644 --- a/src/lib/testing_api_cmd_track_transfer.c +++ b/src/lib/testing_api_cmd_track_transfer.c @@ -179,17 +179,17 @@ track_transfer_cb (void *cls, TALER_TESTING_FAIL (tts->is); return; } - GNUNET_assert (GNUNET_SYSERR != + GNUNET_assert (0 <= TALER_amount_add (&sum, &sum, &amount_iter)); - GNUNET_assert (GNUNET_SYSERR != + GNUNET_assert (0 <= TALER_amount_subtract (&sum, &sum, &deposit_fee_iter)); } - GNUNET_assert (GNUNET_SYSERR != + GNUNET_assert (0 <= TALER_amount_subtract (&sum, &sum, &wire_fee)); |