Remove general get/put/remove methods from AxolotlStore
This commit is contained in:
parent
d0e262d7cb
commit
915612114b
2 changed files with 2 additions and 11 deletions
|
@ -87,15 +87,6 @@
|
||||||
|
|
||||||
AxolotlStore.prototype = {
|
AxolotlStore.prototype = {
|
||||||
constructor: AxolotlStore,
|
constructor: AxolotlStore,
|
||||||
get: function(key,defaultValue) {
|
|
||||||
return textsecure.storage.get(key, defaultValue);
|
|
||||||
},
|
|
||||||
put: function(key, value) {
|
|
||||||
textsecure.storage.put(key, value);
|
|
||||||
},
|
|
||||||
remove: function(key) {
|
|
||||||
textsecure.storage.remove(key);
|
|
||||||
},
|
|
||||||
getMyIdentityKey: function() {
|
getMyIdentityKey: function() {
|
||||||
var res = textsecure.storage.get('identityKey');
|
var res = textsecure.storage.get('identityKey');
|
||||||
if (res === undefined)
|
if (res === undefined)
|
||||||
|
|
|
@ -29,12 +29,12 @@ describe("AxolotlStore", function() {
|
||||||
privKey: textsecure.crypto.getRandomBytes(32),
|
privKey: textsecure.crypto.getRandomBytes(32),
|
||||||
};
|
};
|
||||||
it('retrieves my registration id', function() {
|
it('retrieves my registration id', function() {
|
||||||
store.put('registrationId', 1337);
|
textsecure.storage.put('registrationId', 1337);
|
||||||
var reg = store.getMyRegistrationId();
|
var reg = store.getMyRegistrationId();
|
||||||
assert.strictEqual(reg, 1337);
|
assert.strictEqual(reg, 1337);
|
||||||
});
|
});
|
||||||
it('retrieves my identity key', function() {
|
it('retrieves my identity key', function() {
|
||||||
store.put('identityKey', identityKey);
|
textsecure.storage.put('identityKey', identityKey);
|
||||||
var key = store.getMyIdentityKey();
|
var key = store.getMyIdentityKey();
|
||||||
assertEqualArrayBuffers(key.pubKey, identityKey.pubKey);
|
assertEqualArrayBuffers(key.pubKey, identityKey.pubKey);
|
||||||
assertEqualArrayBuffers(key.privKey, identityKey.privKey);
|
assertEqualArrayBuffers(key.privKey, identityKey.privKey);
|
||||||
|
|
Loading…
Reference in a new issue