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/components/send | |
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/components/send')
-rw-r--r-- | ui/app/components/send/send.utils.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/app/components/send/send.utils.js b/ui/app/components/send/send.utils.js index a18a9e4b3..eb1667c63 100644 --- a/ui/app/components/send/send.utils.js +++ b/ui/app/components/send/send.utils.js @@ -215,7 +215,9 @@ async function estimateGas ({ // if recipient has no code, gas is 21k max: if (!selectedToken && !data) { const code = Boolean(to) && await global.eth.getCode(to) - if (!code || code === '0x') { + // Geth will return '0x', and ganache-core v2.2.1 will return '0x0' + const codeIsEmpty = !code || code === '0x' || code === '0x0' + if (codeIsEmpty) { return SIMPLE_GAS_COST } } else if (selectedToken && !to) { |