aboutsummaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authorChristian Blättler <blatc2@bfh.ch>2024-06-13 17:02:00 +0200
committerChristian Blättler <blatc2@bfh.ch>2024-06-13 17:02:00 +0200
commit7d63433cedc03f561920708cd92ba1e5377dcbf5 (patch)
treeaebe2a896af464a435abdca5d8f608a2f15930a5 /src/testing
parentfdcf3f0929608dc035349e7e8407f3c8cc0f259b (diff)
add rounding and remove h_issue
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/test_merchant_api.c2
-rw-r--r--src/testing/testing_api_cmd_pay_order.c17
-rw-r--r--src/testing/testing_api_cmd_post_tokenfamilies.c8
3 files changed, 11 insertions, 16 deletions
diff --git a/src/testing/test_merchant_api.c b/src/testing/test_merchant_api.c
index fdf5e7f4..28c32c2f 100644
--- a/src/testing/test_merchant_api.c
+++ b/src/testing/test_merchant_api.c
@@ -1698,6 +1698,7 @@ run (void *cls,
GNUNET_TIME_absolute_add (
GNUNET_TIME_timestamp_get ().abs_time, GNUNET_TIME_UNIT_YEARS)),
GNUNET_TIME_UNIT_MONTHS,
+ GNUNET_TIME_UNIT_MONTHS,
"subscription"),
TALER_TESTING_cmd_merchant_post_orders_choices ("create-order-with-upcoming-output",
cred.cfg,
@@ -1720,6 +1721,7 @@ run (void *cls,
GNUNET_TIME_UNIT_ZERO_TS,
GNUNET_TIME_relative_to_timestamp (GNUNET_TIME_UNIT_YEARS),
GNUNET_TIME_UNIT_MONTHS,
+ GNUNET_TIME_UNIT_MONTHS,
"subscription"),
TALER_TESTING_cmd_merchant_post_orders_choices ("create-order-with-output",
cred.cfg,
diff --git a/src/testing/testing_api_cmd_pay_order.c b/src/testing/testing_api_cmd_pay_order.c
index dbcb5b24..97d0b66a 100644
--- a/src/testing/testing_api_cmd_pay_order.c
+++ b/src/testing/testing_api_cmd_pay_order.c
@@ -512,25 +512,11 @@ pay_cb (void *cls,
{
struct TALER_MERCHANT_PrivateTokenDetails *details =
&ps->issued_tokens[i];
+
/* The issued tokens should be in the
same order as the provided envelopes. */
- if (1 == GNUNET_CRYPTO_hash_cmp(
- &details->issue_pub.public_key->pub_key_hash,
- &pr->details.ok.tokens[i].h_issue.hash))
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected token issued. "
- "Expected token with hash %s but got token with hash %s.\n",
- GNUNET_h2s (&details->issue_pub.public_key->pub_key_hash),
- GNUNET_h2s (&pr->details.ok.tokens[i].h_issue.hash));
- GNUNET_break (0);
- TALER_TESTING_interpreter_fail (ps->is);
- return;
- }
-
ps->issued_tokens[i].blinded_sig = pr->details.ok.tokens[i].blinded_sig;
-
if (GNUNET_OK !=
TALER_token_issue_sig_unblind (&details->issue_sig,
&details->blinded_sig,
@@ -880,7 +866,6 @@ pay_run (void *cls,
ps->num_issued_tokens);
for (unsigned int i = 0; i<len_output_tokens; i++)
{
- output_tokens[i].h_issue.hash = ps->issued_tokens[i].issue_pub.public_key->pub_key_hash;
output_tokens[i].envelope.blinded_pub = ps->issued_tokens[i].envelope.blinded_pub;
}
diff --git a/src/testing/testing_api_cmd_post_tokenfamilies.c b/src/testing/testing_api_cmd_post_tokenfamilies.c
index aafff9ef..c24b98db 100644
--- a/src/testing/testing_api_cmd_post_tokenfamilies.c
+++ b/src/testing/testing_api_cmd_post_tokenfamilies.c
@@ -92,6 +92,11 @@ struct PostTokenFamiliesState
struct GNUNET_TIME_Relative duration;
/**
+ * Rounding duation of token family.
+ */
+ struct GNUNET_TIME_Relative rounding;
+
+ /**
* Kind of the token family. "subscription" or "discount".
*/
const char *kind;
@@ -166,6 +171,7 @@ post_tokenfamilies_run (void *cls,
state->valid_after,
state->valid_before,
state->duration,
+ state->rounding,
state->kind,
&post_tokenfamilies_cb,
state);
@@ -241,6 +247,7 @@ TALER_TESTING_cmd_merchant_post_tokenfamilies (
struct GNUNET_TIME_Timestamp valid_after,
struct GNUNET_TIME_Timestamp valid_before,
struct GNUNET_TIME_Relative duration,
+ struct GNUNET_TIME_Relative rounding,
const char *kind) /* "subscription" or "discount" */
{
struct PostTokenFamiliesState *state;
@@ -257,6 +264,7 @@ TALER_TESTING_cmd_merchant_post_tokenfamilies (
state->valid_after = valid_after;
state->valid_before = valid_before;
state->duration = duration;
+ state->rounding = rounding;
state->kind = kind;
{
struct TALER_TESTING_Command cmd = {