gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-wallet-webex] branch master updated (2b1e8873 -> 49e


From: gnunet
Subject: [GNUnet-SVN] [taler-wallet-webex] branch master updated (2b1e8873 -> 49e88338)
Date: Sun, 04 Jun 2017 20:25:37 +0200

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

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

    from 2b1e8873 v0.2.7
     new 2cf33705 warn about incompatible versions on withdraw
     new 00b25fa6 check trust by key, not by URL
     new 49e88338 v0.2.8

The 3 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:
 .gitignore                                 |  2 ++
 manifest.json                              |  4 ++--
 src/i18n/de.po                             | 16 +++++++-------
 src/i18n/en-US.po                          | 16 +++++++-------
 src/i18n/fr.po                             | 16 +++++++-------
 src/i18n/it.po                             | 16 +++++++-------
 src/i18n/taler-wallet-webex.pot            | 16 +++++++-------
 src/types.ts                               | 20 ++++++++++++------
 src/wallet.ts                              | 30 ++++++++++++++++++++++----
 src/webex/pages/confirm-create-reserve.tsx | 34 +++++++++++++++++++++++++++++-
 src/webex/style/wallet.css                 | 19 +++++++++++++++++
 src/webex/wxBackend.ts                     |  2 +-
 12 files changed, 137 insertions(+), 54 deletions(-)

diff --git a/.gitignore b/.gitignore
index c8ef9b05..d7a865b9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,5 @@ dist/
 # Even though node_modules are tracked in git,
 # per default we don't want them to show up in git status
 node_modules
+
+*.swp
diff --git a/manifest.json b/manifest.json
index 947155b9..f035ac84 100644
--- a/manifest.json
+++ b/manifest.json
@@ -4,8 +4,8 @@
   "name": "GNU Taler Wallet (git)",
   "description": "Privacy preserving and transparent payments",
   "author": "GNU Taler Developers",
-  "version": "0.6.44",
-  "version_name": "0.2.7",
+  "version": "0.6.45",
+  "version_name": "0.2.8",
 
   "minimum_chrome_version": "51",
   "minimum_opera_version": "36",
diff --git a/src/i18n/de.po b/src/i18n/de.po
index 171e8b05..5bf73c8a 100644
--- a/src/i18n/de.po
+++ b/src/i18n/de.po
@@ -151,44 +151,44 @@ msgid ""
 "selected."
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:424
+#: src/webex/pages/confirm-create-reserve.tsx:455
 #, c-format
 msgid "Accept fees and withdraw"
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:429
+#: src/webex/pages/confirm-create-reserve.tsx:460
 #, c-format
 msgid "Change Exchange Provider"
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:485
+#: src/webex/pages/confirm-create-reserve.tsx:517
 #, c-format
 msgid "You are about to withdraw %1$s from your bank account into your wallet."
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:568
+#: src/webex/pages/confirm-create-reserve.tsx:600
 #, c-format
 msgid ""
 "Oops, something went wrong. The wallet responded with error status (%1$s)."
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:579
+#: src/webex/pages/confirm-create-reserve.tsx:611
 #, c-format
 msgid "Checking URL, please wait ..."
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:593
+#: src/webex/pages/confirm-create-reserve.tsx:625
 #, c-format
 msgid "Can't parse amount: %1$s"
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:600
+#: src/webex/pages/confirm-create-reserve.tsx:632
 #, c-format
 msgid "Can't parse wire_types: %1$s"
 msgstr ""
 
 #. TODO:generic error reporting function or component.
-#: src/webex/pages/confirm-create-reserve.tsx:620
+#: src/webex/pages/confirm-create-reserve.tsx:652
 #, c-format
 msgid "Fatal error: \"%1$s\"."
 msgstr ""
diff --git a/src/i18n/en-US.po b/src/i18n/en-US.po
index 7870ff89..e548014e 100644
--- a/src/i18n/en-US.po
+++ b/src/i18n/en-US.po
@@ -151,44 +151,44 @@ msgid ""
 "selected."
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:424
+#: src/webex/pages/confirm-create-reserve.tsx:455
 #, c-format
 msgid "Accept fees and withdraw"
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:429
+#: src/webex/pages/confirm-create-reserve.tsx:460
 #, c-format
 msgid "Change Exchange Provider"
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:485
+#: src/webex/pages/confirm-create-reserve.tsx:517
 #, c-format
 msgid "You are about to withdraw %1$s from your bank account into your wallet."
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:568
+#: src/webex/pages/confirm-create-reserve.tsx:600
 #, c-format
 msgid ""
 "Oops, something went wrong. The wallet responded with error status (%1$s)."
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:579
+#: src/webex/pages/confirm-create-reserve.tsx:611
 #, c-format
 msgid "Checking URL, please wait ..."
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:593
+#: src/webex/pages/confirm-create-reserve.tsx:625
 #, c-format
 msgid "Can't parse amount: %1$s"
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:600
+#: src/webex/pages/confirm-create-reserve.tsx:632
 #, c-format
 msgid "Can't parse wire_types: %1$s"
 msgstr ""
 
 #. TODO:generic error reporting function or component.
-#: src/webex/pages/confirm-create-reserve.tsx:620
+#: src/webex/pages/confirm-create-reserve.tsx:652
 #, c-format
 msgid "Fatal error: \"%1$s\"."
 msgstr ""
diff --git a/src/i18n/fr.po b/src/i18n/fr.po
index ccd36aec..da860ad8 100644
--- a/src/i18n/fr.po
+++ b/src/i18n/fr.po
@@ -151,44 +151,44 @@ msgid ""
 "selected."
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:424
+#: src/webex/pages/confirm-create-reserve.tsx:455
 #, c-format
 msgid "Accept fees and withdraw"
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:429
+#: src/webex/pages/confirm-create-reserve.tsx:460
 #, c-format
 msgid "Change Exchange Provider"
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:485
+#: src/webex/pages/confirm-create-reserve.tsx:517
 #, c-format
 msgid "You are about to withdraw %1$s from your bank account into your wallet."
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:568
+#: src/webex/pages/confirm-create-reserve.tsx:600
 #, c-format
 msgid ""
 "Oops, something went wrong. The wallet responded with error status (%1$s)."
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:579
+#: src/webex/pages/confirm-create-reserve.tsx:611
 #, c-format
 msgid "Checking URL, please wait ..."
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:593
+#: src/webex/pages/confirm-create-reserve.tsx:625
 #, c-format
 msgid "Can't parse amount: %1$s"
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:600
+#: src/webex/pages/confirm-create-reserve.tsx:632
 #, c-format
 msgid "Can't parse wire_types: %1$s"
 msgstr ""
 
 #. TODO:generic error reporting function or component.
-#: src/webex/pages/confirm-create-reserve.tsx:620
+#: src/webex/pages/confirm-create-reserve.tsx:652
 #, c-format
 msgid "Fatal error: \"%1$s\"."
 msgstr ""
diff --git a/src/i18n/it.po b/src/i18n/it.po
index ccd36aec..da860ad8 100644
--- a/src/i18n/it.po
+++ b/src/i18n/it.po
@@ -151,44 +151,44 @@ msgid ""
 "selected."
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:424
+#: src/webex/pages/confirm-create-reserve.tsx:455
 #, c-format
 msgid "Accept fees and withdraw"
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:429
+#: src/webex/pages/confirm-create-reserve.tsx:460
 #, c-format
 msgid "Change Exchange Provider"
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:485
+#: src/webex/pages/confirm-create-reserve.tsx:517
 #, c-format
 msgid "You are about to withdraw %1$s from your bank account into your wallet."
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:568
+#: src/webex/pages/confirm-create-reserve.tsx:600
 #, c-format
 msgid ""
 "Oops, something went wrong. The wallet responded with error status (%1$s)."
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:579
+#: src/webex/pages/confirm-create-reserve.tsx:611
 #, c-format
 msgid "Checking URL, please wait ..."
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:593
+#: src/webex/pages/confirm-create-reserve.tsx:625
 #, c-format
 msgid "Can't parse amount: %1$s"
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:600
+#: src/webex/pages/confirm-create-reserve.tsx:632
 #, c-format
 msgid "Can't parse wire_types: %1$s"
 msgstr ""
 
 #. TODO:generic error reporting function or component.
-#: src/webex/pages/confirm-create-reserve.tsx:620
+#: src/webex/pages/confirm-create-reserve.tsx:652
 #, c-format
 msgid "Fatal error: \"%1$s\"."
 msgstr ""
diff --git a/src/i18n/taler-wallet-webex.pot b/src/i18n/taler-wallet-webex.pot
index ccd36aec..da860ad8 100644
--- a/src/i18n/taler-wallet-webex.pot
+++ b/src/i18n/taler-wallet-webex.pot
@@ -151,44 +151,44 @@ msgid ""
 "selected."
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:424
+#: src/webex/pages/confirm-create-reserve.tsx:455
 #, c-format
 msgid "Accept fees and withdraw"
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:429
+#: src/webex/pages/confirm-create-reserve.tsx:460
 #, c-format
 msgid "Change Exchange Provider"
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:485
+#: src/webex/pages/confirm-create-reserve.tsx:517
 #, c-format
 msgid "You are about to withdraw %1$s from your bank account into your wallet."
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:568
+#: src/webex/pages/confirm-create-reserve.tsx:600
 #, c-format
 msgid ""
 "Oops, something went wrong. The wallet responded with error status (%1$s)."
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:579
+#: src/webex/pages/confirm-create-reserve.tsx:611
 #, c-format
 msgid "Checking URL, please wait ..."
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:593
+#: src/webex/pages/confirm-create-reserve.tsx:625
 #, c-format
 msgid "Can't parse amount: %1$s"
 msgstr ""
 
-#: src/webex/pages/confirm-create-reserve.tsx:600
+#: src/webex/pages/confirm-create-reserve.tsx:632
 #, c-format
 msgid "Can't parse wire_types: %1$s"
 msgstr ""
 
 #. TODO:generic error reporting function or component.
-#: src/webex/pages/confirm-create-reserve.tsx:620
+#: src/webex/pages/confirm-create-reserve.tsx:652
 #, c-format
 msgid "Fatal error: \"%1$s\"."
 msgstr ""
diff --git a/src/types.ts b/src/types.ts
index 7120f64c..68fde269 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -27,6 +27,7 @@
  * Imports.
  */
 import { Checkable } from "./checkable";
+import * as LibtoolVersion from "./libtoolVersion";
 
 /**
  * Non-negative financial amount.  Fractional values are expressed as multiples
@@ -153,14 +154,9 @@ export interface AuditorRecord {
  */
 export interface ExchangeForCurrencyRecord {
   /**
-   * Priority for automatic selection when withdrawing.
    * FIXME: unused?
    */
-  priority: number;
-  /**
-   * FIXME: unused?
-   */
-  pinnedPub?: string;
+  exchangePub: string;
   /**
    * Base URL of the exchange.
    */
@@ -492,6 +488,11 @@ export interface ExchangeRecord {
    * Timestamp for last update.
    */
   lastUpdateTime: number;
+
+  /**
+   * Last observed protocol version.
+   */
+  protocolVersion?: string;
 }
 
 /**
@@ -558,6 +559,13 @@ export interface ReserveCreationInfo {
    * Public keys of trusted auditors for the currency we're withdrawing.
    */
   trustedAuditorPubs: string[];
+  /**
+   * Result of checking the wallet's version
+   * against the exchange's version.
+   *
+   * Older exchanges don't return version information.
+   */
+  versionMatch: LibtoolVersion.VersionMatchResult|undefined;
 }
 
 
diff --git a/src/wallet.ts b/src/wallet.ts
index b0029e75..0d4a8e0d 100644
--- a/src/wallet.ts
+++ b/src/wallet.ts
@@ -34,6 +34,7 @@ import {
   HttpRequestLibrary,
   RequestException,
 } from "./http";
+import * as LibtoolVersion from "./libtoolVersion";
 import {
   AbortTransaction,
   Index,
@@ -152,6 +153,12 @@ export class KeysJson {
   signkeys: any;
 
   /**
+   * Protocol version.
+   */
+  @Checkable.Optional(Checkable.String)
+  version?: string;
+
+  /**
    * Verify that a value matches the schema of this class and convert it into a
    * member.
    */
@@ -1151,7 +1158,7 @@ export class Wallet {
     }
 
     if (!isAudited && !isTrusted) {
-      currencyRecord.exchanges.push({baseUrl: req.exchange, priority: 0});
+      currencyRecord.exchanges.push({baseUrl: req.exchange, exchangePub: 
exchangeInfo.masterPublicKey});
     }
 
     await this.q()
@@ -1438,14 +1445,14 @@ export class Wallet {
     const currencyRecord = await this.q().get(Stores.currencies, 
exchangeInfo.currency);
     if (currencyRecord) {
       for (const trustedExchange of currencyRecord.exchanges) {
-        if (trustedExchange.baseUrl === exchangeInfo.baseUrl) {
+        if (trustedExchange.exchangePub === exchangeInfo.masterPublicKey) {
           isTrusted = true;
           break;
         }
       }
       for (const trustedAuditor of currencyRecord.auditors) {
         for (const exchangeAuditor of exchangeInfo.auditors) {
-          if (trustedAuditor.baseUrl === exchangeAuditor.auditor_url) {
+          if (trustedAuditor.auditorPub === exchangeAuditor.auditor_pub) {
             isAudited = true;
             break;
           }
@@ -1500,6 +1507,19 @@ export class Wallet {
       trustedAuditorPubs.push(...currencyRecord.auditors.map((a) => 
a.auditorPub));
     }
 
+    let versionMatch;
+    if (exchangeInfo.protocolVersion) {
+      versionMatch = LibtoolVersion.compare(WALLET_PROTOCOL_VERSION, 
exchangeInfo.protocolVersion);
+
+      if (versionMatch && !versionMatch.compatible && versionMatch.currentCmp 
== -1) {
+        console.log("wallet version might be outdated, checking for updates");
+        chrome.runtime.requestUpdateCheck((status, details) => {
+          console.log("update check status:", status);
+        });
+      }
+    }
+
+
     const ret: ReserveCreationInfo = {
       earliestDepositExpiration,
       exchangeInfo,
@@ -1512,6 +1532,7 @@ export class Wallet {
       wireFees,
       wireInfo,
       withdrawFee: acc,
+      versionMatch,
     };
     return ret;
   }
@@ -1610,8 +1631,9 @@ export class Wallet {
     }
 
     const updatedExchangeInfo = await this.updateExchangeInfo(exchangeInfo,
-                                                            exchangeKeysJson);
+                                                              
exchangeKeysJson);
     await this.suspendCoins(updatedExchangeInfo);
+    updatedExchangeInfo.protocolVersion = exchangeKeysJson.version;
 
     await this.q()
               .put(Stores.exchanges, updatedExchangeInfo)
diff --git a/src/webex/pages/confirm-create-reserve.tsx 
b/src/webex/pages/confirm-create-reserve.tsx
index ca8517a2..f8f53510 100644
--- a/src/webex/pages/confirm-create-reserve.tsx
+++ b/src/webex/pages/confirm-create-reserve.tsx
@@ -414,10 +414,41 @@ class ExchangeSelection extends 
ImplicitStateComponent<ExchangeSelectionProps> {
     );
   }
 
+  renderUpdateStatus() {
+    const rci = this.reserveCreationInfo();
+    if (!rci) {
+      return null;
+    }
+    if (!rci.versionMatch) {
+      return null;
+    }
+    if (rci.versionMatch.compatible) {
+      return null;
+    }
+    if (rci.versionMatch.currentCmp == -1) {
+      return (
+        <p className="errorbox">
+          Your wallet might be outdated.  The exchange has a higher, 
incompatible
+          protocol version.
+        </p>
+      );
+    }
+    if (rci.versionMatch.currentCmp == 1) {
+      return (
+        <p className="errorbox">
+          The chosen exchange might be outdated.  The exchange has a lower, 
incompatible
+          protocol version.
+        </p>
+      );
+    }
+    throw Error("not reached");
+  }
+
   renderConfirm() {
     return (
       <div>
         {this.renderFeeStatus()}
+        <p>
         <button className="pure-button button-success"
                 disabled={this.reserveCreationInfo() === null}
                 onClick={() => this.confirmReserve()}>
@@ -428,7 +459,8 @@ class ExchangeSelection extends 
ImplicitStateComponent<ExchangeSelectionProps> {
                 onClick={() => this.selectingExchange(true)}>
           {i18n.str`Change Exchange Provider`}
         </button>
-        <br/>
+        </p>
+        {this.renderUpdateStatus()}
         <Collapsible initiallyCollapsed={true} title="Fee and Spending 
Details">
           {renderReserveCreationDetails(this.reserveCreationInfo())}
         </Collapsible>
diff --git a/src/webex/style/wallet.css b/src/webex/style/wallet.css
index 752fc6d7..7bfb99e6 100644
--- a/src/webex/style/wallet.css
+++ b/src/webex/style/wallet.css
@@ -220,3 +220,22 @@ span.spacer {
 a.actionLink {
   color: black;
 }
+
+
+.errorbox {
+  border: 1px solid;
+  display: inline-block;
+  margin: 1em;
+  padding: 1em;
+  font-weight: bold;
+  background: #FF8A8A;
+}
+
+.okaybox {
+  border: 1px solid;
+  display: inline-block;
+  margin: 1em;
+  padding: 1em;
+  font-weight: bold;
+  background: #00FA9A;
+}
diff --git a/src/webex/wxBackend.ts b/src/webex/wxBackend.ts
index 6ea9a3cf..b4e24e09 100644
--- a/src/webex/wxBackend.ts
+++ b/src/webex/wxBackend.ts
@@ -58,7 +58,7 @@ const DB_NAME = "taler";
  * In the future we might consider adding migration functions for
  * each version increment.
  */
-const DB_VERSION = 17;
+const DB_VERSION = 18;
 
 function handleMessage(db: IDBDatabase,
                        wallet: Wallet,

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]