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 | |
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')
-rw-r--r-- | ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js | 2 | ||||
-rw-r--r-- | ui/app/components/send/send.utils.js | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js b/ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js index c92867afe..7d01aaffb 100644 --- a/ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js +++ b/ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js @@ -136,7 +136,7 @@ export default class ConfirmTransactionBase extends Component { if (simulationFails) { return { valid: true, - errorKey: TRANSACTION_ERROR_KEY, + errorKey: simulationFails.errorKey ? simulationFails.errorKey : TRANSACTION_ERROR_KEY, } } 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) { |