-
Notifications
You must be signed in to change notification settings - Fork 512
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
[WIP] Unit test representing large inputs in UINT64 type #2790
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe pull request introduces new test cases for the Changes
Possibly related issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
packages/ripple-binary-codec/test/uint.test.ts (2)
131-142
: Approve the new test case and address the SDK limitation.The new test case for comparing the maximum UInt64 value in decimal and hexadecimal representations is valuable. It checks an important edge case and improves test coverage.
However, the comment highlights a limitation in the current SDK version:
// The current version of the SDK throws the following error: // "18446744073709551615 is not a valid hex-string" // This is caused due to the HEX_REGEX: ^[a-fA-F0-9]{1,16}$Would you like me to create a GitHub issue to track the task of addressing this SDK limitation? This would involve updating the HEX_REGEX to handle the full range of UInt64 values.
149-163
: Approve the new test case and document ES2020 requirement.The new test case for creating UInt64 from large inputs is comprehensive and covers various representations of the maximum UInt64 value. It improves the robustness of the tests.
The comment about ES2020 is important:
// Note: Support multiple representation of BigInt literals. The below line invokes the following error: // error TS2737: BigInt literals are not available when targeting lower than ES2020.Consider adding a note in the project's README or documentation about the ES2020 requirement for full BigInt literal support. This will help developers understand the project's compatibility requirements.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- packages/ripple-binary-codec/test/uint.test.ts (1 hunks)
🔇 Additional comments (1)
packages/ripple-binary-codec/test/uint.test.ts (1)
131-163
: Summary: Valuable additions to UInt64 testingThese new test cases significantly enhance the coverage for large UInt64 values, aligning perfectly with the PR objectives. They not only test the functionality but also reveal important limitations in the current SDK implementation.
Next steps to consider:
- Address the SDK limitation regarding the HEX_REGEX for UInt64 values.
- Update project documentation to clarify ES2020 requirements for full BigInt literal support.
- Ensure that these new tests are included in the overall test plan for this PR.
Great work on improving the robustness of the UInt64 testing!
High Level Overview of Change
Code that accompanies this issue: #2789
Context of Change
Type of Change
Did you update HISTORY.md?
Needs further investigation before updating README files.
Test Plan
Summary by CodeRabbit
UInt64
class to enhance coverage for handling large numeric values.