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

fix(swap): don't crash app when token decimals eq 0 #3228

Merged
merged 1 commit into from
Oct 17, 2023

Conversation

shoom3301
Copy link
Collaborator

Summary

image

To Test

  1. Open https://dev.swap.cow.fi/#/1/swap/SLP/COW
  • AR: the app crashes with the error above
  • ER: the app doesn't crash
  1. TWAP suggestion banner should contain a link with proper amounts

@shoom3301 shoom3301 requested a review from a team October 16, 2023 12:41
@shoom3301 shoom3301 self-assigned this Oct 16, 2023
@vercel
Copy link

vercel bot commented Oct 16, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
swap-dev 🔄 Building (Inspect) Visit Preview Oct 17, 2023 8:55am

🌃 Cosmos ↗︎

@@ -101,7 +101,7 @@ export const SwapWarningsTop = React.memo(function (props: SwapWarningsTopProps)
priceImpact={priceImpact}
buyingFiatAmount={buyingFiatAmount}
tradeUrlParams={tradeUrlParams}
sellAmount={trade?.inputAmount.toFixed(trade?.inputAmount?.currency?.decimals || 18)}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@alfetopito do you remember why toFixed() was used instead of toExact()?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably a mistake

Copy link
Collaborator

@alfetopito alfetopito left a comment

Choose a reason for hiding this comment

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

It doesn't crash anymore \o/

But I also don't see the banner 🤔
image

@alfetopito alfetopito changed the base branch from develop to hotfix/1.48.1 October 17, 2023 08:41
@alfetopito alfetopito merged commit 3b8b62b into hotfix/1.48.1 Oct 17, 2023
4 of 5 checks passed
@alfetopito alfetopito deleted the fix/token-0-dec branch October 17, 2023 08:56
@github-actions github-actions bot locked and limited conversation to collaborators Oct 17, 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.

2 participants