settings: remove _checkNetwork in WalletFactory
This commit is contained in:
parent
7159cdb712
commit
b2fb486839
2 changed files with 1 additions and 13 deletions
|
|
@ -84,6 +84,7 @@ angular.module('copayApp.controllers').controller('CreateController',
|
|||
nickname: $scope.myNickname,
|
||||
passphrase: passphrase,
|
||||
privateKeyHex: $scope.private,
|
||||
networkName: $scope.networkName,
|
||||
};
|
||||
var w = walletFactory.create(opts);
|
||||
controllerUtils.startNetwork(w, $scope);
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ var StorageLocalEncrypted = module.exports.StorageLocalEncrypted = require('../s
|
|||
* @param {Object} config.network - the configuration to be sent to the Network constructor
|
||||
* @param {Blockchain} config.Blockchain - the class to instantiate to get information about the blockchain (Insight by default)
|
||||
* @param {Object} config.blockchain - the configuration to be sent to the Blockchain constructor
|
||||
* @param {string} config.networkName - the name of the bitcoin network to use ('testnet' or 'livenet')
|
||||
* @TODO: Investigate what parameters go inside this object
|
||||
* @param {Object} config.wallet - default configuration for the wallet
|
||||
* @TODO: put `version` inside of the config object
|
||||
|
|
@ -92,7 +91,6 @@ WalletFactory.prototype.fromObj = function(obj, skipFields) {
|
|||
var w = Wallet.fromObj(obj, this.storage, this.network, this.blockchain);
|
||||
if (!w) return false;
|
||||
this._checkVersion(w.version);
|
||||
this._checkNetwork(w.getNetworkName());
|
||||
return w;
|
||||
};
|
||||
|
||||
|
|
@ -241,17 +239,6 @@ WalletFactory.prototype._checkVersion = function(inVersion) {
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @desc Throw an error if the network name is different to {@link WalletFactory#networkName}
|
||||
* @param {string} inNetworkName - the network name to check
|
||||
* @throws {Error}
|
||||
*/
|
||||
WalletFactory.prototype._checkNetwork = function(inNetworkName) {
|
||||
if (this.networkName !== inNetworkName) {
|
||||
throw new Error('This Wallet is configured for ' + inNetworkName + ' while currently Copay is configured for: ' + this.networkName + '. Check your settings.');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @desc Retrieve a wallet from the storage
|
||||
* @param {string} walletId - the id of the wallet
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue