gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] branch master updated (4a781bd0d -> e8baaf5eb)


From: gnunet
Subject: [taler-wallet-core] branch master updated (4a781bd0d -> e8baaf5eb)
Date: Tue, 10 Jan 2023 12:14:14 +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 4a781bd0d fix #7153: more error handling
     new cfe33c8e2 wallet-embedded: fetchHttp is now async
     new e8baaf5eb harness: capture createdb/dropdb logs

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/harness.ts    | 22 ++++++++++++++--------
 packages/taler-wallet-embedded/src/wallet-qjs.ts |  5 ++---
 2 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/packages/taler-harness/src/harness/harness.ts 
b/packages/taler-harness/src/harness/harness.ts
index 6f722dc8d..a9298637f 100644
--- a/packages/taler-harness/src/harness/harness.ts
+++ b/packages/taler-harness/src/harness/harness.ts
@@ -63,7 +63,6 @@ import * as http from "http";
 import * as path from "path";
 import * as readline from "readline";
 import { URL } from "url";
-import * as util from "util";
 import { CoinConfig } from "./denomStructures.js";
 import { LibeufinNexusApi, LibeufinSandboxApi } from "./libeufin-apis.js";
 import {
@@ -78,8 +77,6 @@ import {
   TippingReserveStatus,
 } from "./merchantApiTypes.js";
 
-const exec = util.promisify(child_process.exec);
-
 const axios = axiosImp.default;
 
 export async function delayMs(ms: number): Promise<void> {
@@ -390,10 +387,14 @@ export interface DbInfo {
   dbname: string;
 }
 
-export async function setupDb(gc: GlobalTestState): Promise<DbInfo> {
+export async function setupDb(t: GlobalTestState): Promise<DbInfo> {
   const dbname = "taler-integrationtest";
-  await exec(`dropdb "${dbname}" || true`);
-  await exec(`createdb "${dbname}"`);
+  try {
+    await runCommand(t, "dropdb", "dropdb", [dbname]);
+  } catch (e: any) {
+    logger.warn(`dropdb failed: ${e.toString()}`);
+  }
+  await runCommand(t, "createdb", "createdb", [dbname]);
   return {
     connStr: `postgres:///${dbname}`,
     dbname,
@@ -1236,7 +1237,7 @@ export class ExchangeService implements 
ExchangeServiceInterface {
             // Wire fee
             `${this.exchangeConfig.currency}:0.01`,
             // Closing fee
-            `${this.exchangeConfig.currency}:0.01`, 
+            `${this.exchangeConfig.currency}:0.01`,
             "upload",
           ],
         );
@@ -1631,7 +1632,12 @@ export class MerchantService implements 
MerchantServiceInterface {
   }
 
   async start(): Promise<void> {
-    await exec(`taler-merchant-dbinit -c "${this.configFilename}"`);
+    await runCommand(
+      this.globalState,
+      "merchant-dbinit",
+      "taler-merchant-dbinit",
+      ["-c", this.configFilename],
+    );
 
     this.proc = this.globalState.spawnService(
       "taler-merchant-httpd",
diff --git a/packages/taler-wallet-embedded/src/wallet-qjs.ts 
b/packages/taler-wallet-embedded/src/wallet-qjs.ts
index 4c39e6188..6b5f7707c 100644
--- a/packages/taler-wallet-embedded/src/wallet-qjs.ts
+++ b/packages/taler-wallet-embedded/src/wallet-qjs.ts
@@ -78,8 +78,7 @@ export interface QjsHttpOptions {
 }
 
 export interface QjsOsLib {
-  // Not async!
-  fetchHttp(url: string, options?: QjsHttpOptions): QjsHttpResp;
+  fetchHttp(url: string, options?: QjsHttpOptions): Promise<QjsHttpResp>;
   postMessageToHost(s: string): void;
   setMessageFromHostHandler(h: (s: string) => void): void;
   rename(oldPath: string, newPath: string): number;
@@ -145,7 +144,7 @@ export class NativeHttpLib implements HttpRequestLibrary {
         data = new ArrayBuffer(0);
       }
     }
-    const res = qjsOs.fetchHttp(url, {
+    const res = await qjsOs.fetchHttp(url, {
       method,
       data,
       headers,

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