Merge pull request #3528 from bitpay/v1.5

Updates v1.5 to master
This commit is contained in:
Matias Alejo Garcia 2015-11-25 14:29:52 -03:00
commit f8566cb99c
22 changed files with 215 additions and 79 deletions

3
.gitignore vendored
View file

@ -21,6 +21,8 @@ webkitbuilds/*
!webkitbuilds/build-osx.sh
!webkitbuilds/Background.png
# chrome extensions
browser-extensions/chrome/copay-chrome-extension
browser-extensions/chrome/copay-chrome-extension.zip
@ -51,6 +53,7 @@ build/Release
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
node_modules
bower_components
angular-bitcore-wallet-client/angular-bitcore-wallet-client.js
# Users Environment Variables
.lock-wscript

View file

@ -61,8 +61,8 @@ module.exports = function(grunt) {
'bower_components/angular-qrcode/angular-qrcode.js',
'bower_components/angular-gettext/dist/angular-gettext.js',
'bower_components/angular-touch/angular-touch.js',
'bower_components/angular-bitcore-wallet-client/angular-bitcore-wallet-client.js',
'bower_components/angular-ui-switch/angular-ui-switch.js'
'bower_components/angular-ui-switch/angular-ui-switch.js',
'angular-bitcore-wallet-client/angular-bitcore-wallet-client.js'
],
dest: 'public/lib/angular.js'
},
@ -112,8 +112,8 @@ module.exports = function(grunt) {
pot: {
files: {
'i18n/po/template.pot': [
'public/index.html',
'public/views/*.html',
'public/index.html',
'public/views/*.html',
'public/views/**/*.html',
'src/js/routes.js',
'src/js/services/*.js',
@ -140,10 +140,21 @@ module.exports = function(grunt) {
dest: 'public/icons/'
},
linux: {
files: [
{expand: true, cwd: 'webkitbuilds/',src: ['.desktop', '../public/img/icons/favicon.ico', '../public/img/icons/icon-256.png'],dest: 'webkitbuilds/copay/linux32/', flatten: true, filter: 'isFile' },
{expand: true, cwd: 'webkitbuilds/',src: ['.desktop', '../public/img/icons/favicon.ico', '../public/img/icons/icon-256.png'],dest: 'webkitbuilds/copay/linux64/', flatten: true, filter: 'isFile' },
],
files: [{
expand: true,
cwd: 'webkitbuilds/',
src: ['.desktop', '../public/img/icons/favicon.ico', '../public/img/icons/icon-256.png'],
dest: 'webkitbuilds/copay/linux32/',
flatten: true,
filter: 'isFile'
}, {
expand: true,
cwd: 'webkitbuilds/',
src: ['.desktop', '../public/img/icons/favicon.ico', '../public/img/icons/icon-256.png'],
dest: 'webkitbuilds/copay/linux64/',
flatten: true,
filter: 'isFile'
}, ],
}
},
karma: {
@ -166,11 +177,11 @@ module.exports = function(grunt) {
},
nodewebkit: {
options: {
platforms: ['win','osx','linux'],
buildDir: './webkitbuilds',
version: '0.12.2',
macIcns: './public/img/icons/icon.icns',
exeIco: './public/img/icons/icon.ico'
platforms: ['win', 'osx', 'linux'],
buildDir: './webkitbuilds',
version: '0.12.2',
macIcns: './public/img/icons/icon.icns',
exeIco: './public/img/icons/icon.ico'
},
src: ['./package.json', './public/**/*']
},
@ -193,6 +204,13 @@ module.exports = function(grunt) {
src: ['**/*'],
dest: 'copay-linux64/'
}
},
browserify: {
dist: {
files: {
'angular-bitcore-wallet-client/angular-bitcore-wallet-client.js': ['angular-bitcore-wallet-client/index.js']
},
}
}
});
@ -201,13 +219,14 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-angular-gettext');
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-exec');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-karma-coveralls');
grunt.loadNpmTasks('grunt-node-webkit-builder');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.registerTask('default', ['nggettext_compile', 'exec:version', 'concat', 'copy:icons']);
grunt.registerTask('default', ['nggettext_compile', 'exec:version', 'browserify', 'concat', 'copy:icons']);
grunt.registerTask('prod', ['default', 'uglify']);
grunt.registerTask('translate', ['nggettext_extract']);
grunt.registerTask('test', ['karma:unit']);

63
angular-bitcore-wallet-client/index.js vendored Normal file
View file

