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: make age restricted deposits wor


From: gnunet
Subject: [taler-wallet-core] 02/02: wallet-core: make age restricted deposits work
Date: Tue, 14 Nov 2023 17:05:51 +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 b911412ac51cd48ffb53111d2d1fe65a9ae1473a
Author: Florian Dold <florian@dold.me>
AuthorDate: Tue Nov 14 17:05:13 2023 +0100

    wallet-core: make age restricted deposits work
---
 .../{test-deposit.ts => test-age-restrictions-deposit.ts}   | 13 ++++++++++---
 packages/taler-harness/src/integrationtests/test-deposit.ts |  1 +
 packages/taler-harness/src/integrationtests/testrunner.ts   |  2 ++
 packages/taler-util/src/taler-types.ts                      |  2 ++
 packages/taler-wallet-core/src/operations/deposits.ts       |  1 +
 5 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/packages/taler-harness/src/integrationtests/test-deposit.ts 
b/packages/taler-harness/src/integrationtests/test-age-restrictions-deposit.ts
similarity index 89%
copy from packages/taler-harness/src/integrationtests/test-deposit.ts
copy to 
packages/taler-harness/src/integrationtests/test-age-restrictions-deposit.ts
index 1f50377f2..d36ba0e61 100644
--- a/packages/taler-harness/src/integrationtests/test-deposit.ts
+++ 
b/packages/taler-harness/src/integrationtests/test-age-restrictions-deposit.ts
@@ -29,15 +29,22 @@ import {
   createSimpleTestkudosEnvironmentV2,
   withdrawViaBankV2,
 } from "../harness/helpers.js";
+import { defaultCoinConfig } from "../harness/denomStructures.js";
 
 /**
  * Run test for basic, bank-integrated withdrawal and payment.
  */
-export async function runDepositTest(t: GlobalTestState) {
+export async function runAgeRestrictionsDepositTest(t: GlobalTestState) {
   // Set up test environment
 
   const { walletClient, bank, exchange } =
-    await createSimpleTestkudosEnvironmentV2(t);
+    await createSimpleTestkudosEnvironmentV2(
+      t,
+      defaultCoinConfig.map((x) => x("TESTKUDOS")),
+      {
+        ageMaskSpec: "8:10:12:14:16:18:21",
+      },
+    );
 
   // Withdraw digital cash into the wallet.
 
@@ -104,4 +111,4 @@ export async function runDepositTest(t: GlobalTestState) {
   t.assertDeepEqual(transactions.transactions[1].amountRaw, "TESTKUDOS:9.79");
 }
 
-runDepositTest.suites = ["wallet"];
+runAgeRestrictionsDepositTest.suites = ["wallet"];
diff --git a/packages/taler-harness/src/integrationtests/test-deposit.ts 
b/packages/taler-harness/src/integrationtests/test-deposit.ts
index 1f50377f2..4339e75db 100644
--- a/packages/taler-harness/src/integrationtests/test-deposit.ts
+++ b/packages/taler-harness/src/integrationtests/test-deposit.ts
@@ -29,6 +29,7 @@ import {
   createSimpleTestkudosEnvironmentV2,
   withdrawViaBankV2,
 } from "../harness/helpers.js";
+import { defaultCoinConfig } from "../harness/denomStructures.js";
 
 /**
  * Run test for basic, bank-integrated withdrawal and payment.
diff --git a/packages/taler-harness/src/integrationtests/testrunner.ts 
b/packages/taler-harness/src/integrationtests/testrunner.ts
index 968204d78..25bce5712 100644
--- a/packages/taler-harness/src/integrationtests/testrunner.ts
+++ b/packages/taler-harness/src/integrationtests/testrunner.ts
@@ -94,6 +94,7 @@ import { runWithdrawalManualTest } from 
"./test-withdrawal-manual.js";
 import { runWalletGenDbTest } from "./test-wallet-gendb.js";
 import { runLibeufinBankTest } from "./test-libeufin-bank.js";
 import { runMultiExchangeTest } from "./test-multiexchange.js";
+import { runAgeRestrictionsDepositTest } from 
"./test-age-restrictions-deposit.js";
 
 /**
  * Test runner.
@@ -114,6 +115,7 @@ const allTests: TestMainFunction[] = [
   runAgeRestrictionsMerchantTest,
   runAgeRestrictionsMixedMerchantTest,
   runAgeRestrictionsPeerTest,
+  runAgeRestrictionsDepositTest,
   runBankApiTest,
   runClaimLoopTest,
   runClauseSchnorrTest,
diff --git a/packages/taler-util/src/taler-types.ts 
b/packages/taler-util/src/taler-types.ts
index 87925a3a4..c0c8cc17d 100644
--- a/packages/taler-util/src/taler-types.ts
+++ b/packages/taler-util/src/taler-types.ts
@@ -2275,6 +2275,8 @@ export interface BatchDepositRequestCoin {
   // Signature over `TALER_DepositRequestPS`, made by the customer with the
   // `coin's private key <coin-priv>`.
   coin_sig: EddsaSignatureString;
+
+  h_age_commitment?: string;
 }
 
 export interface WalletKycUuid {
diff --git a/packages/taler-wallet-core/src/operations/deposits.ts 
b/packages/taler-wallet-core/src/operations/deposits.ts
index 111d15989..de413a514 100644
--- a/packages/taler-wallet-core/src/operations/deposits.ts
+++ b/packages/taler-wallet-core/src/operations/deposits.ts
@@ -954,6 +954,7 @@ async function processDepositGroupPendingDeposit(
         contribution: Amounts.stringify(perm.contribution),
         denom_pub_hash: perm.h_denom,
         ub_sig: perm.ub_sig,
+        h_age_commitment: perm.h_age_commitment,
       });
       batchIndexes.push(i);
     }

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