aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorThomas Huang <tmashuang@users.noreply.github.com>2019-04-27 01:05:38 +0800
committerGitHub <noreply@github.com>2019-04-27 01:05:38 +0800
commit608796398e7f5045fde3344eefca44d7d73ff7ac (patch)
tree3ce7014c4087e5414543dc6f46538506b11e8a93 /ui
parent13605c2b5ef19c3fcdc5725ed7793024521700ce (diff)
downloadtangerine-wallet-browser-608796398e7f5045fde3344eefca44d7d73ff7ac.tar
tangerine-wallet-browser-608796398e7f5045fde3344eefca44d7d73ff7ac.tar.gz
tangerine-wallet-browser-608796398e7f5045fde3344eefca44d7d73ff7ac.tar.bz2
tangerine-wallet-browser-608796398e7f5045fde3344eefca44d7d73ff7ac.tar.lz
tangerine-wallet-browser-608796398e7f5045fde3344eefca44d7d73ff7ac.tar.xz
tangerine-wallet-browser-608796398e7f5045fde3344eefca44d7d73ff7ac.tar.zst
tangerine-wallet-browser-608796398e7f5045fde3344eefca44d7d73ff7ac.zip
Revert "Adds 4byte registry fallback to getMethodData() (#6435)"
This reverts commit 09f2a2a5476c4c119c7294f496f6590156d8d07a.
Diffstat (limited to 'ui')
-rw-r--r--ui/app/helpers/utils/transactions.util.js30
-rw-r--r--ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js2
2 files changed, 4 insertions, 28 deletions
diff --git a/ui/app/helpers/utils/transactions.util.js b/ui/app/helpers/utils/transactions.util.js
index 8d96b1487..cb6c9536c 100644
--- a/ui/app/helpers/utils/transactions.util.js
+++ b/ui/app/helpers/utils/transactions.util.js
@@ -30,21 +30,6 @@ export function getTokenData (data = '') {
return abiDecoder.decodeMethod(data)
}
-async function getMethodFrom4Byte (fourBytePrefix) {
- const fourByteResponse = (await fetch(`https://www.4byte.directory/api/v1/signatures/?hex_signature=${fourBytePrefix}`, {
- referrerPolicy: 'no-referrer-when-downgrade',
- body: null,
- method: 'GET',
- mode: 'cors',
- })).json()
-
- if (fourByteResponse.count === 1) {
- return fourByteResponse.results[0].text_signature
- } else {
- return null
- }
-}
-
const registry = new MethodRegistry({ provider: global.ethereumProvider })
/**
@@ -58,16 +43,7 @@ const registry = new MethodRegistry({ provider: global.ethereumProvider })
const fourBytePrefix = prefixedData.slice(0, 10)
try {
- const fourByteSig = getMethodFrom4Byte(fourBytePrefix).catch((e) => {
- log.error(e)
- return null
- })
-
- let sig = await registry.lookup(fourBytePrefix)
-
- if (!sig) {
- sig = await fourByteSig
- }
+ const sig = await registry.lookup(fourBytePrefix)
if (!sig) {
return {}
@@ -81,8 +57,8 @@ const registry = new MethodRegistry({ provider: global.ethereumProvider })
}
} catch (error) {
log.error(error)
- const tokenData = getTokenData(data)
- const { name } = tokenData || {}
+ const contractData = getTokenData(data)
+ const { name } = contractData || {}
return { name }
}
diff --git a/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js b/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js
index be819b5f0..1cbe5951d 100644
--- a/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js
+++ b/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js
@@ -543,7 +543,7 @@ export default class ConfirmTransactionBase extends Component {
toName={toName}
toAddress={toAddress}
showEdit={onEdit && !isTxReprice}
- action={actionKey && this.context.t(actionKey) || getMethodName(name) || this.context.t('contractInteraction')}
+ action={this.context.t(actionKey) || getMethodName(name) || this.context.t('contractInteraction')}
title={title}
titleComponent={this.renderTitleComponent()}
subtitle={subtitle}