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

Remove gasPrice defaults for eip-1559 txs (#11391)

This commit is contained in:
Brad Decker 2021-06-28 10:22:59 -05:00 committed by GitHub
parent d68f8f27c6
commit dd1330c707
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -376,7 +376,12 @@ export default class TransactionController extends EventEmitter {
if (simulationFails) {
txMeta.simulationFails = simulationFails;
}
if (defaultGasPrice && !txMeta.txParams.gasPrice) {
if (
defaultGasPrice &&
!txMeta.txParams.gasPrice &&
!txMeta.txParams.maxPriorityFeePerGas &&
!txMeta.txParams.maxFeePerGas
) {
txMeta.txParams.gasPrice = defaultGasPrice;
}
if (defaultGasLimit && !txMeta.txParams.gas) {
@ -391,7 +396,10 @@ export default class TransactionController extends EventEmitter {
* @returns {Promise<string|undefined>} The default gas price
*/
async _getDefaultGasPrice(txMeta) {
if (txMeta.txParams.gasPrice) {
if (
txMeta.txParams.gasPrice ||
(txMeta.txParams.maxFeePerGas && txMeta.txParams.maxPriorityFeePerGas)
) {
return undefined;
}
const gasPrice = await this.query.gasPrice();