Skip to content

Conversation

@achowdhry-ripple
Copy link
Collaborator

@achowdhry-ripple achowdhry-ripple commented Mar 4, 2025

High Level Overview of Change

Add MPTAmount support in the Issue object. Parallel to XRPLF/xrpl-py#809

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 HISTORY.md?

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

Test Plan

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 4, 2025

Caution

Review failed

The head commit changed during the review from d639f57 to 64ab7b0.

Walkthrough

The changes introduce a new section titled "Fixed" in the HISTORY.md file to document the addition of support for MPTAmount in the Issue. Additionally, the IssueObject type has been redefined from an interface to a union type comprising three distinct interfaces: XRPIssue, IOUIssue, and MPTIssue. The Issue class methods have been updated to accommodate these changes, enhancing the handling and serialization of different issue types.

Changes

File(s) Change Summary
packages/ripple-binary-codec/HISTORY.md Added "Fixed" section documenting support for MPTAmount.
packages/ripple-binary-codec/src/types/issue.ts Redefined IssueObject as a union type; added interfaces XRPIssue, IOUIssue, and MPTIssue; updated isIssueObject type guard and Issue class methods for improved handling and serialization.
packages/ripple-binary-codec/test/issue.test.ts Introduced unit tests for Issue type conversion functions, validating Issue.from and Issue.fromParser methods.

Suggested reviewers

  • pdp2121
  • ckeshava

Poem

I'm a little rabbit with code in my heart,
Hopping through changes, playing my part.
MPT support sprouted like a carrot so sweet,
Nibbling on bytes with a happy beat.
With every fix, I hop with delight—
Our code now dances in the moonlight! 🐇✨


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
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

🔭 Outside diff range comments (1)
packages/ripple-binary-codec/src/types/issue.ts (1)

83-90: ⚠️ Potential issue

Update the fromParser method to handle MPT amounts.

The fromParser method doesn't appear to have been updated to handle MPT amounts. Since you've added support for MPT in other methods, this method should also be updated to ensure consistency when parsing from binary data.

Consider adding logic to detect and handle MPT amounts in the parser:

  static fromParser(parser: BinaryParser): Issue {
    const currency = parser.read(20)
    if (new Currency(currency).toJSON() === 'XRP') {
      return new Issue(currency)
    }
+   // If the currency value matches an MPT issuance format, treat as MPT
+   if (currency.length === Hash192.width / 2) {
+     return new Issue(currency)
+   }
    const currencyAndIssuer = [currency, parser.read(20)]
    return new Issue(concat(currencyAndIssuer))
  }

Please verify this implementation against the xrpl-py repository's approach as mentioned in the PR objectives.

🧹 Nitpick comments (1)
packages/ripple-binary-codec/src/types/issue.ts (1)

1-121: Add tests for MPT amount handling.

With the addition of MPT amount support, it would be beneficial to add tests that verify the serialization and deserialization of MPT amounts to ensure the implementation works correctly for all cases.

Would you like me to help draft some test cases for this implementation?

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9d55cb3 and 322bfec.

