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

Replace toWei/fromWei when base token conversion #1318

Merged
merged 21 commits into from
Mar 16, 2022
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/pools/fixedRate/FixedRateExchange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,10 @@ export class FixedRateExchange {
const estGas = await this.estSetRate(
address,
exchangeId,
await this.unitsToAmount(exchange.baseToken, String(newRate))
await this.amountToUnits(exchange.baseToken, String(newRate))
Copy link
Contributor

Choose a reason for hiding this comment

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

why noy toString()?

Copy link
Member Author

Choose a reason for hiding this comment

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

this is what was used above so I used to be consistent

Copy link
Contributor

Choose a reason for hiding this comment

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

strange, we always use toString, don't know how that stayed there.

Copy link
Member Author

Choose a reason for hiding this comment

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

I will change it

Copy link
Member

Choose a reason for hiding this comment

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

feel free to update all String(value) in other places if you find more of this 😃

Copy link
Member Author

Choose a reason for hiding this comment

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

ok, I will

)
const trxReceipt = await this.contract.methods
.setRate(exchangeId, await this.unitsToAmount(exchange.baseToken, String(newRate)))
.setRate(exchangeId, await this.amountToUnits(exchange.baseToken, String(newRate)))
.send({
from: address,
gas: estGas + 1,
Expand Down