From e283c03c4ea9550d9edf852eb0949e261418d0b6 Mon Sep 17 00:00:00 2001 From: David Walsh Date: Fri, 30 Jul 2021 08:00:02 -0500 Subject: [PATCH] EIP-1559 - Improve gas timing logic to show more accurate verbiage (#11668) --- app/scripts/metamask-controller.js | 5 + .../edit-gas-display.component.js | 26 +--- ui/components/app/edit-gas-display/index.scss | 8 -- .../edit-gas-popover.component.js | 1 - .../app/gas-timing/gas-timing.component.js | 122 +++++++++++++++--- ui/components/app/gas-timing/index.scss | 4 + .../confirm-transaction-base.component.js | 1 + ui/store/actions.js | 7 + 8 files changed, 125 insertions(+), 49 deletions(-) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 3267e12e3..1d6c044f6 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -1122,6 +1122,11 @@ export default class MetamaskController extends EventEmitter { this.gasFeeController.disconnectPoller, this.gasFeeController, ), + + getGasFeeTimeEstimate: nodeify( + this.gasFeeController.getTimeEstimate, + this.gasFeeController, + ), }; } diff --git a/ui/components/app/edit-gas-display/edit-gas-display.component.js b/ui/components/app/edit-gas-display/edit-gas-display.component.js index ee80bddee..f44e5aa26 100644 --- a/ui/components/app/edit-gas-display/edit-gas-display.component.js +++ b/ui/components/app/edit-gas-display/edit-gas-display.component.js @@ -15,7 +15,6 @@ import { COLORS, TYPOGRAPHY, FONT_WEIGHT, - TEXT_ALIGN, } from '../../../helpers/constants/design-system'; import { areDappSuggestedAndTxParamGasFeesTheSame } from '../../../helpers/utils/confirm-tx.util'; @@ -52,7 +51,6 @@ export default function EditGasDisplay({ setEstimateToUse, estimatedMinimumFiat, estimatedMaximumFiat, - hasGasErrors, dappSuggestedGasFeeAcknowledged, setDappSuggestedGasFeeAcknowledged, showAdvancedForm, @@ -134,7 +132,12 @@ export default function EditGasDisplay({ , ]) } - timing={} + timing={ + + } /> {requireDappAcknowledgement && (