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(middleware): no need to multiply again with GWEI_TO_WEI_U256 #2326

Merged
merged 4 commits into from
Apr 5, 2023
Merged

fix(middleware): no need to multiply again with GWEI_TO_WEI_U256 #2326

merged 4 commits into from
Apr 5, 2023

Conversation

shekohex
Copy link
Contributor

@shekohex shekohex commented Apr 5, 2023

Motivation

While working on #2325 I did not notice that parse_units will return the correct value and will be no need to multiply the result again with GWEI_TO_WEI_U256 (1_000_000_000) extra zeros! which makes the gas calculations insanely incorrect!

Solution

Removing the multiplication process solves that issue.

Edit: actually, there was a method called from_gwei_f64 that we can use for that.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Copy link
Contributor

@drewstone drewstone left a comment

Choose a reason for hiding this comment

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

LG

@prestwich prestwich merged commit 1dd3545 into gakonst:master Apr 5, 2023
14 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants