aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/selectors
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/selectors')
-rw-r--r--ui/app/selectors/custom-gas.js4
-rw-r--r--ui/app/selectors/selectors.js15
2 files changed, 18 insertions, 1 deletions
diff --git a/ui/app/selectors/custom-gas.js b/ui/app/selectors/custom-gas.js
index 5ba786f0f..1f7ee8f9f 100644
--- a/ui/app/selectors/custom-gas.js
+++ b/ui/app/selectors/custom-gas.js
@@ -119,6 +119,10 @@ function isCustomPriceSafe (state) {
return true
}
+ if (safeLow === null) {
+ return null
+ }
+
const customPriceSafe = conversionGreaterThan(
{
value: customGasPrice,
diff --git a/ui/app/selectors/selectors.js b/ui/app/selectors/selectors.js
index c7cb80024..56591b7b0 100644
--- a/ui/app/selectors/selectors.js
+++ b/ui/app/selectors/selectors.js
@@ -1,5 +1,6 @@
import { NETWORK_TYPES } from '../helpers/constants/common'
-import { stripHexPrefix } from 'ethereumjs-util'
+import { stripHexPrefix, addHexPrefix } from 'ethereumjs-util'
+
const abi = require('human-standard-token-abi')
import {
@@ -50,6 +51,7 @@ const selectors = {
isEthereumNetwork,
getMetaMetricState,
getRpcPrefsForCurrentProvider,
+ getKnownMethodData,
}
module.exports = selectors
@@ -335,3 +337,14 @@ function getRpcPrefsForCurrentProvider (state) {
const { rpcPrefs = {} } = selectRpcInfo || {}
return rpcPrefs
}
+
+function getKnownMethodData (state, data) {
+ if (!data) {
+ return null
+ }
+ const prefixedData = addHexPrefix(data)
+ const fourBytePrefix = prefixedData.slice(0, 10)
+ const { knownMethodData } = state.metamask
+
+ return knownMethodData && knownMethodData[fourBytePrefix]
+}