gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] branch master updated: integration tests: make test-


From: gnunet
Subject: [taler-wallet-core] branch master updated: integration tests: make test-wallet-cryptoworker pass
Date: Wed, 05 Oct 2022 16:02:02 +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 99ace8b7d integration tests: make test-wallet-cryptoworker pass
99ace8b7d is described below

commit 99ace8b7d24416f2b184d66006c89b61935e132e
Author: Florian Dold <florian@dold.me>
AuthorDate: Wed Oct 5 16:01:59 2022 +0200

    integration tests: make test-wallet-cryptoworker pass
---
 packages/taler-wallet-cli/src/index.ts                         | 10 +++++++++-
 .../src/integrationtests/test-wallet-cryptoworker.ts           |  4 ++--
 packages/taler-wallet-core/src/crypto/workers/worker-common.ts |  3 ++-
 packages/taler-wallet-core/src/wallet-api-types.ts             |  8 ++++----
 4 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/packages/taler-wallet-cli/src/index.ts 
b/packages/taler-wallet-cli/src/index.ts
index 47a520c83..c1afbe15c 100644
--- a/packages/taler-wallet-cli/src/index.ts
+++ b/packages/taler-wallet-cli/src/index.ts
@@ -182,7 +182,7 @@ export const walletCli = clk
     },
   })
   .maybeOption("cryptoWorker", ["--crypto-worker"], clk.STRING, {
-    help: "Override crypto worker implementation type."
+    help: "Override crypto worker implementation type.",
   })
   .maybeOption("log", ["-L", "--log"], clk.STRING, {
     help: "configure log level (NONE, ..., TRACE)",
@@ -729,6 +729,14 @@ const advancedCli = walletCli.subcommand("advancedArgs", 
"advanced", {
   help: "Subcommands for advanced operations (only use if you know what you're 
doing!).",
 });
 
+advancedCli
+  .subcommand("init", "init", {
+    help: "Initialize the wallet (with DB) and exit."
+  })
+  .action(async (args) => {
+    await withWallet(args, async () => {});
+  });
+
 advancedCli
   .subcommand("bench1", "bench1", {
     help: "Run the 'bench1' benchmark",
diff --git 
a/packages/taler-wallet-cli/src/integrationtests/test-wallet-cryptoworker.ts 
b/packages/taler-wallet-cli/src/integrationtests/test-wallet-cryptoworker.ts
index fefdab27a..cc0e23a3c 100644
--- a/packages/taler-wallet-cli/src/integrationtests/test-wallet-cryptoworker.ts
+++ b/packages/taler-wallet-cli/src/integrationtests/test-wallet-cryptoworker.ts
@@ -43,13 +43,13 @@ export async function runWalletCryptoWorkerTest(t: 
GlobalTestState) {
     cryptoWorkerType: "sync",
   });
 
-  await wallet1.client.call(WalletApiOperation.CryptoTest, {});
+  await wallet1.client.call(WalletApiOperation.TestCrypto, {});
 
   const wallet2 = new WalletCli(t, "w2", {
     cryptoWorkerType: "node-worker-thread",
   });
 
-  await wallet2.client.call(WalletApiOperation.CryptoTest, {});
+  await wallet2.client.call(WalletApiOperation.TestCrypto, {});
 }
 
 runWalletCryptoWorkerTest.suites = ["wallet"];
diff --git a/packages/taler-wallet-core/src/crypto/workers/worker-common.ts 
b/packages/taler-wallet-core/src/crypto/workers/worker-common.ts
index 67af68f35..dae6d1e28 100644
--- a/packages/taler-wallet-core/src/crypto/workers/worker-common.ts
+++ b/packages/taler-wallet-core/src/crypto/workers/worker-common.ts
@@ -37,6 +37,7 @@ export async function processRequestWithImpl(
   reqMsg: CryptoWorkerRequestMessage,
   impl: TalerCryptoInterfaceR,
 ): Promise<CryptoWorkerResponseMessage> {
+  logger.info(`processing crypto request ${j2s(reqMsg)}`);
   if (typeof reqMsg !== "object") {
     logger.error("request must be an object");
     return {
@@ -85,7 +86,7 @@ export async function processRequestWithImpl(
   let responseMsg: CryptoWorkerResponseMessage;
 
   try {
-    const result = await (impl as any)[operation](impl, reqMsg);
+    const result = await (impl as any)[operation](impl, reqMsg.req);
     responseMsg = { type: "success", result, id };
   } catch (e: any) {
     logger.error(`error during operation: ${e.stack ?? e.toString()}`);
diff --git a/packages/taler-wallet-core/src/wallet-api-types.ts 
b/packages/taler-wallet-core/src/wallet-api-types.ts
index 2860a6972..15de5faf9 100644
--- a/packages/taler-wallet-core/src/wallet-api-types.ts
+++ b/packages/taler-wallet-core/src/wallet-api-types.ts
@@ -92,7 +92,7 @@ export enum WalletApiOperation {
   WithdrawTestBalance = "withdrawTestBalance",
   PreparePayForUri = "preparePayForUri",
   RunIntegrationTest = "runIntegrationTest",
-  CryptoTest = "cryptoTest",
+  TestCrypto = "testCrypto",
   TestPay = "testPay",
   AddExchange = "addExchange",
   GetTransactions = "getTransactions",
@@ -528,8 +528,8 @@ export type RunIntegrationTestOp = {
 /**
  * Test crypto worker.
  */
-export type CryptoTestOp = {
-  op: WalletApiOperation.CryptoTest;
+export type TestCryptoOp = {
+  op: WalletApiOperation.TestCrypto;
   request: {};
   response: any;
 };
@@ -649,7 +649,7 @@ export type WalletOperations = {
   [WalletApiOperation.AddBackupProvider]: AddBackupProviderOp;
   [WalletApiOperation.GetBackupInfo]: GetBackupInfoOp;
   [WalletApiOperation.RunIntegrationTest]: RunIntegrationTestOp;
-  [WalletApiOperation.CryptoTest]: CryptoTestOp;
+  [WalletApiOperation.TestCrypto]: TestCryptoOp;
   [WalletApiOperation.WithdrawTestBalance]: WithdrawTestBalanceOp;
   [WalletApiOperation.TestPay]: TestPayOp;
   [WalletApiOperation.ExportDb]: ExportDbOp;

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