mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 01:39:44 +01:00
Ensure that gas fee minimum errors show when api is down (#11767)
* Fix legacy unapproved tx handling * clean up
This commit is contained in:
parent
818dc13019
commit
9fcd93191b
@ -414,6 +414,17 @@ export function useGasFeeInputs(
|
||||
gasErrors.gasLimit = GAS_FORM_ERRORS.GAS_LIMIT_OUT_OF_BOUNDS;
|
||||
}
|
||||
|
||||
// This ensures these are applied when the api fails to return a fee market type
|
||||
// It is okay if these errors get overwritten below, as those overwrites can only
|
||||
// happen when the estimate api is live.
|
||||
if (networkAndAccountSupports1559) {
|
||||
if (maxPriorityFeePerGasToUse <= 0) {
|
||||
gasErrors.maxPriorityFee = GAS_FORM_ERRORS.MAX_PRIORITY_FEE_BELOW_MINIMUM;
|
||||
} else if (maxPriorityFeePerGasToUse >= maxFeePerGasToUse) {
|
||||
gasErrors.maxFee = GAS_FORM_ERRORS.MAX_FEE_IMBALANCE;
|
||||
}
|
||||
}
|
||||
|
||||
switch (gasEstimateType) {
|
||||
case GAS_ESTIMATE_TYPES.FEE_MARKET:
|
||||
if (maxPriorityFeePerGasToUse <= 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user