diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2016-10-29 07:19:03 +0800 |
---|---|---|
committer | Kevin Serrano <kevgagser@gmail.com> | 2016-10-29 07:19:03 +0800 |
commit | 6eb6968037aeacd9c876912634ca5f4b5287957b (patch) | |
tree | 9e7c4978d07151eb44efedf4f335de300d62f543 /app/scripts/lib | |
parent | b3cb3e9ec67a138767bb2d6833c9056a66d46b92 (diff) | |
parent | 48220cff0e57ea56d3b3e2c2711ca83a4db96c01 (diff) | |
download | tangerine-wallet-browser-6eb6968037aeacd9c876912634ca5f4b5287957b.tar tangerine-wallet-browser-6eb6968037aeacd9c876912634ca5f4b5287957b.tar.gz tangerine-wallet-browser-6eb6968037aeacd9c876912634ca5f4b5287957b.tar.bz2 tangerine-wallet-browser-6eb6968037aeacd9c876912634ca5f4b5287957b.tar.lz tangerine-wallet-browser-6eb6968037aeacd9c876912634ca5f4b5287957b.tar.xz tangerine-wallet-browser-6eb6968037aeacd9c876912634ca5f4b5287957b.tar.zst tangerine-wallet-browser-6eb6968037aeacd9c876912634ca5f4b5287957b.zip |
Merge branch 'master' into i328-MultiVault
Diffstat (limited to 'app/scripts/lib')
-rw-r--r-- | app/scripts/lib/idStore.js | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js index 5943826a3..756becce3 100644 --- a/app/scripts/lib/idStore.js +++ b/app/scripts/lib/idStore.js @@ -245,17 +245,11 @@ IdentityStore.prototype.addUnconfirmedTransaction = function (txParams, onTxDone // perform static analyis on the target contract code function analyzeForDelegateCall(cb){ if (txParams.to) { - query.getCode(txParams.to, function (err, result) { + query.getCode(txParams.to, (err, result) => { if (err) return cb(err) - var code = ethUtil.toBuffer(result) - if (code !== '0x') { - var ops = ethBinToOps(code) - var containsDelegateCall = ops.some((op) => op.name === 'DELEGATECALL') - txData.containsDelegateCall = containsDelegateCall - cb() - } else { - cb() - } + var containsDelegateCall = self.checkForDelegateCall(result) + txData.containsDelegateCall = containsDelegateCall + cb() }) } else { cb() @@ -280,6 +274,17 @@ IdentityStore.prototype.addUnconfirmedTransaction = function (txParams, onTxDone } } +IdentityStore.prototype.checkForDelegateCall = function (codeHex) { + const code = ethUtil.toBuffer(codeHex) + if (code !== '0x') { + const ops = ethBinToOps(code) + const containsDelegateCall = ops.some((op) => op.name === 'DELEGATECALL') + return containsDelegateCall + } else { + return false + } +} + IdentityStore.prototype.addGasBuffer = function (gasHex) { var gas = new BN(gasHex, 16) var buffer = new BN('100000', 10) @@ -419,7 +424,7 @@ IdentityStore.prototype._loadIdentities = function () { // // add to ethStore this._ethStore.addAccount(ethUtil.addHexPrefix(address)) // add to identities - const defaultLabel = 'Wallet ' + (i + 1) + const defaultLabel = 'Account ' + (i + 1) const nickname = configManager.nicknameForWallet(address) var identity = { name: nickname || defaultLabel, |