[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] branch master updated: add dummy helper for sanctions l
From: |
gnunet |
Subject: |
[taler-exchange] branch master updated: add dummy helper for sanctions list checking |
Date: |
Mon, 06 Jan 2025 12:37:55 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
The following commit(s) were added to refs/heads/master by this push:
new 23a9a532d add dummy helper for sanctions list checking
23a9a532d is described below
commit 23a9a532df62c27510d49334548662799a2b7102
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Mon Jan 6 12:37:47 2025 +0100
add dummy helper for sanctions list checking
---
src/kyclogic/.gitignore | 1 +
src/kyclogic/Makefile.am | 14 +++++
.../taler-exchange-helper-sanctions-dummy.c | 71 ++++++++++++++++++++++
3 files changed, 86 insertions(+)
diff --git a/src/kyclogic/.gitignore b/src/kyclogic/.gitignore
new file mode 100644
index 000000000..6798012c9
--- /dev/null
+++ b/src/kyclogic/.gitignore
@@ -0,0 +1 @@
+taler-exchange-helper-sanctions-dummy
diff --git a/src/kyclogic/Makefile.am b/src/kyclogic/Makefile.am
index 86a9279b3..f01bc12a8 100644
--- a/src/kyclogic/Makefile.am
+++ b/src/kyclogic/Makefile.am
@@ -60,6 +60,7 @@ libtalerkyclogic_la_LDFLAGS = \
bin_PROGRAMS = \
+ taler-exchange-helper-sanctions-dummy \
taler-exchange-kyc-tester
taler_exchange_kyc_tester_SOURCES = \
@@ -80,6 +81,19 @@ taler_exchange_kyc_tester_LDADD = \
-lz \
$(XLIB)
+taler_exchange_helper_sanctions_dummy_SOURCES = \
+ taler-exchange-helper-sanctions-dummy.c
+taler_exchange_helper_sanctions_dummy_LDADD = \
+ $(LIBGCRYPT_LIBS) \
+ libtalerkyclogic.la \
+ $(top_builddir)/src/mhd/libtalermhd.la \
+ $(top_builddir)/src/json/libtalerjson.la \
+ $(top_builddir)/src/util/libtalerutil.la \
+ -lgnunetutil \
+ -lgnunetjson \
+ -ljansson \
+ $(XLIB)
+
plugindir = $(libdir)/taler-exchange
diff --git a/src/kyclogic/taler-exchange-helper-sanctions-dummy.c
b/src/kyclogic/taler-exchange-helper-sanctions-dummy.c
new file mode 100644
index 000000000..b908e88af
--- /dev/null
+++ b/src/kyclogic/taler-exchange-helper-sanctions-dummy.c
@@ -0,0 +1,71 @@
+/*
+ This file is part of TALER
+ Copyright (C) 2025 Taler Systems SA
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU Affero General Public License as published by the Free
Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR
+ A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
details.
+
+ You should have received a copy of the GNU Affero General Public License
along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ */
+/**
+ * @file taler-exchange-helper-sanctions-dummy.c
+ * @brief sanction list evaluation simulator with a dummy implementation
+ * @author Christian Grothoff
+ * @defgroup request Request handling routines
+ */
+#include "platform.h"
+#include <gnunet/gnunet_util_lib.h>
+#include <jansson.h>
+#include "taler_json_lib.h"
+#include "taler_templating_lib.h"
+#include "taler_util.h"
+
+
+/**
+ * The main function of the taler-exchange-helper-sanctions-dummy.
+ *
+ * @param argc number of arguments from the command line
+ * @param argv command line arguments
+ * @return 0 ok, non-zero on error
+ */
+int
+main (int argc,
+ char *const *argv)
+{
+ double confidence = 0.0;
+ double match = 1.0;
+ json_t *input;
+ json_error_t err;
+
+ while (NULL != (input = json_loadf (stdin,
+ JSON_DISABLE_EOF_CHECK,
+ &err)))
+ {
+ struct GNUNET_TIME_Timestamp expiration
+ = GNUNET_TIME_absolute_to_timestamp (
+ GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS));
+
+ if (! json_is_object (input))
+ {
+ json_decref (input);
+ return 1;
+ }
+ json_decref (input);
+ fprintf (stdout,
+ "%f %f %llu dummy\n",
+ match,
+ confidence,
+ (unsigned long long) GNUNET_TIME_timestamp_to_s (expiration));
+ fflush (stdout);
+ }
+ return 0;
+}
+
+
+/* end of taler-exchange-helper-sanctions-dummy.c */
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-exchange] branch master updated: add dummy helper for sanctions list checking,
gnunet <=