gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] branch master updated: -fix ID parsing


From: gnunet
Subject: [taler-wallet-core] branch master updated: -fix ID parsing
Date: Fri, 14 Oct 2022 22:49:35 +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 b36807aa0 -fix ID parsing
b36807aa0 is described below

commit b36807aa0f673d074f295d004812ba18b2ab544d
Author: Florian Dold <florian@dold.me>
AuthorDate: Fri Oct 14 22:49:32 2022 +0200

    -fix ID parsing
---
 packages/taler-wallet-core/src/operations/transactions.ts | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/packages/taler-wallet-core/src/operations/transactions.ts 
b/packages/taler-wallet-core/src/operations/transactions.ts
index 9a34379a9..c7ff4161a 100644
--- a/packages/taler-wallet-core/src/operations/transactions.ts
+++ b/packages/taler-wallet-core/src/operations/transactions.ts
@@ -954,7 +954,11 @@ export async function retryTransaction(
 ): Promise<void> {
   logger.info(`retrying transaction ${transactionId}`);
 
-  const [type, ...rest] = transactionId.split(":");
+  const [tmbPrefix, type, ...rest] = transactionId.split(":");
+
+  if (tmbPrefix !== "tmb") {
+    throw Error("invalid tombstone, expected 'tmb' prefix");
+  }
 
   switch (type) {
     case TransactionType.Deposit: {
@@ -996,7 +1000,10 @@ export async function deleteTransaction(
   ws: InternalWalletState,
   transactionId: string,
 ): Promise<void> {
-  const [typeStr, ...rest] = transactionId.split(":");
+  const [txnPrefix, typeStr, ...rest] = transactionId.split(":");
+  if (txnPrefix !== "txn") {
+    throw Error("invalid transaction ID, expected 'txn' prefix");
+  }
   const type = typeStr as TransactionType;
   if (
     type === TransactionType.Withdrawal ||

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