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:
parent
d68f8f27c6
commit
dd1330c707
@ -376,7 +376,12 @@ export default class TransactionController extends EventEmitter {
|
|||||||
if (simulationFails) {
|
if (simulationFails) {
|
||||||
txMeta.simulationFails = simulationFails;
|
txMeta.simulationFails = simulationFails;
|
||||||
}
|
}
|
||||||
if (defaultGasPrice && !txMeta.txParams.gasPrice) {
|
if (
|
||||||
|
defaultGasPrice &&
|
||||||
|
!txMeta.txParams.gasPrice &&
|
||||||
|
!txMeta.txParams.maxPriorityFeePerGas &&
|
||||||
|
!txMeta.txParams.maxFeePerGas
|
||||||
|
) {
|
||||||
txMeta.txParams.gasPrice = defaultGasPrice;
|
txMeta.txParams.gasPrice = defaultGasPrice;
|
||||||
}
|
}
|
||||||
if (defaultGasLimit && !txMeta.txParams.gas) {
|
if (defaultGasLimit && !txMeta.txParams.gas) {
|
||||||
@ -391,7 +396,10 @@ export default class TransactionController extends EventEmitter {
|
|||||||
* @returns {Promise<string|undefined>} The default gas price
|
* @returns {Promise<string|undefined>} The default gas price
|
||||||
*/
|
*/
|
||||||
async _getDefaultGasPrice(txMeta) {
|
async _getDefaultGasPrice(txMeta) {
|
||||||
if (txMeta.txParams.gasPrice) {
|
if (
|
||||||
|
txMeta.txParams.gasPrice ||
|
||||||
|
(txMeta.txParams.maxFeePerGas && txMeta.txParams.maxPriorityFeePerGas)
|
||||||
|
) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
const gasPrice = await this.query.gasPrice();
|
const gasPrice = await this.query.gasPrice();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user