aboutsummaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/test_exchange_p2p.c4
-rw-r--r--src/testing/testing_api_cmd_common.c7
-rw-r--r--src/testing/testing_api_cmd_purse_deposit.c13
-rw-r--r--src/testing/testing_api_cmd_reserve_purse.c8
4 files changed, 25 insertions, 7 deletions
diff --git a/src/testing/test_exchange_p2p.c b/src/testing/test_exchange_p2p.c
index aad0465b7..2f82d1243 100644
--- a/src/testing/test_exchange_p2p.c
+++ b/src/testing/test_exchange_p2p.c
@@ -251,9 +251,9 @@ run (void *cls,
"create-reserve-1",
"EUR:2",
MHD_HTTP_OK),
-#if FIXME
+#if 1
/* POST history doesn't yet support P2P transfers */
- TALER_TESTING_cmd_reserves_status (
+ TALER_TESTING_cmd_reserve_status (
"push-check-post-merge-reserve-balance-post",
"create-reserve-1",
"EUR:2",
diff --git a/src/testing/testing_api_cmd_common.c b/src/testing/testing_api_cmd_common.c
index 1e2439377..138e5502a 100644
--- a/src/testing/testing_api_cmd_common.c
+++ b/src/testing/testing_api_cmd_common.c
@@ -26,10 +26,9 @@
int
-TALER_TESTING_history_entry_cmp (const struct
- TALER_EXCHANGE_ReserveHistoryEntry *h1,
- const struct
- TALER_EXCHANGE_ReserveHistoryEntry *h2)
+TALER_TESTING_history_entry_cmp (
+ const struct TALER_EXCHANGE_ReserveHistoryEntry *h1,
+ const struct TALER_EXCHANGE_ReserveHistoryEntry *h2)
{
if (h1->type != h2->type)
return 1;
diff --git a/src/testing/testing_api_cmd_purse_deposit.c b/src/testing/testing_api_cmd_purse_deposit.c
index 86ed1b185..1c6dcdd9b 100644
--- a/src/testing/testing_api_cmd_purse_deposit.c
+++ b/src/testing/testing_api_cmd_purse_deposit.c
@@ -159,6 +159,7 @@ deposit_cb (void *cls,
const struct TALER_ReserveSignatureP *reserve_sig;
const struct TALER_ReservePublicKeyP *reserve_pub;
const struct GNUNET_TIME_Timestamp *merge_timestamp;
+ const struct TALER_PurseMergePublicKeyP *merge_pub;
purse_cmd = TALER_TESTING_interpreter_lookup_command (ds->is,
ds->purse_ref);
@@ -179,6 +180,14 @@ deposit_cb (void *cls,
TALER_TESTING_interpreter_fail (ds->is);
return;
}
+ if (GNUNET_OK !=
+ TALER_TESTING_get_trait_merge_pub (purse_cmd,
+ &merge_pub))
+ {
+ GNUNET_break (0);
+ TALER_TESTING_interpreter_fail (ds->is);
+ return;
+ }
ds->reserve_pub = *reserve_pub;
if (GNUNET_OK !=
TALER_TESTING_get_trait_timestamp (purse_cmd,
@@ -213,7 +222,9 @@ deposit_cb (void *cls,
ds->reserve_history.details.merge_details.h_contract_terms
= dr->details.success.h_contract_terms;
ds->reserve_history.details.merge_details.merge_pub
- = dr->details.success.merge_pub;
+ = *merge_pub;
+ ds->reserve_history.details.merge_details.purse_pub
+ = ds->purse_pub;
ds->reserve_history.details.merge_details.reserve_sig
= *reserve_sig;
ds->reserve_history.details.merge_details.merge_timestamp
diff --git a/src/testing/testing_api_cmd_reserve_purse.c b/src/testing/testing_api_cmd_reserve_purse.c
index ffdd00053..42aff80e3 100644
--- a/src/testing/testing_api_cmd_reserve_purse.c
+++ b/src/testing/testing_api_cmd_reserve_purse.c
@@ -73,6 +73,11 @@ struct ReservePurseState
struct TALER_PurseMergePrivateKeyP merge_priv;
/**
+ * Public key of the merge capability.
+ */
+ struct TALER_PurseMergePublicKeyP merge_pub;
+
+ /**
* Private key to decrypt the contract.
*/
struct TALER_ContractDiffiePrivateP contract_priv;
@@ -184,6 +189,8 @@ purse_run (void *cls,
GNUNET_CRYPTO_eddsa_key_get_public (&ds->reserve_priv.eddsa_priv,
&ds->reserve_pub.eddsa_pub);
GNUNET_CRYPTO_eddsa_key_create (&ds->merge_priv.eddsa_priv);
+ GNUNET_CRYPTO_eddsa_key_get_public (&ds->merge_priv.eddsa_priv,
+ &ds->merge_pub.eddsa_pub);
GNUNET_CRYPTO_ecdhe_key_create (&ds->contract_priv.ecdhe_priv);
ds->purse_expiration = GNUNET_TIME_absolute_to_timestamp (
GNUNET_TIME_relative_to_absolute (ds->expiration_rel));
@@ -266,6 +273,7 @@ purse_traits (void *cls,
TALER_TESTING_make_trait_purse_priv (&ds->purse_priv),
TALER_TESTING_make_trait_purse_pub (&ds->purse_pub),
TALER_TESTING_make_trait_merge_priv (&ds->merge_priv),
+ TALER_TESTING_make_trait_merge_pub (&ds->merge_pub),
TALER_TESTING_make_trait_contract_priv (&ds->contract_priv),
TALER_TESTING_make_trait_reserve_priv (&ds->reserve_priv),
TALER_TESTING_make_trait_reserve_pub (&ds->reserve_pub),