diff options
Merge branch 'dev' into i843-MoveSaltIntoEncryptor
Diffstat (limited to 'app/scripts/lib')
-rw-r--r-- | app/scripts/lib/encryptor.js | 10 | ||||
-rw-r--r-- | app/scripts/lib/idStore-migrator.js | 2 | ||||
-rw-r--r-- | app/scripts/lib/idStore.js | 8 | ||||
-rw-r--r-- | app/scripts/lib/inpage-provider.js | 10 |
4 files changed, 14 insertions, 16 deletions
diff --git a/app/scripts/lib/encryptor.js b/app/scripts/lib/encryptor.js index 2af2a1d2b..df72b62c0 100644 --- a/app/scripts/lib/encryptor.js +++ b/app/scripts/lib/encryptor.js @@ -1,5 +1,3 @@ -var ethUtil = require('ethereumjs-util') - module.exports = { // Simple encryption methods: @@ -101,10 +99,10 @@ function keyFromPassword (password) { } function serializeBufferFromStorage (str) { - str = ethUtil.stripHexPrefix(str) - var buf = new Uint8Array(str.length / 2) - for (var i = 0; i < str.length; i += 2) { - var seg = str.substr(i, 2) + var stripStr = (str.slice(0, 2) === '0x') ? str.slice(2) : str + var buf = new Uint8Array(stripStr.length / 2) + for (var i = 0; i < stripStr.length; i += 2) { + var seg = stripStr.substr(i, 2) buf[i / 2] = parseInt(seg, 16) } return buf diff --git a/app/scripts/lib/idStore-migrator.js b/app/scripts/lib/idStore-migrator.js index 18134b677..40b08efee 100644 --- a/app/scripts/lib/idStore-migrator.js +++ b/app/scripts/lib/idStore-migrator.js @@ -11,7 +11,7 @@ module.exports = class IdentityStoreMigrator { } } - oldSeedForPassword (password) { + migratedVaultForPassword (password) { const hasOldVault = this.hasOldVault() const configManager = this.configManager diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js index b73652af5..e5861c0ca 100644 --- a/app/scripts/lib/idStore.js +++ b/app/scripts/lib/idStore.js @@ -44,7 +44,7 @@ function IdentityStore (opts = {}) { // public // -IdentityStore.prototype.createNewVault = function (password, entropy, cb) { +IdentityStore.prototype.createNewVault = function (password, cb) { delete this._keyStore var serializedKeystore = this.configManager.getWallet() @@ -53,7 +53,7 @@ IdentityStore.prototype.createNewVault = function (password, entropy, cb) { } this.purgeCache() - this._createVault(password, null, entropy, (err) => { + this._createVault(password, null, (err) => { if (err) return cb(err) this._autoFaucet() @@ -77,7 +77,7 @@ IdentityStore.prototype.recoverSeed = function (cb) { IdentityStore.prototype.recoverFromSeed = function (password, seed, cb) { this.purgeCache() - this._createVault(password, seed, null, (err) => { + this._createVault(password, seed, (err) => { if (err) return cb(err) this._loadIdentities() @@ -497,7 +497,7 @@ IdentityStore.prototype.tryPassword = function (password, cb) { }) } -IdentityStore.prototype._createVault = function (password, seedPhrase, entropy, cb) { +IdentityStore.prototype._createVault = function (password, seedPhrase, cb) { const opts = { password, hdPathString: this.hdPathString, diff --git a/app/scripts/lib/inpage-provider.js b/app/scripts/lib/inpage-provider.js index 034812b6a..7179ae978 100644 --- a/app/scripts/lib/inpage-provider.js +++ b/app/scripts/lib/inpage-provider.js @@ -66,20 +66,20 @@ function MetamaskInpageProvider (connectionStream) { MetamaskInpageProvider.prototype.send = function (payload) { const self = this - let selectedAddress + let selectedAccount let result = null switch (payload.method) { case 'eth_accounts': // read from localStorage - selectedAddress = self.publicConfigStore.get('selectedAddress') - result = selectedAddress ? [selectedAddress] : [] + selectedAccount = self.publicConfigStore.get('selectedAddress') + result = selectedAccount ? [selectedAccount] : [] break case 'eth_coinbase': // read from localStorage - selectedAddress = self.publicConfigStore.get('selectedAddress') - result = selectedAddress || '0x0000000000000000000000000000000000000000' + selectedAccount = self.publicConfigStore.get('selectedAddress') + result = selectedAccount || '0x0000000000000000000000000000000000000000' break // throw not-supported Error |