simplify wallet object

This commit is contained in:
Matias Alejo Garcia 2015-02-02 09:15:50 -03:00
parent 37698a9292
commit 441401987a
1 changed files with 2 additions and 7 deletions

View File

@ -3,8 +3,6 @@
var _ = require('lodash');
var Copayer = require('./copayer');
var Bitcore = require('bitcore');
var PublicKey = Bitcore.PublicKey;
var WALLET_VERSION = '1.0.0';
function Wallet(opts) {
@ -20,9 +18,7 @@ function Wallet(opts) {
this.addressIndex = 0;
this.copayers = [];
this.version = WALLET_VERSION;
if (opts.pubKey)
this.pubKey = new PublicKey(opts.pubKey);
this.pubKey = opts.pubKey;
};
@ -49,8 +45,7 @@ Wallet.fromObj = function (obj) {
x.copayers = _.map(obj.copayers, function (copayer) {
return new Copayer(copayer);
});
x.pubKey = new PublicKey(obj.pubKey);
x.pubKey = obj.pubKey;
return x;
};