aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing_api_trait_truth_key.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/testing_api_trait_truth_key.c')
-rw-r--r--src/testing/testing_api_trait_truth_key.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/testing/testing_api_trait_truth_key.c b/src/testing/testing_api_trait_truth_key.c
new file mode 100644
index 0000000..55094c1
--- /dev/null
+++ b/src/testing/testing_api_trait_truth_key.c
@@ -0,0 +1,58 @@
1/*
2 This file is part of TALER
3 Copyright (C) 2019, 2021 Taler Systems SA
4
5 TALER is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
9
10 TALER is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
14
15 You should have received a copy of the GNU General Public
16 License along with TALER; see the file COPYING. If not, see
17 <http://www.gnu.org/licenses/>
18*/
19/**
20 * @file lib/testing_api_trait_truth_key.c
21 * @brief traits to offer a payment identifier
22 * @author Dennis Neufeld
23 */
24#include "platform.h"
25#include "anastasis_testing_lib.h"
26
27#define ANASTASIS_TESTING_TRAIT_TRUTH_KEY \
28 "anastasis-truth_key"
29
30
31int
32ANASTASIS_TESTING_get_trait_truth_key
33 (const struct TALER_TESTING_Command *cmd,
34 unsigned int index,
35 const struct ANASTASIS_CRYPTO_TruthKeyP **truth_key)
36{
37 return cmd->traits (cmd->cls,
38 (const void **) truth_key,
39 ANASTASIS_TESTING_TRAIT_TRUTH_KEY,
40 index);
41}
42
43
44struct TALER_TESTING_Trait
45ANASTASIS_TESTING_make_trait_truth_key
46 (unsigned int index,
47 const struct ANASTASIS_CRYPTO_TruthKeyP *h)
48{
49 struct TALER_TESTING_Trait ret = {
50 .index = index,
51 .trait_name = ANASTASIS_TESTING_TRAIT_TRUTH_KEY,
52 .ptr = (const void *) h
53 };
54 return ret;
55}
56
57
58/* end of testing_api_trait_truth_key.c */