Skip to content

Support for DID feature in xrpl-rust#161

Open
ckeshava wants to merge 4 commits intoXRPLF:mainfrom
ckeshava:DID
Open

Support for DID feature in xrpl-rust#161
ckeshava wants to merge 4 commits intoXRPLF:mainfrom
ckeshava:DID

Conversation

@ckeshava
Copy link
Copy Markdown
Collaborator

High Level Overview of Change

As indicated by the title, this PR adds support for DID amendment in xrpl-rust.

Context of Change

Two new transactions DIDSet and DIDDelete have been introduced. No new RPCs (or) updates to the binary-codec are included as a part of this 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

Test Plan

Additional unit and integration tests have been included to validate the DID-related behavior.

@ckeshava
Copy link
Copy Markdown
Collaborator Author

/ai-review

Copy link
Copy Markdown

@xrplf-ai-reviewer xrplf-ai-reviewer Bot left a comment

Choose a reason for hiding this comment

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

Byte-to-hex conversion bug on line 21 — see inline comment.

Review by Claude Opus 4.6 · Prompt: V14

Comment thread src/models/transactions/did_set.rs Outdated
/// Maximum length in hex characters for DID fields (Data, DIDDocument, URI).
/// Each field is limited to 256 bytes, which is 256 hex characters in
/// the client library convention (matching xrpl-py).
pub const MAX_DID_FIELD_LENGTH: usize = 256;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Off-by-2x: 256 bytes = 512 hex chars, not 256. This rejects valid 129–256 byte DID fields. Also fix the doc comment above:

/// Maximum length in hex characters for DID fields (Data, DIDDocument, URI).
/// Each field is limited to 256 bytes, which is 512 hex characters
/// (1 byte = 2 hex chars; matching xrpl-py if it's correct).
pub const MAX_DID_FIELD_LENGTH: usize = 512;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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