Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Override lower bound gas when gasLimit is defined #5396

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/transaction-controller/src/utils/gas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ async function getGas(
return [txMeta.txParams.gas, undefined, txMeta.txParams.gas];
}

if (txMeta.txParams.gasLimit) {
Copy link
Member

@matthewwalsh0 matthewwalsh0 Feb 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than adding the support here specifically, is now a good time to instead remove all usages of gasLimit and mark it as deprecated in the TransactionParams type?

Plus update the NORMALIZERS in utils.ts to set gas to gasLimit if gas is undefined?

I'm assuming gas is the best choice going forward as it's the only one defined in our external doc and on ethereum.org.

log('Using value from request', txMeta.txParams.gasLimit);
return [txMeta.txParams.gasLimit, undefined, txMeta.txParams.gasLimit];
}

if (await requiresFixedGas(request)) {
log('Using fixed value', FIXED_GAS);
return [FIXED_GAS, undefined, FIXED_GAS];
Expand Down
Loading