mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +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;
|
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) {
|
switch (gasEstimateType) {
|
||||||
case GAS_ESTIMATE_TYPES.FEE_MARKET:
|
case GAS_ESTIMATE_TYPES.FEE_MARKET:
|
||||||
if (maxPriorityFeePerGasToUse <= 0) {
|
if (maxPriorityFeePerGasToUse <= 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user