diff options
author | Alexander Tseung <alextsg@users.noreply.github.com> | 2018-08-23 05:48:37 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-23 05:48:37 +0800 |
commit | 25eac2334b96b8b2af6b8859631d8a032bfdd2bb (patch) | |
tree | 8205c57d55c2182e21b4dc87ec907b86343e374a /ui/app/helpers/confirm-transaction | |
parent | 619ab3838ba5d34d61fa71204d1d59514299b80c (diff) | |
parent | 865a0d8173e27c073f00d0d156b95e8d92208a94 (diff) | |
download | tangerine-wallet-browser-25eac2334b96b8b2af6b8859631d8a032bfdd2bb.tar tangerine-wallet-browser-25eac2334b96b8b2af6b8859631d8a032bfdd2bb.tar.gz tangerine-wallet-browser-25eac2334b96b8b2af6b8859631d8a032bfdd2bb.tar.bz2 tangerine-wallet-browser-25eac2334b96b8b2af6b8859631d8a032bfdd2bb.tar.lz tangerine-wallet-browser-25eac2334b96b8b2af6b8859631d8a032bfdd2bb.tar.xz tangerine-wallet-browser-25eac2334b96b8b2af6b8859631d8a032bfdd2bb.tar.zst tangerine-wallet-browser-25eac2334b96b8b2af6b8859631d8a032bfdd2bb.zip |
Merge pull request #5089 from MetaMask/i5085-ethcode
Use eth_getCode to sort transaction action type
Diffstat (limited to 'ui/app/helpers/confirm-transaction')
-rw-r--r-- | ui/app/helpers/confirm-transaction/util.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ui/app/helpers/confirm-transaction/util.js b/ui/app/helpers/confirm-transaction/util.js index 76e80a8ac..3d0cb57e7 100644 --- a/ui/app/helpers/confirm-transaction/util.js +++ b/ui/app/helpers/confirm-transaction/util.js @@ -146,3 +146,8 @@ export function roundExponential (value) { // In JS, numbers with exponentials greater than 20 get displayed as an exponential. return bigNumberValue.e > 20 ? Number(bigNumberValue.toPrecision(PRECISION)) : value } + +export async function isSmartContractAddress (address) { + const code = await global.eth.getCode(address) + return code && code !== '0x' +} |