mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
remove unnecessary conversion call (#11742)
* remove unnecessary conversion call * Pass args to GasTiming as decGwei * lint
This commit is contained in:
parent
0eef0d424d
commit
0dcdbdd99e
@ -8,8 +8,6 @@ import { useGasFeeEstimates } from '../../../hooks/useGasFeeEstimates';
|
|||||||
import { usePrevious } from '../../../hooks/usePrevious';
|
import { usePrevious } from '../../../hooks/usePrevious';
|
||||||
import { I18nContext } from '../../../contexts/i18n';
|
import { I18nContext } from '../../../contexts/i18n';
|
||||||
|
|
||||||
import { hexWEIToDecGWEI } from '../../../helpers/utils/conversions.util';
|
|
||||||
|
|
||||||
import Typography from '../../ui/typography/typography';
|
import Typography from '../../ui/typography/typography';
|
||||||
import {
|
import {
|
||||||
TYPOGRAPHY,
|
TYPOGRAPHY,
|
||||||
@ -63,10 +61,7 @@ export default function GasTiming({
|
|||||||
(priority && priority !== previousMaxPriorityFeePerGas) ||
|
(priority && priority !== previousMaxPriorityFeePerGas) ||
|
||||||
(fee && fee !== previousMaxFeePerGas)
|
(fee && fee !== previousMaxFeePerGas)
|
||||||
) {
|
) {
|
||||||
getGasFeeTimeEstimate(
|
getGasFeeTimeEstimate(priority, fee).then((result) => {
|
||||||
hexWEIToDecGWEI(priority),
|
|
||||||
hexWEIToDecGWEI(fee),
|
|
||||||
).then((result) => {
|
|
||||||
if (maxFeePerGas === fee && maxPriorityFeePerGas === priority) {
|
if (maxFeePerGas === fee && maxPriorityFeePerGas === priority) {
|
||||||
setCustomEstimatedTime(result);
|
setCustomEstimatedTime(result);
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,11 @@ import { getEnvironmentType } from '../../../app/scripts/lib/util';
|
|||||||
import ConfirmPageContainer from '../../components/app/confirm-page-container';
|
import ConfirmPageContainer from '../../components/app/confirm-page-container';
|
||||||
import { isBalanceSufficient } from '../send/send.utils';
|
import { isBalanceSufficient } from '../send/send.utils';
|
||||||
import { getHexGasTotal } from '../../helpers/utils/confirm-tx.util';
|
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 {
|
import {
|
||||||
CONFIRM_TRANSACTION_ROUTE,
|
CONFIRM_TRANSACTION_ROUTE,
|
||||||
DEFAULT_ROUTE,
|
DEFAULT_ROUTE,
|
||||||
@ -19,7 +23,6 @@ import {
|
|||||||
} from '../../helpers/constants/error-keys';
|
} from '../../helpers/constants/error-keys';
|
||||||
import UserPreferencedCurrencyDisplay from '../../components/app/user-preferenced-currency-display';
|
import UserPreferencedCurrencyDisplay from '../../components/app/user-preferenced-currency-display';
|
||||||
import { PRIMARY, SECONDARY } from '../../helpers/constants/common';
|
import { PRIMARY, SECONDARY } from '../../helpers/constants/common';
|
||||||
|
|
||||||
import TextField from '../../components/ui/text-field';
|
import TextField from '../../components/ui/text-field';
|
||||||
import {
|
import {
|
||||||
TRANSACTION_TYPES,
|
TRANSACTION_TYPES,
|
||||||
@ -397,8 +400,10 @@ export default class ConfirmTransactionBase extends Component {
|
|||||||
}
|
}
|
||||||
subTitle={
|
subTitle={
|
||||||
<GasTiming
|
<GasTiming
|
||||||
maxPriorityFeePerGas={txData.txParams.maxPriorityFeePerGas}
|
maxPriorityFeePerGas={hexWEIToDecGWEI(
|
||||||
maxFeePerGas={txData.txParams.maxFeePerGas}
|
txData.txParams.maxPriorityFeePerGas,
|
||||||
|
)}
|
||||||
|
maxFeePerGas={hexWEIToDecGWEI(txData.txParams.maxFeePerGas)}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
/>,
|
/>,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user