1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 20:39:08 +01:00
metamask-extension/test/lib/mock-encryptor.js
Whymarrh Whitby 094e4cf555 Check for unused function arguments (#6583)
* eslint: Check for unused function arguments

* eslint: Ignore unused '_' in argument list

Also allow any number of '_' e.g., '__' or '___' which is to be used sparingly

* Remove and rename unused arguments
2019-05-08 15:51:33 -04:00

37 lines
578 B
JavaScript

var mockHex = '0xabcdef0123456789'
var mockKey = Buffer.alloc(32)
let cacheVal
module.exports = {
encrypt (_, dataObj) {
cacheVal = dataObj
return Promise.resolve(mockHex)
},
decrypt () {
return Promise.resolve(cacheVal || {})
},
encryptWithKey (key, dataObj) {
return this.encrypt(key, dataObj)
},
decryptWithKey (key, text) {
return this.decrypt(key, text)
},
keyFromPassword () {
return Promise.resolve(mockKey)
},
generateSalt () {
return 'WHADDASALT!'
},
getRandomValues () {
return 'SOO RANDO!!!1'
},
}