gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] branch master updated: -remove remaining usage of de


From: gnunet
Subject: [taler-wallet-core] branch master updated: -remove remaining usage of deprecated field
Date: Thu, 16 Nov 2023 13:57:29 +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 b3194005f -remove remaining usage of deprecated field
b3194005f is described below

commit b3194005f98f16f7c22b1f013b61daffd78c6b39
Author: Florian Dold <florian@dold.me>
AuthorDate: Thu Nov 16 13:47:21 2023 +0100

    -remove remaining usage of deprecated field
---
 .../src/integrationtests/test-age-restrictions-peer.ts | 17 ++++++++++-------
 .../src/integrationtests/test-peer-repair.ts           | 13 +++++++------
 .../src/integrationtests/test-peer-to-peer-push.ts     | 18 +++++++++++-------
 packages/taler-wallet-core/src/operations/testing.ts   | 14 +++++++++++++-
 4 files changed, 41 insertions(+), 21 deletions(-)

diff --git 
a/packages/taler-harness/src/integrationtests/test-age-restrictions-peer.ts 
b/packages/taler-harness/src/integrationtests/test-age-restrictions-peer.ts
index a58622f74..aea59b706 100644
--- a/packages/taler-harness/src/integrationtests/test-age-restrictions-peer.ts
+++ b/packages/taler-harness/src/integrationtests/test-age-restrictions-peer.ts
@@ -25,7 +25,7 @@ import {
   TalerUriAction,
   TransactionMajorState,
   TransactionMinorState,
-  stringifyTalerUri,
+  TransactionType,
 } from "@gnu-taler/taler-util";
 import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
 import { defaultCoinConfig } from "../harness/denomStructures.js";
@@ -101,16 +101,19 @@ export async function runAgeRestrictionsPeerTest(t: 
GlobalTestState) {
 
     await peerPushReadyCond;
 
-    const talerUri = stringifyTalerUri({
-      type: TalerUriAction.PayPush,
-      exchangeBaseUrl: initResp.exchangeBaseUrl,
-      contractPriv: initResp.contractPriv,
-    })
+    const txDetails = await wallet1.call(
+      WalletApiOperation.GetTransactionById,
+      {
+        transactionId: initResp.transactionId,
+      },
+    );
+    t.assertDeepEqual(txDetails.type, TransactionType.PeerPushDebit);
+    t.assertTrue(!!txDetails.talerUri);
 
     const checkResp = await wallet2.call(
       WalletApiOperation.PreparePeerPushCredit,
       {
-        talerUri,
+        talerUri: txDetails.talerUri,
       },
     );
 
diff --git a/packages/taler-harness/src/integrationtests/test-peer-repair.ts 
b/packages/taler-harness/src/integrationtests/test-peer-repair.ts
index b3adf959b..a225a2057 100644
--- a/packages/taler-harness/src/integrationtests/test-peer-repair.ts
+++ b/packages/taler-harness/src/integrationtests/test-peer-repair.ts
@@ -25,6 +25,7 @@ import {
   TalerUriAction,
   TransactionMajorState,
   TransactionMinorState,
+  TransactionType,
   WalletNotification,
   stringifyTalerUri,
 } from "@gnu-taler/taler-util";
@@ -111,16 +112,16 @@ export async function runPeerRepairTest(t: 
GlobalTestState) {
 
   await peerPushDebitReady1Cond;
 
-  const talerUri = stringifyTalerUri({
-    type: TalerUriAction.PayPush,
-    exchangeBaseUrl: resp1.exchangeBaseUrl,
-    contractPriv: resp1.contractPriv,
-  })
+  const txDetails = await wallet1.call(WalletApiOperation.GetTransactionById, {
+    transactionId: resp1.transactionId,
+  });
+  t.assertDeepEqual(txDetails.type, TransactionType.PeerPushDebit);
+  t.assertTrue(!!txDetails.talerUri);
 
   const resp2 = await wallet2.client.call(
     WalletApiOperation.PreparePeerPushCredit,
     {
-      talerUri,
+      talerUri: txDetails.talerUri,
     },
   );
 
diff --git 
a/packages/taler-harness/src/integrationtests/test-peer-to-peer-push.ts 
b/packages/taler-harness/src/integrationtests/test-peer-to-peer-push.ts
index 514b67e7d..a98ea89bb 100644
--- a/packages/taler-harness/src/integrationtests/test-peer-to-peer-push.ts
+++ b/packages/taler-harness/src/integrationtests/test-peer-to-peer-push.ts
@@ -25,6 +25,7 @@ import {
   TalerUriAction,
   TransactionMajorState,
   TransactionMinorState,
+  TransactionType,
   WalletNotification,
   j2s,
   stringifyTalerUri,
@@ -117,16 +118,19 @@ export async function runPeerToPeerPushTest(t: 
GlobalTestState) {
 
   await peerPushReadyCond;
 
-  const talerUri = stringifyTalerUri({
-    type: TalerUriAction.PayPush,
-    exchangeBaseUrl: resp.exchangeBaseUrl,
-    contractPriv: resp.contractPriv,
-  })
+  const txDetails = await w1.walletClient.call(
+    WalletApiOperation.GetTransactionById,
+    {
+      transactionId: resp.transactionId,
+    },
+  );
+  t.assertDeepEqual(txDetails.type, TransactionType.PeerPushDebit);
+  t.assertTrue(!!txDetails.talerUri);
 
-const checkResp = await w2.walletClient.call(
+  const checkResp = await w2.walletClient.call(
     WalletApiOperation.PreparePeerPushCredit,
     {
-      talerUri,
+      talerUri: txDetails.talerUri,
     },
   );
 
diff --git a/packages/taler-wallet-core/src/operations/testing.ts 
b/packages/taler-wallet-core/src/operations/testing.ts
index 904403dd5..1981519f1 100644
--- a/packages/taler-wallet-core/src/operations/testing.ts
+++ b/packages/taler-wallet-core/src/operations/testing.ts
@@ -686,8 +686,20 @@ export async function runIntegrationTest2(
     contractPriv: peerPushInit.contractPriv,
   })
 
+  const txDetails = await getTransactionById(ws, {
+    transactionId: peerPushInit.transactionId,
+  });
+
+  if (txDetails.type !== TransactionType.PeerPushDebit) {
+    throw Error("internal invariant failed");
+  }
+
+  if (!txDetails.talerUri) {
+    throw Error("internal invariant failed");
+  }
+
   const peerPushCredit = await preparePeerPushCredit(ws, {
-    talerUri,
+    talerUri: txDetails.talerUri,
   });
 
   await confirmPeerPushCredit(ws, {

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