From d85fcbfe077d99a2c262ea9a16b802fdedac44b6 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Mon, 15 Sep 2014 10:16:40 -0300 Subject: [PATCH] Remove forceNetwork --- config.js | 1 - js/app.js | 3 --- js/models/core/Wallet.js | 3 --- test/test.Wallet.js | 9 --------- 4 files changed, 16 deletions(-) diff --git a/config.js b/config.js index a22baad87..82dc4f1d6 100644 --- a/config.js +++ b/config.js @@ -3,7 +3,6 @@ var defaultConfig = { defaultLanguage: 'en', // DEFAULT network (livenet or testnet) networkName: 'testnet', - forceNetwork: false, logLevel: 'info', diff --git a/js/app.js b/js/app.js index 177755b2a..e3d6491c4 100644 --- a/js/app.js +++ b/js/app.js @@ -10,9 +10,6 @@ if (localConfig) { var lmv = localConfig.version ? localConfig.version.split('.')[1] : '-1'; if (cmv === lmv) { _.each(localConfig, function(value, key) { - if (key === 'networkName' && config['forceNetwork']) { - return; - } config[key] = value; }); } diff --git a/js/models/core/Wallet.js b/js/models/core/Wallet.js index 61e81b137..1db23d329 100644 --- a/js/models/core/Wallet.js +++ b/js/models/core/Wallet.js @@ -67,9 +67,6 @@ function Wallet(opts) { preconditions.checkArgument(!_.isUndefined(opts[k]), 'missing required option for Wallet: ' + k); self[k] = opts[k]; }); - preconditions.checkArgument(!copayConfig.forceNetwork || this.getNetworkName() === copayConfig.networkName, - 'Network forced to ' + copayConfig.networkName + - ' and tried to create a Wallet with network ' + this.getNetworkName()); this.id = opts.id || Wallet.getRandomId(); this.secretNumber = opts.secretNumber || Wallet.getRandomNumber(); diff --git a/test/test.Wallet.js b/test/test.Wallet.js index c8ae349e5..194252aee 100644 --- a/test/test.Wallet.js +++ b/test/test.Wallet.js @@ -1247,15 +1247,6 @@ describe('Wallet model', function() { }); - describe('#forceNetwork in config', function() { - it('should throw if network is different', function() { - var backup = copayConfig.forceNetwork; - copayConfig.forceNetwork = true; - walletConfig.networkName = 'livenet'; - createW2.should.throw(Error); - copayConfig.forceNetwork = backup; - }); - }); describe('_getKeymap', function() { var w = cachedCreateW();