@ -0,0 +1,63 @@
var bwcModule = angular.module('bwcModule', []);
var Client = require('../node_modules/bitcore-wallet-client');
bwcModule.constant('MODULE_VERSION', '1.0.0');
bwcModule.provider("bwcService", function() {
var provider = {};
var config = {
baseUrl: 'https://bws.bitpay.com/bws/api',
verbose: null,
transports: null
};
provider.setBaseUrl = function(url) {
config.baseUrl = url;
};
provider.setVerbose = function(v) {
config.verbose = v ? true : false;
};
provider.$get = function() {
var service = {};
service.setBaseUrl = function(url) {
config.baseUrl = url;
};
service.setTransports = function(transports) {
config.transports = transports;
};
service.getBitcore = function() {
return Client.Bitcore;
};
service.getSJCL = function() {
return Client.sjcl;
};
service.buildTx = Client.buildTx;
service.parseSecret = Client.parseSecret;
service.getUtils = function() {
return Client.Utils;
};
service.getClient = function(walletData) {
var bwc = new Client({
baseUrl: config.baseUrl,
verbose: config.verbose,
transports: config.transports
});
if (walletData)
bwc.import(walletData);
return bwc;
};
return service;
};
return provider;
});

View file

@ -1,8 +1,8 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.bitpay.copay"
version="1.5.1"
android-versionCode="55"
ios-CFBundleVersion="1.5.1">
version="1.5.2"
android-versionCode="56"
ios-CFBundleVersion="1.5.2">
<name>Copay</name>
<description>
A secure bitcoin wallet for friends and companies.

View file

@ -57,11 +57,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.5.1</string>
<string>1.5.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.5.1</string>
<string>1.5.2</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSMainNibFile</key>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest" xmlns:m3="http://schemas.microsoft.com/appx/2014/manifest" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest">
<Identity Name="18C7659D.CopayWallet" Publisher="CN=F89609D1-EB3E-45FD-A58A-C2E3895FCE7B" Version="1.5.1.0" />
<Identity Name="18C7659D.CopayWallet" Publisher="CN=F89609D1-EB3E-45FD-A58A-C2E3895FCE7B" Version="1.5.2.0" />
<mp:PhoneIdentity PhoneProductId="5381aa50-9069-11e4-84cc-293caf9cbdc8" PhonePublisherId="F89609D1-EB3E-45FD-A58A-C2E3895FCE7B" />
<Properties>
<DisplayName>Copay Bitcoin Wallet</DisplayName>

View file

@ -8,7 +8,7 @@
<Language code="ja" />
<Language code="es" />
</Languages>
<App Author="Bitpay Inc." BitsPerPixel="32" Description="A multisignature Bitcoin Wallet" Genre="apps.normal" ProductID="{5381aa50-9069-11e4-84cc-293caf9cbdc8}" Publisher="Copay Bitcoin Wallet" PublisherID="{31cdd08b-457c-413d-b440-f6665eec847d}" RuntimeType="Silverlight" Title="Copay Bitcoin Wallet" Version="1.5.1.0" xmlns="" SDOptOut="true" NotificationService="MPN">
<App Author="Bitpay Inc." BitsPerPixel="32" Description="A multisignature Bitcoin Wallet" Genre="apps.normal" ProductID="{5381aa50-9069-11e4-84cc-293caf9cbdc8}" Publisher="Copay Bitcoin Wallet" PublisherID="{31cdd08b-457c-413d-b440-f6665eec847d}" RuntimeType="Silverlight" Title="Copay Bitcoin Wallet" Version="1.5.2.0" xmlns="" NotificationService="MPN">
<IconPath IsRelative="true" IsResource="false">Assets\icon@2.png</IconPath>
<Capabilities>
<Capability Name="ID_CAP_WEBBROWSERCOMPONENT" />

View file

