Remove forceNetwork
This commit is contained in:
parent
6efa6dbf96
commit
d85fcbfe07
4 changed files with 0 additions and 16 deletions
|
|
@ -3,7 +3,6 @@ var defaultConfig = {
|
||||||
defaultLanguage: 'en',
|
defaultLanguage: 'en',
|
||||||
// DEFAULT network (livenet or testnet)
|
// DEFAULT network (livenet or testnet)
|
||||||
networkName: 'testnet',
|
networkName: 'testnet',
|
||||||
forceNetwork: false,
|
|
||||||
logLevel: 'info',
|
logLevel: 'info',
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,6 @@ if (localConfig) {
|
||||||
var lmv = localConfig.version ? localConfig.version.split('.')[1] : '-1';
|
var lmv = localConfig.version ? localConfig.version.split('.')[1] : '-1';
|
||||||
if (cmv === lmv) {
|
if (cmv === lmv) {
|
||||||
_.each(localConfig, function(value, key) {
|
_.each(localConfig, function(value, key) {
|
||||||
if (key === 'networkName' && config['forceNetwork']) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
config[key] = value;
|
config[key] = value;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -67,9 +67,6 @@ function Wallet(opts) {
|
||||||
preconditions.checkArgument(!_.isUndefined(opts[k]), 'missing required option for Wallet: ' + k);
|
preconditions.checkArgument(!_.isUndefined(opts[k]), 'missing required option for Wallet: ' + k);
|
||||||
self[k] = opts[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.id = opts.id || Wallet.getRandomId();
|
||||||
this.secretNumber = opts.secretNumber || Wallet.getRandomNumber();
|
this.secretNumber = opts.secretNumber || Wallet.getRandomNumber();
|
||||||
|
|
|
||||||
|
|
@ -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() {
|
describe('_getKeymap', function() {
|
||||||
var w = cachedCreateW();
|
var w = cachedCreateW();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue