Wallet/test/mocks/FakeStorage.js
Ryan X. Charles 96a6203bb0 make my code work with the latest interface changes
...to Wallet and WalletFactory
2014-04-16 21:13:35 -03:00

30 lines
608 B
JavaScript

var FakeStorage = function(){
this.storage = {};
};
FakeStorage.prototype.setGlobal = function (id, payload) {
this.storage[id] = payload;
};
FakeStorage.prototype.getGlobal = function(id) {
return this.storage[id];
}
FakeStorage.prototype.set = function (wid, id, payload) {
this.storage[wid + '-' + id] = payload;
};
FakeStorage.prototype.get = function(wid, id) {
return this.storage[wid + '-' +id];
}
FakeStorage.prototype.clear = function() {
delete this['storage'];
}
FakeStorage.prototype.getWalletIds = function() {
return [];
};
module.exports = require('soop')(FakeStorage);