@ -2,7 +2,7 @@
"name": "copay",
"description": "A multisignature wallet",
"author": "BitPay",
"version": "1.5.1",
"version": "1.5.2",
"keywords": [
"wallet",
"copay",
@ -40,10 +40,12 @@
"url": "https://github.com/bitpay/copay/issues"
},
"dependencies": {
"bitcore-wallet-client": "1.1.9",
"express": "^4.11.2",
"fs": "0.0.2",
"grunt": "^0.4.5",
"grunt-angular-gettext": "^0.2.15",
"grunt-browserify": "^4.0.1",
"grunt-cli": "^0.1.13",
"grunt-contrib-compress": "^0.13.0",
"grunt-contrib-concat": "^0.5.1",

View file

@ -6,7 +6,7 @@
&nbsp;
</div>
<div class="small-10 columns">
<div ng-if="!$root.updatingBalance">
<div>
<span class="text-bold size-16"><span translate>Send</span> {{tx.amountStr}}</span>
<time class="right size-12 text-gray m5t">{{ (tx.ts || tx.createdOn ) * 1000 | amTimeAgo}}</time>
</div>

View file

@ -156,7 +156,7 @@
</div>
</div>
<div class="columns text-center m20t" ng-if="tx.canBeRemoved">
<div class="columns text-center m20t" ng-if="tx.canBeRemoved && isShared">
<div class="text-gray size-12 m20b" ng-if="!tx.isGlidera" translate>
* A payment proposal can be deleted if 1) you are the creator, and no other copayer has signed, or 2) 24 hours have passed since the proposal was created.
</div>

View file

@ -160,8 +160,8 @@
<div ng-if="index.txps[0]">
<h4 ng-show="index.requiresMultipleSignatures" class="title m0" translate>Payment Proposals</h4>
<h4 ng-show="!index.requiresMultipleSignatures" class="title m0" translate>Unsent transactions</h4>
<div class="last-transactions pr" ng-repeat="tx in index.txps"
ng-include="index.txTemplateUrl">
<div class="last-transactions pr" ng-repeat="tx in index.txps">
<div ng-include="index.txTemplateUrl"></div>
</div>
<div class="text-gray text-center size-12 p10t"
@ -316,7 +316,7 @@
<div class="addressbook-input" ng-show="!sendForm.address.$invalid && _address">
{{index.addressbook[_address] || _address}}
</div>
<a class="postfix size-12 m0 text-gray"
<a class="postfix size-12 m0 text-gray"
ng-click="openDestinationAddressModal(index.otherWallets, _address)">
<i class="icon-wallet size-18"></i>
</a>
@ -449,23 +449,29 @@
</div>
</div>
</div>
<div class="row m20t text-center" ng-show="index.updatingTxHistory[index.walletId]">
<div class="columns large-12 medium-12 small-12">
<div class="spinner">
<div class="rect1"></div>
<div class="rect2"></div>
<div class="rect3"></div>
<div class="rect4"></div>
<div class="rect5"></div>
<div ng-show="index.updatingTxHistory[index.walletId]">
<div ng-show="index.txProgress > 6" class="row m20t text-center">
<div class="circle-icon">
<img src="/img/icon-sync.svg" alt="sync" width="70">
</div>
<div translate class="size-12 text-gray m20t small-10 small-centered columns">
Initial transaction history synchronization can take some minutes for wallets with many transactions.
<b> Please stand by.</b>
</div>
<div class="small-8 small-centered columns line-b p10 m20b"></div>
<div class="columns large-12 medium-12 small-12 m10b">
<div class="spinner">
<div class="rect1"></div>
<div class="rect2"></div>
<div class="rect3"></div>
<div class="rect4"></div>
<div class="rect5"></div>
</div>
</div>
<div class="size-14 text-gray m20t">
<b>{{index.txProgress}}</b> <br>
<span translate>Transactions Downloaded</span>
</div>
</div>
<div ng-show="index.txProgress > 6" translate class="size-12 text-gray m20t">
Initial transaction history synchronization can take some minutes for wallets with many transactions.</br>
Please stand by.
</div>
<div ng-show="index.txProgress > 6" class="size-14 text-gray m20t">
<b>{{index.txProgress}}</b>
<span translate>Transactions<br> Downloaded</span>
</div>
</div>
@ -506,9 +512,9 @@
<i class="icon-arrow-right3 size-18"></i>
</div>
<div class="size-14 text-gray columns m5t" ng-if="btx.message || btx.addressTo">
<div ng-show="btx.message"><span translate>Note</span>: {{btx.message}}</div>
<div ng-show="btx.message">{{btx.message}}</div>
<div ng-show="!btx.message">
<span translate>To</span>: {{index.addressbook[btx.addressTo] || btx.addressTo}}
{{index.addressbook[btx.addressTo] || btx.addressTo}}
</div>
</div>
</div>
@ -524,7 +530,7 @@
</div>
</div>
</div>
<div class="row m20t">
<div class="large-6 medium-6 small-6 columns">
<button type="submit" class="button black round expand" ng-show="index.historyShowShowAll" ng-click="index.showAllHistory()" ng-style="{'background-color':index.backgroundColor}" translate>

