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

DRY-ify humanized amounts + Add "scaleUp" + Fix tokenA decimals #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

PaulRBerg
Copy link

@PaulRBerg PaulRBerg commented Jul 26, 2022

Changelog:

  • Add scaleUp utility
  • DRY-ify humanized variable calculations
  • DRY-ify calculations in entities/helper.ts with scaleUp
  • Fix use tokenA decimals in tokenA amounts
  • Make "humanize" function accept BigNumber | number

Addresses #7, #8 and #9.

feat: add "scaleUp" utility
fix: use tokenA decimals in tokenA amounts
refactor: dry-ify calculations in "entities/helper.ts" with "scaleUp"
refactor: make "humanize" function accept "BigNumber | number"
Copy link

@ggviana ggviana left a comment

Choose a reason for hiding this comment

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

LGTM!

@razgraf
Copy link
Contributor

razgraf commented Jul 27, 2022

Please make sure to conduct further analysis before merging this commit. While some of the optimizations and dry-ification of the code is correct, a part of this PR isn't correct due to a technical misunderstanding of the variables' scope. I've reached out to Paul and explained and will continue his work and add fixes during the next weeks as I return to work.

@PaulRBerg
Copy link
Author

I think that the only changes that have to be reverted are the use of the tokenB decimals. Luckily I have written an exhaustive list of those changes in #9, so I just undid them in my latest commit.

The PR should be good to be merged now, unless there are other mistakes. Will wait for your review.

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.

3 participants