Skip to content

fix: increase gas limit validation threshold #29264

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

Merged
merged 3 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ describe('AdvancedGasFeeGasLimit', () => {
),
).toBeInTheDocument();
fireEvent.change(document.getElementsByTagName('input')[0], {
target: { value: 8000000 },
target: { value: 80000000 },
});
expect(
screen.queryByText(
Expand Down Expand Up @@ -154,7 +154,7 @@ describe('AdvancedGasFeeGasLimit', () => {
);
expect(
screen.queryByText(
`Gas limit must be greater than 29999 and less than 7920050`,
`Gas limit must be greater than 29999 and less than 30000000`,
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't the lower limit 20999?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah I also tried to fix that and got stuck until I realised that we have an error logic where we use editGasLimitOutOfBoundsV2 which accepts two values so in the mocking data we are sending originalGasEstimate: '0x78D9B2' (30000) and there is this logic here changing the min to 29999.

),
).toBeInTheDocument();
});
Expand Down
2 changes: 1 addition & 1 deletion ui/pages/confirmations/send/send.constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { EtherDenomination } from '../../../../shared/constants/common';
const MIN_GAS_PRICE_DEC = '0';
const MIN_GAS_PRICE_HEX = parseInt(MIN_GAS_PRICE_DEC, 10).toString(16);
const MIN_GAS_LIMIT_DEC = new Numeric('21000', 10);
const MAX_GAS_LIMIT_DEC = '7920027';
const MAX_GAS_LIMIT_DEC = '30000000';

const HIGH_FEE_WARNING_MULTIPLIER = 1.5;
const MIN_GAS_PRICE_GWEI = new Numeric(
Expand Down
Loading