1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Ensure correct conversion of data before calling getGasFeeTimeEstimate (#11697)

This commit is contained in:
Dan J Miller 2021-07-30 19:41:55 -02:30 committed by GitHub
parent b2cb38ab2d
commit a1f8a65519
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,8 @@ 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,
@ -58,10 +60,13 @@ export default function GasTiming({
if ( if (
isUnknownLow || isUnknownLow ||
priority !== previousMaxPriorityFeePerGas || (priority && priority !== previousMaxPriorityFeePerGas) ||
fee !== previousMaxFeePerGas (fee && fee !== previousMaxFeePerGas)
) { ) {
getGasFeeTimeEstimate(priority, fee).then((result) => { getGasFeeTimeEstimate(
hexWEIToDecGWEI(priority),
hexWEIToDecGWEI(fee),
).then((result) => {
if (maxFeePerGas === fee && maxPriorityFeePerGas === priority) { if (maxFeePerGas === fee && maxPriorityFeePerGas === priority) {
setCustomEstimatedTime(result); setCustomEstimatedTime(result);
} }