Added Storage#readWallet and used this from WalletFactory
This commit is contained in:
parent
5c1935e04b
commit
0f37ea1929
4 changed files with 105 additions and 63 deletions
|
|
@ -153,10 +153,10 @@ WalletFactory.prototype.read = function(walletId, skipFields, cb) {
|
|||
err;
|
||||
var obj = {};
|
||||
|
||||
this.storage.getMany(walletId, Wallet.PERSISTED_PROPERTIES, function(ret) {
|
||||
for (var ii in ret) {
|
||||
obj[ii] = ret[ii];
|
||||
}
|
||||
this.storage.readWallet(walletId, function(ret) {
|
||||
_.each(Wallet.PERSISTED_PROPERTIES, function(p) {
|
||||
obj[p] = ret[p];
|
||||
});
|
||||
|
||||
if (!_.any(_.values(obj)))
|
||||
return cb(new Error('Wallet not found'));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue