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: neither uint64 or int64 safe integer #1164

Merged
merged 1 commit into from
Jul 20, 2023

Conversation

ChrisCho-H
Copy link
Contributor

@ChrisCho-H ChrisCho-H commented Jul 12, 2023

Number.isSafeInteger is only true when int54.
Because here also checks whether positive, it's actually uint53 which can pass these assertions.
both int64 and uint64 wrong and misleading

@codecov
Copy link

codecov bot commented Jul 12, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.02 ⚠️

Comparison is base (b005869) 69.55% compared to head (5228a00) 69.54%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1164      +/-   ##
==========================================
- Coverage   69.55%   69.54%   -0.02%     
==========================================
  Files         158      159       +1     
  Lines       26603    26607       +4     
==========================================
- Hits        18505    18503       -2     
- Misses       8098     8104       +6     
Impacted Files Coverage Δ
lib/btc/amount.js 20.63% <ø> (ø)
lib/btc/uri.js 0.00% <ø> (ø)
lib/primitives/coin.js 89.85% <ø> (ø)
lib/primitives/output.js 88.63% <ø> (ø)

... and 7 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@pinheadmz
Copy link
Member

I understand where you're coming from but I don't think int53 is a real type? If we do change these messages maybe it should just just say "safe integer" specifically?

@ChrisCho-H
Copy link
Contributor Author

It's normally not in use but can be used in some languages where u can set any bit size for int or uint.
But for javascript, as u suggested, I think safe integer would sound appropriate enough for error message(number must be below 2^53).
I've changed it.

@ChrisCho-H ChrisCho-H changed the title fix: uint53 is safe but not uint64 fix: neither uint64 or int64 not safe integer Jul 17, 2023
@ChrisCho-H ChrisCho-H changed the title fix: neither uint64 or int64 not safe integer fix: neither uint64 or int64 safe integer Jul 17, 2023
@ChrisCho-H ChrisCho-H changed the title fix: neither uint64 or int64 safe integer fix: neither uint64 nor int64 safe integer Jul 17, 2023
@ChrisCho-H ChrisCho-H changed the title fix: neither uint64 nor int64 safe integer fix: neither uint64 or int64 safe integer Jul 17, 2023
@pinheadmz pinheadmz merged commit cd64844 into bcoin-org:master Jul 20, 2023
5 of 6 checks passed
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.

2 participants