commit d3038348a79d2598b0318851e8dde91a083a8c9b parent 1c009f9ef39d9e3f0aed9510e8134c6e446d36a4 Author: Florian Dold <florian@dold.me> Date: Thu, 12 Mar 2026 12:10:14 +0100 harness: fix test regressions due to checkKycStatus et al. Diffstat:
4 files changed, 17 insertions(+), 20 deletions(-)
diff --git a/packages/taler-harness/src/harness/harness.ts b/packages/taler-harness/src/harness/harness.ts @@ -1780,7 +1780,7 @@ export class ExchangeService implements ExchangeServiceInterface { .getPath("taler-exchange-secmod-eddsa", "KEY_DIR") .required(); // Be *VERY* careful when changing this, or you will accidentally delete user data. - await sh(this.globalState, "rm-secmod-keys", `rm -rf ${rsaKeydir}/coin_*`); + await sh(this.globalState, "rm-secmod-keys", `rm -rf ${rsaKeydir}/COIN_*`); await sh(this.globalState, "rm-secmod-keys", `rm ${eddsaKeydir}/*`); } @@ -1796,9 +1796,6 @@ export class ExchangeService implements ExchangeServiceInterface { const rsaKeydir = cfg .getPath("taler-exchange-secmod-rsa", "KEY_DIR") .required(); - const eddsaKeydir = cfg - .getPath("taler-exchange-secmod-eddsa", "KEY_DIR") - .required(); // Be *VERY* careful when changing this, or you will accidentally delete user data. await sh(this.globalState, "rm-secmod-keys", `rm -rf ${rsaKeydir}/COIN_*`); } diff --git a/packages/taler-harness/src/integrationtests/test-exchange-deposit.ts b/packages/taler-harness/src/integrationtests/test-exchange-deposit.ts @@ -43,9 +43,6 @@ import { GlobalTestState } from "../harness/harness.js"; const logger = new Logger("test-exchange-deposit.ts"); -/** - * Run test for basic, bank-integrated withdrawal and payment. - */ export async function runExchangeDepositTest(t: GlobalTestState) { // Set up test environment @@ -60,7 +57,6 @@ export async function runExchangeDepositTest(t: GlobalTestState) { const cryptoApi = cryptiDisp.cryptoApi; const merchantPair = await cryptoApi.createEddsaKeypair({}); - const merchantPub = merchantPair.pub; const merchantPriv = merchantPair.priv; try { diff --git a/packages/taler-harness/src/integrationtests/test-merchant-self-provision-inactive-account-permissions.ts b/packages/taler-harness/src/integrationtests/test-merchant-self-provision-inactive-account-permissions.ts @@ -157,24 +157,22 @@ export async function runMerchantSelfProvisionInactiveAccountPermissionsTest( email: "just_wrong_email", }; - // const bad = failOrThrow( - await merchantClient.createInstanceSelfProvision(wrongInfo, { - challengeIds: emailChange.challenges.map((c) => c.challenge_id), + await t.assertThrowsTalerErrorAsync(async () => { + await merchantClient.createInstanceSelfProvision(wrongInfo, { + challengeIds: emailChange.challenges.map((c) => c.challenge_id), + }); }); - // , - // HttpStatusCode.Conflict, - // ); - - // console.log("ERRORORORORORO", bad) - const completeSignup = succeedOrThrow( + succeedOrThrow( await merchantClient.createInstanceSelfProvision(instanceInfo, { challengeIds: emailChange.challenges.map((c) => c.challenge_id), }), ); - await merchantClient.createInstanceSelfProvision(wrongInfo, { - challengeIds: emailChange.challenges.map((c) => c.challenge_id), + await t.assertThrowsTalerErrorAsync(async () => { + await merchantClient.createInstanceSelfProvision(wrongInfo, { + challengeIds: emailChange.challenges.map((c) => c.challenge_id), + }); }); const loginChallenge = alternativeOrThrow( diff --git a/packages/taler-util/src/http-client/exchange-client.ts b/packages/taler-util/src/http-client/exchange-client.ts @@ -591,6 +591,7 @@ export class TalerExchangeHttpClient { awaitAuth?: boolean; }): Promise< | OperationOk<AccountKycStatus> + | OperationAlternative<HttpStatusCode.Accepted, AccountKycStatus> | OperationAlternative<HttpStatusCode.NoContent, void> | OperationFail< | HttpStatusCode.Forbidden @@ -617,8 +618,13 @@ export class TalerExchangeHttpClient { switch (resp.status) { case HttpStatusCode.Ok: // means there are voluntary checks - case HttpStatusCode.Accepted: // means there are required checks return opSuccessFromHttp(resp, codecForAccountKycStatus()); + case HttpStatusCode.Accepted: // means there are required checks + return opKnownAlternativeHttpFailure( + resp, + resp.status, + codecForAccountKycStatus(), + ); case HttpStatusCode.NoContent: // no checks can be done return opKnownFailureWithBody(resp.status, undefined); case HttpStatusCode.Forbidden: