1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Handle a negative gas fee (#13511)

This commit is contained in:
Daniel 2022-02-07 11:58:31 +01:00 committed by Dan Miller
parent a7eaf1bd7f
commit 9731e5fbeb

View File

@ -51,8 +51,10 @@ function calculateGasEstimateWithRefund(
estimatedRefund, estimatedRefund,
10, 10,
); );
const isMaxGasMinusRefundNegative = maxGasMinusRefund.lt(0);
const gasEstimateWithRefund = maxGasMinusRefund.lt(estimatedGas, 16) const gasEstimateWithRefund =
!isMaxGasMinusRefundNegative && maxGasMinusRefund.lt(estimatedGas, 16)
? maxGasMinusRefund.toString(16) ? maxGasMinusRefund.toString(16)
: estimatedGas; : estimatedGas;