mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-29 23:58:06 +01:00
92971d3c87
* Update eslint-plugin-import version * Convert JS files to use ESM * Update ESLint rules to check imports * Fix test:unit:global command env * Cleanup mock-dev script
37 lines
580 B
JavaScript
37 lines
580 B
JavaScript
const mockHex = '0xabcdef0123456789'
|
|
const mockKey = Buffer.alloc(32)
|
|
let cacheVal
|
|
|
|
export default {
|
|
|
|
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'
|
|
},
|
|
|
|
}
|