diff options
author | kumavis <kumavis@users.noreply.github.com> | 2018-10-30 09:47:07 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-30 09:47:07 +0800 |
commit | 310229d22e5e916e8d6e3b1a469b9b196e0f70c2 (patch) | |
tree | 518bd3f5fb01c792fe2e44db3aace1c20f22c7e1 /ui/app/helpers | |
parent | 1bb4a8428c73c1f1137793b25900db159eec3fa8 (diff) | |
parent | 9b42416fc0d92662d1a21759db357e7f439d7a7b (diff) | |
download | tangerine-wallet-browser-310229d22e5e916e8d6e3b1a469b9b196e0f70c2.tar tangerine-wallet-browser-310229d22e5e916e8d6e3b1a469b9b196e0f70c2.tar.gz tangerine-wallet-browser-310229d22e5e916e8d6e3b1a469b9b196e0f70c2.tar.bz2 tangerine-wallet-browser-310229d22e5e916e8d6e3b1a469b9b196e0f70c2.tar.lz tangerine-wallet-browser-310229d22e5e916e8d6e3b1a469b9b196e0f70c2.tar.xz tangerine-wallet-browser-310229d22e5e916e8d6e3b1a469b9b196e0f70c2.tar.zst tangerine-wallet-browser-310229d22e5e916e8d6e3b1a469b9b196e0f70c2.zip |
Merge pull request #5567 from MetaMask/HowardBraham-develop
Feature: Warn when attempting to send tx with data to non-contract
Diffstat (limited to 'ui/app/helpers')
-rw-r--r-- | ui/app/helpers/transactions.util.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/app/helpers/transactions.util.js b/ui/app/helpers/transactions.util.js index 64ec82225..2f4b1d095 100644 --- a/ui/app/helpers/transactions.util.js +++ b/ui/app/helpers/transactions.util.js @@ -125,7 +125,9 @@ export function getLatestSubmittedTxWithNonce (transactions = [], nonce = '0x0') export async function isSmartContractAddress (address) { const code = await global.eth.getCode(address) - return code && code !== '0x' + // Geth will return '0x', and ganache-core v2.2.1 will return '0x0' + const codeIsEmpty = !code || code === '0x' || code === '0x0' + return !codeIsEmpty } export function sumHexes (...args) { |