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

Remove redundant EIP_1559_V2_ENABLED comparison (#12954)

A redundant comparison for the `EIP_1559_V2_ENABLED` variable has been
removed. This variable is a boolean, so it can be treated as a boolean
directly in most cases.

One such comparison has been preserved for the purpose of allowing unit
testing, because `process.env` entries are always strings in Node.js. A
comment was added to explain this.
This commit is contained in:
Mark Stacey 2021-12-06 11:23:02 -03:30 committed by GitHub
parent 6d34d85f6e
commit b75ef5f0eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -74,8 +74,8 @@ export function useGasFeeInputs(
minimumGasLimit = '0x5208',
editGasMode = EDIT_GAS_MODES.MODIFY_IN_PLACE,
) {
// eslint-disable-next-line prefer-destructuring
const EIP_1559_V2_ENABLED =
// This is a string in unit tests but is a boolean in the browser
process.env.EIP_1559_V2 === true || process.env.EIP_1559_V2 === 'true';
const supportsEIP1559 =

View File

@ -64,8 +64,7 @@ import GasDetailsItem from './gas-details-item';
import TransactionAlerts from './transaction-alerts';
// eslint-disable-next-line prefer-destructuring
const EIP_1559_V2_ENABLED =
process.env.EIP_1559_V2 === true || process.env.EIP_1559_V2 === 'true';
const EIP_1559_V2_ENABLED = process.env.EIP_1559_V2;
const renderHeartBeatIfNotInTest = () =>
process.env.IN_TEST ? null : <LoadingHeartBeat />;