commit 47e6bb4c5f59e53616e6ce4668e0707c5d9ed5e5
parent 0dc132ded682646339917a6a39455cbdf7e9630c
Author: bohdan-potuzhnyi <bohdan.potuzhnyi@gmail.com>
Date: Fri, 11 Jul 2025 18:57:52 +0200
donau denom too early...
Diffstat:
3 files changed, 40 insertions(+), 9 deletions(-)
diff --git a/src/testing/test_merchant_api.c b/src/testing/test_merchant_api.c
@@ -1902,8 +1902,8 @@ run (void *cls,
0,
"post-charity",
2025,
- "123456789",
- "random_salt"
+ "7560001010000",
+ "1234"
),
TALER_TESTING_cmd_merchant_delete_donau_instance (
"delete-donau-instance",
diff --git a/src/testing/testing_api_cmd_pay_order.c b/src/testing/testing_api_cmd_pay_order.c
@@ -91,7 +91,7 @@ struct MerchantDonauPayData
/**
* Charity private key
*/
- struct DONAU_CharityPrivateKeyP charity_priv;
+ //struct DONAU_CharityPrivateKeyP charity_priv;
/**
* Number of BUDIs to create or fetch. Example only.
@@ -155,22 +155,25 @@ prepare_donau_data (struct TALER_TESTING_Interpreter *is,
{
const struct TALER_TESTING_Command *charity_post_cmd;
const unsigned long long *charity_id;
- const struct DONAU_CharityPrivateKeyP *charity_priv;
+ //const struct DONAU_CharityPrivateKeyP *charity_priv;
charity_post_cmd = TALER_TESTING_interpreter_lookup_command (is,
ss->
charity_reference);
if (GNUNET_OK !=
- TALER_TESTING_get_trait_charity_id (charity_post_cmd, &charity_id) ||
- GNUNET_OK != TALER_TESTING_get_trait_charity_priv (charity_post_cmd,
- &charity_priv))
+ TALER_TESTING_get_trait_charity_id (charity_post_cmd, &charity_id)
+ // Well as the charity_priv, doesn't seem to be used anywhere, I think we can skip it...
+ //||
+ //GNUNET_OK != TALER_TESTING_get_trait_charity_priv (charity_post_cmd,
+ // &charity_priv)
+ )
{
GNUNET_break (0);
return GNUNET_SYSERR;
}
ss->charity_id = (uint64_t) *(charity_id);
- ss->charity_priv = *(charity_priv);
+ //ss->charity_priv = *(charity_priv);
}
/* Get donau keys from trait */
diff --git a/src/testing/testing_api_cmd_post_donau_charity_merchant.c b/src/testing/testing_api_cmd_post_donau_charity_merchant.c
@@ -74,6 +74,33 @@ struct StatusState
const char *merchant_reference;
};
+/**
+ * Offer internal data from a CMD, to other commands.
+ *
+ * @param cls closure.
+ * @param[out] ret result.
+ * @param trait name of the trait.
+ * @param index index number of the object to offer.
+ * @return #GNUNET_OK on success.
+ */
+static enum GNUNET_GenericReturnValue
+charity_post_traits (void *cls,
+ const void **ret,
+ const char *trait,
+ unsigned int index)
+{
+ struct StatusState *ss = cls;
+ struct TALER_TESTING_Trait traits[] = {
+ TALER_TESTING_make_trait_charity_pub (&ss->charity_req.charity_pub),
+ TALER_TESTING_make_trait_charity_id (&ss->charity_id),
+ TALER_TESTING_trait_end ()
+ };
+
+ return TALER_TESTING_get_trait (traits,
+ ret,
+ trait,
+ index);
+}
/**
* Check that the reserve balance and HTTP response code are
@@ -221,7 +248,8 @@ TALER_TESTING_cmd_charity_post_merchant (const char *label,
.cls = ss,
.label = label,
.run = &charity_status_run,
- .cleanup = &cleanup
+ .cleanup = &cleanup,
+ .traits = &charity_post_traits
};
return cmd;