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(24732): fix error when sending txn from dapp and editing the gas #24810

Merged
merged 1 commit into from
May 29, 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
8 changes: 4 additions & 4 deletions test/e2e/tests/transaction/edit-gas-fee.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ describe('Editing Confirm Transaction', function () {
});

await driver.clickElement('[data-testid="edit-gas-fee-icon"]');
await driver.waitForSelector({
text: 'sec',
tag: 'span',
});
// -- should render the popover with no error
// this is to test in MV3 a racing issue when request for suggestedGasFees is not fetched properly
// some data would not be defined yet
await driver.waitForSelector('.edit-gas-fee-popover');
await driver.clickElement(
'[data-testid="edit-gas-fee-item-dappSuggested"]',
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export const useCustomTimeEstimate = ({
return {};
}

const { low = {}, medium = {}, high = {} } = gasFeeEstimates;
let waitTimeEstimate = '';

if (
Expand All @@ -73,11 +72,12 @@ export const useCustomTimeEstimate = ({
) {
waitTimeEstimate = Number(customEstimatedTime?.upperTimeBound);
} else if (
Number(maxPriorityFeePerGas) >= Number(medium.suggestedMaxPriorityFeePerGas)
Number(maxPriorityFeePerGas) >=
Number(gasFeeEstimates?.medium?.suggestedMaxPriorityFeePerGas)
) {
waitTimeEstimate = high.minWaitTimeEstimate;
waitTimeEstimate = gasFeeEstimates?.high?.minWaitTimeEstimate;
} else {
waitTimeEstimate = low.maxWaitTimeEstimate;
waitTimeEstimate = gasFeeEstimates?.low?.maxWaitTimeEstimate;
}

return { waitTimeEstimate };
Expand Down