From 5e25d7dbcfbfe1859862a719e4392f17cd356a9b Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Mon, 9 Jul 2018 21:15:47 +0200 Subject: Improve KYC status callback. More parameters for this callback. --- src/exchangedb/test_exchangedb.c | 52 +++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 22 deletions(-) (limited to 'src/exchangedb/test_exchangedb.c') diff --git a/src/exchangedb/test_exchangedb.c b/src/exchangedb/test_exchangedb.c index 535077fbd..8b3486b45 100644 --- a/src/exchangedb/test_exchangedb.c +++ b/src/exchangedb/test_exchangedb.c @@ -344,6 +344,26 @@ never_called_cb (void *cls, } +/** + * Callback used to process data of a merchant under KYC monitoring. + * + * @param cls closure + * @param payto_url payto URL of this particular merchant (bank account) + * @param kyc_checked status of KYC check: if GNUNET_OK, the merchant was + * checked at least once, never otherwise. + * @param merchant_serial_id serial ID identifying this merchant (bank + * account) into the database system; it helps making more efficient + * queries instead of the payto URL. + */ +static void +kcs (void *cls, + const char *payto_url, + uint8_t kyc_checked, + uint64_t merchant_serial_id) +{ + GNUNET_break (0); +} + /** * Function called with information about a refresh order. * Checks that the response matches what we expect to see. @@ -2190,29 +2210,17 @@ run (void *cls) plugin->mark_kyc_merchant (NULL, session, "payto://mock")); + FAILIF (GNUNET_OK != + plugin->get_kyc_status (NULL, + session, + "payto://mock", + &kcs, + NULL)); - { - uint8_t kyc_checked; - - FAILIF (GNUNET_OK != - plugin->get_kyc_status (NULL, - session, - "payto://mock", - &kyc_checked)); - FAILIF (GNUNET_NO == kyc_checked); - - FAILIF (GNUNET_OK != - plugin->unmark_kyc_merchant (NULL, - session, - "payto://mock")); - FAILIF (GNUNET_OK != - plugin->get_kyc_status (NULL, - session, - "payto://mock", - &kyc_checked)); - - FAILIF (GNUNET_YES == kyc_checked); - } + FAILIF (GNUNET_OK != + plugin->unmark_kyc_merchant (NULL, + session, + "payto://mock")); plugin->preflight (plugin->cls, session); -- cgit v1.2.3