gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] branch master updated: -logging


From: gnunet
Subject: [taler-wallet-core] branch master updated: -logging
Date: Wed, 21 Jun 2023 12:36:25 +0200

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

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

The following commit(s) were added to refs/heads/master by this push:
     new 06301efda -logging
06301efda is described below

commit 06301efda34a7b92b7e193b9af67c75946286774
Author: Florian Dold <florian@dold.me>
AuthorDate: Wed Jun 21 12:36:22 2023 +0200

    -logging
---
 .../taler-harness/src/integrationtests/test-kyc.ts | 30 ++++++++++++++--------
 1 file changed, 19 insertions(+), 11 deletions(-)

diff --git a/packages/taler-harness/src/integrationtests/test-kyc.ts 
b/packages/taler-harness/src/integrationtests/test-kyc.ts
index 660595845..0fe24d708 100644
--- a/packages/taler-harness/src/integrationtests/test-kyc.ts
+++ b/packages/taler-harness/src/integrationtests/test-kyc.ts
@@ -20,6 +20,7 @@
 import {
   Duration,
   j2s,
+  Logger,
   NotificationType,
   TransactionMajorState,
   TransactionMinorState,
@@ -45,6 +46,8 @@ import { EnvOptions, SimpleTestEnvironmentNg } from 
"../harness/helpers.js";
 import * as http from "node:http";
 import { createPlatformHttpLib } from "@gnu-taler/taler-util/http";
 
+const logger = new Logger("test-kyc.ts");
+
 export async function createKycTestkudosEnvironment(
   t: GlobalTestState,
   coinConfig: CoinConfig[] = defaultCoinConfig.map((x) => x("TESTKUDOS")),
@@ -226,7 +229,7 @@ function splitInTwoAt(s: string, separator: string): 
[string, string] {
 async function runTestfakeKycService(): Promise<TestfakeKycService> {
   const server = http.createServer((req, res) => {
     const requestUrl = req.url!;
-    console.log(`kyc: got ${req.method} request`, requestUrl);
+    logger.info(`kyc: got ${req.method} request, ${requestUrl}`);
 
     const [path, query] = splitInTwoAt(requestUrl, "?");
 
@@ -254,7 +257,7 @@ async function runTestfakeKycService(): 
Promise<TestfakeKycService> {
       });
 
       req.on("end", () => {
-        console.log("login request body:", reqBody);
+        logger.info("login request body:", reqBody);
 
         res.writeHead(200, { "Content-Type": "application/json" });
         // Normally, the access_token would also include which user we're 
trying
@@ -267,7 +270,7 @@ async function runTestfakeKycService(): 
Promise<TestfakeKycService> {
         );
       });
     } else if (path === "/oauth/v2/info") {
-      console.log("authorization header:", req.headers.authorization);
+      logger.info("authorization header:", req.headers.authorization);
       res.writeHead(200, { "Content-Type": "application/json" });
       res.end(
         JSON.stringify({
@@ -352,11 +355,14 @@ export async function runKycTest(t: GlobalTestState) {
 
   const kycNotif = await kycNotificationCond;
 
-  console.log("got kyc notification:", j2s(kycNotif));
+  logger.info("got kyc notification:", j2s(kycNotif));
 
-  const txState = await 
walletClient.client.call(WalletApiOperation.GetTransactionById, {
-    transactionId: withdrawalTxId
-  });
+  const txState = await walletClient.client.call(
+    WalletApiOperation.GetTransactionById,
+    {
+      transactionId: withdrawalTxId,
+    },
+  );
 
   t.assertDeepEqual(txState.type, TransactionType.Withdrawal);
 
@@ -364,7 +370,7 @@ export async function runKycTest(t: GlobalTestState) {
 
   t.assertTrue(!!kycUrl);
 
-  console.log(`kyc URL is ${kycUrl}`);
+  logger.info(`kyc URL is ${kycUrl}`);
 
   // We now simulate the user interacting with the KYC service,
   // which would usually done in the browser.
@@ -375,11 +381,13 @@ export async function runKycTest(t: GlobalTestState) {
   });
   const kycServerResp = await httpLib.fetch(kycUrl);
   const kycLoginResp = await kycServerResp.json();
-  console.log("kyc server resp:", j2s(kycLoginResp));
+  logger.info(`kyc server resp: ${j2s(kycLoginResp)}`);
   const kycProofUrl = kycLoginResp.redirect_uri;
+  // We need to "visit" the KYC proof URL at least once to trigger the exchange
+  // asking for the KYC status.
   const proofHttpResp = await httpLib.fetch(kycProofUrl);
-  console.log("proof resp status", proofHttpResp.status);
-  console.log("resp headers", proofHttpResp.headers.toJSON());
+  logger.info(`proof resp status ${proofHttpResp.status}`);
+  logger.info(`resp headers ${j2s(proofHttpResp.headers.toJSON())}`);
 
   // Now that KYC is done, withdrawal should finally succeed.
 

-- 
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]