gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] branch master updated (a63dd3900 -> b4ab2fcdf)


From: gnunet
Subject: [taler-wallet-core] branch master updated (a63dd3900 -> b4ab2fcdf)
Date: Fri, 08 Mar 2024 01:06:17 +0100

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

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

    from a63dd3900 remove deprecated function, remove outdated FIXMEs
     add ae34a78ff bump debian version to 0.9.4a
     new b4ab2fcdf wallet-core: remove deprecated peer...PaymentId

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 packages/taler-harness/debian/changelog            |  6 ++++++
 .../src/integrationtests/test-peer-repair.ts       |  2 +-
 .../src/integrationtests/test-peer-to-peer-pull.ts |  4 ++--
 packages/taler-util/src/wallet-types.ts            | 24 ++++------------------
 packages/taler-wallet-cli/debian/changelog         |  6 ++++++
 packages/taler-wallet-cli/src/index.ts             |  5 +++--
 .../taler-wallet-core/src/pay-peer-pull-debit.ts   | 17 +++++----------
 .../taler-wallet-core/src/pay-peer-push-credit.ts  | 22 ++++++++------------
 packages/taler-wallet-core/src/testing.ts          |  2 +-
 .../src/cta/InvoicePay/state.ts                    | 12 ++++-------
 .../src/cta/TransferPickup/state.ts                |  8 ++++----
 11 files changed, 44 insertions(+), 64 deletions(-)

diff --git a/packages/taler-harness/debian/changelog 
b/packages/taler-harness/debian/changelog
index 08dfbbd7a..0aa9ccfbd 100644
--- a/packages/taler-harness/debian/changelog
+++ b/packages/taler-harness/debian/changelog
@@ -1,3 +1,9 @@
+taler-harness (0.9.4a) unstable; urgency=low
+
+  * Release v0.9.4a.
+
+ -- Florian Dold <dold@taler.net>  Thu, 07 Mar 2024 23:43:05 +0100
+
 taler-harness (0.9.3-1) unstable; urgency=low
 
   * Misc bugfixes.
diff --git a/packages/taler-harness/src/integrationtests/test-peer-repair.ts 
b/packages/taler-harness/src/integrationtests/test-peer-repair.ts
index 22664bcc1..8bc7ed0a1 100644
--- a/packages/taler-harness/src/integrationtests/test-peer-repair.ts
+++ b/packages/taler-harness/src/integrationtests/test-peer-repair.ts
@@ -138,7 +138,7 @@ export async function runPeerRepairTest(t: GlobalTestState) 
{
   );
 
   await wallet2.client.call(WalletApiOperation.ConfirmPeerPushCredit, {
-    peerPushCreditId: resp2.peerPushCreditId,
+    transactionId: resp2.transactionId,
   });
 
   await peerPushCreditDone1Cond;
diff --git 
a/packages/taler-harness/src/integrationtests/test-peer-to-peer-pull.ts 
b/packages/taler-harness/src/integrationtests/test-peer-to-peer-pull.ts
index b61a3941b..e1565f295 100644
--- a/packages/taler-harness/src/integrationtests/test-peer-to-peer-pull.ts
+++ b/packages/taler-harness/src/integrationtests/test-peer-to-peer-pull.ts
@@ -157,7 +157,7 @@ async function checkNormalPeerPull(
   );
 
   await wallet2.client.call(WalletApiOperation.ConfirmPeerPullDebit, {
-    peerPullDebitId: checkResp.peerPullDebitId,
+    transactionId: checkResp.transactionId,
   });
 
   await peerPullCreditDoneCond;
@@ -257,7 +257,7 @@ async function checkAbortedPeerPull(
   });
 
   await wallet2.client.call(WalletApiOperation.ConfirmPeerPullDebit, {
-    peerPullDebitId: checkResp.peerPullDebitId,
+    transactionId: checkResp.transactionId,
   });
 
   console.log(`waiting for ${resp.transactionId} to go to state aborted`);
