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

"humanize" utility not used internally (non-DRY) #7

Open
PaulRBerg opened this issue Jul 26, 2022 · 0 comments
Open

"humanize" utility not used internally (non-DRY) #7

PaulRBerg opened this issue Jul 26, 2022 · 0 comments

Comments

@PaulRBerg
Copy link

This code base provides a humanize utility that can abstract away the dividedBy(new BigNumber(10).pow(...)) syntax, so that users don't repeat themselves writing it over and over again, but this utility is not used internally. A quick global search on VSCode revealed over hundreds of repetitions, e.g. here:

sdk/src/entities/option.ts

Lines 211 to 213 in e39956b

humanized: new BigNumber(params.strikePrice).dividedBy(
new BigNumber(10).pow(this.strike!.decimals)
),

And here:

humanized: new BigNumber(this.premiumPaid!).dividedBy(
new BigNumber(10).pow(this.option!.pool!.tokenB!.decimals)
),

And here:

sdk/src/entities/action.ts

Lines 311 to 313 in e39956b

humanized: new BigNumber(this.inputTokenA!).dividedBy(
new BigNumber(10).pow(this.option!.pool!.tokenA!.decimals)
),

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

No branches or pull requests

1 participant