refactor key handing in storage (part 1)
This commit is contained in:
parent
eb9ab115d7
commit
691951a86a
3 changed files with 16 additions and 15 deletions
|
|
@ -330,12 +330,10 @@ Storage.prototype.getLastOpened = function(cb) {
|
|||
this.getGlobal('lastOpened', cb);
|
||||
};
|
||||
|
||||
Storage.prototype.setFromObj = function(walletId, obj, cb) {
|
||||
Storage.prototype.setFromObj = function(key, obj, cb) {
|
||||
preconditions.checkArgument(key);
|
||||
preconditions.checkArgument(cb);
|
||||
var self = this;
|
||||
|
||||
var key = 'wallet::' + walletId + ((obj.opts && obj.opts.name) ? '_' + obj.opts.name : '');
|
||||
self._write(key, obj, function() {
|
||||
this._write(key, obj, function() {
|
||||
return cb();
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue