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: Display manual gasLimit in GasParams overview #1711

Merged
merged 1 commit into from
Mar 1, 2023
Merged

Conversation

usame-algan
Copy link
Member

@usame-algan usame-algan commented Feb 28, 2023

What it solves

Resolves #1661

Changing the gasLimit is possible in any case but wasn't reflected in the UI

How this PR fixes it

  • Displays the manual gasLimit in the GasParams overview if it exists

How to test it

  1. Open the Safe
  2. Create a transaction where gas limit estimation would fail (e.g. send an NFT to a 1.0.0 safe)
  3. Observe Estimated Fee showing "Cannot estimate"
  4. Edit the gas limit and save
  5. Observe seeing an Estimated Fee and the manual gas limit

Analytics changes

Screenshots

Screenshot 2023-02-28 at 14 08 50

Screenshot 2023-02-28 at 14 09 42

@github-actions
Copy link

github-actions bot commented Feb 28, 2023

Branch preview

✅ Deploy successful!

https://edit_gaslimit--webcore.review-web-core.5afe.dev

@github-actions
Copy link

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@@ -34,6 +34,7 @@ const GasParams = ({ params, isExecution, isEIP1559, onEdit, gasLimitError }: Ga

const chain = useCurrentChain()
const isLoading = !gasLimit || !maxFeePerGas
const isError = gasLimitError && !gasLimit
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if we need gasLimitError or could pass the loading flag instead and do const isError = !gasLimitLoading && !gasLimit

Copy link
Member

@katspaugh katspaugh left a comment

Choose a reason for hiding this comment

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

Could you explain a little bit what the root cause of the bug was and how you fixed it?

@usame-algan
Copy link
Member Author

Could you explain a little bit what the root cause of the bug was and how you fixed it?

Changing the gasLimit is possible in any case but it wasn't reflected in the UI because the condition was only checking if there is a gas limit error but not if the gasLimit was manually changed.

Copy link
Member

@katspaugh katspaugh left a comment

Choose a reason for hiding this comment

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

I get it now, thanks!

@francovenica
Copy link
Contributor

Looks good. The value now reflects in the UI.
I also checked that the circular arrow that reset the estimated gas limit is not present (since there was no estimation duh)

@usame-algan usame-algan merged commit b8e4962 into dev Mar 1, 2023
@usame-algan usame-algan deleted the edit-gaslimit branch March 1, 2023 16:15
@github-actions github-actions bot locked and limited conversation to collaborators Mar 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't set up gaslimit manually in case of "This transaction will most likely fail"
4 participants