aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/idStore.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-10-26 07:59:58 +0800
committerDan Finlay <dan@danfinlay.com>2016-10-26 07:59:58 +0800
commitf9ff6cb55e35f29e95cab3b2157b58e602e6a35c (patch)
treeb722dadc330744a8037be1afe9ffd7a4c51c5baf /app/scripts/lib/idStore.js
parent152419a79bd26d9b6f5af43c2066eb1e6f619716 (diff)
parentf7688ac3cf8939057013667f544d57dcb73937a5 (diff)
downloadtangerine-wallet-browser-f9ff6cb55e35f29e95cab3b2157b58e602e6a35c.tar
tangerine-wallet-browser-f9ff6cb55e35f29e95cab3b2157b58e602e6a35c.tar.gz
tangerine-wallet-browser-f9ff6cb55e35f29e95cab3b2157b58e602e6a35c.tar.bz2
tangerine-wallet-browser-f9ff6cb55e35f29e95cab3b2157b58e602e6a35c.tar.lz
tangerine-wallet-browser-f9ff6cb55e35f29e95cab3b2157b58e602e6a35c.tar.xz
tangerine-wallet-browser-f9ff6cb55e35f29e95cab3b2157b58e602e6a35c.tar.zst
tangerine-wallet-browser-f9ff6cb55e35f29e95cab3b2157b58e602e6a35c.zip
Merge branch 'master' into i328-MultiVault
Diffstat (limited to 'app/scripts/lib/idStore.js')
-rw-r--r--app/scripts/lib/idStore.js23
1 files changed, 14 insertions, 9 deletions
diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js
index 416b65b85..236de3fd2 100644
--- a/app/scripts/lib/idStore.js
+++ b/app/scripts/lib/idStore.js
@@ -248,15 +248,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()
@@ -281,6 +275,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)