summaryrefslogtreecommitdiff
path: root/src/exchangedb/test_exchangedb.c
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2018-07-09 21:15:47 +0200
committerMarcello Stanisci <stanisci.m@gmail.com>2018-07-09 21:15:47 +0200
commit5e25d7dbcfbfe1859862a719e4392f17cd356a9b (patch)
tree16cc3a13fcbda9cc122976f46c65ef7e9cb3a23a /src/exchangedb/test_exchangedb.c
parent01158a48171d6dbfddec1cf274b70d2e730a1a04 (diff)
downloadexchange-5e25d7dbcfbfe1859862a719e4392f17cd356a9b.tar.gz
exchange-5e25d7dbcfbfe1859862a719e4392f17cd356a9b.tar.bz2
exchange-5e25d7dbcfbfe1859862a719e4392f17cd356a9b.zip
Improve KYC status callback.
More parameters for this callback.
Diffstat (limited to 'src/exchangedb/test_exchangedb.c')
-rw-r--r--src/exchangedb/test_exchangedb.c52
1 files changed, 30 insertions, 22 deletions
diff --git a/src/exchangedb/test_exchangedb.c b/src/exchangedb/test_exchangedb.c
index 535077fb..8b3486b4 100644
--- a/src/exchangedb/test_exchangedb.c
+++ b/src/exchangedb/test_exchangedb.c
@@ -345,6 +345,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);