summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Blättler <blatc2@bfh.ch>2024-03-18 20:57:57 +0100
committerChristian Blättler <blatc2@bfh.ch>2024-03-18 20:58:10 +0100
commit52708604b7cc3bebfb90f4c2800a76fda323d574 (patch)
tree717ba6ba175a33b56598a90aa1e5e6821532fe84 /src/include
parent54dfaa7d739f259cd4f7210df57ef163977093b7 (diff)
downloadmerchant-52708604b7cc3bebfb90f4c2800a76fda323d574.tar.gz
merchant-52708604b7cc3bebfb90f4c2800a76fda323d574.tar.bz2
merchant-52708604b7cc3bebfb90f4c2800a76fda323d574.zip
db: add lookup function for token family key
Diffstat (limited to 'src/include')
-rw-r--r--src/include/taler_merchantdb_plugin.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/include/taler_merchantdb_plugin.h b/src/include/taler_merchantdb_plugin.h
index 316b8678..c7ff7463 100644
--- a/src/include/taler_merchantdb_plugin.h
+++ b/src/include/taler_merchantdb_plugin.h
@@ -23,6 +23,7 @@
#ifndef TALER_MERCHANTDB_PLUGIN_H
#define TALER_MERCHANTDB_PLUGIN_H
+#include <gnunet/gnunet_common.h>
#include <gnunet/gnunet_util_lib.h>
#include <gnunet/gnunet_db_lib.h>
#include <taler/taler_exchange_service.h>
@@ -1079,14 +1080,20 @@ struct TALER_MERCHANTDB_TokenFamilyKeyDetails
struct TALER_TokenFamilyPublicKey pub;
/**
+ * TODO: Remove this separate field, since it's already available within pub.
* Hash of the token family public key.
*/
struct TALER_TokenFamilyPublicKeyHash pub_h;
/**
* Token family private key.
- */
+ */
struct TALER_TokenFamilyPrivateKey priv;
+
+ /**
+ * Details about the token family this key belongs to.
+ */
+ struct TALER_MERCHANTDB_TokenFamilyDetails token_family;
};
/**
@@ -3229,6 +3236,24 @@ struct TALER_MERCHANTDB_Plugin
const char *token_family_slug,
const struct TALER_MERCHANTDB_TokenFamilyDetails *details);
+
+ /**
+ * Lookup details about a particular token family public key.
+ *
+ * @param cls closure
+ * @param instance_id instance to lookup token family for
+ * @param h_public_key hash of token family public key to lookup
+ * @param[out] details set to the token family key details on success, can be NULL
+ * (in that case we only want to check if the token family key exists)
+ * @return database result code
+ */
+ enum GNUNET_DB_QueryStatus
+ (*lookup_token_family_key) (
+ void *cls,
+ const char *instance_id,
+ struct GNUNET_HashCode *h_public_key,
+ struct TALER_MERCHANTDB_TokenFamilyKeyDetails *details);
+
/**
* Lookup deposits that are finished and awaiting a wire transfer.
*