A Metamask fork with Infura removed and default networks editable
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ciphermask/test/lib/mock-encryptor.js

33 lines
549 B

var mockHex = '0xabcdef0123456789'
var mockKey = new Buffer(32)
let cacheVal
module.exports = {
8 years ago
encrypt (password, dataObj) {
cacheVal = dataObj
return Promise.resolve(mockHex)
},
8 years ago
decrypt (password, text) {
return Promise.resolve(cacheVal || {})
},
8 years ago
encryptWithKey (key, dataObj) {
return this.encrypt(key, dataObj)
},
8 years ago
decryptWithKey (key, text) {
return this.decrypt(key, text)
},
8 years ago
keyFromPassword (password) {
return Promise.resolve(mockKey)
},
8 years ago
generateSalt () {
return 'WHADDASALT!'
},
}