commit 7bc5f4e7fb42af73b9514f0655d9cc45f20e79fe
parent bbba167f12a002e30f603235946e031f225f85c9
Author: Özgür Kesim <oec@codeblau.de>
Date: Mon, 14 Sep 2026 21:14:01 +0200
testing: re-enable the recoup integration tests
The melt response now reports the refresh commitment, which the melt
command stores for the recoup-refresh command. The recoup commands
pass the age commitment hash only for denominations with age
restriction. The recoup batches of test_exchange_api and
test_auditor_api run again, and test_exchange_api_revocation is built
and run in the CS and RSA variants (using the current melt-reveal
command), removing the last FIXME_9828 markers from the tests.
Diffstat:
9 files changed, 83 insertions(+), 58 deletions(-)
diff --git a/src/include/taler/exchange/post-melt.h b/src/include/taler/exchange/post-melt.h
@@ -103,6 +103,12 @@ struct TALER_EXCHANGE_PostMeltResponse
* Gamma value chosen by the exchange.
*/
uint32_t noreveal_index;
+
+ /**
+ * Commitment of the refresh operation, needed for
+ * /reveal-melt and /recoup-refresh.
+ */
+ struct TALER_RefreshCommitmentP rc;
} ok;
} details;
diff --git a/src/lib/exchange_api_post-melt.c b/src/lib/exchange_api_post-melt.c
@@ -241,6 +241,7 @@ handle_melt_finished (void *cls,
break;
}
mr.details.ok.noreveal_index = mh->noreveal_index;
+ mr.details.ok.rc = mh->md.rc;
mr.details.ok.num_melt_blinding_values = mh->rd->num_fresh_denom_pubs;
mr.details.ok.melt_blinding_values = mh->melt_blinding_values;
mr.details.ok.blinding_seed = mh->no_blinding_seed
diff --git a/src/testing/meson.build b/src/testing/meson.build
@@ -212,9 +212,6 @@ endif
# test_bank_api_with_fakebank_twisted
#endif
#
-## FIXME_9828
-## test_exchange_api_revocation_cs
-## test_exchange_api_revocation_rsa
#
test_auditor_api_cs = executable(
@@ -569,37 +566,61 @@ test(
-## FIXME_9828
-## test_exchange_api_revocation_cs_SOURCES = \
-## test_exchange_api_revocation.c
-## test_exchange_api_revocation_cs_LDADD = \
-## libtalertesting.la \
-## $(top_builddir)/src/lib/libtalerexchange.la \
-## $(LIBGCRYPT_LIBS) \
-## $(top_builddir)/src/bank-lib/libtalerfakebank.la \
-## $(top_builddir)/src/bank-lib/libtalerbank.la \
-## $(top_builddir)/src/json/libtalerjson.la \
-## $(top_builddir)/src/util/libtalerutil.la \
-## -lgnunetcurl \
-## -lgnunetutil \
-## -ljansson \
-## $(XLIB)
-#
-## FIXME_9828
-## test_exchange_api_revocation_rsa_SOURCES = \
-## test_exchange_api_revocation.c
-## test_exchange_api_revocation_rsa_LDADD = \
-## libtalertesting.la \
-## $(top_builddir)/src/lib/libtalerexchange.la \
-## $(LIBGCRYPT_LIBS) \
-## $(top_builddir)/src/bank-lib/libtalerfakebank.la \
-## $(top_builddir)/src/bank-lib/libtalerbank.la \
-## $(top_builddir)/src/json/libtalerjson.la \
-## $(top_builddir)/src/util/libtalerutil.la \
-## -lgnunetcurl \
-## -lgnunetutil \
-## -ljansson \
-## $(XLIB)
+test_exchange_api_revocation_cs = executable(
+ 'test_exchange_api_revocation_cs',
+ ['test_exchange_api_revocation.c'],
+ dependencies: [
+ libtalertesting_dep,
+ libtalerexchange_dep,
+ libtalerbank_dep,
+ libtalerfakebank_dep,
+ libtalerjson_dep,
+ libtalerutil_dep,
+ json_dep,
+ gcrypt_dep,
+ gnunetutil_dep,
+ gnunetcurl_dep,
+ ],
+ include_directories: [incdir, configuration_inc],
+ build_by_default: false,
+ install: false,
+)
+test(
+ 'test_exchange_api_revocation_cs',
+ test_exchange_api_revocation_cs,
+ workdir: meson.current_build_dir(),
+ suite: ['testing', 'integrationtests'],
+ is_parallel: false,
+)
+
+
+test_exchange_api_revocation_rsa = executable(
+ 'test_exchange_api_revocation_rsa',
+ ['test_exchange_api_revocation.c'],
+ dependencies: [
+ libtalertesting_dep,
+ libtalerexchange_dep,
+ libtalerbank_dep,
+ libtalerfakebank_dep,
+ libtalerjson_dep,
+ libtalerutil_dep,
+ json_dep,
+ gcrypt_dep,
+ gnunetutil_dep,
+ gnunetcurl_dep,
+ ],
+ include_directories: [incdir, configuration_inc],
+ build_by_default: false,
+ install: false,
+)
+test(
+ 'test_exchange_api_revocation_rsa',
+ test_exchange_api_revocation_rsa,
+ workdir: meson.current_build_dir(),
+ suite: ['testing', 'integrationtests'],
+ is_parallel: false,
+)
+
test_exchange_api_overlapping_keys_bug_rsa = executable(
'test_exchange_api_overlapping_keys_bug_rsa',
diff --git a/src/testing/test_auditor_api.c b/src/testing/test_auditor_api.c
@@ -382,7 +382,6 @@ run (void *cls,
TALER_TESTING_cmd_end ()
};
-#if FIXME_9828
struct TALER_TESTING_Command recoup[] = {
/**
* Fill reserve with EUR:5.01, as withdraw fee is 1 ct per
@@ -476,7 +475,6 @@ run (void *cls,
"EUR:0.5"),
TALER_TESTING_cmd_end ()
};
-#endif
struct TALER_TESTING_Command massive_deposit_confirms[] = {
@@ -676,10 +674,8 @@ run (void *cls,
unaggregation),
TALER_TESTING_cmd_batch ("refund",
refund),
-#if FIXME_9828
TALER_TESTING_cmd_batch ("recoup",
recoup),
-#endif
// CMD_RUN_AUDITOR ("normal-auditor"),
TALER_TESTING_cmd_end ()
};
diff --git a/src/testing/test_exchange_api.c b/src/testing/test_exchange_api.c
@@ -908,7 +908,6 @@ run (void *cls,
TALER_TESTING_cmd_end ()
};
-#if FIXME_9828
struct TALER_TESTING_Command recoup[] = {
/**
* Fill reserve with EUR:5.01, as withdraw fee is 1 ct per
@@ -1213,7 +1212,6 @@ run (void *cls,
TALER_TESTING_cmd_end ()
};
-#endif
/**
* Test batch withdrawal plus spending.
@@ -1362,10 +1360,8 @@ run (void *cls,
refund),
TALER_TESTING_cmd_batch ("batch-withdraw",
batch_withdraw),
-#if FIXME_9828
TALER_TESTING_cmd_batch ("recoup",
recoup),
-#endif
TALER_TESTING_cmd_batch ("reserve-open-close",
reserve_open_close),
/* End the suite. */
diff --git a/src/testing/test_exchange_api_revocation.c b/src/testing/test_exchange_api_revocation.c
@@ -161,9 +161,9 @@ run (void *cls,
/**
* Complete (successful) melt operation, and withdraw the coins
*/
- TALER_TESTING_cmd_refresh_reveal ("refresh-reveal-1",
- "refresh-melt-1",
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_melt_reveal ("refresh-reveal-1",
+ "refresh-melt-1",
+ MHD_HTTP_OK),
/* Try to recoup before it's allowed */
TALER_TESTING_cmd_recoup_refresh ("recoup-not-allowed",
MHD_HTTP_GONE,
@@ -234,9 +234,9 @@ run (void *cls,
/**
* Complete (successful) melt operation, and withdraw the coins
*/
- TALER_TESTING_cmd_refresh_reveal ("refresh-reveal-2",
- "refresh-melt-2",
- MHD_HTTP_OK),
+ TALER_TESTING_cmd_melt_reveal ("refresh-reveal-2",
+ "refresh-melt-2",
+ MHD_HTTP_OK),
/* Revokes refreshed EUR:0.1 coin */
TALER_TESTING_cmd_revoke ("revoke-3-EUR:0.1",
MHD_HTTP_OK,
diff --git a/src/testing/testing_api_cmd_recoup.c b/src/testing/testing_api_cmd_recoup.c
@@ -278,11 +278,13 @@ recoup_run (void *cls,
TALER_TESTING_interpreter_fail (is);
return;
}
- if (GNUNET_OK ==
- TALER_TESTING_get_trait_h_age_commitment (coin_cmd,
- (unsigned int) i,
- &hac))
- c->h_age_commitment = hac; /* may be NULL */
+ /* only denominations with age restriction have a commitment */
+ if ( (0 != c->pk->key.age_mask.bits) &&
+ (GNUNET_OK ==
+ TALER_TESTING_get_trait_h_age_commitment (coin_cmd,
+ (unsigned int) i,
+ &hac)) )
+ c->h_age_commitment = hac; /* may still be NULL */
c->ps = &secrets[i];
if (GNUNET_CRYPTO_BSA_CS == c->pk->key.bsign_pub_key->cipher)
have_cs = true;
diff --git a/src/testing/testing_api_cmd_recoup_refresh.c b/src/testing/testing_api_cmd_recoup_refresh.c
@@ -279,11 +279,13 @@ recoup_refresh_run (void *cls,
TALER_TESTING_interpreter_fail (is);
return;
}
- if (GNUNET_OK ==
- TALER_TESTING_get_trait_h_age_commitment (reveal_cmd,
- (unsigned int) i,
- &hac))
- c->h_age_commitment = hac; /* may be NULL */
+ /* only denominations with age restriction have a commitment */
+ if ( (0 != c->pk->key.age_mask.bits) &&
+ (GNUNET_OK ==
+ TALER_TESTING_get_trait_h_age_commitment (reveal_cmd,
+ (unsigned int) i,
+ &hac)) )
+ c->h_age_commitment = hac; /* may still be NULL */
for (size_t j = 0; j < rrs->num_indices; j++)
if (rrs->indices[j] == i)
recoup = true;
diff --git a/src/testing/testing_api_cmd_refresh.c b/src/testing/testing_api_cmd_refresh.c
@@ -708,6 +708,7 @@ melt_cb (struct MeltState *ms,
if (MHD_HTTP_OK == hr->http_status)
{
ms->noreveal_index = mr->details.ok.noreveal_index;
+ ms->rc = mr->details.ok.rc;
if (mr->details.ok.num_melt_blinding_values != ms->num_fresh_coins)
{
GNUNET_break (0);