refactor baseUrl in angular-bwc

This commit is contained in:
Matias Alejo Garcia 2016-06-01 15:49:20 -03:00
commit 6bd316424a
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
4 changed files with 21 additions and 43 deletions

View file

@ -67,7 +67,6 @@ angular.module('copayApp.services')
var defaults = configService.getDefaults();
bwcService.setBaseUrl((config.bwsFor && config.bwsFor[walletId]) || defaults.bws.url);
bwcService.setTransports(['polling']);
}
root.setWalletClient = function(credentials) {
@ -219,10 +218,7 @@ angular.module('copayApp.services')
root._seedWallet = function(opts, cb) {
opts = opts || {};
if (opts.bwsurl)
bwcService.setBaseUrl(opts.bwsurl);
var walletClient = bwcService.getClient();
var walletClient = bwcService.getClient(null, opts);
var network = opts.networkName || 'livenet';
@ -471,10 +467,8 @@ angular.module('copayApp.services')
};
root.importWallet = function(str, opts, cb) {
if (opts.bwsurl)
bwcService.setBaseUrl(opts.bwsurl);
var walletClient = bwcService.getClient();
var walletClient = bwcService.getClient(null, opts);
$log.debug('Importing Wallet:', opts);
try {
@ -573,7 +567,6 @@ angular.module('copayApp.services')
configService.get(function(err) {
bwcService.setBaseUrl(defaults.bws.url);
bwcService.setTransports(['polling']);
root._createNewProfile(opts, function(err, p) {
if (err) return cb(err);

View file

@ -173,6 +173,14 @@ angular.module('copayApp.services')
storage.remove('backup-' + walletId, cb);
};
root.setDerivationTestFlag = function(walletId, ua, cb) {
storage.set('DerivationTest-'+walletId+ua.replace(' ', ''), true, cb);
};
root.getDerivationTestFlag = function(walletId, ua, cb) {
storage.get('DerivationTest-'+walletId+ua.replace(' ', ''), cb);
};
root.setCleanAndScanAddresses = function(walletId, cb) {
storage.set('CleanAndScanAddresses', walletId, cb);
};