commit 731cbfc545f002d09a3458efc91e12a7e74e8530
parent e6c85ea262ba2213e0f33bf5e9eee4716419a9a1
Author: Florian Dold <florian@dold.me>
Date: Fri, 13 Dec 2024 13:31:11 +0100
harness: let AML fallback tests terminate via manual AML decision
Diffstat:
2 files changed, 31 insertions(+), 5 deletions(-)
diff --git a/packages/taler-harness/src/integrationtests/test-kyc-amp-failure.ts b/packages/taler-harness/src/integrationtests/test-kyc-amp-failure.ts
@@ -27,6 +27,7 @@ import {
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
import {
createKycTestkudosEnvironment,
+ postAmlDecisionNoRules,
withdrawViaBankV3,
} from "../harness/environments.js";
import { GlobalTestState } from "../harness/harness.js";
@@ -66,7 +67,11 @@ function adjustExchangeConfig(config: Configuration) {
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(
+ "AML-PROGRAM-FREEZE",
+ "command",
+ "taler-exchange-helper-measure-freeze",
+ );
config.setString;
}
@@ -104,6 +109,15 @@ export async function runKycAmpFailureTest(t: GlobalTestState) {
console.log(j2s(txDet));
+ t.assertTrue(!!txDet.kycPaytoHash);
+
+ await postAmlDecisionNoRules(t, {
+ amlPriv: amlKeypair.priv,
+ amlPub: amlKeypair.pub,
+ exchangeBaseUrl: exchange.baseUrl,
+ paytoHash: txDet.kycPaytoHash,
+ });
+
await wres.withdrawalFinishedCond;
}
diff --git a/packages/taler-harness/src/integrationtests/test-kyc-amp-timeout.ts b/packages/taler-harness/src/integrationtests/test-kyc-amp-timeout.ts
@@ -27,6 +27,7 @@ import {
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
import {
createKycTestkudosEnvironment,
+ postAmlDecisionNoRules,
withdrawViaBankV3,
} from "../harness/environments.js";
import { GlobalTestState } from "../harness/harness.js";
@@ -66,7 +67,11 @@ function adjustExchangeConfig(config: Configuration) {
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(
+ "AML-PROGRAM-FREEZE",
+ "command",
+ "taler-exchange-helper-measure-freeze",
+ );
config.setString;
}
@@ -102,11 +107,18 @@ export async function runKycAmpTimeoutTest(t: GlobalTestState) {
transactionId: wres.transactionId as TransactionIdStr,
});
- console.log(j2s(txDet));
+ t.assertTrue(!!txDet.kycPaytoHash);
- // FIXME: Test incomplete. Check that fallback rules have been applied.
+ await postAmlDecisionNoRules(t, {
+ amlPriv: amlKeypair.priv,
+ amlPub: amlKeypair.pub,
+ exchangeBaseUrl: exchange.baseUrl,
+ paytoHash: txDet.kycPaytoHash,
+ });
+
+ console.log(j2s(txDet));
- //await wres.withdrawalFinishedCond;
+ await wres.withdrawalFinishedCond;
}
runKycAmpTimeoutTest.suites = ["wallet"];