diff options
author | Dan Finlay <dan@danfinlay.com> | 2016-10-22 03:11:54 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-10-22 03:11:54 +0800 |
commit | 44aa1be2778a1647c9a607fd02c61bf93704d92d (patch) | |
tree | a99d27dbcac5209950ffde79c53519fde2eaa621 /test/lib | |
parent | c3e1c5c57f2062155626647e239c2a760f3e4b8a (diff) | |
download | tangerine-wallet-browser-44aa1be2778a1647c9a607fd02c61bf93704d92d.tar tangerine-wallet-browser-44aa1be2778a1647c9a607fd02c61bf93704d92d.tar.gz tangerine-wallet-browser-44aa1be2778a1647c9a607fd02c61bf93704d92d.tar.bz2 tangerine-wallet-browser-44aa1be2778a1647c9a607fd02c61bf93704d92d.tar.lz tangerine-wallet-browser-44aa1be2778a1647c9a607fd02c61bf93704d92d.tar.xz tangerine-wallet-browser-44aa1be2778a1647c9a607fd02c61bf93704d92d.tar.zst tangerine-wallet-browser-44aa1be2778a1647c9a607fd02c61bf93704d92d.zip |
Create basic keyring-controller unit test file
Diffstat (limited to 'test/lib')
-rw-r--r-- | test/lib/mock-encryptor.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/lib/mock-encryptor.js b/test/lib/mock-encryptor.js new file mode 100644 index 000000000..09bbf7ad5 --- /dev/null +++ b/test/lib/mock-encryptor.js @@ -0,0 +1,32 @@ +var mockHex = '0xabcdef0123456789' +var mockKey = new Buffer(32) +let cacheVal + +module.exports = { + + encrypt(password, dataObj) { + cacheVal = dataObj + return Promise.resolve(mockHex) + }, + + decrypt(password, text) { + return Promise.resolve(cacheVal || {}) + }, + + encryptWithKey(key, dataObj) { + return this.encrypt(key, dataObj) + }, + + decryptWithKey(key, text) { + return this.decrypt(key, text) + }, + + keyFromPassword(password) { + return Promise.resolve(mockKey) + }, + + generateSalt() { + return 'WHADDASALT!' + }, + +} |