added a wrapper for the method fromObj of Wallet

This commit is contained in:
Mario Colque 2014-04-28 12:02:43 -03:00
commit 47cb4bd3da
3 changed files with 29 additions and 16 deletions

View file

@ -52,15 +52,8 @@ WalletFactory.prototype._checkRead = function(walletId) {
};
WalletFactory.prototype.fromObj = function(obj) {
var opts = obj.opts;
opts.publicKeyRing = new PublicKeyRing.fromObj(obj.publicKeyRing);
opts.txProposals = new TxProposals.fromObj(obj.txProposals);
opts.privateKey = new PrivateKey.fromObj(obj.privateKey);
opts.storage = this.storage;
opts.network = this.network;
opts.blockchain = this.blockchain;
opts.verbose = this.verbose;
var w = new Wallet(opts);
var w = Wallet.fromObj(obj, this.storage, this.network, this.blockchain);
w.verbose = this.verbose;
// JIC: Add our key
try {