View file

@ -359,6 +359,15 @@ ul.tx-copayers {
background-color: #C0392B;
}
.circle-icon {
background: #F1F3F5;
border-radius: 100%;
padding: 1.5rem;
width: 80px;
height: 80px;
margin: 0 auto;
}
.date-message {
background-color: #213140;
border-radius: 3px;

View file

@ -170,11 +170,6 @@ angular.module('copayApp.controllers').controller('createController',
return;
}
if (opts.mnemonic || opts.externalSource || opts.extendedPrivateKey) {
if (opts.n == 1) {
$rootScope.$emit('Local/WalletImported', walletId);
}
}
});
}, 100);
}

View file

@ -142,7 +142,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
var defaults = configService.getDefaults();
var config = configService.getSync();
self.usingCustomBWS = config.bwsFor && config.bwsFor[self.walletId] && (config.bwsFor[self.walletId] != defaults.bws.url);
self.usingCustomBWS = config.bwsFor && config.bwsFor[self.walletId] && (config.bwsFor[self.walletId] != defaults.bws.url);
};
self.setTab = function(tab, reset, tries, switchState) {
@ -615,7 +615,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.alternativeConversionRate = $filter('noFractionNumber')(alternativeConversionRate, 2);
self.alternativeBalanceAvailable = true;
self.updatingBalance = false;
self.isRateAvailable = true;
$rootScope.$apply();
@ -786,11 +785,32 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.updateLocalTxHistory = function(client, cb) {
var requestLimit = 6;
var walletId = client.credentials.walletId;
var config = configService.getSync().wallet.settings;
var fixTxsUnit = function(txs) {
if (!txs || !txs[0]) return;
var cacheUnit = txs[0].amountStr.split(' ')[1];
if (cacheUnit == config.unitName)
return;
var name = ' ' + config.unitName;
$log.debug('Fixing Tx Cache Unit to:' + name)
lodash.each(txs, function(tx) {
tx.amountStr = profileService.formatAmount(tx.amount, config.unitName) + name;
tx.feeStr = profileService.formatAmount(tx.fees, config.unitName) + name;
});
};
self.getConfirmedTxs(walletId, function(err, txsFromLocal) {
if (err) return cb(err);
var endingTxid = txsFromLocal[0] ? txsFromLocal[0].txid : null;
fixTxsUnit(txsFromLocal);
function getNewTxs(newTxs, skip, i_cb) {
self.getTxsFromServer(client, skip, endingTxid, requestLimit, function(err, res, shouldContinue) {
@ -807,7 +827,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
return i_cb(null, newTxs);
}
if (walletId == profileService.focusedClient.credentials.walletId)
if (walletId == profileService.focusedClient.credentials.walletId)
self.txProgress = newTxs.length;
$timeout(function() {
@ -822,7 +842,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
var newHistory = lodash.compact(txs.concat(txsFromLocal));
$log.debug('Tx History synced. Total Txs: ' + newHistory.length);
if (walletId == profileService.focusedClient.credentials.walletId) {
if (walletId == profileService.focusedClient.credentials.walletId) {
self.completeHistory = newHistory;
self.txHistory = newHistory.slice(0, self.historyShowLimit);
self.historyShowShowAll = newHistory.length >= self.historyShowLimit;
@ -924,9 +944,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
}
profileService.setWalletClients();
$timeout(function() {
$rootScope.$emit('Local/WalletImported', self.walletId);
}, 100);
self.startScan(self.walletId);
});
};
@ -1140,8 +1158,9 @@ angular.module('copayApp.controllers').controller('indexController', function($r
});
$rootScope.$on('Local/UnitSettingUpdated', function(event) {
self.updateAll();
self.updateTxHistory();
self.updateAll({
triggerTxUpdate: true,
});
self.updateRemotePreferences({
saveAll: true
}, function() {
@ -1177,10 +1196,10 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.debouncedUpdate();
});
$rootScope.$on('Local/BackupDone', function(event) {
$rootScope.$on('Local/BackupDone', function(event, walletId) {
self.needsBackup = false;
$log.debug('Backup done');
storageService.setBackupFlag(self.walletId, function(err) {
storageService.setBackupFlag(walletId || self.walletId, function(err) {
$log.debug('Backup done stored');
});
});

View file

@ -129,11 +129,6 @@ angular.module('copayApp.controllers').controller('joinController',
return;
}
$timeout(function() {
var fc = profileService.focusedClient;
if (fc.isComplete() && (opts.mnemonic || opts.externalSource || opts.extendedPrivateKey))
$rootScope.$emit('Local/WalletImported', fc.credentials.walletId);
}, 2000);
});
}, 100);
};

View file

@ -28,8 +28,7 @@ angular.module('copayApp.controllers').controller('sidebarController',
self.switchWallet = function(selectedWalletId, currentWalletId) {
if (selectedWalletId == currentWalletId) return;
self.walletSelection = false;
profileService.setAndStoreFocus(selectedWalletId, function() {
});
profileService.setAndStoreFocus(selectedWalletId, function() {});
};
self.toggleWalletSelection = function() {
@ -40,10 +39,14 @@ angular.module('copayApp.controllers').controller('sidebarController',
self.setWallets = function() {
if (!profileService.profile) return;
var config = configService.getSync();
config.colorFor = config.colorFor || {};
config.aliasFor = config.aliasFor || {};
var ret = lodash.map(profileService.profile.credentials, function(c) {
// Sanitize empty wallets (fixed in BWC 1.8.1, and auto fixed when wallets completes)
var credentials = lodash.filter(profileService.profile.credentials, 'walletName');
var ret = lodash.map(credentials, function(c) {
return {
m: c.m,
n: c.n,
@ -52,6 +55,7 @@ angular.module('copayApp.controllers').controller('sidebarController',
color: config.colorFor[c.walletId] || '#4A90E2',
};
});
self.wallets = lodash.sortBy(ret, 'name');
};

View file

@ -271,6 +271,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
$scope.canSign = fc.canSign() || fc.isPrivKeyExternal();
$scope.loading = null;
$scope.color = fc.backgroundColor;
$scope.isShared = fc.credentials.n > 1;
// ToDo: use tx.customData instead of tx.message
if (tx.message === 'Glidera transaction' && isGlidera) {
@ -951,6 +952,9 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
profileService.signTxProposal(txp, function(err, signedTx) {
self.setOngoingProcess();
if (err) {
if (!lodash.isObject(err)) {
err = { message: err};
}
err.message = bwsError.msg(err, gettextCatalog.getString('The payment was created but could not be signed. Please try again from home screen'));
return cb(err);
}

View file

@ -20,7 +20,7 @@ angular
$urlRouterProvider.otherwise('/');
$logProvider.debugEnabled(true);
$provide.decorator('$log', ['$delegate',
$provide.decorator('$log', ['$delegate', 'isDevel',
function($delegate, isDevel) {
var historicLog = historicLogProvider.$get();

View file

@ -276,8 +276,8 @@ angular.module('copayApp.services')
// check if exist
if (lodash.find(root.profile.credentials, {
'walletId': walletData.walletId
})) {
'walletId': walletData.walletId
})) {
return cb(gettext('Cannot join the same wallet more that once'));
}
} catch (ex) {
@ -379,9 +379,26 @@ angular.module('copayApp.services')
root.profile.credentials.push(JSON.parse(walletClient.export()));
root.setWalletClients();
root.setAndStoreFocus(walletId, function() {
storageService.storeProfile(root.profile, function(err) {
return cb(err, walletId);
var handleImport = function(cb) {
var isImport = opts.mnemonic || opts.externalSource || opts.extendedPrivateKey;
if (!isImport)
return cb();
$rootScope.$emit('Local/BackupDone', walletId);
if (!walletClient.isComplete())
return cb();
storageService.setCleanAndScanAddresses(walletId, cb);
};
handleImport(function() {
root.setAndStoreFocus(walletId, function() {
storageService.storeProfile(root.profile, function(err) {
return cb(err, walletId);
});
});
});
});

View file

@ -1,6 +1,6 @@
[Desktop Entry]
Type=Application
Version=1.5.1
Version=1.5.2
Name=Copay
Comment=A multisignature wallet
Exec=copay

View file

@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Copay"
#define MyAppVersion "1.5.1"
#define MyAppVersion "1.5.2"
#define MyAppPublisher "BitPay"
#define MyAppURL "https://copay.io"
#define MyAppExeName "copay.exe"

View file

@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Copay"
#define MyAppVersion "1.5.1"
#define MyAppVersion "1.5.2"
#define MyAppPublisher "BitPay"
#define MyAppURL "https://copay.io"
#define MyAppExeName "copay.exe"