gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] branch master updated: wallet-core: also create depo


From: gnunet
Subject: [taler-wallet-core] branch master updated: wallet-core: also create deposit in runIntegrationTestV2
Date: Mon, 29 Jan 2024 22:58:18 +0100

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 609919027 wallet-core: also create deposit in runIntegrationTestV2
609919027 is described below

commit 609919027c85ac4bf33a176a51b013db85450d7e
Author: Florian Dold <florian@dold.me>
AuthorDate: Mon Jan 29 22:58:15 2024 +0100

    wallet-core: also create deposit in runIntegrationTestV2
---
 .../taler-wallet-core/src/operations/deposits.ts   |  1 +
 .../taler-wallet-core/src/operations/testing.ts    | 28 ++++++++++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/packages/taler-wallet-core/src/operations/deposits.ts 
b/packages/taler-wallet-core/src/operations/deposits.ts
index 4a6791922..3619ac4f4 100644
--- a/packages/taler-wallet-core/src/operations/deposits.ts
+++ b/packages/taler-wallet-core/src/operations/deposits.ts
@@ -949,6 +949,7 @@ async function processDepositGroupPendingDeposit(
     cancellationToken?.throwIfCancelled();
     const url = new URL(`batch-deposit`, exchangeUrl);
     logger.info(`depositing to ${url}`);
+    logger.trace(`deposit request: ${j2s(batchReq)}`);
     const httpResp = await ws.http.fetch(url.href, {
       method: "POST",
       body: batchReq,
diff --git a/packages/taler-wallet-core/src/operations/testing.ts 
b/packages/taler-wallet-core/src/operations/testing.ts
index 92ce504fe..4c2cfae2c 100644
--- a/packages/taler-wallet-core/src/operations/testing.ts
+++ b/packages/taler-wallet-core/src/operations/testing.ts
@@ -25,6 +25,7 @@
  */
 import {
   AbsoluteTime,
+  addPaytoQueryParams,
   Amounts,
   AmountString,
   CheckPaymentResponse,
@@ -37,6 +38,7 @@ import {
   j2s,
   Logger,
   NotificationType,
+  parsePaytoUri,
   PreparePayResultType,
   TalerCorebankApiClient,
   TestPayArgs,
@@ -79,6 +81,7 @@ import { initiatePeerPushDebit } from 
"./pay-peer-push-debit.js";
 import { getPendingOperations } from "./pending.js";
 import { getTransactionById, getTransactions } from "./transactions.js";
 import { acceptWithdrawalFromUri } from "./withdraw.js";
+import { createDepositGroup } from "./deposits.js";
 
 const logger = new Logger("operations/testing.ts");
 
@@ -92,6 +95,11 @@ export interface WithdrawTestBalanceResult {
    * Transaction ID of the newly created withdrawal transaction.
    */
   transactionId: string;
+
+  /**
+   * Account of the user registered for the withdrawal.
+   */
+  accountPaytoUri: string;
 }
 
 export async function withdrawTestBalance(
@@ -130,6 +138,7 @@ export async function withdrawTestBalance(
 
   return {
     transactionId: acceptResp.transactionId,
+    accountPaytoUri: bankUser.accountPaytoUri,
   };
 }
 
@@ -876,6 +885,25 @@ export async function runIntegrationTest2(
     peerPushInit.transactionId,
   );
 
+  let depositPayto = withdrawalRes.accountPaytoUri;
+
+  const parsedPayto = parsePaytoUri(depositPayto);
+  if (!parsedPayto) {
+    throw Error("invalid payto");
+  }
+
+  // Work around libeufin-bank bug where receiver-name is missing
+  if (!parsedPayto.params["receiver-name"]) {
+    depositPayto = addPaytoQueryParams(depositPayto, {
+      "receiver-name": "Test",
+    });
+  }
+
+  await createDepositGroup(ws, {
+    amount: `${currency}:5` as AmountString,
+    depositPaytoUri: depositPayto,
+  });
+
   logger.trace("integration test: all done!");
 }
 

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