Skip to content

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

Open
PaulRBerg wants to merge 2 commits intopods-finance:masterfrom
PaulRBerg:dryification
Open

DRY-ify humanized amounts + Add "scaleUp" + Fix tokenA decimals#10
PaulRBerg wants to merge 2 commits intopods-finance:masterfrom
PaulRBerg:dryification

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