Skip to content

Conversation

khancode
Copy link
Contributor

@khancode khancode commented Jul 19, 2024

High Level Overview of Change

Adds Multi-Purpose Tokens (MPT) feature.

Context of Change

XLS-33 spec

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

Adds unit/integ tests for new transactions.

@khancode khancode changed the title feat: MPT feat: MPT (Multi-purpose Token) Jul 19, 2024
@khancode khancode changed the title feat: MPT (Multi-purpose Token) feat: Multi-Purpose Tokens (MPTs) Jul 19, 2024
@khancode khancode changed the title feat: Multi-Purpose Tokens (MPTs) feat: Multi-Purpose Tokens (MPT) Jul 19, 2024
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 and nitpick comments (1)
tests/integration/transactions/test_clawback.py (1)

126-128: Document the reason for using max int64 value

The initial token amount (9223372036854775807) appears to be the maximum value for a 64-bit integer. Consider adding a comment explaining why this specific value was chosen for the test.

 amount=MPTAmount(
-    mpt_issuance_id=mpt_issuance_id, value="9223372036854775807"
+    mpt_issuance_id=mpt_issuance_id,
+    value="9223372036854775807"  # Max int64 value to test upper bounds
 ),
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between fdb43e3 and babb8f9.

📒 Files selected for processing (1)
  • tests/integration/transactions/test_clawback.py (3 hunks)
🔇 Additional comments (5)
tests/integration/transactions/test_clawback.py (5)

4-4: LGTM! Import statements are properly organized.

The new imports for MPT-related functionality are correctly added and well-organized.

Also applies to: 14-14, 19-24


Line range hint 33-82: Skipping review of unchanged test method.


158-159: ⚠️ Potential issue

Correct the assertion to check the clawback transaction result

The test is asserting the engine_result of auth_res (authorization response) instead of response (clawback response).

self.assertTrue(response.is_successful())
-self.assertEqual(auth_res.result["engine_result"], "tesSUCCESS")
+self.assertEqual(response.result["engine_result"], "tesSUCCESS")

168-170: ⚠️ Potential issue

Update balance assertion after clawback

The test asserts an incorrect balance after clawback. The final balance should be reduced by 500 tokens.

self.assertEqual(
-    ledger_entry_res.result["node"]["MPTAmount"], "9223372036854775307"
+    ledger_entry_res.result["node"]["MPTAmount"], "9223372036854774807"  # Initial amount (9223372036854775807) - clawback amount (500)
)

144-156: Verify holder's address in clawback response

Consider adding validation to ensure the holder's address is correctly reflected in the clawback transaction response.

@achowdhry-ripple
Copy link
Collaborator

Same as the comment from the js library, am assuming the getBalanceChanges utility here would need to be modified in the same way (or have a comment and raise an issue to track the addition later on)

Copy link
Collaborator

@achowdhry-ripple achowdhry-ripple 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
Collaborator

@shawnxie999 shawnxie999 left a comment

Choose a reason for hiding this comment

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

I think it looks good. Might be useful to test serialization/deserialization of MPTokenIssuance and MPToken objects

@khancode
Copy link
Contributor Author

I think it looks good. Might be useful to test serialization/deserialization of MPTokenIssuance and MPToken objects

xrpl-py doesn't support ledger objects yet so that's why they're excluded for now.

@khancode khancode requested a review from shawnxie999 December 12, 2024 01:52
Copy link
Collaborator

@shawnxie999 shawnxie999 left a comment

Choose a reason for hiding this comment

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

Looks good

@khancode khancode linked an issue Dec 12, 2024 that may be closed by this pull request
@khancode khancode merged commit 864f7b9 into main Dec 12, 2024
21 of 22 checks passed
@khancode khancode deleted the mpt branch December 12, 2024 02:18
@coderabbitai coderabbitai bot mentioned this pull request Jun 6, 2025
9 tasks
LimpidCrypto pushed a commit to LimpidCrypto/xrpl-py that referenced this pull request Jun 7, 2025
Adds Multi-Purpose Tokens (MPT) feature.
@coderabbitai coderabbitai bot mentioned this pull request Sep 4, 2025
9 tasks
@coderabbitai coderabbitai bot mentioned this pull request Oct 1, 2025
9 tasks
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.

Update get_balance_changes to include MPT

3 participants