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

feature/default_network_editable
Brad Decker 3 years ago committed by GitHub
parent 80e755afcb
commit b6f514e293
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      app/scripts/controllers/transactions/tx-gas-utils.js

@ -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);

Loading…
Cancel
Save