From 54c85e87f0e0c569ca5fff1f1b0e3a7e2c6e000d Mon Sep 17 00:00:00 2001 From: Vinicius Stevam <45455812+vinistevam@users.noreply.github.com> Date: Wed, 11 Sep 2024 10:03:17 +0100 Subject: [PATCH] fix: update `network is busy` threshold 0.9 (#26983) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** This PR aims to update the threshold for the `network is busy` warning. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26983?quickstart=1) ## **Related issues** Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2752 ## **Manual testing steps** 1. Go to this test Dapp or start a simple send ## **Screenshots/Recordings** ### **Before** ### **After** ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com> --- shared/constants/gas.ts | 2 +- ui/ducks/metamask/metamask.test.js | 6 +++--- .../status-slider/status-slider.test.js | 8 ++++---- .../components/gas-details-item/gas-details-item.test.js | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/shared/constants/gas.ts b/shared/constants/gas.ts index 5748ee00d9f3..010ff6ffe66f 100644 --- a/shared/constants/gas.ts +++ b/shared/constants/gas.ts @@ -82,7 +82,7 @@ export enum EditGasModes { export enum NetworkCongestionThresholds { notBusy = 0, stable = 0.33, - busy = 0.66, + busy = 0.9, } export type TxGasFees = { diff --git a/ui/ducks/metamask/metamask.test.js b/ui/ducks/metamask/metamask.test.js index d36dac4f87bb..5f3021297c96 100644 --- a/ui/ducks/metamask/metamask.test.js +++ b/ui/ducks/metamask/metamask.test.js @@ -509,7 +509,7 @@ describe('MetaMask Reducers', () => { metamask: { gasFeeEstimatesByChainId: { '0x1': { - gasFeeEstimates: { networkCongestion: 0.67 }, + gasFeeEstimates: { networkCongestion: 0.91 }, }, }, }, @@ -526,7 +526,7 @@ describe('MetaMask Reducers', () => { metamask: { gasFeeEstimatesByChainId: { '0x1': { - gasFeeEstimates: { networkCongestion: 0.66 }, + gasFeeEstimates: { networkCongestion: 0.9 }, }, }, }, @@ -543,7 +543,7 @@ describe('MetaMask Reducers', () => { metamask: { gasFeeEstimatesByChainId: { '0x1': { - gasFeeEstimates: { networkCongestion: 0.65 }, + gasFeeEstimates: { networkCongestion: 0.89 }, }, }, }, diff --git a/ui/pages/confirmations/components/edit-gas-fee-popover/network-statistics/status-slider/status-slider.test.js b/ui/pages/confirmations/components/edit-gas-fee-popover/network-statistics/status-slider/status-slider.test.js index abeee19e720e..4811469a667b 100644 --- a/ui/pages/confirmations/components/edit-gas-fee-popover/network-statistics/status-slider/status-slider.test.js +++ b/ui/pages/confirmations/components/edit-gas-fee-popover/network-statistics/status-slider/status-slider.test.js @@ -34,13 +34,13 @@ describe('StatusSlider', () => { expect(getByText('Stable')).toBeInTheDocument(); }); - it('should show "Busy" when networkCongestion is 0.66', () => { - const { getByText } = renderComponent({ networkCongestion: 0.66 }); + it('should show "Busy" when networkCongestion is 0.9', () => { + const { getByText } = renderComponent({ networkCongestion: 0.9 }); expect(getByText('Busy')).toBeInTheDocument(); }); - it('should show "Busy" when networkCongestion is greater than 0.66', () => { - const { getByText } = renderComponent({ networkCongestion: 0.67 }); + it('should show "Busy" when networkCongestion is greater than 0.9', () => { + const { getByText } = renderComponent({ networkCongestion: 0.91 }); expect(getByText('Busy')).toBeInTheDocument(); }); diff --git a/ui/pages/confirmations/components/gas-details-item/gas-details-item.test.js b/ui/pages/confirmations/components/gas-details-item/gas-details-item.test.js index 16ba3c892877..ca85dd9abae9 100644 --- a/ui/pages/confirmations/components/gas-details-item/gas-details-item.test.js +++ b/ui/pages/confirmations/components/gas-details-item/gas-details-item.test.js @@ -270,7 +270,7 @@ describe('GasDetailsItem', () => { high: { suggestedMaxPriorityFeePerGas: '1', }, - networkCongestion: 0.7, + networkCongestion: 0.91, }, }, },