gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] 02/02: wallet-core: deliver kyc URL via experimental


From: gnunet
Subject: [taler-wallet-core] 02/02: wallet-core: deliver kyc URL via experimental user data
Date: Thu, 09 Nov 2023 14:54:30 +0100

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

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

commit f1e6fe17303ae21000b596b05dfb8b24163b0880
Author: Florian Dold <florian@dold.me>
AuthorDate: Thu Nov 9 14:54:15 2023 +0100

    wallet-core: deliver kyc URL via experimental user data
    
    Currently only needed by iOS, might be removed in the future.
---
 packages/taler-util/src/notifications.ts            | 13 +++++++++++--
 .../src/operations/transactions.ts                  |  2 ++
 .../taler-wallet-core/src/operations/withdraw.ts    | 21 +++++++++++++--------
 3 files changed, 26 insertions(+), 10 deletions(-)

diff --git a/packages/taler-util/src/notifications.ts 
b/packages/taler-util/src/notifications.ts
index ed26c6ae7..b91d91777 100644
--- a/packages/taler-util/src/notifications.ts
+++ b/packages/taler-util/src/notifications.ts
@@ -46,6 +46,17 @@ export interface TransactionStateTransitionNotification {
   oldTxState: TransactionState;
   newTxState: TransactionState;
   errorInfo?: ErrorInfoSummary;
+
+  /**
+   * Additional "user data" that is dependent on the
+   * state transition.
+   *
+   * Usage should be avoided.
+   *
+   * Currently used to notify the iOS app about
+   * the KYC URL.
+   */
+  experimentalUserData?: any;
 }
 
 export interface ExchangeAddedNotification {
@@ -66,13 +77,11 @@ export interface BackupOperationErrorNotification {
   error: TalerErrorDetail;
 }
 
-
 export interface PendingOperationProcessedNotification {
   type: NotificationType.PendingOperationProcessed;
   id: string;
 }
 
-
 export type WalletNotification =
   | BalanceChangeNotification
   | BackupOperationErrorNotification
diff --git a/packages/taler-wallet-core/src/operations/transactions.ts 
b/packages/taler-wallet-core/src/operations/transactions.ts
index 33ee2b424..a30120baa 100644
--- a/packages/taler-wallet-core/src/operations/transactions.ts
+++ b/packages/taler-wallet-core/src/operations/transactions.ts
@@ -1934,6 +1934,7 @@ export function notifyTransition(
   ws: InternalWalletState,
   transactionId: string,
   transitionInfo: TransitionInfo | undefined,
+  experimentalUserData: any = undefined,
 ): void {
   if (
     transitionInfo &&
@@ -1947,6 +1948,7 @@ export function notifyTransition(
       oldTxState: transitionInfo.oldTxState,
       newTxState: transitionInfo.newTxState,
       transactionId,
+      experimentalUserData,
     });
   }
   ws.workAvailable.trigger();
diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts 
b/packages/taler-wallet-core/src/operations/withdraw.ts
index 5b8d101b1..c83993816 100644
--- a/packages/taler-wallet-core/src/operations/withdraw.ts
+++ b/packages/taler-wallet-core/src/operations/withdraw.ts
@@ -781,6 +781,8 @@ async function handleKycRequired(
     throw Error(`unexpected response from kyc-check (${kycStatusRes.status})`);
   }
 
+  let notificationKycUrl: string | undefined = undefined;
+
   const transitionInfo = await ws.db
     .mktx((x) => [x.planchets, x.withdrawalGroups])
     .runReadWrite(async (tx) => {
@@ -813,10 +815,12 @@ async function handleKycRequired(
             amlStatus === AmlStatus.normal || amlStatus === undefined
               ? WithdrawalGroupStatus.PendingKyc
               : amlStatus === AmlStatus.pending
-                ? WithdrawalGroupStatus.PendingAml
-                : amlStatus === AmlStatus.fronzen
-                  ? WithdrawalGroupStatus.SuspendedAml
-                  : assertUnreachable(amlStatus);
+              ? WithdrawalGroupStatus.PendingAml
+              : amlStatus === AmlStatus.fronzen
+              ? WithdrawalGroupStatus.SuspendedAml
+              : assertUnreachable(amlStatus);
+
+          notificationKycUrl = kycUrl;
 
           await tx.withdrawalGroups.put(wg2);
           const newTxState = computeWithdrawalTransactionStatus(wg2);
@@ -829,7 +833,7 @@ async function handleKycRequired(
           return undefined;
       }
     });
-  notifyTransition(ws, transactionId, transitionInfo);
+  notifyTransition(ws, transactionId, transitionInfo, notificationKycUrl);
 }
 
 /**
@@ -1102,7 +1106,7 @@ async function processPlanchetVerifyAndStoreCoin(
         return false;
       }
       p.planchetStatus = PlanchetStatus.WithdrawalDone;
-      p.lastError = undefined
+      p.lastError = undefined;
       await tx.planchets.put(p);
       await makeCoinAvailable(ws, tx, coin);
       return true;
@@ -1150,7 +1154,8 @@ export async function updateWithdrawalDenoms(
         denom.verificationStatus === DenominationVerificationStatus.Unverified
       ) {
         logger.trace(
-          `Validating denomination (${current + 1}/${denominations.length
+          `Validating denomination (${current + 1}/${
+            denominations.length
           }) signature of ${denom.denomPubHash}`,
         );
         let valid = false;
@@ -1775,7 +1780,7 @@ export async function getExchangeWithdrawalInfo(
     ) {
       logger.warn(
         `wallet's support for exchange protocol version 
${WALLET_EXCHANGE_PROTOCOL_VERSION} might be outdated ` +
-        `(exchange has ${exchangeDetails.protocolVersionRange}), checking for 
updates`,
+          `(exchange has ${exchangeDetails.protocolVersionRange}), checking 
for updates`,
       );
     }
   }

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