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

Swaps: fix safe math negative number support, add comparison functions #5776

Merged
merged 2 commits into from
May 27, 2024

Conversation

christianbaroni
Copy link
Member

@christianbaroni christianbaroni commented May 27, 2024

What changed (plus any additional context for devs)

  • Fixes the isNumberString regex check to allow negative number strings
  • Updates scaleUp and formatResult to handle negative numbers correctly — previously they were failing when passed a negative number string
  • Adds number comparison functions and tests:
    • equal
    • greaterThan
    • greaterThanOrEqualTo
    • lessThan
    • lessThanOrEqualTo
  • Converts all functions to worklets — confirmed that tests still run successfully
  • Adds a Worklet suffix to the safe math function names

Screen recordings / screenshots

Screenshot 2024-05-27 at 3 22 26 PM

What to test

Copy link
Member

@brunobar79 brunobar79 left a comment

Choose a reason for hiding this comment

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

🔥 🔥 🔥

@christianbaroni christianbaroni merged commit 0889e09 into develop May 27, 2024
6 checks passed
@christianbaroni christianbaroni deleted the @christian/safe-math-improvements branch May 27, 2024 19:56
BrodyHughes added a commit that referenced this pull request May 28, 2024
…licious-dapp-warning-e2e

* 'develop' of github.com:rainbow-me/rainbow:
  Swaps: package upgrades, fix SwapBackground and AnimatedSwapSpinner (#5775)
  Swaps: fix safe math negative number support, add comparison functions (#5776)
  Reanimated v3.11.0 (#5683)
  Gas (#5757)
  add degen chain to network selector (#5766)
  prefer local chain image over custom (#5772)
  add safe math fns (#5765)
  filter out assets from curated assets with no icon_url (#5768)
  fix isQuoteStale lag (#5769)
  fix icon sizing (#5771)
  Preliminary work: Update formatter functions to take in object params (#5760)
  APP-1500 (#5763)
  chore: i18n updates (#5762)
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.

None yet

2 participants