diff options
author | kumavis <kumavis@users.noreply.github.com> | 2016-10-25 07:24:29 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-25 07:24:29 +0800 |
commit | f7688ac3cf8939057013667f544d57dcb73937a5 (patch) | |
tree | 6fd725ffd0ea856c4205472557e33aa012b3b16e /app | |
parent | eba37e773df54276e84d27c02a370719f670cc8b (diff) | |
parent | 3af3565000e4952d95c50c1c25a9367ba8caec90 (diff) | |
download | tangerine-wallet-browser-f7688ac3cf8939057013667f544d57dcb73937a5.tar tangerine-wallet-browser-f7688ac3cf8939057013667f544d57dcb73937a5.tar.gz tangerine-wallet-browser-f7688ac3cf8939057013667f544d57dcb73937a5.tar.bz2 tangerine-wallet-browser-f7688ac3cf8939057013667f544d57dcb73937a5.tar.lz tangerine-wallet-browser-f7688ac3cf8939057013667f544d57dcb73937a5.tar.xz tangerine-wallet-browser-f7688ac3cf8939057013667f544d57dcb73937a5.tar.zst tangerine-wallet-browser-f7688ac3cf8939057013667f544d57dcb73937a5.zip |
Merge pull request #745 from MetaMask/i743-FixDelegateCallFlag
Reproduced issue 743 in test case
Diffstat (limited to 'app')
-rw-r--r-- | app/scripts/lib/idStore.js | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js index 9d0ca7f19..402a5e612 100644 --- a/app/scripts/lib/idStore.js +++ b/app/scripts/lib/idStore.js @@ -249,15 +249,9 @@ IdentityStore.prototype.addUnconfirmedTransaction = function (txParams, onTxDone if (txParams.to) { query.getCode(txParams.to, function (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 = this.checkForDelegateCall(result) + txData.containsDelegateCall = containsDelegateCall + cb() }) } else { cb() @@ -282,6 +276,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) |