diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-01-17 15:43:04 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-01-17 15:43:04 +0100 |
commit | 0328ab313b9194f10c154f74518089df9509fe09 (patch) | |
tree | 4088179075b4d8f063307c0180c2f4e5615ec3be /src/exchangedb/test_exchangedb.c | |
parent | cdd8d14f76de8d0abdbe90f75820cc0dadab9751 (diff) |
use more specific SELECT in exchange aggregator on refunds instead of filtering in application logic later
Diffstat (limited to 'src/exchangedb/test_exchangedb.c')
-rw-r--r-- | src/exchangedb/test_exchangedb.c | 43 |
1 files changed, 3 insertions, 40 deletions
diff --git a/src/exchangedb/test_exchangedb.c b/src/exchangedb/test_exchangedb.c index e9fe67b43..a880ce621 100644 --- a/src/exchangedb/test_exchangedb.c +++ b/src/exchangedb/test_exchangedb.c @@ -1412,60 +1412,21 @@ wire_missing_cb (void *cls, * to a particular coin. * * @param cls closure with the `struct TALER_EXCHANGEDB_Refund *` we expect to get - * @param merchant_pub public key of merchant who authorized refund - * @param merchant_sig signature of merchant authorizing refund - * @param h_contract hash of contract being refunded - * @param rtransaction_id refund transaction ID * @param amount_with_fee amount being refunded - * @param refund_fee fee the exchange keeps for the refund processing * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop */ static int check_refund_cb (void *cls, - const struct TALER_MerchantPublicKeyP *merchant_pub, - const struct TALER_MerchantSignatureP *merchant_sig, - const struct GNUNET_HashCode *h_contract, - uint64_t rtransaction_id, - const struct TALER_Amount *amount_with_fee, - const struct TALER_Amount *refund_fee) + const struct TALER_Amount *amount_with_fee) { const struct TALER_EXCHANGEDB_Refund *refund = cls; - if (0 != GNUNET_memcmp (merchant_pub, - &refund->details.merchant_pub)) - { - GNUNET_break (0); - result = 66; - } - if (0 != GNUNET_memcmp (merchant_sig, - &refund->details.merchant_sig)) - { - GNUNET_break (0); - result = 66; - } - if (0 != GNUNET_memcmp (h_contract, - &refund->details.h_contract_terms)) - { - GNUNET_break (0); - result = 66; - } - if (rtransaction_id != refund->details.rtransaction_id) - { - GNUNET_break (0); - result = 66; - } if (0 != TALER_amount_cmp (amount_with_fee, &refund->details.refund_amount)) { GNUNET_break (0); result = 66; } - if (0 != TALER_amount_cmp (refund_fee, - &refund->details.refund_fee)) - { - GNUNET_break (0); - result = 66; - } return GNUNET_OK; } @@ -1988,6 +1949,8 @@ run (void *cls) plugin->select_refunds_by_coin (plugin->cls, session, &refund.coin.coin_pub, + &refund.details.merchant_pub, + &refund.details.h_contract_terms, &check_refund_cb, &refund)); |