diff --git a/packages/taler-util/src/wallet-types.ts 
b/packages/taler-util/src/wallet-types.ts
index 599f65731..4ebaa3668 100644
--- a/packages/taler-util/src/wallet-types.ts
+++ b/packages/taler-util/src/wallet-types.ts
@@ -2766,14 +2766,7 @@ export const codecForCheckPeerPullPaymentRequest =
       .build("PreparePeerPullDebitRequest");
 
 export interface ConfirmPeerPushCreditRequest {
-  /**
-   * Transparent identifier of the incoming peer push payment.
-   *
-   * @deprecated specify transactionId instead!
-   */
-  peerPushCreditId?: string;
-
-  transactionId?: string;
+  transactionId: string;
 }
 export interface AcceptPeerPushPaymentResponse {
   transactionId: TransactionIdStr;
@@ -2786,19 +2779,11 @@ export interface AcceptPeerPullPaymentResponse {
 export const codecForConfirmPeerPushPaymentRequest =
   (): Codec<ConfirmPeerPushCreditRequest> =>
     buildCodecForObject<ConfirmPeerPushCreditRequest>()
-      .property("peerPushCreditId", codecOptional(codecForString()))
-      .property("transactionId", codecOptional(codecForString()))
+      .property("transactionId", codecForString())
       .build("ConfirmPeerPushCreditRequest");
 
 export interface ConfirmPeerPullDebitRequest {
-  /**
-   * Transparent identifier of the incoming peer pull payment.
-   *
-   * @deprecated use transactionId instead
-   */
-  peerPullDebitId?: string;
-
-  transactionId?: TransactionIdStr;
+  transactionId: TransactionIdStr;
 }
 
 export interface ApplyDevExperimentRequest {
@@ -2814,8 +2799,7 @@ export const codecForApplyDevExperiment =
 export const codecForAcceptPeerPullPaymentRequest =
   (): Codec<ConfirmPeerPullDebitRequest> =>
     buildCodecForObject<ConfirmPeerPullDebitRequest>()
-      .property("peerPullDebitId", codecOptional(codecForString()))
-      .property("transactionId", codecOptional(codecForTransactionIdStr()))
+      .property("transactionId", codecForTransactionIdStr())
       .build("ConfirmPeerPullDebitRequest");
 
 export interface CheckPeerPullCreditRequest {
diff --git a/packages/taler-wallet-cli/debian/changelog 
b/packages/taler-wallet-cli/debian/changelog
index c6c788a52..dfcfa4f03 100644
--- a/packages/taler-wallet-cli/debian/changelog
+++ b/packages/taler-wallet-cli/debian/changelog
@@ -1,3 +1,9 @@
+taler-harness (0.9.4a) unstable; urgency=low
+
+  * Release v0.9.4a.
+
+ -- Florian Dold <dold@taler.net>  Thu, 07 Mar 2024 23:43:05 +0100
+
 taler-wallet-cli (0.9.3-1) unstable; urgency=low
 
   * Misc bugfixes.
diff --git a/packages/taler-wallet-cli/src/index.ts 
b/packages/taler-wallet-cli/src/index.ts
index 5c0bfe3cf..32b1eb901 100644
--- a/packages/taler-wallet-cli/src/index.ts
+++ b/packages/taler-wallet-cli/src/index.ts
@@ -1057,13 +1057,14 @@ peerCli
 
 peerCli
   .subcommand("confirmIncomingPayPull", "confirm-pull-debit")
-  .requiredArgument("peerPullDebitId", clk.STRING)
+  .requiredArgument("transactionId", clk.STRING)
   .action(async (args) => {
     await withWallet(args, async (wallet) => {
       const resp = await wallet.client.call(
         WalletApiOperation.ConfirmPeerPullDebit,
         {
-          peerPullDebitId: args.confirmIncomingPayPull.peerPullDebitId,
+          transactionId: args.confirmIncomingPayPull
+            .transactionId as TransactionIdStr,
         },
       );
       console.log(JSON.stringify(resp, undefined, 2));
diff --git a/packages/taler-wallet-core/src/pay-peer-pull-debit.ts 
b/packages/taler-wallet-core/src/pay-peer-pull-debit.ts
index 0ccca82a2..114d2366a 100644
--- a/packages/taler-wallet-core/src/pay-peer-pull-debit.ts
+++ b/packages/taler-wallet-core/src/pay-peer-pull-debit.ts
@@ -561,18 +561,11 @@ export async function confirmPeerPullDebit(
   req: ConfirmPeerPullDebitRequest,
 ): Promise<AcceptPeerPullPaymentResponse> {
   let peerPullDebitId: string;
-
-  if (req.transactionId) {
-    const parsedTx = parseTransactionIdentifier(req.transactionId);
-    if (!parsedTx || parsedTx.tag !== TransactionType.PeerPullDebit) {
-      throw Error("invalid peer-pull-debit transaction identifier");
-    }
-    peerPullDebitId = parsedTx.peerPullDebitId;
-  } else if (req.peerPullDebitId) {
-    peerPullDebitId = req.peerPullDebitId;
-  } else {
-    throw Error("invalid request, transactionId or peerPullDebitId required");
+  const parsedTx = parseTransactionIdentifier(req.transactionId);
+  if (!parsedTx || parsedTx.tag !== TransactionType.PeerPullDebit) {
+    throw Error("invalid peer-pull-debit transaction identifier");
   }
+  peerPullDebitId = parsedTx.peerPullDebitId;
 
   const peerPullInc = await wex.db.runReadOnlyTx(
     ["peerPullDebit"],
@@ -583,7 +576,7 @@ export async function confirmPeerPullDebit(
 
   if (!peerPullInc) {
     throw Error(
-      `can't accept unknown incoming p2p pull payment 
(${req.peerPullDebitId})`,
+      `can't accept unknown incoming p2p pull payment (${req.transactionId})`,
     );
   }
 
diff --git a/packages/taler-wallet-core/src/pay-peer-push-credit.ts 
b/packages/taler-wallet-core/src/pay-peer-push-credit.ts
index f6ba429a6..ecc1e827f 100644
--- a/packages/taler-wallet-core/src/pay-peer-push-credit.ts
+++ b/packages/taler-wallet-core/src/pay-peer-push-credit.ts
@@ -901,20 +901,14 @@ export async function confirmPeerPushCredit(
 ): Promise<AcceptPeerPushPaymentResponse> {
   let peerInc: PeerPushPaymentIncomingRecord | undefined;
   let peerPushCreditId: string;
-  if (req.peerPushCreditId) {
-    peerPushCreditId = req.peerPushCreditId;
-  } else if (req.transactionId) {
-    const parsedTx = parseTransactionIdentifier(req.transactionId);
-    if (!parsedTx) {
-      throw Error("invalid transaction ID");
-    }
-    if (parsedTx.tag !== TransactionType.PeerPushCredit) {
-      throw Error("invalid transaction ID type");
-    }
-    peerPushCreditId = parsedTx.peerPushCreditId;
-  } else {
-    throw Error("no transaction ID (or deprecated peerPushCreditId) provided");
+  const parsedTx = parseTransactionIdentifier(req.transactionId);
+  if (!parsedTx) {
+    throw Error("invalid transaction ID");
+  }
+  if (parsedTx.tag !== TransactionType.PeerPushCredit) {
+    throw Error("invalid transaction ID type");
   }
+  peerPushCreditId = parsedTx.peerPushCreditId;
 
   logger.trace(`confirming peer-push-credit ${peerPushCreditId}`);
 
@@ -934,7 +928,7 @@ export async function confirmPeerPushCredit(
 
   if (!peerInc) {
     throw Error(
-      `can't accept unknown incoming p2p push payment 
(${req.peerPushCreditId})`,
+      `can't accept unknown incoming p2p push payment (${req.transactionId})`,
     );
   }
 
diff --git a/packages/taler-wallet-core/src/testing.ts 
b/packages/taler-wallet-core/src/testing.ts
index 795f963d0..b192e7b70 100644
--- a/packages/taler-wallet-core/src/testing.ts
+++ b/packages/taler-wallet-core/src/testing.ts
@@ -821,7 +821,7 @@ export async function runIntegrationTest2(
   });
 
   await confirmPeerPullDebit(wex, {
-    peerPullDebitId: peerPullInc.peerPullDebitId,
+    transactionId: peerPullInc.transactionId,
   });
 
   await waitUntilTransactionWithAssociatedRefreshesFinal(
diff --git a/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts 
b/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts
index ff9c7e5c7..99de03d2d 100644
--- a/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts
+++ b/packages/taler-wallet-webextension/src/cta/InvoicePay/state.ts
@@ -23,10 +23,10 @@ import {
   TalerProtocolTimestamp,
 } from "@gnu-taler/taler-util";
 import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
+import { useTranslationContext } from "@gnu-taler/web-util/browser";
 import { useEffect } from "preact/hooks";
 import { alertFromError, useAlertContext } from "../../context/alert.js";
 import { useBackendContext } from "../../context/backend.js";
-import { useTranslationContext } from "@gnu-taler/web-util/browser";
 import { useAsyncAsHook } from "../../hooks/useAsyncAsHook.js";
 import { Props, State } from "./index.js";
 
@@ -77,12 +77,8 @@ export function useComponentState({
   //   };
   // }
 
-  const {
-    contractTerms,
-    peerPullDebitId,
-    amountEffective,
-    amountRaw,
-  } = hook.response.p2p;
+  const { contractTerms, transactionId, amountEffective, amountRaw } =
+    hook.response.p2p;
 
   const amountStr: string = contractTerms.amount;
   const amount = Amounts.parseOrThrow(amountStr);
@@ -156,7 +152,7 @@ export function useComponentState({
     const resp = await api.wallet.call(
       WalletApiOperation.ConfirmPeerPullDebit,
       {
-        peerPullDebitId,
+        transactionId,
       },
     );
     onSuccess(resp.transactionId);
diff --git a/packages/taler-wallet-webextension/src/cta/TransferPickup/state.ts 
b/packages/taler-wallet-webextension/src/cta/TransferPickup/state.ts
index 50b9e5fe7..67f6d9113 100644
--- a/packages/taler-wallet-webextension/src/cta/TransferPickup/state.ts
+++ b/packages/taler-wallet-webextension/src/cta/TransferPickup/state.ts
@@ -20,9 +20,9 @@ import {
   TalerProtocolTimestamp,
 } from "@gnu-taler/taler-util";
 import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
+import { useTranslationContext } from "@gnu-taler/web-util/browser";
 import { alertFromError, useAlertContext } from "../../context/alert.js";
 import { useBackendContext } from "../../context/backend.js";
-import { useTranslationContext } from "@gnu-taler/web-util/browser";
 import { useAsyncAsHook } from "../../hooks/useAsyncAsHook.js";
 import { Props, State } from "./index.js";
 
@@ -59,10 +59,10 @@ export function useComponentState({
 
   const {
     contractTerms,
-    peerPushCreditId,
+    transactionId,
     amountEffective,
     amountRaw,
-    exchangeBaseUrl
+    exchangeBaseUrl,
   } = hook.response;
 
   const effective = Amounts.parseOrThrow(amountEffective);
@@ -74,7 +74,7 @@ export function useComponentState({
     const resp = await api.wallet.call(
       WalletApiOperation.ConfirmPeerPushCredit,
       {
-        peerPushCreditId,
+        transactionId,
       },
     );
     onSuccess(resp.transactionId);

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