1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00

Allow max priority fee to be below 1, and only require it to be greater than 0 (#11749)

This commit is contained in:
Dan J Miller 2021-08-04 10:53:52 -02:30 committed by GitHub
parent 61b965a8a2
commit b9fb495c7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 7 deletions

View File

@ -668,6 +668,9 @@
"editGasMaxFeeTooltip": {
"message": "The max fee is the most youll pay (base fee + priority fee)."
},
"editGasMaxPriorityFeeBelowMinimum": {
"message": "Max priority fee must be greater than 0 GWEI"
},
"editGasMaxPriorityFeeHigh": {
"message": "Max priority fee is higher than necessary. You may pay more than needed."
},
@ -677,9 +680,6 @@
"editGasMaxPriorityFeeTooltip": {
"message": "Max priority fee (aka “miner tip”) goes directly to miners and incentivizes them to prioritize your transaction. Youll most often pay your max setting"
},
"editGasMaxPriorityFeeZeroError": {
"message": "Max priority fee must be at least 1 GWEI"
},
"editGasMedium": {
"message": "Medium"
},

View File

@ -17,8 +17,8 @@ export function getGasFormErrorText(type, t, { minimumGasLimit } = {}) {
return t('editGasMaxPriorityFeeLow');
case GAS_FORM_ERRORS.MAX_FEE_TOO_LOW:
return t('editGasMaxFeeLow');
case GAS_FORM_ERRORS.MAX_PRIORITY_FEE_ZERO:
return t('editGasMaxPriorityFeeZeroError');
case GAS_FORM_ERRORS.MAX_PRIORITY_FEE_BELOW_MINIMUM:
return t('editGasMaxPriorityFeeBelowMinimum');
case GAS_FORM_ERRORS.MAX_PRIORITY_FEE_HIGH_WARNING:
return t('editGasMaxPriorityFeeHigh');
case GAS_FORM_ERRORS.MAX_FEE_HIGH_WARNING:

View File

@ -390,8 +390,9 @@ export function useGasFeeInputs(
switch (gasEstimateType) {
case GAS_ESTIMATE_TYPES.FEE_MARKET:
if (maxPriorityFeePerGasToUse < 1) {
gasErrors.maxPriorityFee = GAS_FORM_ERRORS.MAX_PRIORITY_FEE_ZERO;
if (maxPriorityFeePerGasToUse <= 0) {
gasErrors.maxPriorityFee =
GAS_FORM_ERRORS.MAX_PRIORITY_FEE_BELOW_MINIMUM;
} else if (
!isGasEstimatesLoading &&
maxPriorityFeePerGasToUse <