[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-anastasis] branch master updated: Created initial file for high-l
From: |
gnunet |
Subject: |
[taler-anastasis] branch master updated: Created initial file for high-level functions |
Date: |
Sat, 09 Nov 2019 13:53:31 +0100 |
This is an automated email from the git hooks/post-receive script.
dennis-neufeld pushed a commit to branch master
in repository anastasis.
The following commit(s) were added to refs/heads/master by this push:
new 526beaf Created initial file for high-level functions
526beaf is described below
commit 526beaf15c5c090833f8bac8a2e368c5a4d1f9e4
Author: Dennis Neufeld <address@hidden>
AuthorDate: Sat Nov 9 12:53:14 2019 +0000
Created initial file for high-level functions
---
src/include/anastasis.h | 28 ++++++++++++++++++++++++++++
src/include/anastasis_database_plugin.h | 20 ++------------------
src/include/anastasis_service.h | 21 +++++++++++++++++++++
src/stasis/plugin_anastasis_postgres.c | 8 ++++----
src/stasis/test_anastasis_db.c | 6 +++---
5 files changed, 58 insertions(+), 25 deletions(-)
diff --git a/src/include/anastasis.h b/src/include/anastasis.h
new file mode 100644
index 0000000..2c18b6b
--- /dev/null
+++ b/src/include/anastasis.h
@@ -0,0 +1,28 @@
+/*
+ This file is part of Anastasis
+ Copyright (C) 2019 Taler Systems SA
+
+ Anastasis is free software; you can redistribute it and/or modify it under
the
+ terms of the GNU Lesser General Public License as published by the Free
Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ Anastasis 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ Anastasis; see the file COPYING.GPL. If not, see
<http://www.gnu.org/licenses/>
+*/
+/**
+ * @file include/anastasis.h
+ * @brief low level functions for Anastasis
+ * @author Christian Grothoff
+ * @author Dennis Neufeld
+ * @author Dominik Meister
+ */
+#ifndef ANASTASIS_H
+#define ANASTASIS_H
+
+#include "anastasis_service.h"
+
+//FIXME
\ No newline at end of file
diff --git a/src/include/anastasis_database_plugin.h
b/src/include/anastasis_database_plugin.h
index e0dace0..e4d59ac 100644
--- a/src/include/anastasis_database_plugin.h
+++ b/src/include/anastasis_database_plugin.h
@@ -23,27 +23,11 @@
#include <gnunet/gnunet_util_lib.h>
#include <anastasis_error_codes.h>
+#include "anastasis_service.h"
#include <jansson.h>
#include <taler/taler_util.h>
#include <uuid/uuid.h>
-
-/**
- * An EdDSA public key that is used to identify a user's account.
- */
-struct ANASTASIS_AccountPubP
-{
- struct GNUNET_CRYPTO_EddsaPublicKey pub;
-};
-
-/**
- * Random identifier used to later charge a payment.
- */
-struct ANASTASIS_PaymentSecretP
-{
- uint32_t id[8];
-};
-
/**
* Handle to interact with the database.
*
@@ -252,7 +236,7 @@ struct ANASTASIS_DatabasePlugin
void **truth,
size_t *truth_size,
char **truth_mime);
-
+
/**
* @param cls closure
* @param uuid the identifier for the Truth
diff --git a/src/include/anastasis_service.h b/src/include/anastasis_service.h
index 4370d9d..201ebc0 100644
--- a/src/include/anastasis_service.h
+++ b/src/include/anastasis_service.h
@@ -18,6 +18,8 @@
* @brief C interface of libanastasisrest, a C library to use merchant's HTTP
API
* @author Christian Grothoff
* @author Marcello Stanisci
+ * @author Dennis Neufeld
+ * @author Dominik Meister
*/
#ifndef _ANASTASIS_SERVICE_H
#define _ANASTASIS_SERVICE_H
@@ -25,6 +27,25 @@
#include <gnunet/gnunet_curl_lib.h>
#include <jansson.h>
+
+/* ****************** Anastasis crypto primitives ************* */
+
+/**
+ * An EdDSA public key that is used to identify a user's account.
+ */
+struct ANASTASIS_AccountPubP
+{
+ struct GNUNET_CRYPTO_EddsaPublicKey pub;
+};
+
+/**
+ * Random identifier used to later charge a payment.
+ */
+struct ANASTASIS_PaymentSecretP
+{
+ uint32_t id[8];
+};
+
struct ANASTASIS_SaltOperation;
/**
diff --git a/src/stasis/plugin_anastasis_postgres.c
b/src/stasis/plugin_anastasis_postgres.c
index 97d80c0..e034a0a 100644
--- a/src/stasis/plugin_anastasis_postgres.c
+++ b/src/stasis/plugin_anastasis_postgres.c
@@ -471,7 +471,7 @@ postgres_record_payment (void *cls,
struct PostgresClosure *pg = cls;
enum ANASTASIS_DB_QueryStatus qs;
struct GNUNET_TIME_Absolute paid_until;
-
+
check_connection (pg);
if (GNUNET_OK !=
begin_transaction (pg,
@@ -520,7 +520,7 @@ postgres_record_payment (void *cls,
}
paid_until = GNUNET_TIME_absolute_add (paid_until,
lifetime_inc);
- GNUNET_TIME_round_abs (&paid_until);
+ GNUNET_TIME_round_abs (&paid_until);
if (ANASTASIS_DB_STATUS_SUCCESS_NO_RESULTS == qs)
{
/* user did not yet exist, create */
@@ -711,8 +711,8 @@ postgres_get_escrow_challenge (void *cls,
};
struct GNUNET_PQ_ResultSpec rs[] = {
GNUNET_PQ_result_spec_variable_size ("truth",
- truth,
- truth_size),
+ truth,
+ truth_size),
GNUNET_PQ_result_spec_string ("mime_type",
truth_mime),
GNUNET_PQ_result_spec_end
diff --git a/src/stasis/test_anastasis_db.c b/src/stasis/test_anastasis_db.c
index fc1189a..704b1e2 100644
--- a/src/stasis/test_anastasis_db.c
+++ b/src/stasis/test_anastasis_db.c
@@ -1,5 +1,5 @@
/*
- This file is part of
+ This file is part of
(C) 2014-2017 INRIA
TALER is free software; you can redistribute it and/or modify it under the
@@ -151,7 +151,7 @@ run (void *cls)
}
uint32_t recversion = 1;
- size_t truthsize;
+ size_t truthsize;
size_t recoverydatasize;
size_t keysharesize;
RND_BLK (&accountPubP);
@@ -174,7 +174,7 @@ run (void *cls)
mime_type = "Picture";
TALER_string_to_amount ("EUR:30",&amount);
uuid_t uuid;
- uuid_generate(uuid);
+ uuid_generate (uuid);
struct GNUNET_TIME_Relative rel_time;
rel_time = GNUNET_TIME_UNIT_MONTHS;
--
To stop receiving notification emails like this one, please contact
address@hidden.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-anastasis] branch master updated: Created initial file for high-level functions,
gnunet <=