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

feat: add warning for invalid precision in BN format method #3586

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

VolodymyrBg
Copy link

@VolodymyrBg VolodymyrBg commented Jan 14, 2025

Added a warning when precision is less than minPrecision in the BN.format method. This maintains backward compatibility while alerting users to potential issues. The warning suggests setting precision >= minPrecision for correct behavior.

Resolves TODO in packages/math/src/bn.ts

Checklist

  • All changes are covered by tests (or not applicable)
  • All changes are documented (or not applicable)
  • I reviewed the entire PR myself (preferably, on GH UI)
  • I described all Breaking Changes (or there's none)

Added a warning when precision is less than minPrecision in the BN.format method.
This maintains backward compatibility while alerting users to potential issues.
The warning suggests setting precision >= minPrecision for correct behavior.

Resolves TODO in packages/math/src/bn.ts
@fuel-cla-bot
Copy link

fuel-cla-bot bot commented Jan 14, 2025

Thanks for the contribution! Before we can merge this, we need @VolodymyrBg to sign the Fuel Labs Contributor License Agreement.

Copy link

vercel bot commented Jan 14, 2025

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

Name Status Preview Comments Updated (UTC)
ts-docs-api ❌ Failed (Inspect) Jan 17, 2025 6:46pm

Copy link

vercel bot commented Jan 14, 2025

@VolodymyrBg is attempting to deploy a commit to the Fuel Labs Team on Vercel.

A member of the Team first needs to authorize it.

@petertonysmith94
Copy link
Contributor

Hey @VolodymyrBg 👋🏼

Could you add some tests around this behaviour?

This PR also requires a changeset, run the following command and select the affected packages.

pnpm changeset add

@VolodymyrBg
Copy link
Author

@petertonysmith94 Done

@arboleya arboleya changed the title feat(math): Add warning for invalid precision in BN format method feat: add warning for invalid precision in BN format method Jan 16, 2025
packages/math/src/bn.test.ts Outdated Show resolved Hide resolved
packages/math/src/bn.test.ts Outdated Show resolved Hide resolved
packages/math/src/bn.ts Outdated Show resolved Hide resolved
@VolodymyrBg
Copy link
Author

@danielbate Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:missing feat Issue is a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants