Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

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
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.

3 participants