gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated (05101d0ef -> 04163a5de)


From: gnunet
Subject: [taler-wallet-core] branch master updated (05101d0ef -> 04163a5de)
Date: Wed, 08 Jan 2025 17:41:29 +0100

This is an automated email from the git hooks/post-receive script.

dold pushed a change to branch master
in repository wallet-core.

    from 05101d0ef harness: external confirmation for coin acceptor scenario
     new d0f18f74c harness: adjust tests to new kyc config constraints
     new 04163a5de harness: adjust tests to new kyc config constraints 
(continued)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 packages/taler-harness/src/harness/environments.ts |  27 +++
 .../src/integrationtests/test-kyc-amp-failure.ts   |  19 +-
 .../src/integrationtests/test-kyc-amp-timeout.ts   |  21 +-
 .../test-kyc-balance-withdrawal.ts                 |  12 +-
 .../src/integrationtests/test-kyc-decisions.ts     |   3 +-
 .../test-kyc-deposit-aggregate-implicit-auth.ts    |  12 +-
 .../integrationtests/test-kyc-deposit-aggregate.ts |  12 +-
 .../test-kyc-deposit-deposit-kyctransfer.ts        | 203 ++--------------
 .../integrationtests/test-kyc-deposit-deposit.ts   |  12 +-
 .../integrationtests/test-kyc-exchange-wallet.ts   | 188 +++------------
 .../integrationtests/test-kyc-form-withdrawal.ts   | 241 +++++--------------
 .../test-kyc-merchant-activate-bank-account.ts     |   1 +
 .../test-kyc-merchant-aggregate.ts                 |  12 +-
 .../integrationtests/test-kyc-merchant-deposit.ts  |   7 +-
 .../src/integrationtests/test-kyc-new-measure.ts   | 265 +++++----------------
 .../src/integrationtests/test-kyc-peer-pull.ts     | 207 ++--------------
 .../src/integrationtests/test-kyc-peer-push.ts     | 207 ++--------------
 .../integrationtests/test-kyc-skip-expiration.ts   |  13 +-
 .../test-kyc-withdrawal-verboten.ts                |  11 +-
 .../taler-harness/src/integrationtests/test-kyc.ts |  17 +-
 20 files changed, 295 insertions(+), 1195 deletions(-)

diff --git a/packages/taler-harness/src/harness/environments.ts 
b/packages/taler-harness/src/harness/environments.ts
index 155dae463..3ab521653 100644
--- a/packages/taler-harness/src/harness/environments.ts
+++ b/packages/taler-harness/src/harness/environments.ts
@@ -1337,3 +1337,30 @@ export async function registerHarnessBankTestUser(
     token: tokRes.body.access_token,
   };
 }
