aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-harness/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-harness/src')
-rw-r--r--packages/taler-harness/src/integrationtests/test-kyc-skip-expiration.ts41
1 files changed, 23 insertions, 18 deletions
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 215a1ccf6..f08d9ecc7 100644
--- a/packages/taler-harness/src/integrationtests/test-kyc-skip-expiration.ts
+++ b/packages/taler-harness/src/integrationtests/test-kyc-skip-expiration.ts
@@ -147,7 +147,7 @@ async function createKycTestkudosEnvironment(
config.setString("KYC-MEASURE-M3", "check_name", "SKIP");
config.setString("KYC-MEASURE-M3", "context", "{}");
- config.setString("KYC-MEASURE-M3", "program", "P2");
+ config.setString("KYC-MEASURE-M3", "program", "P1");
config.setString(
"AML-PROGRAM-P1",
@@ -253,6 +253,7 @@ export async function runKycSkipExpirationTest(t: GlobalTestState) {
let firstTransaction: string | undefined;
{
+ // step 1) Withdraw to trigger AML
const wres = await withdrawViaBankV3(t, {
amount: "TESTKUDOS:20",
bankClient,
@@ -283,6 +284,7 @@ export async function runKycSkipExpirationTest(t: GlobalTestState) {
t.assertTrue(!!accessToken);
{
+ // step 2) Check KYC info
const infoResp = await harnessHttpLib.fetch(
new URL(`kyc-info/${accessToken}`, exchange.baseUrl).href,
);
@@ -298,6 +300,7 @@ export async function runKycSkipExpirationTest(t: GlobalTestState) {
const sig = signAmlQuery(decodeCrock(amlKeypair.priv));
{
+ // step 3) Apply Measure 3 with SKIP check
const decisionsResp = await harnessHttpLib.fetch(
new URL(`aml/${amlKeypair.pub}/decisions`, exchange.baseUrl).href,
{
@@ -309,26 +312,28 @@ export async function runKycSkipExpirationTest(t: GlobalTestState) {
console.log(decisionsResp.status);
t.assertDeepEqual(decisionsResp.status, 204);
- }
- t.assertTrue(!!kycPaytoHash);
-
- await postAmlDecision(t, {
- amlPriv: amlKeypair.priv,
- amlPub: amlKeypair.pub,
- exchangeBaseUrl: exchange.baseUrl,
- paytoHash: kycPaytoHash,
- newMeasure: "M3",
- newRules: {
- expiration_time: TalerProtocolTimestamp.now(),
- custom_measures: {},
- rules: [
- // No rules!
- ],
- },
- });
+ t.assertTrue(!!kycPaytoHash);
+
+ await postAmlDecision(t, {
+ amlPriv: amlKeypair.priv,
+ amlPub: amlKeypair.pub,
+ exchangeBaseUrl: exchange.baseUrl,
+ paytoHash: kycPaytoHash,
+ newMeasure: "M3",
+ newRules: {
+ expiration_time: TalerProtocolTimestamp.now(),
+ custom_measures: {},
+ rules: [
+ // No rules!
+ ],
+ },
+ });
+ }
{
+ // step 4) Check KYC info, it should have the result
+ // of running program p1
const decisionsResp = await harnessHttpLib.fetch(
new URL(`aml/${amlKeypair.pub}/decisions`, exchange.baseUrl).href,
{