remove storage from Wallet

This commit is contained in:
Matias Alejo Garcia 2014-10-24 09:36:28 -03:00
commit 567cb8c713
8 changed files with 92 additions and 116 deletions

View file

@ -46,17 +46,12 @@ Profile.create = function(email, password, storage, cb) {
};
Profile.any = function(storage, cb) {
storage.getFirst(Profile.key(''), { onlyKey: true}, function(err, v, k) {
return cb(k ? true : false);
});
};
Profile.open = function(email, password, storage, cb) {
preconditions.checkArgument(cb);
preconditions.checkState(storage.hasPassphrase());
var key = Profile.key(Profile.hash(email, password));
console.log('[Profile.js.59:key:]',key); //TODO
storage.get(key, function(err, val) {
if (err || !val)
return cb(new Error('PNOTFOUND: Profile not found'));