From dc9f3189deff7528d1809f1aca404fd4b593d485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Tue, 9 Aug 2016 12:42:13 -0300 Subject: [PATCH 1/6] clean unused rateService code --- src/js/services/rateService.js | 44 ---------------------------------- 1 file changed, 44 deletions(-) diff --git a/src/js/services/rateService.js b/src/js/services/rateService.js index be7f2e6ee..394c556b4 100644 --- a/src/js/services/rateService.js +++ b/src/js/services/rateService.js @@ -22,8 +22,6 @@ var RateService = function(opts) { self.UNAVAILABLE_ERROR = 'Service is not available - check for service.isAvailable() or use service.whenAvailable()'; self.UNSUPPORTED_CURRENCY_ERROR = 'Currency not supported'; - self._url = opts.url || 'https://insight.bitpay.com:443/api/rates'; - self._isAvailable = false; self._rates = {}; self._alternatives = []; @@ -82,39 +80,6 @@ RateService.prototype.getRate = function(code) { return this._rates[code]; }; -RateService.prototype.getHistoricRate = function(code, date, cb) { - var self = this; - - self.httprequest.get(self._url + '/' + code + '?ts=' + date) - .success(function(body) { - return cb(null, body.rate) - }) - .error(function(err) { - return cb(err) - }); - -}; - -RateService.prototype.getHistoricRates = function(code, dates, cb) { - var self = this; - - var tsList = dates.join(','); - - self.httprequest.get(self._url + '/' + code + '?ts=' + tsList) - .success(function(body) { - if (!self.lodash.isArray(body)) { - body = [{ - ts: dates[0], - rate: body.rate - }]; - } - return cb(null, body); - }) - .error(function(err) { - return cb(err) - }); -}; - RateService.prototype.getAlternatives = function() { return this._alternatives; }; @@ -139,15 +104,6 @@ RateService.prototype.toFiat = function(satoshis, code) { return satoshis * this.SAT_TO_BTC * this.getRate(code); }; -RateService.prototype.toFiatHistoric = function(satoshis, code, date, cb) { - var self = this; - - self.getHistoricRate(code, date, function(err, rate) { - if (err) return cb(err); - return cb(null, satoshis * self.SAT_TO_BTC * rate); - }); -}; - RateService.prototype.fromFiat = function(amount, code) { if (!this.isAvailable()) { return null; From 6a8c3d469f34c1565daad840e0234cf6291f9da4 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Fri, 12 Aug 2016 11:13:38 -0300 Subject: [PATCH 2/6] update .gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 06fdf1546..81e6b9838 100644 --- a/.gitignore +++ b/.gitignore @@ -107,7 +107,7 @@ public/lib/* public/js/* ## templates -appConfig.json +./appConfig.json cordova/Makefile cordova/ProjectMakefile app-template/bpapp From 47e5361310017475ac2345bb094a8d213dd1f63d Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Fri, 12 Aug 2016 11:15:26 -0300 Subject: [PATCH 3/6] appConfig --- .gitignore | 2 +- app-template/copay/appConfig.json | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 app-template/copay/appConfig.json diff --git a/.gitignore b/.gitignore index 81e6b9838..e4739f9a0 100644 --- a/.gitignore +++ b/.gitignore @@ -107,7 +107,7 @@ public/lib/* public/js/* ## templates -./appConfig.json +/appConfig.json cordova/Makefile cordova/ProjectMakefile app-template/bpapp diff --git a/app-template/copay/appConfig.json b/app-template/copay/appConfig.json new file mode 100644 index 000000000..bc9bec14e --- /dev/null +++ b/app-template/copay/appConfig.json @@ -0,0 +1,24 @@ + { + "//":"PLEASE! Do not edit this file directly", + "//":" Modify it at app-template/", + + + "name": "copay", + "nameNoSpace": "copay", + "nameCase": "Copay", + "nameCaseNoSpace": "Copay", + "url": "https://copay.io", + "appDescription": "Copay Bitcoin Wallet", + "winAppName": "CopayWallet", + "wpPublisherId": "{31cdd08b-457c-413d-b440-f6665eec847d}", + "wpProductId": "{5381aa50-9069-11e4-84cc-293caf9cbdc8}", + "description": "A Secure Bitcoin Wallet", + "version": "2.5.0", + "androidVersion": "115", + "_extraCSS": null, + "_enabledExtensions": { + "coinbase": true, + "glidera": true, + "amazon": true + } +} From a46e883715bb5dae3e80e25398b95c4f050cc36a Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Fri, 12 Aug 2016 12:28:09 -0300 Subject: [PATCH 4/6] First boot. Fix travis --- app-template/package.json | 2 +- package.json | 2 +- public/index.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app-template/package.json b/app-template/package.json index 369729f80..baf763101 100644 --- a/app-template/package.json +++ b/app-template/package.json @@ -85,7 +85,7 @@ "xcode": "^0.8.2" }, "scripts": { - "preinstall": "bower install && cd app-template && ./apply.js", + "preinstall": "bower install && npm install fs-extra && npm install path && cd app-template && ./apply.js", "postinstall": "npm run build", "build": "grunt", "start": "node app.js", diff --git a/package.json b/package.json index df700bb1d..8fa6aaa42 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "xcode": "^0.8.2" }, "scripts": { - "preinstall": "bower install && cd app-template && ./apply.js", + "preinstall": "bower install && npm install fs-extra && npm install path && cd app-template && ./apply.js", "postinstall": "npm run build", "build": "grunt", "start": "node app.js", diff --git a/public/index.html b/public/index.html index 258619c30..9105830c5 100644 --- a/public/index.html +++ b/public/index.html @@ -11,7 +11,7 @@ - {{index.appConfig.name}} - {{index.appConfig.description}} + {{index.appConfig.nameCase}} - {{index.appConfig.description}} From f66946931ae5b56b628e79948101fa4b45d00b91 Mon Sep 17 00:00:00 2001 From: Peter deHaan Date: Wed, 24 Aug 2016 20:27:08 -0700 Subject: [PATCH 5/6] Remove 'fs' dependency Ref: https://www.npmjs.com/package/fs --- app-template/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/app-template/package.json b/app-template/package.json index baf763101..dcffc479c 100644 --- a/app-template/package.json +++ b/app-template/package.json @@ -45,7 +45,6 @@ "bitcore-wallet-client": "2.11.0", "coveralls": "^2.11.9", "express": "^4.11.2", - "fs": "0.0.2", "shelljs": "^0.3.0", "grunt-angular-gettext": "^2.2.3", "fs-extra": "^0.30.0", From 78e80e9dfa0e0e2e1886ae3a0f1fb065ff7e8e24 Mon Sep 17 00:00:00 2001 From: Javier Date: Sat, 3 Sep 2016 22:25:51 -0300 Subject: [PATCH 6/6] check for old backup version --- src/js/services/profileService.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index 46a0eb14a..7f03f5740 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -572,6 +572,10 @@ angular.module('copayApp.services') str = JSON.parse(str); + if (!str.n) { + return cb("Backup format not recognized. If you are using a Copay Beta backup and version is older than 0.10, please see: https://github.com/bitpay/copay/issues/4730#issuecomment-244522614"); + } + var addressBook = str.addressBook || {}; root.addAndBindWalletClient(walletClient, {