mv log to util

This commit is contained in:
Matias Alejo Garcia 2014-12-02 11:17:03 -03:00
commit cfa5748f74
18 changed files with 32 additions and 26 deletions

View file

@ -3,7 +3,7 @@ var _ = require('lodash');
var preconditions = require('preconditions').singleton();
var inherits = require('inherits');
var events = require('events');
var log = require('../log');
var log = require('../util/log');
var async = require('async');
var bitcore = require('bitcore');
@ -122,7 +122,7 @@ Identity.open = function(opts, cb) {
var storage = opts.storage || opts.pluginManager.get('DB');
storage.setCredentials(opts.email, opts.password, opts);
storage.getItem(Identity.getKeyForEmail(opts.email), function(err, data, headers) {
storage.getItem(Identity.getKeyForEmail(opts.email), function(err, data) {
var exported;
if (err) {
return cb(err);
@ -132,7 +132,7 @@ Identity.open = function(opts, cb) {
} catch (e) {
return cb(e);
}
return cb(null, new Identity(_.extend(opts, exported)), headers);
return cb(null, new Identity(_.extend(opts, exported)));
});
};
@ -553,8 +553,8 @@ Identity.prototype.createWallet = function(opts, cb) {
var self = this;
var w = new walletClass(opts);
self.bindWallet(w);
self.updateFocusedTimestamp(w.getId());
self.bindWallet(w);
self.storeWallet(w, function(err) {
if (err) return cb(err);
self.store({
@ -619,10 +619,11 @@ Identity.prototype.deleteWallet = function(walletId, cb) {
delete this.focusedTimestamps[walletId];
this.storage.removeItem(Wallet.getStorageKey(walletId), function(err) {
if (err) return cb(err);
if (err) {
return cb(err);
}
self.emitAndKeepAlive('deletedWallet', walletId);
self.store(null, cb);
return cb();
});
};