Display a message for users whose have wallet:: but not profile::

This commit is contained in:
Gustavo Maximiliano Cortez 2014-10-29 16:21:44 -03:00
commit 2c07ad6dd7
7 changed files with 94 additions and 8 deletions

View file

@ -165,14 +165,32 @@ Wallet.COPAYER_PAIR_LIMITS = {
12: 1,
};
Wallet.getStoragePrefix = function() {
return 'wallet::';
};
Wallet.getStorageKey = function(str) {
return 'wallet::' + str;
return Wallet.getStoragePrefix() + str;
};
Wallet.prototype.getStorageKey = function() {
return Wallet.getStorageKey(this.getId());
};
/**
* check if any wallet exists on storage
* @param opts.storageOpts
* @param cb
*/
Wallet.checkIfExistsAny = function(opts, cb) {
var storage = opts.storage || opts.pluginManager.get('DB');
storage.getFirst(Wallet.getStoragePrefix(), {
onlyKey: true
}, function(err, v, k) {
return cb(k ? true : false);
});
};
/* for stubbing */
Wallet._newInsight = function(opts) {
return new Insight(opts);