📒 Files selected for processing (2)
  • packages/ripple-binary-codec/HISTORY.md (1 hunks)
  • packages/ripple-binary-codec/src/types/issue.ts (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: snippets (22.x)
  • GitHub Check: snippets (20.x)
  • GitHub Check: integration (22.x)
  • GitHub Check: snippets (18.x)
  • GitHub Check: integration (20.x)
  • GitHub Check: integration (18.x)
  • GitHub Check: browser (18.x)
🔇 Additional comments (5)
packages/ripple-binary-codec/HISTORY.md (1)

5-6: Documentation looks good.

The added "Fixed" section properly documents the implementation of MPTAmount support in the Issue type, making it clear what change was made in this release.

packages/ripple-binary-codec/src/types/issue.ts (4)

7-7: Appropriate import for MPT support.

The Hash192 import is correctly added to handle the MPT issuance ID in the Issue type.


13-16: Interface modifications look good.

The changes to the IssueObject interface are appropriate:

  • Making currency optional allows for cases where only an MPT issuance ID is present
  • Adding the optional mpt_issuance_id property supports the new MPT functionality

These changes align with the PR's objective of adding MPTAmount support.


23-29: Type guard logic properly updated.

The isIssueObject function is correctly updated to handle all three cases:

  • XRP case: object has only a currency property
  • IOU case: object has both currency and issuer properties
  • MPT case: object has only an mpt_issuance_id property

This comprehensive type guard ensures proper validation for all supported Issue object types.


54-72: Implementation of MPT case in from method looks good.

The static from method has been properly updated to handle the three cases:

  1. IOU case (when both currency and issuer are present)
  2. XRP case (when only currency is present)
  3. MPT case (when mpt_issuance_id is present)

The code structure is clear and the implementation is correct.

Copy link
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: 0

🔭 Outside diff range comments (1)
packages/ripple-binary-codec/src/types/issue.ts (1)

92-99: 🛠️ Refactor suggestion

Update fromParser method to handle MPT Issue types.

The fromParser method hasn't been updated to handle MPT issue types, which could lead to issues when parsing serialized MPT Issues. Consider adding support for MPT Issue types in this method.

static fromParser(parser: BinaryParser): Issue {
  const currency = parser.read(20)
  if (new Currency(currency).toJSON() === 'XRP') {
    return new Issue(currency)
  }
+ 
+ // Check if this is an MPT issue (should be exactly Hash192.width bytes)
+ if (currency.length === Hash192.width) {
+   return new Issue(currency)
+ }
+ 
  const currencyAndIssuer = [currency, parser.read(20)]
  return new Issue(concat(currencyAndIssuer))
}
♻️ Duplicate comments (1)
packages/ripple-binary-codec/src/types/issue.ts (1)

107-113: ⚠️ Potential issue

Fix method call in toJSON implementation.

There appears to be a syntax error when checking the byte length. The toBytes should be called as a method, not accessed as a property.

-    if (this.toBytes.length === Hash192.width) {
+    if (this.toBytes().length === Hash192.width) {
🧹 Nitpick comments (3)
packages/ripple-binary-codec/src/types/issue.ts (3)

48-54: Update JSDoc to include MPT issue type.

The JSDoc comment for the from method should be updated to include the MPT issue type.

/**
 * Construct an amount from an IOU or string amount
 *
- * @param value An Amount, object representing an IOU, or a string
+ * @param value An Amount, object representing an XRP, IOU, or MPT issue, or a string
 *     representing an integer amount
 * @returns An Amount object
 */

55-55: Consider implementing stronger type checking in the from method.

The current implementation relies on checking properties in a specific order. Consider making the type guard more explicit to handle unexpected combinations of properties.

static from<T extends Issue | IssueObject>(value: T): Issue {
  if (value instanceof Issue) {
    return value
  }

  if (isIssueObject(value)) {
+   // Handle each type explicitly rather than relying on property checks
+   if ('mpt_issuance_id' in value) {
+     const mptIssuanceIdBytes = Hash192.from(
+       value.mpt_issuance_id.toString(),
+     ).toBytes()
+     return new Issue(mptIssuanceIdBytes)
+   } else if ('currency' in value) {
+     const currency = Currency.from(value.currency.toString()).toBytes()
+     
+     if ('issuer' in value) {
+       const issuer = AccountID.from(value.issuer.toString()).toBytes()
+       return new Issue(concat([currency, issuer]))
+     }
+     
+     return new Issue(currency)
+   }
-   if (value.currency) {
-     const currency = Currency.from(value.currency.toString()).toBytes()
-
-     //IOU case
-     if (value.issuer) {
-       const issuer = AccountID.from(value.issuer.toString()).toBytes()
-       return new Issue(concat([currency, issuer]))
-     }
-
-     //XRP case
-     return new Issue(currency)
-   }
-
-   // MPT case
-   if (value.mpt_issuance_id) {
-     const mptIssuanceIdBytes = Hash192.from(
-       value.mpt_issuance_id.toString(),
-     ).toBytes()
-     return new Issue(mptIssuanceIdBytes)
-   }
  }

  throw new Error('Invalid type to construct an Amount')
}

83-83: Improve error message specificity.

The current error message is generic. Consider providing more specific error messages for different failure scenarios.

- throw new Error('Invalid type to construct an Amount')
+ throw new Error('Invalid type to construct an Issue: expected Issue instance or IssueObject with valid properties')
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 322bfec and a877ba8.

📒 Files selected for processing (1)
  • packages/ripple-binary-codec/src/types/issue.ts (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: snippets (22.x)
  • GitHub Check: unit (20.x)
  • GitHub Check: snippets (20.x)
  • GitHub Check: unit (18.x)
  • GitHub Check: integration (22.x)
  • GitHub Check: snippets (18.x)
  • GitHub Check: integration (20.x)
  • GitHub Check: integration (18.x)
  • GitHub Check: browser (18.x)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (5)
packages/ripple-binary-codec/src/types/issue.ts (5)

7-7: LGTM: Adding Hash192 import for MPT support.

The import of Hash192 is correctly added to support the new MPTIssue type.


9-19: Well-structured type definitions for Issue types.

The interfaces are cleanly structured to represent the three distinct issue types:

  • XRPIssue: Contains only currency
  • IOUIssue: Contains currency and issuer
  • MPTIssue: Contains mpt_issuance_id

This approach provides good type safety and clarity.


23-23: Good union type approach for IssueObject.

Converting IssueObject from an interface to a union type is the correct approach to handle the different issue variants.


28-36: Correctly updated type guard for the new union type.

The isIssueObject type guard has been properly updated to handle all three issue types. The implementation is clean and follows a logical pattern.


61-81: Well-implemented Issue handling in the from method.

The from method has been correctly updated to handle all three issue types with appropriate branching logic.


it(`test from value mpt`, () => {
const mptJson = {
// value: '100', // MPT amounts must be an integer string (no decimal point)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@khancode saw value in the python tests, but wasn't sure whether to add it here based on our discussions. Seems like it should be here, but that would require me to change the isMPT logic in Issue to something different than what we discussed

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you check if value is included when Issue.from is normally called? If yes, then we should add it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Issue.from accepts both types in the input parameter.

static from<T extends Issue | IssueObject>(value: T): Issue

It should work either ways

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@khancode when you say normally called do you mean the implementations for IOU and XRP? there were no tests before so hard to tell but based off of the isIssueObject check it seems like those have no value param. However, in your python implementation there was no value parameter for IOU and XRP either, but you added it for MPT. I'm assuming this should be the same in JS so I should add value as a param

Copy link
Contributor

@khancode khancode Mar 11, 2025

Choose a reason for hiding this comment

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

Yes I meant the implementations normal call flow. Yes, it looks like in PY its design is different than JS. Just need to make sure we make it compatible with JS design.

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like value is excluded by looking at the console.log inside of Issue.from so this looks good 👍

@achowdhry-ripple achowdhry-ripple changed the title Mptamount issue support fix: add MPTAmount support in Issue model Mar 5, 2025
Copy link
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

🧹 Nitpick comments (3)
packages/ripple-binary-codec/src/types/issue.ts (3)

28-36: Type guard implementation could be more robust

The current implementation of isIssueObject relies on checking the existence and order of keys, which might be brittle if object properties are reordered. Consider enhancing the type guard to also validate the types of the values:

function isIssueObject(arg): arg is IssueObject {
  const keys = Object.keys(arg).sort()
  const isXRP = keys.length === 1 && keys[0] === 'currency'
  const isIOU =
    keys.length === 2 && keys[0] === 'currency' && keys[1] === 'issuer'
  const isMPT = keys.length === 1 && keys[0] === 'mpt_issuance_id'

+  // Additional validation for value types
+  if (isXRP && typeof arg.currency !== 'string') return false
+  if (isIOU && (typeof arg.currency !== 'string' || typeof arg.issuer !== 'string')) return false
+  if (isMPT && typeof arg.mpt_issuance_id !== 'string') return false

  return isXRP || isIOU || isMPT
}

48-54: Update JSDoc comment for the from method

The JSDoc comment for the from method needs to be updated to reflect the addition of MPT issue support.

/**
 * Construct an amount from an IOU or string amount
 *
 * @param value An Amount, object representing an IOU, or a string
 *     representing an integer amount
- * @returns An Issue object
+ * @param value An Amount, object representing an XRP issue, IOU issue, MPT issue, or a string
+ *     representing an integer amount
+ * @returns An Issue object representing XRP, IOU, or MPT
 */

75-81: Add validation for MPT issuance ID format

Currently, the code doesn't validate the format of the mpt_issuance_id string beyond passing it to Hash192.from(). Consider adding explicit validation to ensure it meets the expected format.

// MPT case
if (value.mpt_issuance_id) {
+  // Validate mpt_issuance_id format (should be 48 characters of hex)
+  const mptId = value.mpt_issuance_id.toString()
+  if (!/^[0-9A-Fa-f]{48}$/.test(mptId)) {
+    throw new Error('Invalid MPT issuance ID format')
+  }
  const mptIssuanceIdBytes = Hash192.from(
    value.mpt_issuance_id.toString(),
  ).toBytes()
  return new Issue(mptIssuanceIdBytes)
}
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a877ba8 and 6680559.

📒 Files selected for processing (2)
  • packages/ripple-binary-codec/src/types/issue.ts (4 hunks)
  • packages/ripple-binary-codec/test/issue.test.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: snippets (22.x)
  • GitHub Check: snippets (20.x)
  • GitHub Check: snippets (18.x)
  • GitHub Check: integration (22.x)
  • GitHub Check: integration (20.x)
  • GitHub Check: integration (18.x)
🔇 Additional comments (7)
packages/ripple-binary-codec/test/issue.test.ts (2)

29-36: Good implementation of MPT issue test case

The test case properly verifies that an MPT issue with a mpt_issuance_id can be created and correctly serialized back to JSON.

There's a commented-out line about value property with an explanation that "MPT amounts must be an integer string (no decimal point)". This comment provides helpful context about the constraints of MPT amounts.


79-86: Comprehensive error handling test

Good job including a test case for invalid input handling. The test properly verifies that the Issue.from method throws an appropriate error message when given invalid input.

packages/ripple-binary-codec/src/types/issue.ts (5)

7-7: Good addition of Hash192 import

The addition of the Hash192 import is necessary for handling MPT issuance IDs, which are 192-bit hashes.


9-23: Well-structured type definitions for different issue types

Breaking down the IssueObject into three distinct interfaces (XRPIssue, IOUIssue, and MPTIssue) improves type safety and makes the code more maintainable. The union type definition in line 23 properly combines these interfaces.


55-81: Structured handling of different issue types

The implementation of the from method properly handles all three types of issues (XRP, IOU, and MPT). The structure is clear with dedicated code paths for each case.


95-106: Proper implementation of MPT parsing with hint parameter

The fromParser method has been updated to handle MPT issues by checking if the hint parameter matches Hash192.width. This approach is efficient and clear.


113-119: Fix method call in toJSON implementation

The issue identified in the previous review regarding this.toBytes has been correctly fixed to this.toBytes().

The implementation properly handles MPT issues by checking if the byte length matches Hash192.width and returning an appropriate object with mpt_issuance_id.

@ckeshava ckeshava self-requested a review March 6, 2025 00:08

it(`test from value mpt`, () => {
const mptJson = {
// value: '100', // MPT amounts must be an integer string (no decimal point)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you check if value is included when Issue.from is normally called? If yes, then we should add it.


it(`test from value mpt`, () => {
const mptJson = {
// value: '100', // MPT amounts must be an integer string (no decimal point)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Issue.from accepts both types in the input parameter.

static from<T extends Issue | IssueObject>(value: T): Issue

It should work either ways

Copy link
Contributor

@khancode khancode left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
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

🧹 Nitpick comments (1)
packages/ripple-binary-codec/src/types/issue.ts (1)

57-57: Remove console.log statement.

Debug logging statements should be removed before merging to production.

-    console.log('ISSUE: ', JSON.stringify(value))
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6680559 and 112da38.

📒 Files selected for processing (2)
  • packages/ripple-binary-codec/src/types/issue.ts (4 hunks)
  • packages/ripple-binary-codec/test/issue.test.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/ripple-binary-codec/test/issue.test.ts
🧰 Additional context used
🧬 Code Definitions (1)
packages/ripple-binary-codec/src/types/issue.ts (7)
packages/ripple-binary-codec/src/types/serialized-type.ts (1) (1)
  • JsonObject (122-122)
packages/xrpl/src/models/common/index.ts (1) (1)
  • Currency (17-17)
packages/ripple-binary-codec/src/types/index.ts (3) (3)
  • Currency (53-53)
  • AccountID (50-50)
  • Hash192 (56-56)
packages/ripple-binary-codec/src/types/currency.ts (1) (1)
  • Currency (140-140)
packages/ripple-binary-codec/src/types/account-id.ts (1) (1)
  • AccountID (86-86)
packages/isomorphic/src/utils/shared.ts (1) (1)
  • concat (5-7)
packages/ripple-binary-codec/src/serdes/binary-parser.ts (1) (1)
  • BinaryParser (228-228)
🪛 ESLint
packages/ripple-binary-codec/src/types/issue.ts

[error] 33-33: Insert ⏎···

(prettier/prettier)


[error] 55-56: Delete

(prettier/prettier)

🪛 GitHub Actions: Node.js CI
packages/ripple-binary-codec/src/types/issue.ts

[error] 33-33: Insert ⏎··· prettier/prettier


[error] 55-55: Delete prettier/prettier

🔇 Additional comments (10)
packages/ripple-binary-codec/src/types/issue.ts (10)

7-7: LGTM: Hash192 import included for MPTAmount support.

The added import of Hash192 is necessary to handle the MPT issuance ID data type.


9-19: LGTM: Well-structured interface definitions.

The introduction of separate interfaces for different issue types (XRP, IOU, MPT) provides clear type definitions and improves code readability.


22-23: LGTM: Union type properly defines all issue object variants.

Converting IssueObject from an interface to a union type is the right approach to model these distinct cases.


25-27: LGTM: Updated documentation.

The documentation now properly describes the purpose of the type guard function.


51-54: LGTM: Updated parameter documentation.

The documentation now correctly includes MPTAmount as a possible input type.


63-83: LGTM: Properly handling all issue types.

The implementation correctly handles all three issue types (XRP, IOU, and MPT) with appropriate type checking and conversion.


92-97: LGTM: Updated documentation for the fromParser method.

The documentation now correctly explains the purpose of the new hint parameter.


97-108: LGTM: Added MPT support to the fromParser method.

The method now handles MPT amounts by using the optional hint parameter. This approach aligns with the previous discussion in the PR comments.


115-122: LGTM: Fixed toJSON method to handle MPT amounts.

The implementation now correctly handles MPT amounts and the previous syntax error has been fixed by changing this.toBytes.length to this.toBytes().length.


1-138:

❓ Verification inconclusive

Verify MPT functionality with comprehensive unit tests.

The changes introduce a new type of Issue (MPT) and modify several methods to handle this new type. Please ensure there are comprehensive unit tests covering all possible edge cases, especially for the newly added MPT support.


🏁 Script executed:

#!/bin/bash
# Check for unit tests related to MPT support in the Issue class

echo "Searching for unit tests related to MPT in Issue..."
fd -e ts -e js "issue.*test" packages/ripple-binary-codec/test --exec grep -l "MPT" {} \;

echo "Searching for test cases specifically testing mpt_issuance_id..."
fd -e ts -e js "issue.*test" packages/ripple-binary-codec/test --exec grep -l "mpt_issuance_id" {} \;

echo "If no files are shown above, it suggests missing test coverage for MPT functionality"

Length of output: 724


MPT Test Coverage Confirmation

Unit tests for the new MPT support are present in the Issue test file (packages/ripple-binary-codec/test/issue.test.ts), with markers for both "MPT" and "mpt_issuance_id". Please review these tests to confirm they cover all edge cases for MPT functionality—including, but not limited to, handling valid/invalid mpt_issuance_id values and ensuring the parser logic for a 24-byte MPT amount is robust. If you identify any gaps, additional test cases should be added accordingly.

🧰 Tools
🪛 ESLint

[error] 33-33: Insert ⏎···

(prettier/prettier)


[error] 55-56: Delete

(prettier/prettier)

🪛 GitHub Actions: Node.js CI

[error] 33-33: Insert ⏎··· prettier/prettier


[error] 55-55: Delete prettier/prettier

@achowdhry-ripple achowdhry-ripple merged commit ea4f606 into main Mar 19, 2025
16 checks passed
@achowdhry-ripple achowdhry-ripple deleted the mptamount-issue-support branch March 19, 2025 19:19
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.

4 participants