Skip to content

small changes#996

Open
ledhed2222 wants to merge 1 commit intoXRPLF:mainfrom
ledhed2222:small-changes
Open

small changes#996
ledhed2222 wants to merge 1 commit intoXRPLF:mainfrom
ledhed2222:small-changes

Conversation

@ledhed2222
Copy link
Copy Markdown
Contributor

High Level Overview of Change

just looking at the state of repo and noticed a few easy changes :)

Context of Change

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Tests (You added tests for code that already exists, or your new feature included in this PR)
  • Documentation Updates
  • Release

Did you update CHANGELOG.md?

  • Yes
  • No, this change does not impact library users

Test Plan

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 3, 2026

Warning

Rate limit exceeded

@ledhed2222 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 52 minutes and 31 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3c8dced5-5c51-408f-ac42-089bc872a239

📥 Commits

Reviewing files that changed from the base of the PR and between 2528024 and 3936e13.

📒 Files selected for processing (7)
  • CONTRIBUTING.md
  • xrpl/constants.py
  • xrpl/core/keypairs/ed25519.py
  • xrpl/core/keypairs/helpers.py
  • xrpl/core/keypairs/secp256k1.py
  • xrpl/models/transactions/nftoken_mint.py
  • xrpl/models/transactions/nftoken_modify.py

Walkthrough

This PR consolidates NFT URI validation by extracting a hardcoded 512-byte limit to a shared constant, and refactors keypairs module code for consistency. Includes minor documentation updates to Python environment setup instructions.

Changes

NFT URI Constant Consolidation

Layer / File(s) Summary
Constant Definition
xrpl/constants.py
New exported constant MAX_NFT_URI_LENGTH: Final[int] = 512 defines the maximum byte length for NFT URIs.
Implementation Updates
xrpl/models/transactions/nftoken_mint.py, xrpl/models/transactions/nftoken_modify.py
Both modules now import and use MAX_NFT_URI_LENGTH for URI length validation instead of local _MAX_URI_LENGTH constants.

Keypairs Module Refactoring & Documentation

Layer / File(s) Summary
Key Formatting Constants
xrpl/core/keypairs/ed25519.py, xrpl/core/keypairs/secp256k1.py
Added _KEY_LENGTH: Final[int] = 64 to ed25519; removed _PADDING_PREFIX from secp256k1. Both now standardize key padding via zfill(_KEY_LENGTH) instead of conditional or right-justified approaches.
Hash Computation
xrpl/core/keypairs/helpers.py
Refactored get_account_id to compute SHA-256 and RIPEMD160 digest in a single return expression, removing intermediate variable.
Documentation
CONTRIBUTING.md
Added alternative setup instruction for contributors already using pyenv to run pyenv local 3.11.6.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • support DynamicNFT XLS-46 #799 — Relates to NFT URI validation updates; this PR originally added NFTokenModify with the 512-byte URI length constraint that is now being consolidated into a shared constant.

Suggested reviewers

  • pdp2121
  • achowdhry-ripple
  • khancode

Poem

🐰 A constant hops from place to place,
Five-twelve bytes find their proper base,
Keys are padded, formatted clean,
The nicest constants I've seen! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description lacks critical details: no high-level summary of actual changes, no context or justification, and no test plan; while the template sections are present, most are incomplete or empty. Fill in the High Level Overview with a clear summary of the changes (constant consolidation, key formatting refactors), provide context explaining why these changes improve the codebase, and describe the test plan.
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'small changes' is too vague and generic; it does not convey any meaningful information about what was actually changed in the pull request. Provide a more descriptive title that summarizes the main changes, such as 'Consolidate NFT URI length constant and refactor key formatting utilities'.
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 52 minutes and 31 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@xrpl/constants.py`:
- Around line 85-88: The docstring for the constant MAX_NFT_URI_LENGTH is
incorrect about units: update the docstring for MAX_NFT_URI_LENGTH to state that
512 is a hex-character limit (not bytes) and optionally note it corresponds to
256 bytes (256 bytes × 2 hex chars/byte) to match the XRPL spec and downstream
error messages; locate the constant MAX_NFT_URI_LENGTH in xrpl/constants.py and
replace the "in bytes" wording with "in hex characters (corresponds to 256
bytes)".
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e8676709-0e2d-4f25-8f7f-0371d36a8020

📥 Commits

Reviewing files that changed from the base of the PR and between a68a2f0 and 2528024.

📒 Files selected for processing (7)
  • CONTRIBUTING.md
  • xrpl/constants.py
  • xrpl/core/keypairs/ed25519.py
  • xrpl/core/keypairs/helpers.py
  • xrpl/core/keypairs/secp256k1.py
  • xrpl/models/transactions/nftoken_mint.py
  • xrpl/models/transactions/nftoken_modify.py

Comment thread xrpl/constants.py
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.

1 participant