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.
35 lines
1.0 KiB
35 lines
1.0 KiB
var assert = require('assert')
|
|
var KeyringController = require('../../app/scripts/keyring-controller')
|
|
var configManagerGen = require('../lib/mock-config-manager')
|
|
const ethUtil = require('ethereumjs-util')
|
|
const async = require('async')
|
|
|
|
describe('KeyringController', function() {
|
|
|
|
describe('#createNewVault', function () {
|
|
let keyringController
|
|
let password = 'password123'
|
|
let entropy = 'entripppppyy duuude'
|
|
let seedWords
|
|
let accounts = []
|
|
let originalKeystore
|
|
|
|
before(function(done) {
|
|
window.localStorage = {} // Hacking localStorage support into JSDom
|
|
|
|
keyringController = new KeyringController({
|
|
configManager: configManagerGen(),
|
|
ethStore: {
|
|
addAccount(acct) { accounts.push(ethUtil.addHexPrefix(acct)) },
|
|
},
|
|
})
|
|
|
|
keyringController.createNewVault(password, entropy, (err, seeds) => {
|
|
assert.ifError(err, 'createNewVault threw error')
|
|
seedWords = seeds
|
|
originalKeystore = keyringController._idmgmt.keyStore
|
|
done()
|
|
})
|
|
})
|
|
})
|
|
})
|
|
|