remove unnecessary conversion call (#11742)

* remove unnecessary conversion call

* Pass args to GasTiming as decGwei

* lint
feature/default_network_editable
Alex Donesky 3 years ago committed by GitHub
parent 7902e62d8f
commit 4552a53724
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      ui/components/app/gas-timing/gas-timing.component.js
  2. 13
      ui/pages/confirm-transaction-base/confirm-transaction-base.component.js

@ -8,8 +8,6 @@ import { useGasFeeEstimates } from '../../../hooks/useGasFeeEstimates';
import { usePrevious } from '../../../hooks/usePrevious';
import { I18nContext } from '../../../contexts/i18n';
import { hexWEIToDecGWEI } from '../../../helpers/utils/conversions.util';
import Typography from '../../ui/typography/typography';
import {
TYPOGRAPHY,
@ -63,10 +61,7 @@ export default function GasTiming({
(priority && priority !== previousMaxPriorityFeePerGas) ||
(fee && fee !== previousMaxFeePerGas)
) {
getGasFeeTimeEstimate(
hexWEIToDecGWEI(priority),
hexWEIToDecGWEI(fee),
).then((result) => {
getGasFeeTimeEstimate(priority, fee).then((result) => {
if (maxFeePerGas === fee && maxPriorityFeePerGas === priority) {
setCustomEstimatedTime(result);
}

@ -5,7 +5,11 @@ import { getEnvironmentType } from '../../../app/scripts/lib/util';
import ConfirmPageContainer from '../../components/app/confirm-page-container';
import { isBalanceSufficient } from '../send/send.utils';
import { getHexGasTotal } from '../../helpers/utils/confirm-tx.util';
import { addHexes, hexToDecimal } from '../../helpers/utils/conversions.util';
import {
addHexes,
hexToDecimal,
hexWEIToDecGWEI,
} from '../../helpers/utils/conversions.util';
import {
CONFIRM_TRANSACTION_ROUTE,
DEFAULT_ROUTE,
@ -19,7 +23,6 @@ import {
} from '../../helpers/constants/error-keys';
import UserPreferencedCurrencyDisplay from '../../components/app/user-preferenced-currency-display';
import { PRIMARY, SECONDARY } from '../../helpers/constants/common';
import TextField from '../../components/ui/text-field';
import {
TRANSACTION_TYPES,
@ -397,8 +400,10 @@ export default class ConfirmTransactionBase extends Component {
}
subTitle={
<GasTiming
maxPriorityFeePerGas={txData.txParams.maxPriorityFeePerGas}
maxFeePerGas={txData.txParams.maxFeePerGas}
maxPriorityFeePerGas={hexWEIToDecGWEI(
txData.txParams.maxPriorityFeePerGas,
)}
maxFeePerGas={hexWEIToDecGWEI(txData.txParams.maxFeePerGas)}
/>
}
/>,

Loading…
Cancel
Save