8000
Skip to content
This repository was 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
DaniPopes merged 1 commit into
gakonst:masterfrom
0xfourzerofour:master
Sep 16, 2023
Merged

fix(oracle): update helper function to use correct conversion maths#2602
DaniPopes merged 1 commit into
gakonst:masterfrom
0xfourzerofour:master

Conversation

@0xfourzerofour
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

@FrankieIsLost

@mattsse mattsse left a comment
Copy link
Copy Markdown
Collaborator

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

0