mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 01:39:44 +01:00
parent
38ff2c937f
commit
4ce6994a6c
@ -662,6 +662,9 @@
|
||||
"editGasMaxFeeLow": {
|
||||
"message": "Max fee too low for network conditions"
|
||||
},
|
||||
"editGasMaxFeePriorityImbalance": {
|
||||
"message": "Max fee cannot be lower than max priority fee"
|
||||
},
|
||||
"editGasMaxFeeTooltip": {
|
||||
"message": "The max fee is the most you’ll pay (base fee + priority fee)."
|
||||
},
|
||||
|
@ -5,6 +5,7 @@ export const GAS_FORM_ERRORS = {
|
||||
MAX_PRIORITY_FEE_ZERO: 'editGasMaxPriorityFeeZeroError',
|
||||
MAX_PRIORITY_FEE_HIGH_WARNING: 'editGasMaxPriorityFeeHigh',
|
||||
MAX_FEE_HIGH_WARNING: 'editGasMaxFeeHigh',
|
||||
MAX_FEE_IMBALANCE: 'editGasMaxFeeImbalance',
|
||||
};
|
||||
|
||||
export function getGasFormErrorText(type, t, { minimumGasLimit } = {}) {
|
||||
@ -21,6 +22,8 @@ export function getGasFormErrorText(type, t, { minimumGasLimit } = {}) {
|
||||
return t('editGasMaxPriorityFeeHigh');
|
||||
case GAS_FORM_ERRORS.MAX_FEE_HIGH_WARNING:
|
||||
return t('editGasMaxFeeHigh');
|
||||
case GAS_FORM_ERRORS.MAX_FEE_IMBALANCE:
|
||||
return t('editGasMaxFeePriorityImbalance');
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
|
@ -384,6 +384,8 @@ export function useGasFeeInputs(
|
||||
gasFeeEstimates?.low?.suggestedMaxPriorityFeePerGas
|
||||
) {
|
||||
gasErrors.maxPriorityFee = GAS_FORM_ERRORS.MAX_PRIORITY_FEE_TOO_LOW;
|
||||
} else if (maxPriorityFeePerGasToUse >= maxFeePerGasToUse) {
|
||||
gasErrors.maxFee = GAS_FORM_ERRORS.MAX_FEE_IMBALANCE;
|
||||
} else if (
|
||||
gasFeeEstimates?.high &&
|
||||
maxPriorityFeePerGasToUse >
|
||||
@ -419,8 +421,8 @@ export function useGasFeeInputs(
|
||||
// and errors into one object for easier use within the UI. This object should have
|
||||
// no effect on whether or not the user can submit the form
|
||||
const errorsAndWarnings = {
|
||||
...gasErrors,
|
||||
...gasWarnings,
|
||||
...gasErrors,
|
||||
};
|
||||
|
||||
const minimumTxCostInHexWei = addHexes(
|
||||
|
Loading…
Reference in New Issue
Block a user