aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorFrankie <frankie.diamond@gmail.com>2017-01-19 03:30:41 +0800
committerGitHub <noreply@github.com>2017-01-19 03:30:41 +0800
commite3650b336a37c6026ec9bca8174abdbed22dc554 (patch)
tree4086c37f0981f6aac6dd6a244a14580db43e48cf /app
parent460cbb985f4190220b9f5dc0e5b0cf80bfa08941 (diff)
parent528ceff07c01371feaa147bb850452eab30ea2e0 (diff)
downloadtangerine-wallet-browser-e3650b336a37c6026ec9bca8174abdbed22dc554.tar.gz
tangerine-wallet-browser-e3650b336a37c6026ec9bca8174abdbed22dc554.tar.zst
tangerine-wallet-browser-e3650b336a37c6026ec9bca8174abdbed22dc554.zip
Merge branch 'master' into fixSignedVsSubmitted
Diffstat (limited to 'app')
-rw-r--r--app/manifest.json2
-rw-r--r--app/scripts/keyrings/simple.js9
2 files changed, 7 insertions, 4 deletions
diff --git a/app/manifest.json b/app/manifest.json
index 95dcfc31a..9c6558d15 100644
--- a/app/manifest.json
+++ b/app/manifest.json
@@ -1,7 +1,7 @@
{
"name": "MetaMask",
"short_name": "Metamask",
- "version": "2.14.1",
+ "version": "3.0.0",
"manifest_version": 2,
"author": "https://metamask.io",
"description": "Ethereum Browser Extension",
diff --git a/app/scripts/keyrings/simple.js b/app/scripts/keyrings/simple.js
index 9717f1c45..6b16137ae 100644
--- a/app/scripts/keyrings/simple.js
+++ b/app/scripts/keyrings/simple.js
@@ -35,12 +35,12 @@ class SimpleKeyring extends EventEmitter {
newWallets.push(Wallet.generate())
}
this.wallets = this.wallets.concat(newWallets)
- const hexWallets = newWallets.map(w => w.getAddress().toString('hex'))
+ const hexWallets = newWallets.map(w => ethUtil.bufferToHex(w.getAddress()))
return Promise.resolve(hexWallets)
}
getAccounts () {
- return Promise.resolve(this.wallets.map(w => w.getAddress().toString('hex')))
+ return Promise.resolve(this.wallets.map(w => ethUtil.bufferToHex(w.getAddress())))
}
// tx is an instance of the ethereumjs-transaction class.
@@ -54,6 +54,7 @@ class SimpleKeyring extends EventEmitter {
// For eth_sign, we need to sign transactions:
signMessage (withAccount, data) {
const wallet = this._getWalletForAccount(withAccount)
+
const message = ethUtil.removeHexPrefix(data)
var privKey = wallet.getPrivateKey()
var msgSig = ethUtil.ecsign(new Buffer(message, 'hex'), privKey)
@@ -70,7 +71,9 @@ class SimpleKeyring extends EventEmitter {
/* PRIVATE METHODS */
_getWalletForAccount (account) {
- return this.wallets.find(w => w.getAddress().toString('hex') === account)
+ let wallet = this.wallets.find(w => ethUtil.bufferToHex(w.getAddress()) === account)
+ if (!wallet) throw new Error('Simple Keyring - Unable to find matching address.')
+ return wallet
}
}