+
+/**
+ * Add common AML configuration.
+ *
+ * In particular, the measure and program FREEZE and the program NONE is 
defined.
+ */
+export function configureCommonKyc(config: Configuration): void {
+  config.setString("exchange", "enable_kyc", "yes");
+
+  config.setString("KYC-MEASURE-FREEZE", "check_name", "SKIP");
+  config.setString("KYC-MEASURE-FREEZE", "context", "{}");
+  config.setString("KYC-MEASURE-FREEZE", "program", "FREEZE");
+  config.setString(
+    "AML-PROGRAM-FREEZE",
+    "command",
+    "taler-exchange-helper-measure-freeze",
+  );
+  config.setString("AML-PROGRAM-FREEZE", "enabled", "true");
+  config.setString("AML-PROGRAM-FREEZE", "description", "Freeze account");
+  config.setString("AML-PROGRAM-FREEZE", "description_i18n", "{}");
+  config.setString("AML-PROGRAM-FREEZE", "fallback", "FREEZE");
+
+  config.setString("AML-PROGRAM-NONE", "command", "/bin/true");
+  config.setString("AML-PROGRAM-NONE", "enabled", "true");
+  config.setString("AML-PROGRAM-NONE", "description", "this does nothing");
+  config.setString("AML-PROGRAM-NONE", "fallback", "FREEZE");
+}
diff --git 
a/packages/taler-harness/src/integrationtests/test-kyc-amp-failure.ts 
b/packages/taler-harness/src/integrationtests/test-kyc-amp-failure.ts
index 16fa51262..ecbaf5450 100644
--- a/packages/taler-harness/src/integrationtests/test-kyc-amp-failure.ts
+++ b/packages/taler-harness/src/integrationtests/test-kyc-amp-failure.ts
@@ -26,6 +26,7 @@ import {
 } from "@gnu-taler/taler-util";
 import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
 import {
+  configureCommonKyc,
   createKycTestkudosEnvironment,
   postAmlDecisionNoRules,
   withdrawViaBankV3,
@@ -33,7 +34,7 @@ import {
 import { GlobalTestState } from "../harness/harness.js";
 
 function adjustExchangeConfig(config: Configuration) {
-  config.setString("exchange", "enable_kyc", "yes");
+  configureCommonKyc(config);
 
   config.setString("exchangedb", "MAX_AML_PROGRAM_RUNTIME", "3s");
 
@@ -49,30 +50,16 @@ function adjustExchangeConfig(config: Configuration) {
   config.setString("KYC-MEASURE-M1", "context", "{}");
   config.setString("KYC-MEASURE-M1", "program", "P1");
 
-  config.setString("KYC-MEASURE-M2", "program", "freeze");
-  config.setString("KYC-MEASURE-M2", "check_name", "SKIP");
-  config.setString("KYC-MEASURE-M2", "context", "{}");
-
   config.setString("AML-PROGRAM-P1", "enabled", "true");
   config.setString("AML-PROGRAM-P1", "description", "hang");
   config.setString("AML-PROGRAM-P1", "description_i18n", "{}");
-  config.setString("AML-PROGRAM-P1", "fallback", "M2");
+  config.setString("AML-PROGRAM-P1", "fallback", "FREEZE");
   config.setString(
     "AML-PROGRAM-P1",
     "command",
     "taler-harness aml-program run-program --name fail",
   );
 
-  config.setString("AML-PROGRAM-FREEZE", "enabled", "true");
-  config.setString("AML-PROGRAM-FREEZE", "description", "freeze account");
-  config.setString("AML-PROGRAM-FREEZE", "description_i18n", "{}");
-  config.setString("AML-PROGRAM-FREEZE", "fallback", "M1");
-  config.setString(
-    "AML-PROGRAM-FREEZE",
-    "command",
-    "taler-exchange-helper-measure-freeze",
-  );
-
   config.setString;
 }
 
diff --git 
a/packages/taler-harness/src/integrationtests/test-kyc-amp-timeout.ts 
b/packages/taler-harness/src/integrationtests/test-kyc-amp-timeout.ts
index 13147082a..80ae3a2e9 100644
--- a/packages/taler-harness/src/integrationtests/test-kyc-amp-timeout.ts
+++ b/packages/taler-harness/src/integrationtests/test-kyc-amp-timeout.ts
@@ -26,6 +26,7 @@ import {
 } from "@gnu-taler/taler-util";
 import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
 import {
+  configureCommonKyc,
   createKycTestkudosEnvironment,
   postAmlDecisionNoRules,
   withdrawViaBankV3,
@@ -33,7 +34,7 @@ import {
 import { GlobalTestState } from "../harness/harness.js";
 
 function adjustExchangeConfig(config: Configuration) {
-  config.setString("exchange", "enable_kyc", "yes");
+  configureCommonKyc(config);
 
   config.setString("exchangedb", "MAX_AML_PROGRAM_RUNTIME", "3s");
 
@@ -49,31 +50,15 @@ function adjustExchangeConfig(config: Configuration) {
   config.setString("KYC-MEASURE-M1", "context", "{}");
   config.setString("KYC-MEASURE-M1", "program", "P1");
 
-  config.setString("KYC-MEASURE-M2", "program", "freeze");
-  config.setString("KYC-MEASURE-M2", "check_name", "SKIP");
-  config.setString("KYC-MEASURE-M2", "context", "{}");
-
   config.setString("AML-PROGRAM-P1", "enabled", "true");
   config.setString("AML-PROGRAM-P1", "description", "hang");
   config.setString("AML-PROGRAM-P1", "description_i18n", "{}");
-  config.setString("AML-PROGRAM-P1", "fallback", "M2");
+  config.setString("AML-PROGRAM-P1", "fallback", "FREEZE");
   config.setString(
     "AML-PROGRAM-P1",
     "command",
     "taler-harness aml-program run-program --name hang",
   );
-
-  config.setString("AML-PROGRAM-FREEZE", "enabled", "true");
-  config.setString("AML-PROGRAM-FREEZE", "description", "freeze account");
-  config.setString("AML-PROGRAM-FREEZE", "description_i18n", "{}");
-  config.setString("AML-PROGRAM-FREEZE", "fallback", "M1");
-  config.setString(
-    "AML-PROGRAM-FREEZE",
-    "command",
-    "taler-exchange-helper-measure-freeze",
-  );
-
-  config.setString;
 }
 
 /**
diff --git 
a/packages/taler-harness/src/integrationtests/test-kyc-balance-withdrawal.ts 
b/packages/taler-harness/src/integrationtests/test-kyc-balance-withdrawal.ts
index 824378db6..83ae9c5ac 100644
--- a/packages/taler-harness/src/integrationtests/test-kyc-balance-withdrawal.ts
+++ b/packages/taler-harness/src/integrationtests/test-kyc-balance-withdrawal.ts
@@ -45,6 +45,7 @@ import {
   WalletService,
 } from "../harness/harness.js";
 import {
+  configureCommonKyc,
   EnvOptions,
   postAmlDecisionNoRules,
   withdrawViaBankV3,
@@ -120,7 +121,7 @@ async function createKycTestkudosEnvironment(
   exchange.addCoinConfigList(coinConfig);
 
   await exchange.modifyConfig(async (config) => {
-    config.setString("exchange", "enable_kyc", "yes");
+    configureCommonKyc(config);
 
     config.setString("KYC-RULE-R1", "operation_type", "balance");
     config.setString("KYC-RULE-R1", "enabled", "yes");
@@ -132,16 +133,11 @@ async function createKycTestkudosEnvironment(
 
     config.setString("KYC-MEASURE-M1", "check_name", "C1");
     config.setString("KYC-MEASURE-M1", "context", "{}");
-    config.setString("KYC-MEASURE-M1", "program", "P1");
-
-    config.setString("AML-PROGRAM-P1", "command", "/bin/true");
-    config.setString("AML-PROGRAM-P1", "enabled", "true");
-    config.setString("AML-PROGRAM-P1", "description", "this does nothing");
-    config.setString("AML-PROGRAM-P1", "fallback", "M1");
+    config.setString("KYC-MEASURE-M1", "program", "NONE");
 
     config.setString("KYC-CHECK-C1", "type", "INFO");
     config.setString("KYC-CHECK-C1", "description", "my check!");
-    config.setString("KYC-CHECK-C1", "fallback", "M1");
+    config.setString("KYC-CHECK-C1", "fallback", "FREEZE");
   });
 
   await exchange.start();
diff --git a/packages/taler-harness/src/integrationtests/test-kyc-decisions.ts 
b/packages/taler-harness/src/integrationtests/test-kyc-decisions.ts
index fbb8f7958..2df591cb8 100644
--- a/packages/taler-harness/src/integrationtests/test-kyc-decisions.ts
+++ b/packages/taler-harness/src/integrationtests/test-kyc-decisions.ts
@@ -37,6 +37,7 @@ import {
   WalletApiOperation,
 } from "@gnu-taler/taler-wallet-core";
 import {
+  configureCommonKyc,
   createKycTestkudosEnvironment,
   postAmlDecision,
   withdrawViaBankV3,
@@ -49,7 +50,7 @@ import {
 } from "../harness/harness.js";
 
 function adjustExchangeConfig(config: Configuration) {
-  config.setString("exchange", "enable_kyc", "yes");
+  configureCommonKyc(config);
 
   config.setString("KYC-RULE-R1", "operation_type", "withdraw");
   config.setString("KYC-RULE-R1", "enabled", "yes");
diff --git 
a/packages/taler-harness/src/integrationtests/test-kyc-deposit-aggregate-implicit-auth.ts
 
b/packages/taler-harness/src/integrationtests/test-kyc-deposit-aggregate-implicit-auth.ts
index 9024f36aa..ca589a7d7 100644
--- 
a/packages/taler-harness/src/integrationtests/test-kyc-deposit-aggregate-implicit-auth.ts
+++ 
b/packages/taler-harness/src/integrationtests/test-kyc-deposit-aggregate-implicit-auth.ts
@@ -24,6 +24,7 @@ import {
 } from "@gnu-taler/taler-util";
 import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
 import {
+  configureCommonKyc,
   createKycTestkudosEnvironment,
   postAmlDecisionNoRules,
   withdrawViaBankV3,
@@ -31,7 +32,7 @@ import {
 import { GlobalTestState } from "../harness/harness.js";
 
 function adjustExchangeConfig(config: Configuration): void {
-  config.setString("exchange", "enable_kyc", "yes");
+  configureCommonKyc(config);
 
   config.setString("KYC-RULE-R1", "operation_type", "aggregate");
   config.setString("KYC-RULE-R1", "enabled", "yes");
@@ -43,16 +44,11 @@ function adjustExchangeConfig(config: Configuration): void {
 
   config.setString("KYC-MEASURE-M1", "check_name", "C1");
   config.setString("KYC-MEASURE-M1", "context", "{}");
-  config.setString("KYC-MEASURE-M1", "program", "P1");
-
-  config.setString("AML-PROGRAM-P1", "command", "/bin/true");
-  config.setString("AML-PROGRAM-P1", "enabled", "true");
-  config.setString("AML-PROGRAM-P1", "description", "this does nothing");
-  config.setString("AML-PROGRAM-P1", "fallback", "M1");
+  config.setString("KYC-MEASURE-M1", "program", "NONE");
 
   config.setString("KYC-CHECK-C1", "type", "INFO");
   config.setString("KYC-CHECK-C1", "description", "my check!");
-  config.setString("KYC-CHECK-C1", "fallback", "M1");
+  config.setString("KYC-CHECK-C1", "fallback", "FREEZE");
 }
 
 export async function runKycDepositAggregateImplicitAuthTest(t: 
GlobalTestState) {
diff --git 
a/packages/taler-harness/src/integrationtests/test-kyc-deposit-aggregate.ts 
b/packages/taler-harness/src/integrationtests/test-kyc-deposit-aggregate.ts
index 815cd7c45..1f6ccf8b4 100644
--- a/packages/taler-harness/src/integrationtests/test-kyc-deposit-aggregate.ts
+++ b/packages/taler-harness/src/integrationtests/test-kyc-deposit-aggregate.ts
@@ -25,6 +25,7 @@ import {
 } from "@gnu-taler/taler-util";
 import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
 import {
+  configureCommonKyc,
   createKycTestkudosEnvironment,
   postAmlDecisionNoRules,
   withdrawViaBankV3,
@@ -32,7 +33,7 @@ import {
 import { GlobalTestState } from "../harness/harness.js";
 
 function adjustExchangeConfig(config: Configuration): void {
-  config.setString("exchange", "enable_kyc", "yes");
+  configureCommonKyc(config);
 
   config.setString("KYC-RULE-R1", "operation_type", "aggregate");
   config.setString("KYC-RULE-R1", "enabled", "yes");
@@ -44,16 +45,11 @@ function adjustExchangeConfig(config: Configuration): void {
 
   config.setString("KYC-MEASURE-M1", "check_name", "C1");
   config.setString("KYC-MEASURE-M1", "context", "{}");
-  config.setString("KYC-MEASURE-M1", "program", "P1");
-
-  config.setString("AML-PROGRAM-P1", "command", "/bin/true");
-  config.setString("AML-PROGRAM-P1", "enabled", "true");
-  config.setString("AML-PROGRAM-P1", "description", "this does nothing");
-  config.setString("AML-PROGRAM-P1", "fallback", "M1");
+  config.setString("KYC-MEASURE-M1", "program", "NONE");;
 
   config.setString("KYC-CHECK-C1", "type", "INFO");
   config.setString("KYC-CHECK-C1", "description", "my check!");
-  config.setString("KYC-CHECK-C1", "fallback", "M1");
+  config.setString("KYC-CHECK-C1", "fallback", "FREEZE");
 }
 
 export async function runKycDepositAggregateTest(t: GlobalTestState) {
diff --git 
a/packages/taler-harness/src/integrationtests/test-kyc-deposit-deposit-kyctransfer.ts
 
b/packages/taler-harness/src/integrationtests/test-kyc-deposit-deposit-kyctransfer.ts
index 378b235b6..c6d7f59ff 100644
--- 
a/packages/taler-harness/src/integrationtests/test-kyc-deposit-deposit-kyctransfer.ts
+++ 
b/packages/taler-harness/src/integrationtests/test-kyc-deposit-deposit-kyctransfer.ts
@@ -18,201 +18,46 @@
  * Imports.
  */
 import {
+  Configuration,
   Logger,
   parsePaytoUri,
-  TalerCorebankApiClient,
   TransactionMajorState,
   TransactionMinorState,
   TransactionType,
   WireGatewayApiClient,
 } from "@gnu-taler/taler-util";
+import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
 import {
-  createSyncCryptoApi,
-  EddsaKeyPairStrings,
-  WalletApiOperation,
-} from "@gnu-taler/taler-wallet-core";
-import { CoinConfig, defaultCoinConfig } from "../harness/denomStructures.js";
+  configureCommonKyc,
+  createKycTestkudosEnvironment,
+  postAmlDecisionNoRules,
+  withdrawViaBankV3,
+} from "../harness/environments.js";
 import {
-  BankService,
-  DbInfo,
-  ExchangeService,
   getTestHarnessPaytoForLabel,
   GlobalTestState,
-  HarnessExchangeBankAccount,
-  setupDb,
-  WalletClient,
-  WalletService,
 } from "../harness/harness.js";
-import {
-  EnvOptions,
-  postAmlDecisionNoRules,
-  withdrawViaBankV3,
-} from "../harness/environments.js";
 
 const logger = new Logger("test-kyc-deposit-deposit.ts");
 
-interface KycTestEnv {
-  commonDb: DbInfo;
-  bankClient: TalerCorebankApiClient;
-  exchange: ExchangeService;
-  exchangeBankAccount: HarnessExchangeBankAccount;
-  walletClient: WalletClient;
-  walletService: WalletService;
-  amlKeypair: EddsaKeyPairStrings;
-}
-
-async function createKycTestkudosEnvironment(
-  t: GlobalTestState,
-  coinConfig: CoinConfig[] = defaultCoinConfig.map((x) => x("TESTKUDOS")),
-  opts: EnvOptions = {},
-): Promise<KycTestEnv> {
-  const db = await setupDb(t);
-
-  const bank = await BankService.create(t, {
-    allowRegistrations: true,
-    currency: "TESTKUDOS",
-    database: db.connStr,
-    httpPort: 8082,
-  });
-
-  const exchange = ExchangeService.create(t, {
-    name: "testexchange-1",
-    currency: "TESTKUDOS",
-    httpPort: 8081,
-    database: db.connStr,
-  });
-
-  let receiverName = "Exchange";
-  let exchangeBankUsername = "exchange";
-  let exchangeBankPassword = "mypw-password";
-  let exchangePaytoUri = getTestHarnessPaytoForLabel(exchangeBankUsername);
-
-  const wireGatewayApiBaseUrl = new URL(
-    `accounts/${exchangeBankUsername}/taler-wire-gateway/`,
-    bank.corebankApiBaseUrl,
-  ).href;
-
-  await exchange.addBankAccount("1", {
-    accountName: exchangeBankUsername,
-    accountPassword: exchangeBankPassword,
-    wireGatewayApiBaseUrl,
-    accountPaytoUri: exchangePaytoUri,
-  });
-
-  bank.setSuggestedExchange(exchange, exchangePaytoUri);
-
-  await bank.start();
-
-  await bank.pingUntilAvailable();
-
-  const bankClient = new TalerCorebankApiClient(bank.corebankApiBaseUrl, {
-    auth: {
-      username: "admin",
-      password: "admin-password",
-    },
-  });
-
-  await bankClient.registerAccountExtended({
-    name: receiverName,
-    password: exchangeBankPassword,
-    username: exchangeBankUsername,
-    is_taler_exchange: true,
-    payto_uri: exchangePaytoUri,
-  });
-
-  const ageMaskSpec = opts.ageMaskSpec;
-
-  if (ageMaskSpec) {
-    exchange.enableAgeRestrictions(ageMaskSpec);
-    // Enable age restriction for all coins.
-    exchange.addCoinConfigList(
-      coinConfig.map((x) => ({
-        ...x,
-        name: `${x.name}-age`,
-        ageRestricted: true,
-      })),
-    );
-    // For mixed age restrictions, we also offer coins without age restrictions
-    if (opts.mixedAgeRestriction) {
-      exchange.addCoinConfigList(
-        coinConfig.map((x) => ({ ...x, ageRestricted: false })),
-      );
-    }
-  } else {
-    exchange.addCoinConfigList(coinConfig);
-  }
+function adjustExchangeConfig(config: Configuration) {
+  configureCommonKyc(config);
 
-  await exchange.modifyConfig(async (config) => {
-    config.setString("exchange", "enable_kyc", "yes");
-
-    config.setString("KYC-RULE-R1", "operation_type", "deposit");
-    config.setString("KYC-RULE-R1", "enabled", "yes");
-    config.setString("KYC-RULE-R1", "exposed", "yes");
-    config.setString("KYC-RULE-R1", "is_and_combinator", "yes");
-    config.setString("KYC-RULE-R1", "threshold", "TESTKUDOS:5");
-    config.setString("KYC-RULE-R1", "timeframe", "1d");
-    config.setString("KYC-RULE-R1", "next_measures", "M1");
-
-    config.setString("KYC-MEASURE-M1", "check_name", "C1");
-    config.setString("KYC-MEASURE-M1", "context", "{}");
-    config.setString("KYC-MEASURE-M1", "program", "P1");
-
-    config.setString("AML-PROGRAM-P1", "command", "/bin/true");
-    config.setString("AML-PROGRAM-P1", "enabled", "true");
-    config.setString("AML-PROGRAM-P1", "description", "this does nothing");
-    config.setString("AML-PROGRAM-P1", "fallback", "M1");
-
-    config.setString("KYC-CHECK-C1", "type", "INFO");
-    config.setString("KYC-CHECK-C1", "description", "my check!");
-    config.setString("KYC-CHECK-C1", "fallback", "M1");
-  });
-
-  await exchange.start();
-
-  const cryptoApi = createSyncCryptoApi();
-  const amlKeypair = await cryptoApi.createEddsaKeypair({});
-
-  await exchange.enableAmlAccount(amlKeypair.pub, "Alice");
-
-  const walletService = new WalletService(t, {
-    name: "wallet",
-    useInMemoryDb: true,
-  });
-  await walletService.start();
-  await walletService.pingUntilAvailable();
-
-  const walletClient = new WalletClient({
-    name: "wallet",
-    unixPath: walletService.socketPath,
-    onNotification(n) {
-      console.log("got notification", n);
-    },
-  });
-  await walletClient.connect();
-  await walletClient.client.call(WalletApiOperation.InitWallet, {
-    config: {
-      testing: {
-        skipDefaults: true,
-      },
-    },
-  });
+  config.setString("KYC-RULE-R1", "operation_type", "deposit");
+  config.setString("KYC-RULE-R1", "enabled", "yes");
+  config.setString("KYC-RULE-R1", "exposed", "yes");
+  config.setString("KYC-RULE-R1", "is_and_combinator", "yes");
+  config.setString("KYC-RULE-R1", "threshold", "TESTKUDOS:5");
+  config.setString("KYC-RULE-R1", "timeframe", "1d");
+  config.setString("KYC-RULE-R1", "next_measures", "M1");
 
-  console.log("setup done!");
+  config.setString("KYC-MEASURE-M1", "check_name", "C1");
+  config.setString("KYC-MEASURE-M1", "context", "{}");
+  config.setString("KYC-MEASURE-M1", "program", "NONE");
 
-  return {
-    commonDb: db,
-    exchange,
-    amlKeypair,
-    walletClient,
-    walletService,
-    bankClient,
-    exchangeBankAccount: {
-      accountName: exchangeBankUsername,
-      accountPassword: exchangeBankPassword,
-      accountPaytoUri: exchangePaytoUri,
-      wireGatewayApiBaseUrl,
-    },
-  };
+  config.setString("KYC-CHECK-C1", "type", "INFO");
+  config.setString("KYC-CHECK-C1", "description", "my check!");
+  config.setString("KYC-CHECK-C1", "fallback", "FREEZE");
 }
 
 export async function runKycDepositDepositKyctransferTest(t: GlobalTestState) {
@@ -224,7 +69,9 @@ export async function runKycDepositDepositKyctransferTest(t: 
GlobalTestState) {
     exchange,
     amlKeypair,
     exchangeBankAccount,
-  } = await createKycTestkudosEnvironment(t);
+  } = await createKycTestkudosEnvironment(t, {
+    adjustExchangeConfig,
+  });
 
   // Withdraw digital cash into the wallet.
 
diff --git 
a/packages/taler-harness/src/integrationtests/test-kyc-deposit-deposit.ts 
b/packages/taler-harness/src/integrationtests/test-kyc-deposit-deposit.ts
index bd3ea294c..f88ecba67 100644
--- a/packages/taler-harness/src/integrationtests/test-kyc-deposit-deposit.ts
+++ b/packages/taler-harness/src/integrationtests/test-kyc-deposit-deposit.ts
@@ -25,6 +25,7 @@ import {
 } from "@gnu-taler/taler-util";
 import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
 import {
+  configureCommonKyc,
   createKycTestkudosEnvironment,
   postAmlDecisionNoRules,
   withdrawViaBankV3,
@@ -34,7 +35,7 @@ import { GlobalTestState } from "../harness/harness.js";
 const logger = new Logger("test-kyc-deposit-deposit.ts");
 
 function adjustExchangeConfig(config: Configuration) {
-  config.setString("exchange", "enable_kyc", "yes");
+  configureCommonKyc(config);
 
   config.setString("KYC-RULE-R1", "operation_type", "deposit");
   config.setString("KYC-RULE-R1", "enabled", "yes");
@@ -46,16 +47,11 @@ function adjustExchangeConfig(config: Configuration) {
 
   config.setString("KYC-MEASURE-M1", "check_name", "C1");
   config.setString("KYC-MEASURE-M1", "context", "{}");
-  config.setString("KYC-MEASURE-M1", "program", "P1");
-
-  config.setString("AML-PROGRAM-P1", "command", "/bin/true");
-  config.setString("AML-PROGRAM-P1", "enabled", "true");
-  config.setString("AML-PROGRAM-P1", "description", "this does nothing");
-  config.setString("AML-PROGRAM-P1", "fallback", "M1");
+  config.setString("KYC-MEASURE-M1", "program", "NONE");
 
   config.setString("KYC-CHECK-C1", "type", "INFO");
   config.setString("KYC-CHECK-C1", "description", "my check!");
-  config.setString("KYC-CHECK-C1", "fallback", "M1");
+  config.setString("KYC-CHECK-C1", "fallback", "FREEZE");
 }
 
 export async function runKycDepositDepositTest(t: GlobalTestState) {
diff --git 
a/packages/taler-harness/src/integrationtests/test-kyc-exchange-wallet.ts 
b/packages/taler-harness/src/integrationtests/test-kyc-exchange-wallet.ts
index a56d82a51..113c88a28 100644
--- a/packages/taler-harness/src/integrationtests/test-kyc-exchange-wallet.ts
+++ b/packages/taler-harness/src/integrationtests/test-kyc-exchange-wallet.ts
@@ -22,174 +22,40 @@ import {
   ExchangeWalletKycStatus,
   hashFullPaytoUri,
   j2s,
-  TalerCorebankApiClient,
 } from "@gnu-taler/taler-util";
+import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
 import {
-  createSyncCryptoApi,
-  EddsaKeyPairStrings,
-  WalletApiOperation,
-} from "@gnu-taler/taler-wallet-core";
-import { CoinConfig, defaultCoinConfig } from "../harness/denomStructures.js";
-import { EnvOptions, postAmlDecisionNoRules } from 
"../harness/environments.js";
-import {
-  BankService,
-  DbInfo,
-  ExchangeService,
-  getTestHarnessPaytoForLabel,
-  GlobalTestState,
-  HarnessExchangeBankAccount,
-  setupDb,
-  WalletClient,
-  WalletService,
-} from "../harness/harness.js";
-
-interface KycTestEnv {
-  commonDb: DbInfo;
-  bankClient: TalerCorebankApiClient;
-  exchange: ExchangeService;
-  exchangeBankAccount: HarnessExchangeBankAccount;
-  walletClient: WalletClient;
-  walletService: WalletService;
-  amlKeypair: EddsaKeyPairStrings;
-}
-
-async function createKycTestkudosEnvironment(
-  t: GlobalTestState,
-  coinConfig: CoinConfig[] = defaultCoinConfig.map((x) => x("TESTKUDOS")),
-  opts: EnvOptions = {},
-): Promise<KycTestEnv> {
-  const db = await setupDb(t);
-
-  const bank = await BankService.create(t, {
-    allowRegistrations: true,
-    currency: "TESTKUDOS",
-    database: db.connStr,
-    httpPort: 8082,
-  });
-
-  const exchange = ExchangeService.create(t, {
-    name: "testexchange-1",
-    currency: "TESTKUDOS",
-    httpPort: 8081,
-    database: db.connStr,
-  });
-
-  let receiverName = "Exchange";
-  let exchangeBankUsername = "exchange";
-  let exchangeBankPassword = "mypw-password";
-  let exchangePaytoUri = getTestHarnessPaytoForLabel(exchangeBankUsername);
-
-  await exchange.addBankAccount("1", {
-    accountName: exchangeBankUsername,
-    accountPassword: exchangeBankPassword,
-    wireGatewayApiBaseUrl: new URL(
-      "accounts/exchange/taler-wire-gateway/",
-      bank.baseUrl,
-    ).href,
-    accountPaytoUri: exchangePaytoUri,
-  });
-
-  bank.setSuggestedExchange(exchange, exchangePaytoUri);
-
-  await bank.start();
-
-  await bank.pingUntilAvailable();
-
-  const bankClient = new TalerCorebankApiClient(bank.corebankApiBaseUrl, {
-    auth: {
-      username: "admin",
-      password: "admin-password",
-    },
-  });
-
-  await bankClient.registerAccountExtended({
-    name: receiverName,
-    password: exchangeBankPassword,
-    username: exchangeBankUsername,
-    is_taler_exchange: true,
-    payto_uri: exchangePaytoUri,
-  });
-
-  exchange.addCoinConfigList(coinConfig);
-
-  await exchange.modifyConfig(async (config) => {
-    config.setString("exchange", "enable_kyc", "yes");
-
-    config.setString("KYC-RULE-R1", "operation_type", "balance");
-    config.setString("KYC-RULE-R1", "enabled", "yes");
-    config.setString("KYC-RULE-R1", "exposed", "yes");
-    config.setString("KYC-RULE-R1", "is_and_combinator", "yes");
-    config.setString("KYC-RULE-R1", "threshold", "TESTKUDOS:5");
-    config.setString("KYC-RULE-R1", "timeframe", "forever");
-    config.setString("KYC-RULE-R1", "next_measures", "M1");
-
-    config.setString("KYC-MEASURE-M1", "check_name", "C1");
-    config.setString("KYC-MEASURE-M1", "context", "{}");
-    config.setString("KYC-MEASURE-M1", "program", "P1");
-
-    config.setString("AML-PROGRAM-P1", "command", "/bin/true");
-    config.setString("AML-PROGRAM-P1", "enabled", "true");
-    config.setString("AML-PROGRAM-P1", "description", "this does nothing");
-    config.setString("AML-PROGRAM-P1", "fallback", "M1");
-
-    config.setString("KYC-CHECK-C1", "type", "INFO");
-    config.setString("KYC-CHECK-C1", "description", "my check!");
-    config.setString("KYC-CHECK-C1", "fallback", "M1");
-  });
-
-  await exchange.start();
-
-  const cryptoApi = createSyncCryptoApi();
-  const amlKeypair = await cryptoApi.createEddsaKeypair({});
-
-  await exchange.enableAmlAccount(amlKeypair.pub, "Alice");
-
-  const walletService = new WalletService(t, {
-    name: "wallet",
-    useInMemoryDb: true,
-  });
-  await walletService.start();
-  await walletService.pingUntilAvailable();
-
-  const walletClient = new WalletClient({
-    name: "wallet",
-    unixPath: walletService.socketPath,
-    onNotification(n) {
-      console.log("got notification", n);
-    },
-  });
-  await walletClient.connect();
-  await walletClient.client.call(WalletApiOperation.InitWallet, {
-    config: {
-      testing: {
-        skipDefaults: true,
-      },
-    },
-  });
-
-  console.log("setup done!");
-
-  return {
-    commonDb: db,
-    exchange,
-    walletClient,
-    walletService,
-    bankClient,
-    exchangeBankAccount: {
-      accountName: "",
-      accountPassword: "",
-      accountPaytoUri: "",
-      wireGatewayApiBaseUrl: "",
-    },
-    amlKeypair,
-  };
-}
+  configureCommonKyc,
+  createKycTestkudosEnvironment,
+  postAmlDecisionNoRules,
+} from "../harness/environments.js";
+import { GlobalTestState } from "../harness/harness.js";
 
 export async function runKycExchangeWalletTest(t: GlobalTestState) {
   // Set up test environment
 
   const { walletClient, exchange, amlKeypair } =
-    await createKycTestkudosEnvironment(t);
+    await createKycTestkudosEnvironment(t, {
+      adjustExchangeConfig(config) {
+        configureCommonKyc(config);
+
+        config.setString("KYC-RULE-R1", "operation_type", "balance");
+        config.setString("KYC-RULE-R1", "enabled", "yes");
+        config.setString("KYC-RULE-R1", "exposed", "yes");
+        config.setString("KYC-RULE-R1", "is_and_combinator", "yes");
+        config.setString("KYC-RULE-R1", "threshold", "TESTKUDOS:5");
+        config.setString("KYC-RULE-R1", "timeframe", "forever");
+        config.setString("KYC-RULE-R1", "next_measures", "M1");
+
+        config.setString("KYC-MEASURE-M1", "check_name", "C1");
+        config.setString("KYC-MEASURE-M1", "context", "{}");
+        config.setString("KYC-MEASURE-M1", "program", "NONE");
+
+        config.setString("KYC-CHECK-C1", "type", "INFO");
+        config.setString("KYC-CHECK-C1", "description", "my check!");
+        config.setString("KYC-CHECK-C1", "fallback", "FREEZE");
+      },
+    });
 
   await walletClient.call(WalletApiOperation.AddExchange, {
     exchangeBaseUrl: exchange.baseUrl,
diff --git 
a/packages/taler-harness/src/integrationtests/test-kyc-form-withdrawal.ts 
b/packages/taler-harness/src/integrationtests/test-kyc-form-withdrawal.ts
index 35718dc04..4e36883ae 100644
--- a/packages/taler-harness/src/integrationtests/test-kyc-form-withdrawal.ts
+++ b/packages/taler-harness/src/integrationtests/test-kyc-form-withdrawal.ts
@@ -20,210 +20,75 @@
 import {
   codecForAny,
   codecForKycProcessClientInformation,
+  Configuration,
   decodeCrock,
   encodeCrock,
   j2s,
   signAmlQuery,
-  TalerCorebankApiClient,
   TransactionIdStr,
   TransactionMajorState,
   TransactionMinorState,
 } from "@gnu-taler/taler-util";
 import { readResponseJsonOrThrow } from "@gnu-taler/taler-util/http";
+import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
 import {
-  createSyncCryptoApi,
-  EddsaKeyPairStrings,
-  WalletApiOperation,
-} from "@gnu-taler/taler-wallet-core";
-import { CoinConfig, defaultCoinConfig } from "../harness/denomStructures.js";
-import {
-  BankService,
-  DbInfo,
-  ExchangeService,
-  getTestHarnessPaytoForLabel,
-  GlobalTestState,
-  HarnessExchangeBankAccount,
-  harnessHttpLib,
-  setupDb,
-  WalletClient,
-  WalletService,
-} from "../harness/harness.js";
-import { EnvOptions, withdrawViaBankV3 } from "../harness/environments.js";
-
-interface KycTestEnv {
-  commonDb: DbInfo;
-  bankClient: TalerCorebankApiClient;
-  exchange: ExchangeService;
-  exchangeBankAccount: HarnessExchangeBankAccount;
-  walletClient: WalletClient;
-  walletService: WalletService;
-  amlKeypair: EddsaKeyPairStrings;
-}
-
-async function createKycTestkudosEnvironment(
-  t: GlobalTestState,
-  coinConfig: CoinConfig[] = defaultCoinConfig.map((x) => x("TESTKUDOS")),
-  opts: EnvOptions = {},
-): Promise<KycTestEnv> {
-  const db = await setupDb(t);
-
-  const bank = await BankService.create(t, {
-    allowRegistrations: true,
-    currency: "TESTKUDOS",
-    database: db.connStr,
-    httpPort: 8082,
-  });
-
-  const exchange = ExchangeService.create(t, {
-    name: "testexchange-1",
-    currency: "TESTKUDOS",
-    httpPort: 8081,
-    database: db.connStr,
-  });
-
-  let receiverName = "Exchange";
-  let exchangeBankUsername = "exchange";
-  let exchangeBankPassword = "mypw-password";
-  let exchangePaytoUri = getTestHarnessPaytoForLabel(exchangeBankUsername);
-
-  await exchange.addBankAccount("1", {
-    accountName: exchangeBankUsername,
-    accountPassword: exchangeBankPassword,
-    wireGatewayApiBaseUrl: new URL(
-      "accounts/exchange/taler-wire-gateway/",
-      bank.baseUrl,
-    ).href,
-    accountPaytoUri: exchangePaytoUri,
-  });
-
-  bank.setSuggestedExchange(exchange, exchangePaytoUri);
-
-  await bank.start();
-
-  await bank.pingUntilAvailable();
-
-  const bankClient = new TalerCorebankApiClient(bank.corebankApiBaseUrl, {
-    auth: {
-      username: "admin",
-      password: "admin-password",
-    },
-  });
-
-  await bankClient.registerAccountExtended({
-    name: receiverName,
-    password: exchangeBankPassword,
-    username: exchangeBankUsername,
-    is_taler_exchange: true,
-    payto_uri: exchangePaytoUri,
-  });
-
-  exchange.addCoinConfigList(coinConfig);
-
-  await exchange.modifyConfig(async (config) => {
-    config.setString("exchange", "enable_kyc", "yes");
-
-    config.setString("KYC-RULE-R1", "operation_type", "withdraw");
-    config.setString("KYC-RULE-R1", "enabled", "yes");
-    config.setString("KYC-RULE-R1", "exposed", "yes");
-    config.setString("KYC-RULE-R1", "is_and_combinator", "yes");
-    config.setString("KYC-RULE-R1", "threshold", "TESTKUDOS:5");
-    config.setString("KYC-RULE-R1", "timeframe", "1d");
-    config.setString("KYC-RULE-R1", "next_measures", "M1 M2");
-
-    config.setString("KYC-MEASURE-M1", "check_name", "C1");
-    config.setString("KYC-MEASURE-M1", "context", "{}");
-    config.setString("KYC-MEASURE-M1", "program", "P1");
-
-    config.setString("KYC-MEASURE-M2", "check_name", "C2");
-    config.setString("KYC-MEASURE-M2", "context", "{}");
-    config.setString("KYC-MEASURE-M2", "program", "P2");
-
-    config.setString(
-      "AML-PROGRAM-P1",
-      "command",
-      "taler-exchange-helper-measure-test-form",
-    );
-    config.setString("AML-PROGRAM-P1", "enabled", "true");
-    config.setString(
-      "AML-PROGRAM-P1",
-      "description",
-      "test for full_name and birthdate",
-    );
-    config.setString("AML-PROGRAM-P1", "description_i18n", "{}");
-    config.setString("AML-PROGRAM-P1", "fallback", "M1");
-
-    config.setString("AML-PROGRAM-P2", "command", "/bin/true");
-    config.setString("AML-PROGRAM-P2", "enabled", "true");
-    config.setString("AML-PROGRAM-P2", "description", "does nothing");
-    config.setString("AML-PROGRAM-P2", "description_i18n", "{}");
-    config.setString("AML-PROGRAM-P2", "fallback", "M1");
-
-    config.setString("KYC-CHECK-C1", "type", "FORM");
-    config.setString("KYC-CHECK-C1", "form_name", "myform");
-    config.setString("KYC-CHECK-C1", "description", "my check!");
-    config.setString("KYC-CHECK-C1", "description_i18n", "{}");
-    config.setString("KYC-CHECK-C1", "outputs", "full_name birthdate");
-    config.setString("KYC-CHECK-C1", "fallback", "M1");
-
-    config.setString("KYC-CHECK-C2", "type", "INFO");
-    config.setString("KYC-CHECK-C2", "description", "my check info!");
-    config.setString("KYC-CHECK-C2", "description_i18n", "{}");
-    config.setString("KYC-CHECK-C2", "fallback", "M2");
-  });
-
-  await exchange.start();
-
-  const cryptoApi = createSyncCryptoApi();
-  const amlKeypair = await cryptoApi.createEddsaKeypair({});
-
-  await exchange.enableAmlAccount(amlKeypair.pub, "Alice");
-
-  const walletService = new WalletService(t, {
-    name: "wallet",
-    useInMemoryDb: true,
-  });
-  await walletService.start();
-  await walletService.pingUntilAvailable();
-
-  const walletClient = new WalletClient({
-    name: "wallet",
-    unixPath: walletService.socketPath,
-    onNotification(n) {
-      console.log("got notification", n);
-    },
-  });
-  await walletClient.connect();
-  await walletClient.client.call(WalletApiOperation.InitWallet, {
-    config: {
-      testing: {
-        skipDefaults: true,
-      },
-    },
-  });
-
-  console.log("setup done!");
-
-  return {
-    commonDb: db,
-    exchange,
-    amlKeypair,
-    walletClient,
-    walletService,
-    bankClient,
-    exchangeBankAccount: {
-      accountName: "",
-      accountPassword: "",
-      accountPaytoUri: "",
-      wireGatewayApiBaseUrl: "",
-    },
-  };
+  configureCommonKyc,
+  createKycTestkudosEnvironment,
+  withdrawViaBankV3,
+} from "../harness/environments.js";
+import { GlobalTestState, harnessHttpLib } from "../harness/harness.js";
+
+function adjustExchangeConfig(config: Configuration) {
+  configureCommonKyc(config);
+
+  config.setString("KYC-RULE-R1", "operation_type", "withdraw");
+  config.setString("KYC-RULE-R1", "enabled", "yes");
+  config.setString("KYC-RULE-R1", "exposed", "yes");
+  config.setString("KYC-RULE-R1", "is_and_combinator", "yes");
+  config.setString("KYC-RULE-R1", "threshold", "TESTKUDOS:5");
+  config.setString("KYC-RULE-R1", "timeframe", "1d");
+  config.setString("KYC-RULE-R1", "next_measures", "M1 M2");
+
+  config.setString("KYC-MEASURE-M1", "check_name", "C1");
+  config.setString("KYC-MEASURE-M1", "context", "{}");
+  config.setString("KYC-MEASURE-M1", "program", "P1");
+
+  config.setString("KYC-MEASURE-M2", "check_name", "C2");
+  config.setString("KYC-MEASURE-M2", "context", "{}");
+  config.setString("KYC-MEASURE-M2", "program", "NONE");
+
+  config.setString(
+    "AML-PROGRAM-P1",
+    "command",
+    "taler-exchange-helper-measure-test-form",
+  );
+  config.setString("AML-PROGRAM-P1", "enabled", "true");
+  config.setString(
+    "AML-PROGRAM-P1",
+    "description",
+    "test for full_name and birthdate",
+  );
+  config.setString("AML-PROGRAM-P1", "description_i18n", "{}");
+  config.setString("AML-PROGRAM-P1", "fallback", "FREEZE");
+
+  config.setString("KYC-CHECK-C1", "type", "FORM");
+  config.setString("KYC-CHECK-C1", "form_name", "myform");
+  config.setString("KYC-CHECK-C1", "description", "my check!");
+  config.setString("KYC-CHECK-C1", "description_i18n", "{}");
+  config.setString("KYC-CHECK-C1", "outputs", "full_name birthdate");
+  config.setString("KYC-CHECK-C1", "fallback", "FREEZE");
+
+  config.setString("KYC-CHECK-C2", "type", "INFO");
+  config.setString("KYC-CHECK-C2", "description", "my check info!");
+  config.setString("KYC-CHECK-C2", "description_i18n", "{}");
+  config.setString("KYC-CHECK-C2", "fallback", "FREEZE");
 }
 
 export async function runKycFormWithdrawalTest(t: GlobalTestState) {
   // Set up test environment
 
   const { walletClient, bankClient, exchange, amlKeypair } =
-    await createKycTestkudosEnvironment(t);
+    await createKycTestkudosEnvironment(t, { adjustExchangeConfig });
 
   // Withdraw digital cash into the wallet.
 
diff --git 
a/packages/taler-harness/src/integrationtests/test-kyc-merchant-activate-bank-account.ts
 
b/packages/taler-harness/src/integrationtests/test-kyc-merchant-activate-bank-account.ts
index f13c4cfb7..bf598d6a6 100644
--- 
a/packages/taler-harness/src/integrationtests/test-kyc-merchant-activate-bank-account.ts
+++ 
b/packages/taler-harness/src/integrationtests/test-kyc-merchant-activate-bank-account.ts
@@ -20,6 +20,7 @@
 import {
   codecForAccountKycRedirects,
   codecForQueryInstancesResponse,
+  Configuration,
   j2s,
   Logger,
   MerchantAccountKycRedirectsResponse,
diff --git 
a/packages/taler-harness/src/integrationtests/test-kyc-merchant-aggregate.ts 
b/packages/taler-harness/src/integrationtests/test-kyc-merchant-aggregate.ts
index 6b6f615ce..d6f246721 100644
--- a/packages/taler-harness/src/integrationtests/test-kyc-merchant-aggregate.ts
+++ b/packages/taler-harness/src/integrationtests/test-kyc-merchant-aggregate.ts
@@ -19,6 +19,7 @@
  */
 import { Configuration, j2s } from "@gnu-taler/taler-util";
 import {
+  configureCommonKyc,
   createKycTestkudosEnvironment,
   makeTestPaymentV2,
   withdrawViaBankV3,
@@ -30,7 +31,7 @@ import {
 } from "../harness/harness.js";
 
 function adjustExchangeConfig(config: Configuration) {
-  config.setString("exchange", "enable_kyc", "yes");
+  configureCommonKyc(config);
 
   config.setString("KYC-RULE-R1", "operation_type", "aggregate");
   config.setString("KYC-RULE-R1", "enabled", "yes");
@@ -42,16 +43,11 @@ function adjustExchangeConfig(config: Configuration) {
 
   config.setString("KYC-MEASURE-M1", "check_name", "C1");
   config.setString("KYC-MEASURE-M1", "context", "{}");
-  config.setString("KYC-MEASURE-M1", "program", "P1");
-
-  config.setString("AML-PROGRAM-P1", "command", "/bin/true");
-  config.setString("AML-PROGRAM-P1", "enabled", "true");
-  config.setString("AML-PROGRAM-P1", "description", "this does nothing");
-  config.setString("AML-PROGRAM-P1", "fallback", "M1");
+  config.setString("KYC-MEASURE-M1", "program", "NONE");
 
   config.setString("KYC-CHECK-C1", "type", "INFO");
   config.setString("KYC-CHECK-C1", "description", "my check!");
-  config.setString("KYC-CHECK-C1", "fallback", "M1");
+  config.setString("KYC-CHECK-C1", "fallback", "FREEZE");
 }
 
 export async function runKycMerchantAggregateTest(t: GlobalTestState) {
diff --git 
a/packages/taler-harness/src/integrationtests/test-kyc-merchant-deposit.ts 
b/packages/taler-harness/src/integrationtests/test-kyc-merchant-deposit.ts
index 74571ba26..1bf2f13ab 100644
--- a/packages/taler-harness/src/integrationtests/test-kyc-merchant-deposit.ts
+++ b/packages/taler-harness/src/integrationtests/test-kyc-merchant-deposit.ts
@@ -35,6 +35,7 @@ import {
   readSuccessResponseJsonOrThrow,
 } from "@gnu-taler/taler-util/http";
 import {
+  configureCommonKyc,
   createKycTestkudosEnvironment,
   postAmlDecisionNoRules,
   withdrawViaBankV3,
@@ -48,7 +49,7 @@ import {
 const logger = new Logger(`test-kyc-merchant-deposit.ts`);
 
 function adjustExchangeConfig(config: Configuration) {
-  config.setString("exchange", "enable_kyc", "yes");
+  configureCommonKyc(config);
 
   config.setString("KYC-RULE-R1", "operation_type", "deposit");
   config.setString("KYC-RULE-R1", "enabled", "yes");
@@ -69,11 +70,11 @@ function adjustExchangeConfig(config: Configuration) {
   config.setString("AML-PROGRAM-P1", "command", "/bin/true");
   config.setString("AML-PROGRAM-P1", "enabled", "true");
   config.setString("AML-PROGRAM-P1", "description", "this does nothing");
-  config.setString("AML-PROGRAM-P1", "fallback", "FM");
+  config.setString("AML-PROGRAM-P1", "fallback", "FREEZE");
 
   config.setString("KYC-CHECK-C1", "type", "INFO");
   config.setString("KYC-CHECK-C1", "description", "my check!");
-  config.setString("KYC-CHECK-C1", "fallback", "FM");
+  config.setString("KYC-CHECK-C1", "fallback", "FREEZE");
 }
 
 export async function runKycMerchantDepositTest(t: GlobalTestState) {
diff --git 
a/packages/taler-harness/src/integrationtests/test-kyc-new-measure.ts 
b/packages/taler-harness/src/integrationtests/test-kyc-new-measure.ts
index cc854dc64..117245315 100644
--- a/packages/taler-harness/src/integrationtests/test-kyc-new-measure.ts
+++ b/packages/taler-harness/src/integrationtests/test-kyc-new-measure.ts
@@ -24,214 +24,20 @@ import {
   encodeCrock,
   j2s,
   signAmlQuery,
-  TalerCorebankApiClient,
   TalerProtocolTimestamp,
   TransactionIdStr,
   TransactionMajorState,
   TransactionMinorState,
 } from "@gnu-taler/taler-util";
 import { readResponseJsonOrThrow } from "@gnu-taler/taler-util/http";
+import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
 import {
-  createSyncCryptoApi,
-  EddsaKeyPairStrings,
-  WalletApiOperation,
-} from "@gnu-taler/taler-wallet-core";
-import { CoinConfig, defaultCoinConfig } from "../harness/denomStructures.js";
-import {
-  BankService,
-  DbInfo,
-  ExchangeService,
-  getTestHarnessPaytoForLabel,
-  GlobalTestState,
-  HarnessExchangeBankAccount,
-  harnessHttpLib,
-  setupDb,
-  WalletClient,
-  WalletService,
-} from "../harness/harness.js";
-import {
-  EnvOptions,
+  configureCommonKyc,
+  createKycTestkudosEnvironment,
   postAmlDecision,
   withdrawViaBankV3,
 } from "../harness/environments.js";
-
-interface KycTestEnv {
-  commonDb: DbInfo;
-  bankClient: TalerCorebankApiClient;
-  exchange: ExchangeService;
-  exchangeBankAccount: HarnessExchangeBankAccount;
-  walletClient: WalletClient;
-  walletService: WalletService;
-  amlKeypair: EddsaKeyPairStrings;
-}
-
-async function createKycTestkudosEnvironment(
-  t: GlobalTestState,
-  coinConfig: CoinConfig[] = defaultCoinConfig.map((x) => x("TESTKUDOS")),
-  opts: EnvOptions = {},
-): Promise<KycTestEnv> {
-  const db = await setupDb(t);
-
-  const bank = await BankService.create(t, {
-    allowRegistrations: true,
-    currency: "TESTKUDOS",
-    database: db.connStr,
-    httpPort: 8082,
-  });
-
-  const exchange = ExchangeService.create(t, {
-    name: "testexchange-1",
-    currency: "TESTKUDOS",
-    httpPort: 8081,
-    database: db.connStr,
-  });
-
-  let receiverName = "Exchange";
-  let exchangeBankUsername = "exchange";
-  let exchangeBankPassword = "mypw-password";
-  let exchangePaytoUri = getTestHarnessPaytoForLabel(exchangeBankUsername);
-
-  await exchange.addBankAccount("1", {
-    accountName: exchangeBankUsername,
-    accountPassword: exchangeBankPassword,
-    wireGatewayApiBaseUrl: new URL(
-      "accounts/exchange/taler-wire-gateway/",
-      bank.baseUrl,
-    ).href,
-    accountPaytoUri: exchangePaytoUri,
-  });
-
-  bank.setSuggestedExchange(exchange, exchangePaytoUri);
-
-  await bank.start();
-
-  await bank.pingUntilAvailable();
-
-  const bankClient = new TalerCorebankApiClient(bank.corebankApiBaseUrl, {
-    auth: {
-      username: "admin",
-      password: "admin-password",
-    },
-  });
-
-  await bankClient.registerAccountExtended({
-    name: receiverName,
-    password: exchangeBankPassword,
-    username: exchangeBankUsername,
-    is_taler_exchange: true,
-    payto_uri: exchangePaytoUri,
-  });
-
-  exchange.addCoinConfigList(coinConfig);
-
-  await exchange.modifyConfig(async (config) => {
-    config.setString("exchange", "enable_kyc", "yes");
-
-    config.setString("KYC-RULE-R1", "operation_type", "withdraw");
-    config.setString("KYC-RULE-R1", "enabled", "yes");
-    config.setString("KYC-RULE-R1", "exposed", "yes");
-    config.setString("KYC-RULE-R1", "is_and_combinator", "yes");
-    config.setString("KYC-RULE-R1", "threshold", "TESTKUDOS:5");
-    config.setString("KYC-RULE-R1", "timeframe", "1d");
-    config.setString("KYC-RULE-R1", "next_measures", "M1 M2");
-
-    config.setString("KYC-MEASURE-M1", "check_name", "C1");
-    config.setString("KYC-MEASURE-M1", "context", "{}");
-    config.setString("KYC-MEASURE-M1", "program", "P1");
-
-    config.setString("KYC-MEASURE-M2", "check_name", "C2");
-    config.setString("KYC-MEASURE-M2", "context", "{}");
-    config.setString("KYC-MEASURE-M2", "program", "P2");
-
-    config.setString("KYC-MEASURE-M3", "check_name", "C3");
-    config.setString("KYC-MEASURE-M3", "context", "{}");
-    config.setString("KYC-MEASURE-M3", "program", "P2");
-
-    config.setString(
-      "AML-PROGRAM-P1",
-      "command",
-      "taler-exchange-helper-measure-test-form",
-    );
-    config.setString("AML-PROGRAM-P1", "enabled", "true");
-    config.setString(
-      "AML-PROGRAM-P1",
-      "description",
-      "test for full_name and birthdate",
-    );
-    config.setString("AML-PROGRAM-P1", "description_i18n", "{}");
-    config.setString("AML-PROGRAM-P1", "fallback", "M1");
-
-    config.setString("AML-PROGRAM-P2", "command", "/bin/true");
-    config.setString("AML-PROGRAM-P2", "enabled", "true");
-    config.setString("AML-PROGRAM-P2", "description", "does nothing");
-    config.setString("AML-PROGRAM-P2", "description_i18n", "{}");
-    config.setString("AML-PROGRAM-P2", "fallback", "M1");
-
-    config.setString("KYC-CHECK-C1", "type", "FORM");
-    config.setString("KYC-CHECK-C1", "form_name", "myform");
-    config.setString("KYC-CHECK-C1", "description", "my check!");
-    config.setString("KYC-CHECK-C1", "description_i18n", "{}");
-    config.setString("KYC-CHECK-C1", "outputs", "full_name birthdate");
-    config.setString("KYC-CHECK-C1", "fallback", "M1");
-
-    config.setString("KYC-CHECK-C2", "type", "INFO");
-    config.setString("KYC-CHECK-C2", "description", "my check info!");
-    config.setString("KYC-CHECK-C2", "description_i18n", "{}");
-    config.setString("KYC-CHECK-C2", "fallback", "M2");
-
-    config.setString("KYC-CHECK-C3", "type", "INFO");
-    config.setString("KYC-CHECK-C3", "description", "this is info c3");
-    config.setString("KYC-CHECK-C3", "description_i18n", "{}");
-    config.setString("KYC-CHECK-C3", "fallback", "M2");
-  });
-
-  await exchange.start();
-
-  const cryptoApi = createSyncCryptoApi();
-  const amlKeypair = await cryptoApi.createEddsaKeypair({});
-
-  await exchange.enableAmlAccount(amlKeypair.pub, "Alice");
-
-  const walletService = new WalletService(t, {
-    name: "wallet",
-    useInMemoryDb: true,
-  });
-  await walletService.start();
-  await walletService.pingUntilAvailable();
-
-  const walletClient = new WalletClient({
-    name: "wallet",
-    unixPath: walletService.socketPath,
-    onNotification(n) {
-      console.log("got notification", n);
-    },
-  });
-  await walletClient.connect();
-  await walletClient.client.call(WalletApiOperation.InitWallet, {
-    config: {
-      testing: {
-        skipDefaults: true,
-      },
-    },
-  });
-
-  console.log("setup done!");
-
-  return {
-    commonDb: db,
-    exchange,
-    amlKeypair,
-    walletClient,
-    walletService,
-    bankClient,
-    exchangeBankAccount: {
-      accountName: "",
-      accountPassword: "",
-      accountPaytoUri: "",
-      wireGatewayApiBaseUrl: "",
-    },
-  };
-}
+import { GlobalTestState, harnessHttpLib } from "../harness/harness.js";
 
 /**
  * Test setting a `new_measure` as the AML officer.
@@ -240,7 +46,68 @@ export async function runKycNewMeasureTest(t: 
GlobalTestState) {
   // Set up test environment
 
   const { walletClient, bankClient, exchange, amlKeypair } =
-    await createKycTestkudosEnvironment(t);
+    await createKycTestkudosEnvironment(t, {
+      adjustExchangeConfig(config) {
+        configureCommonKyc(config);
+
+        config.setString("KYC-RULE-R1", "operation_type", "withdraw");
+        config.setString("KYC-RULE-R1", "enabled", "yes");
+        config.setString("KYC-RULE-R1", "exposed", "yes");
+        config.setString("KYC-RULE-R1", "is_and_combinator", "yes");
+        config.setString("KYC-RULE-R1", "threshold", "TESTKUDOS:5");
+        config.setString("KYC-RULE-R1", "timeframe", "1d");
+        config.setString("KYC-RULE-R1", "next_measures", "M1 M2");
+
+        config.setString("KYC-MEASURE-M1", "check_name", "C1");
+        config.setString("KYC-MEASURE-M1", "context", "{}");
+        config.setString("KYC-MEASURE-M1", "program", "P1");
+
+        config.setString("KYC-MEASURE-M2", "check_name", "C2");
+        config.setString("KYC-MEASURE-M2", "context", "{}");
+        config.setString("KYC-MEASURE-M2", "program", "P2");
+
+        config.setString("KYC-MEASURE-M3", "check_name", "C3");
+        config.setString("KYC-MEASURE-M3", "context", "{}");
+        config.setString("KYC-MEASURE-M3", "program", "P2");
+
+        config.setString(
+          "AML-PROGRAM-P1",
+          "command",
+          "taler-exchange-helper-measure-test-form",
+        );
+        config.setString("AML-PROGRAM-P1", "enabled", "true");
+        config.setString(
+          "AML-PROGRAM-P1",
+          "description",
+          "test for full_name and birthdate",
+        );
+        config.setString("AML-PROGRAM-P1", "description_i18n", "{}");
+        config.setString("AML-PROGRAM-P1", "fallback", "FREEZE");
+
+        config.setString("AML-PROGRAM-P2", "command", "/bin/true");
+        config.setString("AML-PROGRAM-P2", "enabled", "true");
+        config.setString("AML-PROGRAM-P2", "description", "does nothing");
+        config.setString("AML-PROGRAM-P2", "description_i18n", "{}");
+        config.setString("AML-PROGRAM-P2", "fallback", "FREEZE");
+
+        config.setString("KYC-CHECK-C1", "type", "FORM");
+        config.setString("KYC-CHECK-C1", "form_name", "myform");
+        config.setString("KYC-CHECK-C1", "description", "my check!");
+        config.setString("KYC-CHECK-C1", "description_i18n", "{}");
+        config.setString("KYC-CHECK-C1", "outputs", "full_name birthdate");
+        config.setString("KYC-CHECK-C1", "fallback", "FREEZE");
+
+        config.setString("KYC-CHECK-C2", "type", "INFO");
+        config.setString("KYC-CHECK-C2", "description", "my check info!");
+        config.setString("KYC-CHECK-C2", "description_i18n", "{}");
+        config.setString("KYC-CHECK-C2", "fallback", "FREEZE");
+
+        config.setString("KYC-CHECK-C3", "type", "INFO");
+        config.setString("KYC-CHECK-C3", "description", "this is info c3");
+        config.setString("KYC-CHECK-C3", "description_i18n", "{}");
+        config.setString("KYC-CHECK-C3", "fallback", "FREEZE");
+      },
+    });
 
   // Withdraw digital cash into the wallet.
   let kycPaytoHash: string | undefined;
diff --git a/packages/taler-harness/src/integrationtests/test-kyc-peer-pull.ts 
b/packages/taler-harness/src/integrationtests/test-kyc-peer-pull.ts
index dd92919ef..c1a61976a 100644
--- a/packages/taler-harness/src/integrationtests/test-kyc-peer-pull.ts
+++ b/packages/taler-harness/src/integrationtests/test-kyc-peer-pull.ts
@@ -22,203 +22,46 @@ import {
   AmountString,
   Duration,
   j2s,
-  TalerCorebankApiClient,
   TransactionIdStr,
   TransactionMajorState,
   TransactionMinorState,
   TransactionType,
 } from "@gnu-taler/taler-util";
+import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
 import {
-  createSyncCryptoApi,
-  EddsaKeyPairStrings,
-  WalletApiOperation,
-} from "@gnu-taler/taler-wallet-core";
-import { CoinConfig, defaultCoinConfig } from "../harness/denomStructures.js";
-import {
-  BankService,
-  DbInfo,
-  ExchangeService,
-  getTestHarnessPaytoForLabel,
-  GlobalTestState,
-  HarnessExchangeBankAccount,
-  setupDb,
-  WalletClient,
-  WalletService,
-} from "../harness/harness.js";
-import {
+  configureCommonKyc,
+  createKycTestkudosEnvironment,
   createWalletDaemonWithClient,
-  EnvOptions,
   postAmlDecisionNoRules,
   withdrawViaBankV3,
 } from "../harness/environments.js";
-
-interface KycTestEnv {
-  commonDb: DbInfo;
-  bankClient: TalerCorebankApiClient;
-  exchange: ExchangeService;
-  exchangeBankAccount: HarnessExchangeBankAccount;
-  walletClient: WalletClient;
-  walletService: WalletService;
-  amlKeypair: EddsaKeyPairStrings;
-}
-
-async function createKycTestkudosEnvironment(
-  t: GlobalTestState,
-  coinConfig: CoinConfig[] = defaultCoinConfig.map((x) => x("TESTKUDOS")),
-  opts: EnvOptions = {},
-): Promise<KycTestEnv> {
-  const db = await setupDb(t);
-
-  const bank = await BankService.create(t, {
-    allowRegistrations: true,
-    currency: "TESTKUDOS",
-    database: db.connStr,
-    httpPort: 8082,
-  });
-
-  const exchange = ExchangeService.create(t, {
-    name: "testexchange-1",
-    currency: "TESTKUDOS",
-    httpPort: 8081,
-    database: db.connStr,
-  });
-
-  let receiverName = "Exchange";
-  let exchangeBankUsername = "exchange";
-  let exchangeBankPassword = "mypw-password";
-  let exchangePaytoUri = getTestHarnessPaytoForLabel(exchangeBankUsername);
-
-  await exchange.addBankAccount("1", {
-    accountName: exchangeBankUsername,
-    accountPassword: exchangeBankPassword,
-    wireGatewayApiBaseUrl: new URL(
-      "accounts/exchange/taler-wire-gateway/",
-      bank.baseUrl,
-    ).href,
-    accountPaytoUri: exchangePaytoUri,
-  });
-
-  bank.setSuggestedExchange(exchange, exchangePaytoUri);
-
-  await bank.start();
-
-  await bank.pingUntilAvailable();
-
-  const bankClient = new TalerCorebankApiClient(bank.corebankApiBaseUrl, {
-    auth: {
-      username: "admin",
-      password: "admin-password",
-    },
-  });
-
-  await bankClient.registerAccountExtended({
-    name: receiverName,
-    password: exchangeBankPassword,
-    username: exchangeBankUsername,
-    is_taler_exchange: true,
-    payto_uri: exchangePaytoUri,
-  });
-
-  const ageMaskSpec = opts.ageMaskSpec;
-
-  if (ageMaskSpec) {
-    exchange.enableAgeRestrictions(ageMaskSpec);
-    // Enable age restriction for all coins.
-    exchange.addCoinConfigList(
-      coinConfig.map((x) => ({
-        ...x,
-        name: `${x.name}-age`,
-        ageRestricted: true,
-      })),
-    );
-    // For mixed age restrictions, we also offer coins without age restrictions
-    if (opts.mixedAgeRestriction) {
-      exchange.addCoinConfigList(
-        coinConfig.map((x) => ({ ...x, ageRestricted: false })),
-      );
-    }
-  } else {
-    exchange.addCoinConfigList(coinConfig);
-  }
-
-  await exchange.modifyConfig(async (config) => {
-    config.setString("exchange", "enable_kyc", "yes");
-
-    config.setString("KYC-RULE-R1", "operation_type", "merge");
-    config.setString("KYC-RULE-R1", "enabled", "yes");
-    config.setString("KYC-RULE-R1", "exposed", "yes");
-    config.setString("KYC-RULE-R1", "is_and_combinator", "yes");
-    config.setString("KYC-RULE-R1", "threshold", "TESTKUDOS:5");
-    config.setString("KYC-RULE-R1", "timeframe", "1d");
-    config.setString("KYC-RULE-R1", "next_measures", "M1");
-
-    config.setString("KYC-MEASURE-M1", "check_name", "C1");
-    config.setString("KYC-MEASURE-M1", "context", "{}");
-    config.setString("KYC-MEASURE-M1", "program", "P1");
-
-    config.setString("AML-PROGRAM-P1", "command", "/bin/true");
-    config.setString("AML-PROGRAM-P1", "enabled", "true");
-    config.setString("AML-PROGRAM-P1", "description", "this does nothing");
-    config.setString("AML-PROGRAM-P1", "fallback", "M1");
-
-    config.setString("KYC-CHECK-C1", "type", "INFO");
-    config.setString("KYC-CHECK-C1", "description", "my check!");
-    config.setString("KYC-CHECK-C1", "fallback", "M1");
-  });
-
-  await exchange.start();
-
-  const cryptoApi = createSyncCryptoApi();
-  const amlKeypair = await cryptoApi.createEddsaKeypair({});
-
-  await exchange.enableAmlAccount(amlKeypair.pub, "Alice");
-
-  const walletService = new WalletService(t, {
-    name: "wallet",
-    useInMemoryDb: true,
-  });
-  await walletService.start();
-  await walletService.pingUntilAvailable();
-
-  const walletClient = new WalletClient({
-    name: "wallet",
-    unixPath: walletService.socketPath,
-    onNotification(n) {
-      console.log("got notification", n);
-    },
-  });
-  await walletClient.connect();
-  await walletClient.client.call(WalletApiOperation.InitWallet, {
-    config: {
-      testing: {
-        skipDefaults: true,
-      },
-    },
-  });
-
-  console.log("setup done!");
-
-  return {
-    commonDb: db,
-    exchange,
-    amlKeypair,
-    walletClient,
-    walletService,
-    bankClient,
-    exchangeBankAccount: {
-      accountName: "",
-      accountPassword: "",
-      accountPaytoUri: "",
-      wireGatewayApiBaseUrl: "",
-    },
-  };
-}
+import { GlobalTestState, WalletClient } from "../harness/harness.js";
 
 export async function runKycPeerPullTest(t: GlobalTestState) {
   // Set up test environment
 
   const { walletClient, bankClient, exchange, amlKeypair } =
-    await createKycTestkudosEnvironment(t);
+    await createKycTestkudosEnvironment(t, {
+      adjustExchangeConfig(config) {
+        configureCommonKyc(config);
+
+        config.setString("KYC-RULE-R1", "operation_type", "merge");
+        config.setString("KYC-RULE-R1", "enabled", "yes");
+        config.setString("KYC-RULE-R1", "exposed", "yes");
+        config.setString("KYC-RULE-R1", "is_and_combinator", "yes");
+        config.setString("KYC-RULE-R1", "threshold", "TESTKUDOS:5");
+        config.setString("KYC-RULE-R1", "timeframe", "1d");
+        config.setString("KYC-RULE-R1", "next_measures", "M1");
+
+        config.setString("KYC-MEASURE-M1", "check_name", "C1");
+        config.setString("KYC-MEASURE-M1", "context", "{}");
+        config.setString("KYC-MEASURE-M1", "program", "NONE");
+
+        config.setString("KYC-CHECK-C1", "type", "INFO");
+        config.setString("KYC-CHECK-C1", "description", "my check!");
+        config.setString("KYC-CHECK-C1", "fallback", "FREEZE");
+      },
+    });
 
   // Origin wallet for the p2p transaction,
   // will pay for the invoice.
diff --git a/packages/taler-harness/src/integrationtests/test-kyc-peer-push.ts 
b/packages/taler-harness/src/integrationtests/test-kyc-peer-push.ts
index 455b7138a..2748a54f1 100644
--- a/packages/taler-harness/src/integrationtests/test-kyc-peer-push.ts
+++ b/packages/taler-harness/src/integrationtests/test-kyc-peer-push.ts
@@ -22,202 +22,45 @@ import {
   AmountString,
   Duration,
   j2s,
-  TalerCorebankApiClient,
   TransactionMajorState,
   TransactionMinorState,
   TransactionType,
 } from "@gnu-taler/taler-util";
+import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
 import {
-  createSyncCryptoApi,
-  EddsaKeyPairStrings,
-  WalletApiOperation,
-} from "@gnu-taler/taler-wallet-core";
-import { CoinConfig, defaultCoinConfig } from "../harness/denomStructures.js";
-import {
-  BankService,
-  DbInfo,
-  ExchangeService,
-  getTestHarnessPaytoForLabel,
-  GlobalTestState,
-  HarnessExchangeBankAccount,
-  setupDb,
-  WalletClient,
-  WalletService,
-} from "../harness/harness.js";
-import {
+  configureCommonKyc,
+  createKycTestkudosEnvironment,
   createWalletDaemonWithClient,
-  EnvOptions,
   postAmlDecisionNoRules,
   withdrawViaBankV3,
 } from "../harness/environments.js";
-
-interface KycTestEnv {
-  commonDb: DbInfo;
-  bankClient: TalerCorebankApiClient;
-  exchange: ExchangeService;
-  exchangeBankAccount: HarnessExchangeBankAccount;
-  walletClient: WalletClient;
-  walletService: WalletService;
-  amlKeypair: EddsaKeyPairStrings;
-}
-
-async function createKycTestkudosEnvironment(
-  t: GlobalTestState,
-  coinConfig: CoinConfig[] = defaultCoinConfig.map((x) => x("TESTKUDOS")),
-  opts: EnvOptions = {},
-): Promise<KycTestEnv> {
-  const db = await setupDb(t);
-
-  const bank = await BankService.create(t, {
-    allowRegistrations: true,
-    currency: "TESTKUDOS",
-    database: db.connStr,
-    httpPort: 8082,
-  });
-
-  const exchange = ExchangeService.create(t, {
-    name: "testexchange-1",
-    currency: "TESTKUDOS",
-    httpPort: 8081,
-    database: db.connStr,
-  });
-
-  let receiverName = "Exchange";
-  let exchangeBankUsername = "exchange";
-  let exchangeBankPassword = "mypw-password";
-  let exchangePaytoUri = getTestHarnessPaytoForLabel(exchangeBankUsername);
-
-  await exchange.addBankAccount("1", {
-    accountName: exchangeBankUsername,
-    accountPassword: exchangeBankPassword,
-    wireGatewayApiBaseUrl: new URL(
-      "accounts/exchange/taler-wire-gateway/",
-      bank.baseUrl,
-    ).href,
-    accountPaytoUri: exchangePaytoUri,
-  });
-
-  bank.setSuggestedExchange(exchange, exchangePaytoUri);
-
-  await bank.start();
-
-  await bank.pingUntilAvailable();
-
-  const bankClient = new TalerCorebankApiClient(bank.corebankApiBaseUrl, {
-    auth: {
-      username: "admin",
-      password: "admin-password",
-    },
-  });
-
-  await bankClient.registerAccountExtended({
-    name: receiverName,
-    password: exchangeBankPassword,
-    username: exchangeBankUsername,
-    is_taler_exchange: true,
-    payto_uri: exchangePaytoUri,
-  });
-
-  const ageMaskSpec = opts.ageMaskSpec;
-
-  if (ageMaskSpec) {
-    exchange.enableAgeRestrictions(ageMaskSpec);
-    // Enable age restriction for all coins.
-    exchange.addCoinConfigList(
-      coinConfig.map((x) => ({
-        ...x,
-        name: `${x.name}-age`,
-        ageRestricted: true,
-      })),
-    );
-    // For mixed age restrictions, we also offer coins without age restrictions
-    if (opts.mixedAgeRestriction) {
-      exchange.addCoinConfigList(
-        coinConfig.map((x) => ({ ...x, ageRestricted: false })),
-      );
-    }
-  } else {
-    exchange.addCoinConfigList(coinConfig);
-  }
-
-  await exchange.modifyConfig(async (config) => {
-    config.setString("exchange", "enable_kyc", "yes");
-
-    config.setString("KYC-RULE-R1", "operation_type", "merge");
-    config.setString("KYC-RULE-R1", "enabled", "yes");
-    config.setString("KYC-RULE-R1", "exposed", "yes");
-    config.setString("KYC-RULE-R1", "is_and_combinator", "yes");
-    config.setString("KYC-RULE-R1", "threshold", "TESTKUDOS:5");
-    config.setString("KYC-RULE-R1", "timeframe", "1d");
-    config.setString("KYC-RULE-R1", "next_measures", "M1");
-
-    config.setString("KYC-MEASURE-M1", "check_name", "C1");
-    config.setString("KYC-MEASURE-M1", "context", "{}");
-    config.setString("KYC-MEASURE-M1", "program", "P1");
-
-    config.setString("AML-PROGRAM-P1", "command", "/bin/true");
-    config.setString("AML-PROGRAM-P1", "enabled", "true");
-    config.setString("AML-PROGRAM-P1", "description", "this does nothing");
-    config.setString("AML-PROGRAM-P1", "fallback", "M1");
-
-    config.setString("KYC-CHECK-C1", "type", "INFO");
-    config.setString("KYC-CHECK-C1", "description", "my check!");
-    config.setString("KYC-CHECK-C1", "fallback", "M1");
-  });
-
-  await exchange.start();
-
-  const cryptoApi = createSyncCryptoApi();
-  const amlKeypair = await cryptoApi.createEddsaKeypair({});
-
-  await exchange.enableAmlAccount(amlKeypair.pub, "Alice");
-
-  const walletService = new WalletService(t, {
-    name: "wallet",
-    useInMemoryDb: true,
-  });
-  await walletService.start();
-  await walletService.pingUntilAvailable();
-
-  const walletClient = new WalletClient({
-    name: "wallet",
-    unixPath: walletService.socketPath,
-    onNotification(n) {
-      console.log("got notification", n);
-    },
-  });
-  await walletClient.connect();
-  await walletClient.client.call(WalletApiOperation.InitWallet, {
-    config: {
-      testing: {
-        skipDefaults: true,
-      },
-    },
-  });
-
-  console.log("setup done!");
-
-  return {
-    commonDb: db,
-    exchange,
-    amlKeypair,
-    walletClient,
-    walletService,
-    bankClient,
-    exchangeBankAccount: {
-      accountName: "",
-      accountPassword: "",
-      accountPaytoUri: "",
-      wireGatewayApiBaseUrl: "",
-    },
-  };
-}
+import { GlobalTestState, WalletClient } from "../harness/harness.js";
 
 export async function runKycPeerPushTest(t: GlobalTestState) {
   // Set up test environment
 
   const { walletClient, bankClient, exchange, amlKeypair } =
-    await createKycTestkudosEnvironment(t);
+    await createKycTestkudosEnvironment(t, {
+      adjustExchangeConfig(config) {
+        configureCommonKyc(config);
+
+        config.setString("KYC-RULE-R1", "operation_type", "merge");
+        config.setString("KYC-RULE-R1", "enabled", "yes");
+        config.setString("KYC-RULE-R1", "exposed", "yes");
+        config.setString("KYC-RULE-R1", "is_and_combinator", "yes");
+        config.setString("KYC-RULE-R1", "threshold", "TESTKUDOS:5");
+        config.setString("KYC-RULE-R1", "timeframe", "1d");
+        config.setString("KYC-RULE-R1", "next_measures", "M1");
+
+        config.setString("KYC-MEASURE-M1", "check_name", "C1");
+        config.setString("KYC-MEASURE-M1", "context", "{}");
+        config.setString("KYC-MEASURE-M1", "program", "NONE");
+
+        config.setString("KYC-CHECK-C1", "type", "INFO");
+        config.setString("KYC-CHECK-C1", "description", "my check!");
+        config.setString("KYC-CHECK-C1", "fallback", "FREEZE");
+      },
+    });
 
   // Origin wallet for the p2p transaction.
   const w0 = await createWalletDaemonWithClient(t, {
diff --git 
a/packages/taler-harness/src/integrationtests/test-kyc-skip-expiration.ts 
b/packages/taler-harness/src/integrationtests/test-kyc-skip-expiration.ts
index 2e463d5b7..fda61396c 100644
--- a/packages/taler-harness/src/integrationtests/test-kyc-skip-expiration.ts
+++ b/packages/taler-harness/src/integrationtests/test-kyc-skip-expiration.ts
@@ -35,6 +35,7 @@ import {
 import { readResponseJsonOrThrow } from "@gnu-taler/taler-util/http";
 import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
 import {
+  configureCommonKyc,
   createKycTestkudosEnvironment,
   postAmlDecision,
   withdrawViaBankV3,
@@ -78,7 +79,7 @@ export const AML_PROGRAM_FROM_ATTRIBUTES_TO_CONTEXT: 
TalerKycAml.AmlProgramDefin
   };
 
 function adjustExchangeConfig(config: Configuration) {
-  config.setString("exchange", "enable_kyc", "yes");
+  configureCommonKyc(config);
 
   config.setString("KYC-RULE-R1", "operation_type", "withdraw");
   config.setString("KYC-RULE-R1", "enabled", "yes");
@@ -108,32 +109,32 @@ function adjustExchangeConfig(config: Configuration) {
   config.setString("AML-PROGRAM-P1", "enabled", "true");
   config.setString("AML-PROGRAM-P1", "description", "remove all rules");
   config.setString("AML-PROGRAM-P1", "description_i18n", "{}");
-  config.setString("AML-PROGRAM-P1", "fallback", "M1");
+  config.setString("AML-PROGRAM-P1", "fallback", "FREEZE");
 
   config.setString("AML-PROGRAM-P2", "command", "/bin/true");
   config.setString("AML-PROGRAM-P2", "enabled", "true");
   config.setString("AML-PROGRAM-P2", "description", "does nothing");
   config.setString("AML-PROGRAM-P2", "description_i18n", "{}");
-  config.setString("AML-PROGRAM-P2", "fallback", "M1");
+  config.setString("AML-PROGRAM-P2", "fallback", "FREEZE");
 
   config.setString("KYC-CHECK-C1", "type", "FORM");
   config.setString("KYC-CHECK-C1", "form_name", "myform");
   config.setString("KYC-CHECK-C1", "description", "my check!");
   config.setString("KYC-CHECK-C1", "description_i18n", "{}");
   config.setString("KYC-CHECK-C1", "outputs", "full_name birthdate");
-  config.setString("KYC-CHECK-C1", "fallback", "M1");
+  config.setString("KYC-CHECK-C1", "fallback", "FREEZE");
 
   config.setString("KYC-CHECK-C2", "type", "FORM");
   config.setString("KYC-CHECK-C2", "form_name", "dynamicform");
   config.setString("KYC-CHECK-C2", "description", "my check info!");
   config.setString("KYC-CHECK-C2", "description_i18n", "{}");
   config.setString("KYC-CHECK-C1", "outputs", "what_the_officer_asked");
-  config.setString("KYC-CHECK-C2", "fallback", "M2");
+  config.setString("KYC-CHECK-C2", "fallback", "FREEZE");
 
   config.setString("KYC-CHECK-C3", "type", "INFO");
   config.setString("KYC-CHECK-C3", "description", "this is info c3");
   config.setString("KYC-CHECK-C3", "description_i18n", "{}");
-  config.setString("KYC-CHECK-C3", "fallback", "M2");
+  config.setString("KYC-CHECK-C3", "fallback", "FREEZE");
 }
 
 /**
diff --git 
a/packages/taler-harness/src/integrationtests/test-kyc-withdrawal-verboten.ts 
b/packages/taler-harness/src/integrationtests/test-kyc-withdrawal-verboten.ts
index cf1c8206e..6a440b306 100644
--- 
a/packages/taler-harness/src/integrationtests/test-kyc-withdrawal-verboten.ts
+++ 
b/packages/taler-harness/src/integrationtests/test-kyc-withdrawal-verboten.ts
@@ -27,6 +27,7 @@ import {
 } from "@gnu-taler/taler-util";
 import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
 import {
+  configureCommonKyc,
   createKycTestkudosEnvironment,
   postAmlDecision,
   postAmlDecisionNoRules,
@@ -39,6 +40,7 @@ export async function runKycWithdrawalVerbotenTest(t: 
GlobalTestState) {
   const { walletClient, bankClient, exchange, amlKeypair } =
     await createKycTestkudosEnvironment(t, {
       adjustExchangeConfig(config) {
+        configureCommonKyc(config);
         config.setString("exchange", "enable_kyc", "yes");
 
         config.setString("KYC-RULE-R1", "operation_type", "withdraw");
@@ -59,16 +61,11 @@ export async function runKycWithdrawalVerbotenTest(t: 
GlobalTestState) {
 
         config.setString("KYC-MEASURE-M1", "check_name", "C1");
         config.setString("KYC-MEASURE-M1", "context", "{}");
-        config.setString("KYC-MEASURE-M1", "program", "P1");
-
-        config.setString("AML-PROGRAM-P1", "command", "/bin/true");
-        config.setString("AML-PROGRAM-P1", "enabled", "true");
-        config.setString("AML-PROGRAM-P1", "description", "this does nothing");
-        config.setString("AML-PROGRAM-P1", "fallback", "M1");
+        config.setString("KYC-MEASURE-M1", "program", "NONE");
 
         config.setString("KYC-CHECK-C1", "type", "INFO");
         config.setString("KYC-CHECK-C1", "description", "my check!");
-        config.setString("KYC-CHECK-C1", "fallback", "M1");
+        config.setString("KYC-CHECK-C1", "fallback", "FREEZE");
       },
     });
 
diff --git a/packages/taler-harness/src/integrationtests/test-kyc.ts 
b/packages/taler-harness/src/integrationtests/test-kyc.ts
index 5b1ba9f0a..41e05b148 100644
--- a/packages/taler-harness/src/integrationtests/test-kyc.ts
+++ b/packages/taler-harness/src/integrationtests/test-kyc.ts
@@ -29,7 +29,7 @@ import {
 import { readResponseJsonOrThrow } from "@gnu-taler/taler-util/http";
 import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
 import * as http from "node:http";
-import { createKycTestkudosEnvironment } from "../harness/environments.js";
+import { configureCommonKyc, createKycTestkudosEnvironment } from 
"../harness/environments.js";
 import { GlobalTestState, harnessHttpLib } from "../harness/harness.js";
 
 const logger = new Logger("test-kyc.ts");
@@ -134,6 +134,8 @@ export async function runKycTest(t: GlobalTestState) {
       adjustExchangeConfig(config) {
         config.setString("exchange", "enable_kyc", "yes");
 
+        configureCommonKyc(config);
+
         config.setString("KYC-RULE-R1", "operation_type", "withdraw");
         config.setString("KYC-RULE-R1", "enabled", "yes");
         config.setString("KYC-RULE-R1", "exposed", "yes");
@@ -167,19 +169,6 @@ export async function runKycTest(t: GlobalTestState) {
         config.setString("AML-PROGRAM-P1", "description_i18n", "{}");
         config.setString("AML-PROGRAM-P1", "fallback", "FREEZE");
 
-        config.setString("KYC-MEASURE-FREEZE", "check_name", "SKIP");
-        config.setString("KYC-MEASURE-FREEZE", "context", "{}");
-        config.setString("KYC-MEASURE-FREEZE", "program", "FREEZE");
-        config.setString(
-          "AML-PROGRAM-FREEZE",
-          "command",
-          "taler-exchange-helper-measure-freeze",
-        );
-        config.setString("AML-PROGRAM-FREEZE", "enabled", "true");
-        config.setString("AML-PROGRAM-FREEZE", "description", "Freeze 
account");
-        config.setString("AML-PROGRAM-FREEZE", "description_i18n", "{}");
-        config.setString("AML-PROGRAM-FREEZE", "fallback", "FREEZE");
-
         const myprov = "KYC-PROVIDER-MYPROV";
         config.setString(myprov, "logic", "oauth2");
         config.setString(

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]