Skip to content

Fix To Base radix validation#2524

Closed
marko1olo wants to merge 1 commit into
gchq:masterfrom
marko1olo:fix-to-base-radix-validation
Closed

Fix To Base radix validation#2524
marko1olo wants to merge 1 commit into
gchq:masterfrom
marko1olo:fix-to-base-radix-validation

Conversation

@marko1olo

Copy link
Copy Markdown

Summary

  • Reject fractional radix values before passing them to BigNumber#toString().
  • Convert values such as To_Base(2.2) into the existing controlled radix validation error instead of an uncaught BigNumber error.
  • Add operation coverage for normal base-2 conversion and the fractional radix regression.

Fixes #2487

Checks

  • node --no-warnings --no-deprecation --openssl-legacy-provider tests/operations/index.mjs
  • npx eslint src/core/operations/ToBase.mjs tests/operations/index.mjs tests/operations/tests/Base.mjs
  • npx grunt configTests
  • git diff --check

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@GCHQDeveloper581

Copy link
Copy Markdown
Contributor

Closing as #2561 enables a better fix, as now provided in #2586

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(To Base): Uncaught BigNumber Error when radix is a float

3 participants