WIP: performance in chrome

This commit is contained in:
Matias Alejo Garcia 2015-08-31 18:10:46 -03:00
commit ab78588a9f
6 changed files with 19 additions and 8 deletions

View file

@ -57,7 +57,7 @@ angular.module('copayApp.controllers').controller('createController',
m: $scope.requiredCopayers,
n: $scope.totalCopayers,
name: form.walletName.$modelValue,
extendedPrivateKey: form.privateKey.$modelValue,
mnemonic: form.privateKey.$modelValue,
myName: $scope.totalCopayers > 1 ? form.myName.$modelValue : null,
networkName: form.isTestnet.$modelValue ? 'testnet' : 'livenet',
};

View file

@ -68,7 +68,6 @@ angular.module('copayApp.controllers').controller('importController',
profileService.importWalletMnemonic(words, {
passphrase: passphrase,
}, function(err, ret) {
console.log('[import.js.70:err:]',err, ret); //TODO
self.loading = false;
if (err) {
self.error = err;

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('splashController',
function($scope, $timeout, $log, profileService, storageService, go) {
function($scope, $timeout, $log, profileService, storageService, go, bwcService) {
storageService.getCopayDisclaimerFlag(function(err, val) {
if (!val) go.path('disclaimer');
@ -29,4 +29,12 @@ angular.module('copayApp.controllers').controller('splashController',
});
}, 100);
};
console.log('[splash.js.32]'); //TODO
var a = bwcService.getClient();
console.log('[splash.js.34]'); //TODO
a.seedFromMnemonic('glare benefit approve speak post afford spot cancel argue cushion unaware kitchen');
console.log("LISTO", a.credentials);
});

View file

@ -168,8 +168,11 @@ angular.module('copayApp.services')
root._seedWallet = function(walletClient, network) {
var lang = uxLanguage.getCurrentLanguage();
console.log('[profileService.js.170]'); //TODO
try {
walletClient.seedFromRandomWithMnemonic(network, null, lang);
console.log('[profileService.js.174]'); //TODO
} catch (e) {
$log.info('Error creating seed: ' + e.message);
if (e.message.indexOf('language') > 0) {
@ -205,11 +208,12 @@ angular.module('copayApp.services')
var walletClient = bwcService.getClient();
$log.debug('Creating Wallet:', opts);
if (opts.extendedPrivateKey) {
if (opts.mnemonic) {
try {
walletClient.seedFromExtendedPrivateKey(opts.extendedPrivateKey);
walletClient.seedFromMnemonic(opts.mnemonic);
} catch (ex) {
return cb(gettext('Could not create using the specified extended private key'));
$log.info(ex);
return cb(gettext('Could not create: Invalid Backup Words'));
}
} else if (opts.extendedPublicKey) {
try {