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

remove EIP-1559 fields from txParams before calling estimateGas (#11368)

This commit is contained in:
Brad Decker 2021-06-28 10:33:19 -05:00 committed by GitHub
parent 80e755afcb
commit b6f514e293
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,8 +62,11 @@ export default class TxGasUtil {
// `eth_estimateGas` can fail if the user has insufficient balance for the
// value being sent, or for the gas cost. We don't want to check their
// balance here, we just want the gas estimate. The gas price is removed
// to skip those balance checks. We check balance elsewhere.
// to skip those balance checks. We check balance elsewhere. We also delete
// maxFeePerGas and maxPriorityFeePerGas to support EIP-1559 txs.
delete txParams.gasPrice;
delete txParams.maxFeePerGas;
delete txParams.maxPriorityFeePerGas;
// estimate tx gas requirements
return await this.query.estimateGas(txParams);