From 7c62570c023f72ba7bfe7bac9ce5cd2b809071ca Mon Sep 17 00:00:00 2001 From: kshitij01042002 Date: Thu, 22 Feb 2024 10:06:04 +0530 Subject: [PATCH] removed gas estimation feature as of now --- .../send-gas-row/send-gas-row.component.js | 3 ++- ui/app/selectors/custom-gas.js | 25 +++++++++++-------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/ui/app/pages/send/send-content/send-gas-row/send-gas-row.component.js b/ui/app/pages/send/send-content/send-gas-row/send-gas-row.component.js index 8df7bbbfaebf..157173ec5a44 100644 --- a/ui/app/pages/send/send-content/send-gas-row/send-gas-row.component.js +++ b/ui/app/pages/send/send-content/send-gas-row/send-gas-row.component.js @@ -147,7 +147,8 @@ export default class SendGasRow extends Component { ) // Tests should behave in same way as mainnet, but are using Localhost - if (advancedInlineGasShown || (!isMainnet && !process.env.IN_TEST)) { + // if (advancedInlineGasShown || (!isMainnet && !process.env.IN_TEST)) { // will enable this when gas estimation endpoint is ready + if (advancedInlineGasShown || (!process.env.IN_TEST)) { return advancedGasInputs } else if (gasButtonGroupShown) { return gasPriceButtonGroup diff --git a/ui/app/selectors/custom-gas.js b/ui/app/selectors/custom-gas.js index 7e8a2dea621d..4dcf4c062e9b 100644 --- a/ui/app/selectors/custom-gas.js +++ b/ui/app/selectors/custom-gas.js @@ -40,12 +40,14 @@ export function getCustomGasTotal (state) { return state.gas.customData.total } -export function getBasicGasEstimateLoadingStatus (state) { - return state.gas.basicEstimateIsLoading +export function getBasicGasEstimateLoadingStatus () { + // return state.gas.basicEstimateIsLoading // will enable again when API for gas endpoint is ready + return false } export function getGasEstimatesLoadingStatus (state) { - return state.gas.gasEstimatesLoading + // return state.gas.gasEstimatesLoading // will enable again when API for gas endpoint is ready + return false } export function getPriceAndTimeEstimates (state) { @@ -53,7 +55,8 @@ export function getPriceAndTimeEstimates (state) { } export function getEstimatedGasPrices (state) { - return getPriceAndTimeEstimates(state).map(({ gasprice }) => gasprice) + // return getPriceAndTimeEstimates(state).map(({ gasprice }) => gasprice) //will enable again when API for gas endpoint is ready + return 15 } export function getEstimatedGasTimes (state) { @@ -67,7 +70,7 @@ export function getAveragePriceEstimateInHexWEI (state) { export function getFastPriceEstimateInHexWEI (state) { const fastPriceEstimate = state.gas.basicEstimates.fast - return getGasPriceInHexWei(fastPriceEstimate || '0x0') + return getGasPriceInHexWei(fastPriceEstimate || '0xF') } export function getDefaultActiveButtonIndex (gasButtonInfo, customGasPriceInHex, gasPrice) { @@ -192,9 +195,9 @@ export function getGasPriceInHexWei (price) { } export function getRenderableBasicEstimateData (state, gasLimit) { - if (getBasicGasEstimateLoadingStatus(state)) { - return [] - } + // if (getBasicGasEstimateLoadingStatus(state)) { + // return [] + // } // will enable again when API for gas endpoint is ready const { showFiatInTestnets } = getPreferences(state) const isMainnet = getIsMainnet(state) const showFiat = (isMainnet || Boolean(showFiatInTestnets)) @@ -245,9 +248,9 @@ export function getRenderableBasicEstimateData (state, gasLimit) { } export function getRenderableEstimateDataForSmallButtonsFromGWEI (state) { - if (getBasicGasEstimateLoadingStatus(state)) { - return [] - } + // if (getBasicGasEstimateLoadingStatus(state)) { + // return [] + // } // will enable again when API for gas endpoint is ready const { showFiatInTestnets } = getPreferences(state) const isMainnet = getIsMainnet(state)