gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] branch master updated (2f6225f6e -> 3c50b1233)


From: gnunet
Subject: [taler-wallet-core] branch master updated (2f6225f6e -> 3c50b1233)
Date: Tue, 01 Nov 2022 12:01:24 +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 2f6225f6e taler-util: fix config utils for ESM
     new dab739a63 wallet-core: use PeerContractTerms
     new 3c50b1233 taler-wallet-cli: fix sourcemap support

The 2 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-util/src/taler-types.ts             |  7 +++--
 packages/taler-util/src/wallet-types.ts            | 10 +++---
 packages/taler-wallet-cli/bin/taler-wallet-cli.mjs | 36 ++++++++++++++++------
 packages/taler-wallet-cli/src/harness/helpers.ts   |  4 +--
 .../src/harness/merchantApiTypes.ts                |  8 ++---
 .../src/integrationtests/test-libeufin-basic.ts    |  4 +--
 packages/taler-wallet-core/src/db.ts               |  9 +++---
 .../taler-wallet-core/src/operations/deposits.ts   |  6 ++--
 .../src/operations/pay-merchant.ts                 |  6 ++--
 .../src/cta/Payment/stories.tsx                    |  3 +-
 .../src/cta/Payment/views.tsx                      |  5 +--
 11 files changed, 55 insertions(+), 43 deletions(-)

