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

fix(oracle): update helper function to use correct conversion maths #2602

Merged
merged 1 commit into from
Sep 16, 2023

Conversation

0xfourzerofour
Copy link
Contributor

When converting between gwei and U256 it was rounding to the nearest whole number based on the decimal. For example if you added 2.49, the result would be 20000000 which is not idea

Solution

Multiplied the f64 before the rounding occurs

PR Checklist

  • [ yes] Added Tests
  • [no ] Added Documentation
  • [no ] Breaking changes

@0xfourzerofour 0xfourzerofour changed the title fix(oracle): update helper function to use correct converion maths fix(oracle): update helper function to use correct conversion maths Sep 15, 2023
@0xfourzerofour
Copy link
Contributor Author

@FrankieIsLost

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

lgtm

@DaniPopes DaniPopes merged commit 4ac0058 into gakonst:master Sep 16, 2023
19 checks passed
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