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: iban workaround


From: gnunet
Subject: [taler-wallet-core] branch master updated: wallet-core: iban workaround
Date: Thu, 11 May 2023 13:04:18 +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 07bf3d5b8 wallet-core: iban workaround
07bf3d5b8 is described below

commit 07bf3d5b8f1b57f4881a023c4ee7123761248db9
Author: Florian Dold <florian@dold.me>
AuthorDate: Thu May 11 13:04:09 2023 +0200

    wallet-core: iban workaround
---
 packages/taler-wallet-core/src/bank-api-client.ts | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/packages/taler-wallet-core/src/bank-api-client.ts 
b/packages/taler-wallet-core/src/bank-api-client.ts
index 677581e22..ead985a58 100644
--- a/packages/taler-wallet-core/src/bank-api-client.ts
+++ b/packages/taler-wallet-core/src/bank-api-client.ts
@@ -29,6 +29,7 @@ import {
   codecForAny,
   codecForString,
   encodeCrock,
+  generateIban,
   getRandomBytes,
   j2s,
   Logger,
@@ -107,9 +108,16 @@ export namespace BankApi {
     bank: BankServiceHandle,
     username: string,
     password: string,
+    options: {
+      iban?: string;
+    },
   ): Promise<BankUser> {
     const url = new URL("testing/register", bank.bankAccessApiBaseUrl);
-    const resp = await bank.http.postJson(url.href, { username, password });
+    const resp = await bank.http.postJson(url.href, {
+      username,
+      password,
+      iban: options.iban,
+    });
     let paytoUri = `payto://x-taler-bank/localhost/${username}`;
     if (resp.status !== 200 && resp.status !== 202 && resp.status !== 204) {
       logger.error(`${j2s(await resp.json())}`);
@@ -143,7 +151,11 @@ export namespace BankApi {
   ): Promise<BankUser> {
     const username = "user-" + encodeCrock(getRandomBytes(10)).toLowerCase();
     const password = "pw-" + encodeCrock(getRandomBytes(10)).toLowerCase();
-    return await registerAccount(bank, username, password);
+    // FIXME: This is just a temporary workaround, because demobank is running 
out of short IBANs
+    const iban = generateIban("DE", 15);
+    return await registerAccount(bank, username, password, {
+      iban,
+    });
   }
 
   export async function confirmWithdrawalOperation(

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