diff --git a/packages/taler-util/src/taler-types.ts 
b/packages/taler-util/src/taler-types.ts
index e6223ca76..134f59836 100644
--- a/packages/taler-util/src/taler-types.ts
+++ b/packages/taler-util/src/taler-types.ts
@@ -413,8 +413,9 @@ export interface InternationalizedString {
 
 /**
  * Contract terms from a merchant.
+ * FIXME: Add type field!
  */
-export interface ContractTerms {
+export interface MerchantContractTerms {
   /**
    * Hash of the merchant's wire details.
    */
@@ -1310,8 +1311,8 @@ export const codecForProduct = (): Codec<Product> =>
     .property("price", codecOptional(codecForString()))
     .build("Tax");
 
-export const codecForContractTerms = (): Codec<ContractTerms> =>
-  buildCodecForObject<ContractTerms>()
+export const codecForContractTerms = (): Codec<MerchantContractTerms> =>
+  buildCodecForObject<MerchantContractTerms>()
     .property("order_id", codecForString())
     .property("fulfillment_url", codecOptional(codecForString()))
     .property("fulfillment_message", codecOptional(codecForString()))
diff --git a/packages/taler-util/src/wallet-types.ts 
b/packages/taler-util/src/wallet-types.ts
index 614610bb1..fc69fd9cb 100644
--- a/packages/taler-util/src/wallet-types.ts
+++ b/packages/taler-util/src/wallet-types.ts
@@ -55,7 +55,7 @@ import {
   AuditorDenomSig,
   codecForContractTerms,
   CoinEnvelope,
-  ContractTerms,
+  MerchantContractTerms,
   DenominationPubKey,
   DenomKeyType,
   ExchangeAuditor,
@@ -229,7 +229,7 @@ export enum ConfirmPayResultType {
  */
 export interface ConfirmPayResultDone {
   type: ConfirmPayResultType.Done;
-  contractTerms: ContractTerms;
+  contractTerms: MerchantContractTerms;
   transactionId: string;
 }
 
@@ -529,7 +529,7 @@ export type PreparePayResult =
 export interface PreparePayResultPaymentPossible {
   status: PreparePayResultType.PaymentPossible;
   proposalId: string;
-  contractTerms: ContractTerms;
+  contractTerms: MerchantContractTerms;
   contractTermsHash: string;
   amountRaw: string;
   amountEffective: string;
@@ -539,14 +539,14 @@ export interface PreparePayResultPaymentPossible {
 export interface PreparePayResultInsufficientBalance {
   status: PreparePayResultType.InsufficientBalance;
   proposalId: string;
-  contractTerms: ContractTerms;
+  contractTerms: MerchantContractTerms;
   amountRaw: string;
   noncePriv: string;
 }
 
 export interface PreparePayResultAlreadyConfirmed {
   status: PreparePayResultType.AlreadyConfirmed;
-  contractTerms: ContractTerms;
+  contractTerms: MerchantContractTerms;
   paid: boolean;
   amountRaw: string;
   amountEffective: string;
diff --git a/packages/taler-wallet-cli/bin/taler-wallet-cli.mjs 
b/packages/taler-wallet-cli/bin/taler-wallet-cli.mjs
index e0f6630b5..a06b0f637 100755
--- a/packages/taler-wallet-cli/bin/taler-wallet-cli.mjs
+++ b/packages/taler-wallet-cli/bin/taler-wallet-cli.mjs
@@ -1,15 +1,31 @@
 #!/usr/bin/env node
+/*
+ This file is part of GNU Taler
+ (C) 2022 Taler Systems SA
 
-import { main } from '../dist/taler-wallet-cli.mjs';
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
 
-async function run() {
-  try {
-    (await import('source-map-support')).install();
-  } catch (e) {
-    // Do nothing.
-  }
-  main();
-}
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+ */
 
-run();
+import { main } from '../dist/taler-wallet-cli.mjs';
+import { createRequire } from "module";
+const require = createRequire(import.meta.url);
+
+const doLog = process.env["TALER_DEBUG_SOURCEMAPS"] == "1";
 
+try {
+  require("source-map-support");
+  doLog && console.error("source map support installed");
+} catch (e) {
+  // Do nothing.
+  doLog && console.error("source map support not installed", e);
+}
+main();
diff --git a/packages/taler-wallet-cli/src/harness/helpers.ts 
b/packages/taler-wallet-cli/src/harness/helpers.ts
index aa970f76b..affaccd61 100644
--- a/packages/taler-wallet-cli/src/harness/helpers.ts
+++ b/packages/taler-wallet-cli/src/harness/helpers.ts
@@ -26,7 +26,7 @@
 import {
   AmountString,
   ConfirmPayResultType,
-  ContractTerms,
+  MerchantContractTerms,
   Duration,
   PreparePayResultType,
 } from "@gnu-taler/taler-util";
@@ -381,7 +381,7 @@ export async function makeTestPayment(
   args: {
     merchant: MerchantServiceInterface;
     wallet: WalletCli;
-    order: Partial<ContractTerms>;
+    order: Partial<MerchantContractTerms>;
     instance?: string;
   },
   auth: WithAuthorization = {},
diff --git a/packages/taler-wallet-cli/src/harness/merchantApiTypes.ts 
b/packages/taler-wallet-cli/src/harness/merchantApiTypes.ts
index 8b10bb749..dc9132b3e 100644
--- a/packages/taler-wallet-cli/src/harness/merchantApiTypes.ts
+++ b/packages/taler-wallet-cli/src/harness/merchantApiTypes.ts
@@ -25,7 +25,7 @@
  * Imports.
  */
 import {
-  ContractTerms,
+  MerchantContractTerms,
   Duration,
   Codec,
   buildCodecForObject,
@@ -50,7 +50,7 @@ import {
 export interface PostOrderRequest {
   // The order must at least contain the minimal
   // order detail, but can override all
-  order: Partial<ContractTerms>;
+  order: Partial<MerchantContractTerms>;
 
   // if set, the backend will then set the refund deadline to the current
   // time plus the specified delay.
@@ -143,7 +143,7 @@ export interface CheckPaymentClaimedResponse {
   // Wallet claimed the order, but didn't pay yet.
   order_status: "claimed";
 
-  contract_terms: ContractTerms;
+  contract_terms: MerchantContractTerms;
 }
 
 export interface CheckPaymentPaidResponse {
@@ -175,7 +175,7 @@ export interface CheckPaymentPaidResponse {
   refund_amount: AmountString;
 
   // Contract terms
-  contract_terms: ContractTerms;
+  contract_terms: MerchantContractTerms;
 
   // Ihe wire transfer status from the exchange for this order if available, 
otherwise empty array
   wire_details: TransactionWireTransfer[];
diff --git 
a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-basic.ts 
b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-basic.ts
index 300967c7a..8002f093f 100644
--- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-basic.ts
+++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-basic.ts
@@ -17,7 +17,7 @@
 /**
  * Imports.
  */
-import { AbsoluteTime, ContractTerms, Duration } from "@gnu-taler/taler-util";
+import { AbsoluteTime, MerchantContractTerms, Duration } from 
"@gnu-taler/taler-util";
 import {
   WalletApiOperation,
   HarnessExchangeBankAccount,
@@ -271,7 +271,7 @@ export async function runLibeufinBasicTest(t: 
GlobalTestState) {
   console.log("balances", JSON.stringify(bal, undefined, 2));
   t.assertAmountEquals(bal.balances[0].available, "EUR:14.7");
 
-  const order: Partial<ContractTerms> = {
+  const order: Partial<MerchantContractTerms> = {
     summary: "Buy me!",
     amount: "EUR:5",
     fulfillment_url: "taler://fulfillment-success/thx",
diff --git a/packages/taler-wallet-core/src/db.ts 
b/packages/taler-wallet-core/src/db.ts
index c3fce6404..3abb76d60 100644
--- a/packages/taler-wallet-core/src/db.ts
+++ b/packages/taler-wallet-core/src/db.ts
@@ -25,7 +25,7 @@ import {
   CoinEnvelope,
   CoinRefreshRequest,
   CoinStatus,
-  ContractTerms,
+  MerchantContractTerms,
   DenominationInfo,
   DenominationPubKey,
   DenomSelectionState,
@@ -1572,7 +1572,7 @@ export interface DepositGroupRecord {
   /**
    * Verbatim contract terms.
    */
-  contractTermsRaw: ContractTerms;
+  contractTermsRaw: MerchantContractTerms;
 
   contractTermsHash: string;
 
@@ -1707,10 +1707,9 @@ export interface PeerPullPaymentInitiationRecord {
   /**
    * Contract terms for the other party.
    *
-   * FIXME: Nail down type!
-   * FIXME: Put in contractTerms store
+   * FIXME: Put into contract terms store.
    */
-  contractTerms: any;
+  contractTerms: PeerContractTerms;
 }
 
 /**
diff --git a/packages/taler-wallet-core/src/operations/deposits.ts 
b/packages/taler-wallet-core/src/operations/deposits.ts
index 4d617ee13..b2bd18260 100644
--- a/packages/taler-wallet-core/src/operations/deposits.ts
+++ b/packages/taler-wallet-core/src/operations/deposits.ts
@@ -24,7 +24,7 @@ import {
   CancellationToken,
   canonicalJson,
   codecForDepositSuccess,
-  ContractTerms,
+  MerchantContractTerms,
   CreateDepositGroupRequest,
   CreateDepositGroupResponse,
   DepositGroupFees,
@@ -310,7 +310,7 @@ export async function prepareDepositGroup(
 
   const now = AbsoluteTime.now();
   const nowRounded = AbsoluteTime.toTimestamp(now);
-  const contractTerms: ContractTerms = {
+  const contractTerms: MerchantContractTerms = {
     auditors: [],
     exchanges: exchangeInfos,
     amount: req.amount,
@@ -407,7 +407,7 @@ export async function createDepositGroup(
   const merchantPair = await ws.cryptoApi.createEddsaKeypair({});
   const wireSalt = encodeCrock(getRandomBytes(16));
   const wireHash = hashWire(req.depositPaytoUri, wireSalt);
-  const contractTerms: ContractTerms = {
+  const contractTerms: MerchantContractTerms = {
     auditors: [],
     exchanges: exchangeInfos,
     amount: req.amount,
diff --git a/packages/taler-wallet-core/src/operations/pay-merchant.ts 
b/packages/taler-wallet-core/src/operations/pay-merchant.ts
index b085e3f53..2eb5b18e9 100644
--- a/packages/taler-wallet-core/src/operations/pay-merchant.ts
+++ b/packages/taler-wallet-core/src/operations/pay-merchant.ts
@@ -44,7 +44,7 @@ import {
   CoinStatus,
   ConfirmPayResult,
   ConfirmPayResultType,
-  ContractTerms,
+  MerchantContractTerms,
   ContractTermsUtil,
   DenominationInfo,
   Duration,
@@ -298,7 +298,7 @@ export async function expectProposalDownload(
 }
 
 export function extractContractData(
-  parsedContractTerms: ContractTerms,
+  parsedContractTerms: MerchantContractTerms,
   contractTermsHash: string,
   merchantSig: string,
 ): WalletContractData {
@@ -453,7 +453,7 @@ export async function processDownloadProposal(
 
   logger.info(`Contract terms hash: ${contractTermsHash}`);
 
-  let parsedContractTerms: ContractTerms;
+  let parsedContractTerms: MerchantContractTerms;
 
   try {
     parsedContractTerms = codecForContractTerms().decode(
diff --git a/packages/taler-wallet-webextension/src/cta/Payment/stories.tsx 
b/packages/taler-wallet-webextension/src/cta/Payment/stories.tsx
index c499dc285..7d5a7694e 100644
--- a/packages/taler-wallet-webextension/src/cta/Payment/stories.tsx
+++ b/packages/taler-wallet-webextension/src/cta/Payment/stories.tsx
@@ -21,8 +21,7 @@
 
 import {
   Amounts,
-  ConfirmPayResultType,
-  ContractTerms,
+  MerchantContractTerms as ContractTerms,
   PreparePayResultType,
 } from "@gnu-taler/taler-util";
 import merchantIcon from "../../../static-dev/merchant-icon.jpeg";
diff --git a/packages/taler-wallet-webextension/src/cta/Payment/views.tsx 
b/packages/taler-wallet-webextension/src/cta/Payment/views.tsx
index 7646e4bf1..d9b6eaa02 100644
--- a/packages/taler-wallet-webextension/src/cta/Payment/views.tsx
+++ b/packages/taler-wallet-webextension/src/cta/Payment/views.tsx
@@ -18,17 +18,14 @@ import {
   AbsoluteTime,
   AmountJson,
   Amounts,
-  ConfirmPayResultType,
-  ContractTerms,
+  MerchantContractTerms as ContractTerms,
   PreparePayResult,
-  PreparePayResultPaymentPossible,
   PreparePayResultType,
   Product,
 } from "@gnu-taler/taler-util";
 import { Fragment, h, VNode } from "preact";
 import { useState } from "preact/hooks";
 import { Amount } from "../../components/Amount.js";
-import { ErrorTalerOperation } from "../../components/ErrorTalerOperation.js";
 import { LoadingError } from "../../components/LoadingError.js";
 import { LogoHeader } from "../../components/LogoHeader.js";
 import { Part } from "../../components/Part.js";

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