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