aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/idStore-migration-test.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-03-17 02:16:03 +0800
committerDan Finlay <dan@danfinlay.com>2017-03-17 02:16:03 +0800
commitb6e2eaf7b1d14fcca8ed614791937a5ccbfc00dd (patch)
tree9e718e5d775371ada9d389233fd72d06721f047e /test/unit/idStore-migration-test.js
parent00f1a2d78d01301f51157e9c8b8352dc0796d034 (diff)
downloadtangerine-wallet-browser-b6e2eaf7b1d14fcca8ed614791937a5ccbfc00dd.tar
tangerine-wallet-browser-b6e2eaf7b1d14fcca8ed614791937a5ccbfc00dd.tar.gz
tangerine-wallet-browser-b6e2eaf7b1d14fcca8ed614791937a5ccbfc00dd.tar.bz2
tangerine-wallet-browser-b6e2eaf7b1d14fcca8ed614791937a5ccbfc00dd.tar.lz
tangerine-wallet-browser-b6e2eaf7b1d14fcca8ed614791937a5ccbfc00dd.tar.xz
tangerine-wallet-browser-b6e2eaf7b1d14fcca8ed614791937a5ccbfc00dd.tar.zst
tangerine-wallet-browser-b6e2eaf7b1d14fcca8ed614791937a5ccbfc00dd.zip
Remove eth-lightwallet
Diffstat (limited to 'test/unit/idStore-migration-test.js')
-rw-r--r--test/unit/idStore-migration-test.js83
1 files changed, 0 insertions, 83 deletions
diff --git a/test/unit/idStore-migration-test.js b/test/unit/idStore-migration-test.js
deleted file mode 100644
index 81a99ef63..000000000
--- a/test/unit/idStore-migration-test.js
+++ /dev/null
@@ -1,83 +0,0 @@
-const async = require('async')
-const assert = require('assert')
-const ObservableStore = require('obs-store')
-const ethUtil = require('ethereumjs-util')
-const BN = ethUtil.BN
-const ConfigManager = require('../../app/scripts/lib/config-manager')
-const firstTimeState = require('../../app/scripts/first-time-state')
-const delegateCallCode = require('../lib/example-code.json').delegateCallCode
-const clone = require('clone')
-
-// The old way:
-const IdentityStore = require('../../app/scripts/lib/idStore')
-const STORAGE_KEY = 'metamask-config'
-
-// The new ways:
-var KeyringController = require('../../app/scripts/keyring-controller')
-const mockEncryptor = require('../lib/mock-encryptor')
-const MockSimpleKeychain = require('../lib/mock-simple-keychain')
-const sinon = require('sinon')
-
-const mockVault = {
- seed: 'picnic injury awful upper eagle junk alert toss flower renew silly vague',
- account: '0x5d8de92c205279c10e5669f797b853ccef4f739a',
-}
-
-const badVault = {
- seed: 'radar blur cabbage chef fix engine embark joy scheme fiction master release',
-}
-
-describe('IdentityStore to KeyringController migration', function() {
-
- // The stars of the show:
- let idStore, keyringController, seedWords, configManager
-
- let password = 'password123'
- let entropy = 'entripppppyy duuude'
- let accounts = []
- let newAccounts = []
- let originalKeystore
-
- // This is a lot of setup, I know!
- // We have to create an old style vault, populate it,
- // and THEN create a new one, before we can run tests on it.
- beforeEach(function(done) {
- this.sinon = sinon.sandbox.create()
- let store = new ObservableStore(clone(firstTimeState))
- configManager = new ConfigManager({ store })
-
- idStore = new IdentityStore({
- configManager: configManager,
- ethStore: {
- addAccount(acct) { accounts.push(ethUtil.addHexPrefix(acct)) },
- del(acct) { delete accounts[acct] },
- },
- })
-
- idStore._createVault(password, mockVault.seed, (err) => {
- assert.ifError(err, 'createNewVault threw error')
- originalKeystore = idStore._idmgmt.keyStore
-
- idStore.setLocked((err) => {
- assert.ifError(err, 'createNewVault threw error')
- keyringController = new KeyringController({
- configManager,
- ethStore: {
- addAccount(acct) { newAccounts.push(ethUtil.addHexPrefix(acct)) },
- del(acct) { delete newAccounts[acct] },
- },
- txManager: {
- getTxList: () => [],
- getUnapprovedTxList: () => []
- },
- })
-
- // Stub out the browser crypto for a mock encryptor.
- // Browser crypto is tested in the integration test suite.
- keyringController.encryptor = mockEncryptor
- done()
- })
- })
- })
-
-})