Skip to content

Single Asset Vault XLS-65d #814

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

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open

Single Asset Vault XLS-65d #814

wants to merge 23 commits into from

Conversation

ckeshava
Copy link
Collaborator

@ckeshava ckeshava commented Mar 4, 2025

High Level Overview of Change

CPP implementation for SAV: XRPLF/rippled#5224
CPP implementation of the STNumber type: https://github.com/XRPLF/rippled/pull/5121/files

XLS Specification for this feature: XRPLF/XRPL-Standards#192

Context of Change

New Transactions added in this PR:
Vault <Create, Set, Deposit, Withdraw, Clawback, Delete>

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

Test Plan

I don't see the value of writing unit tests for the transaction models. All the tem codes are caught in the preflight method of the relevant Transactor class. Additional latency to an already failing transaction should not affect user-experience.

Transaction-model unit tests add unnecessary code bloat and duplication. Certain transactions (like the ones related to XChain amendment) do not have unit tests associated with them. Furthermore, requests also do not have unit tests associated with their models.

Copy link
Contributor

coderabbitai bot commented Mar 4, 2025

Walkthrough

This pull request adds a new “SingleAssetVault” feature by updating configuration and changelog files. It introduces new integration and unit tests—including tests for the vault lifecycle and number serialization. Updates to transaction fee calculation integrate a new fee for vault creation. Additionally, the changes extend the binary codec definitions with vault-related fields and types while exporting a new Number codec. Several new vault-related transaction types and models are added throughout the codebase, alongside updates to account and ledger entry enumerations to accommodate vault operations.

Changes

File(s) Summary
.ci-config/rippled.cfg, CHANGELOG.md Added SingleAssetVault feature to configuration; changelog updated with vault support and enhanced validation.
tests/integration/transactions/test_sav.py Introduced integration tests for validating the SingleAssetVault lifecycle (create, deposit, withdraw, clawback, delete).
tests/unit/core/binarycodec/types/test_number.py Added unit tests for the Number class covering serialization, deserialization, and edge case handling.
xrpl/asyncio/transaction/main.py Updated fee calculation logic to include TransactionType.VAULT_CREATE.
xrpl/core/binarycodec/.../definitions.json Added new vault-related fields, ledger entry types, and updated the Number type identifier.
xrpl/core/binarycodec/types/__init__.py, xrpl/core/binarycodec/types/number.py Introduced the Number codec implementation and updated module exports.
xrpl/models/amounts/mpt_amount.py, xrpl/models/requests/account_objects.py, xrpl/models/requests/ledger_entry.py Added MPTIssue model; extended account object types and ledger entry support with new vault-related identifiers.
xrpl/models/transactions/__init__.py, xrpl/models/transactions/types/transaction_type.py, xrpl/models/transactions/vault_*.py Introduced new Vault transaction types (VaultClawback, VaultCreate, VaultDelete, VaultDeposit, VaultSet, VaultWithdraw) and updated the transaction type enumeration.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant VaultOwner
    participant Issuer
    participant Ledger

    Client->>VaultOwner: Initiate VaultCreate transaction
    VaultOwner->>Ledger: Request vault creation
    Ledger-->>VaultOwner: Return vault ID confirmation
    Client->>VaultOwner: Send VaultDeposit transaction
    VaultOwner->>Ledger: Process deposit
    Ledger-->>VaultOwner: Confirm deposit
    Client->>VaultOwner: Send VaultWithdraw transaction
    VaultOwner->>Ledger: Process withdrawal
    Ledger-->>VaultOwner: Confirm withdrawal
    Issuer->>Ledger: Send VaultClawback transaction
    Ledger-->>Issuer: Confirm clawback
    Client->>VaultOwner: Send VaultDelete transaction
    VaultOwner->>Ledger: Request vault deletion
    Ledger-->>VaultOwner: Confirm deletion
Loading

Suggested reviewers

  • khancode
  • achowdhry-ripple
  • pdp2121

Poem

I’m just a rabbit hopping in code meadows,
Vaults and Numbers light up my paths so mellow.
I nibble lines of change with a twitch of my ear,
Leaping through tests that make bugs disappear.
Here’s to vaults and tech so clever—
A rabbit’s celebration now and forever!


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between eb78553 and 4cb1d02.

📒 Files selected for processing (1)
  • tests/unit/core/binarycodec/types/test_number.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/unit/core/binarycodec/types/test_number.py
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Snippet test (3.11)
  • GitHub Check: Snippet test (3.10)
  • GitHub Check: Snippet test (3.13)
  • GitHub Check: Snippet test (3.12)
  • GitHub Check: Snippet test (3.8)
  • GitHub Check: Snippet test (3.9)

🪧 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.

@ckeshava ckeshava marked this pull request as ready for review March 6, 2025 20:58
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: 10

🧹 Nitpick comments (18)
xrpl/models/amounts/mpt_amount.py (1)

42-50: Consider making MPTIssue consistent with other data models.

Currently, this class does not inherit from BaseModel or use a dataclass. If you anticipate adding dynamic validation or JSON serialization logic, aligning it with the approach used for MPTAmount may simplify future enhancements.

xrpl/core/binarycodec/definitions/definitions.json (2)

2073-2082: New field “AssetTotal”.

This addition follows the same pattern. Keep an eye on whether integrators might interpret it as a typical “UINT” or a decimal. Documentation should clarify that it’s a “Number” with potential decimal representation.


2702-2711: New field “WithdrawalPolicy”.

Added as a UInt8 with nth=20. This is typically used for small enumerations. Confirm you’ve reserved or documented permissible values (e.g., 0,1,2).

xrpl/models/transactions/vault_set.py (3)

1-3: Fix docstring formatting

The module docstring should fit on one line with quotes per linting rules.

-"""
-Represents a VaultSet transaction on the XRP Ledger.
-"""
+"""Represents a VaultSet transaction on the XRP Ledger."""
🧰 Tools
🪛 GitHub Actions: Unit test

[warning] 1-1: D200 One-line docstring should fit on one line with quotes


16-19: Fix class docstring formatting

The class docstring should fit on one line with quotes per linting rules.

-    """
-    The VaultSet updates an existing Vault ledger object.
-    """
+    """The VaultSet updates an existing Vault ledger object."""
🧰 Tools
🪛 GitHub Actions: Unit test

[warning] 17-17: D200 One-line docstring should fit on one line with quotes


30-33: Fix trailing whitespace

There's a trailing whitespace at the end of line 31.

-    """The maximum asset amount that can be held in a vault. The value cannot be lower 
+    """The maximum asset amount that can be held in a vault. The value cannot be lower
     than the current AssetTotal unless the value is 0.
     """
🧰 Tools
🪛 GitHub Actions: Unit test

[warning] 31-31: W291 trailing whitespace

xrpl/models/transactions/vault_clawback.py (2)

1-3: Fix docstring formatting

The module docstring should fit on one line with quotes per linting rules.

-"""
-Represents a VaultClawback transaction on the XRP Ledger.
-"""
+"""Represents a VaultClawback transaction on the XRP Ledger."""
🧰 Tools
🪛 GitHub Actions: Unit test

[warning] 1-1: D200 One-line docstring should fit on one line with quotes


35-38: Fix trailing whitespace

There's a trailing whitespace at the end of line 36.

-    """The asset amount to clawback. When Amount is 0 clawback all funds, up to the 
+    """The asset amount to clawback. When Amount is 0 clawback all funds, up to the
     total shares the Holder owns.
     """
🧰 Tools
🪛 GitHub Actions: Unit test

[warning] 36-36: W291 trailing whitespace

xrpl/models/transactions/vault_create.py (6)

1-3: Fix docstring formatting

The module docstring should fit on one line with quotes per linting rules.

-"""
-Represents a VaultCreate transaction on the XRP Ledger.
-"""
+"""Represents a VaultCreate transaction on the XRP Ledger."""
🧰 Tools
🪛 GitHub Actions: Unit test

[warning] 1-1: D200 One-line docstring should fit on one line with quotes


18-22: Add docstring to VaultCreateFlag enum

The enum class is missing a docstring, which is required for public classes.

 class VaultCreateFlag(int, Enum):
+    """Flags that can be set on a VaultCreate transaction."""
 
     TF_VAULT_PRIVATE = 0x0001
     TF_VAULT_SHARE_NON_TRANSFERABLE = 0x0002
🧰 Tools
🪛 GitHub Actions: Unit test

[warning] 18-18: D101 Missing docstring in public class


24-28: Add docstring to VaultCreateFlagInterface class

The interface class is missing a docstring, which is required for public classes.

 class VaultCreateFlagInterface(FlagInterface):
+    """Interface for VaultCreate transaction flags."""
 
     TF_VAULT_PRIVATE: bool
     TF_VAULT_SHARE_NON_TRANSFERABLE: bool
🧰 Tools
🪛 GitHub Actions: Unit test

[warning] 24-24: D101 Missing docstring in public class


32-35: Fix class docstring formatting

The class docstring should fit on one line with quotes per linting rules.

-    """
-    The VaultCreate transaction creates a new Vault object.
-    """
+    """The VaultCreate transaction creates a new Vault object."""
🧰 Tools
🪛 GitHub Actions: Unit test

[warning] 33-33: D200 One-line docstring should fit on one line with quotes


53-60: Fix blank line with whitespace

Line 54 contains whitespace on an otherwise blank line.

     """Indicates the withdrawal strategy used by the Vault.
-    
+
     The below withdrawal policy is supported:

     Strategy Name	           Value	      Description
🧰 Tools
🪛 GitHub Actions: Unit test

[warning] 54-54: W293 blank line contains whitespace


37-61: Document flag meanings and consider adding more withdrawal policies

While the implementation is solid, it would be helpful to:

  1. Document what each flag means (TF_VAULT_PRIVATE and TF_VAULT_SHARE_NON_TRANSFERABLE)
  2. Consider using an enum for withdrawal_policy instead of an int with comments, to make the API more type-safe
🧰 Tools
🪛 GitHub Actions: Unit test

[warning] 54-54: W293 blank line contains whitespace

tests/unit/core/binarycodec/types/test_number.py (1)

35-42: Consider adding validation for negative exponents in extreme limits test

The current test only checks extreme mantissa values with positive exponents. For comprehensive testing, consider adding test cases with negative exponents as well, which would test the handling of extremely small numbers.

tests/integration/transactions/test_sav.py (3)

78-78: Variable name should follow Python convention

Use lowercase for variable names according to PEP 8. VAULT_ID should be renamed to vault_id.

-        VAULT_ID = account_objects_response.result["account_objects"][0]["index"]
+        vault_id = account_objects_response.result["account_objects"][0]["index"]

114-123: Improve comment clarity for VaultClawback transaction

The comment describing the behavior is somewhat confusing. It would be clearer to explicitly state that the transaction will clawback the entire remaining balance (1 unit) regardless of the specified amount (9).

-            # Note: Although the amount is specified as 9, 1 unit of the IOU will be
-            # clawed back, because that is the remaining balance in the vault
+            # Note: This will clawback only 1 unit of the IOU (the remaining balance),
+            # even though the amount is specified as 9. The clawback amount is limited
+            # to the available balance in the vault.

27-135: Add verification of vault state after each operation

The test validates that transactions are successful, but doesn't verify the actual state of the vault after each operation (e.g., checking balances). Adding assertions for vault state would strengthen the test.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 13fdbd8 and 6c4f801.

📒 Files selected for processing (19)
  • .ci-config/rippled.cfg (1 hunks)
  • CHANGELOG.md (1 hunks)
  • tests/integration/transactions/test_sav.py (1 hunks)
  • tests/unit/core/binarycodec/types/test_number.py (1 hunks)
  • xrpl/asyncio/transaction/main.py (1 hunks)
  • xrpl/core/binarycodec/definitions/definitions.json (6 hunks)
  • xrpl/core/binarycodec/types/__init__.py (2 hunks)
  • xrpl/core/binarycodec/types/number.py (1 hunks)
  • xrpl/models/amounts/mpt_amount.py (1 hunks)
  • xrpl/models/requests/account_objects.py (1 hunks)
  • xrpl/models/requests/ledger_entry.py (3 hunks)
  • xrpl/models/transactions/__init__.py (2 hunks)
  • xrpl/models/transactions/types/transaction_type.py (1 hunks)
  • xrpl/models/transactions/vault_clawback.py (1 hunks)
  • xrpl/models/transactions/vault_create.py (1 hunks)
  • xrpl/models/transactions/vault_delete.py (1 hunks)
  • xrpl/models/transactions/vault_deposit.py (1 hunks)
  • xrpl/models/transactions/vault_set.py (1 hunks)
  • xrpl/models/transactions/vault_withdraw.py (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: Unit test
xrpl/models/transactions/vault_delete.py

[warning] 1-1: D200 One-line docstring should fit on one line with quotes


[warning] 16-16: D200 One-line docstring should fit on one line with quotes

xrpl/models/transactions/vault_deposit.py

[warning] 1-1: D200 One-line docstring should fit on one line with quotes


[warning] 17-17: D200 One-line docstring should fit on one line with quotes

xrpl/models/transactions/vault_withdraw.py

[warning] 1-1: D200 One-line docstring should fit on one line with quotes


[warning] 18-18: D200 One-line docstring should fit on one line with quotes

xrpl/models/transactions/vault_set.py

[warning] 1-1: D200 One-line docstring should fit on one line with quotes


[warning] 17-17: D200 One-line docstring should fit on one line with quotes


[warning] 31-31: W291 trailing whitespace

xrpl/models/transactions/vault_create.py

[warning] 1-1: D200 One-line docstring should fit on one line with quotes


[warning] 18-18: D101 Missing docstring in public class


[warning] 24-24: D101 Missing docstring in public class


[warning] 33-33: D200 One-line docstring should fit on one line with quotes


[warning] 54-54: W293 blank line contains whitespace

tests/unit/core/binarycodec/types/test_number.py

[error] 8-8: Error in test_serialization_and_deserialization: TypeError occurred during test execution.

xrpl/models/transactions/vault_clawback.py

[warning] 1-1: D200 One-line docstring should fit on one line with quotes


[warning] 36-36: W291 trailing whitespace

xrpl/core/binarycodec/types/number.py

[error] 87-87: TypeError: to_bytes() missing required argument 'byteorder' (pos 2)

🔇 Additional comments (23)
.ci-config/rippled.cfg (1)

199-199: Ensure supported configuration for new feature.

Adding SingleAssetVault under [features] is straightforward. However, as noted in line 91, standalone mode may not honor these flags. If you plan on using this feature in standalone mode, please validate that the enabling logic is recognized by your rippled version.

Would you like a shell script to cross-check whether the feature is supported on your targeted rippled build?

xrpl/core/binarycodec/definitions/definitions.json (8)

2043-2052: ”Number” field creation.

The “Number” field is added as an alias to the newly introduced type with nth=1. Ensure consistency regarding bit size constraints when using “Number” in practice, as it differs from standard “UInt32” or “UInt64.”


2053-2062: New field “AssetAvailable”.

Marking this as a “Number” with nth=2 is fine. Please confirm in your usage or docs that the “Number” type properly handles large integer or floating-point values as intended for this field.


2063-2072: New field “AssetMaximum”.

Same consideration as “AssetAvailable.” If “AssetMaximum” can be quite large, the “Number” type must handle big mantissa/exponent pairs without overflow or precision loss.


2083-2092: New field “LossUnrealized”.

As a “Number,” ensure that negative values are supported if “loss” can indeed be negative. If not, consider validating to ensure non-negative input.


2959-2959: New Ledger Entry Type “Vault”.

Assigned ID 131. Check that no collisions exist with previously assigned ledger entry type codes.


3197-3202: New Transaction Types for Vault operations.

The new codes (64, 65, 66, 67, 68, 69) appear unique. Ensure that any transaction processing logic (like TransactionType enum usage) recognizes these new values and is tested accordingly.


3226-3226: Number type assigned ID=9.

Declaring “Number” in the TYPES set is consistent with the newly introduced serialization logic. Confirm everything referencing type 9 is fully implemented and tested.


1263-1272:

❓ Verification inconclusive

Addition of VaultID field.

Declaring a new Hash256 field with nth=35 in the [FIELDS] array is valid. Verify that no collisions occur with existing fields using the same index, especially if similar sets of indices are reused for different data types.


🏁 Script executed:

#!/bin/bash
# Verify no index collisions for VaultID by scanning "nth": 35 usage across the file
rg '"nth": 35' -A 5 definitions.json

Length of output: 95


I'll perform an additional check to see if the file exists at the expected path. Below is a shell script to search for the file relative to the repository root:

#!/bin/bash
# Locate the definitions.json file and verify its path.
find . -type f -name definitions.json | grep "xrpl/core/binarycodec/definitions/definitions.json"

If the above script finds the file, please re-run the previous scan using the correct full path:

#!/bin/bash
# Verify no index collisions for VaultID by scanning "nth": 35 usage in the file:
rg '"nth": 35' -A 5 xrpl/core/binarycodec/definitions/definitions.json

VaultID Field Addition – Manual Verification Required

  • The addition of the VaultID field (with nth: 35 and type Hash256) appears valid provided there are no conflicts.
  • The initial automated scan couldn’t locate definitions.json using the relative path. Please verify the file exists at xrpl/core/binarycodec/definitions/definitions.json and confirm that no other field uses the nth index 35.

Please double-check the file location and ensure the intended consistency across the field indices.

xrpl/models/requests/account_objects.py (1)

39-39: Addition of VAULT type looks good

This new enumeration value for AccountObjectType allows retrieving vault objects associated with an account, which aligns with the Single Asset Vault (XLS-65d) feature being introduced.

xrpl/core/binarycodec/types/__init__.py (1)

13-13: Appropriate exposure of the Number type

The addition of the Number type to the module exports is correctly implemented, following the existing pattern for exposing binary codec types. This new type will be essential for handling numerical values in the Single Asset Vault implementation.

Also applies to: 36-36

xrpl/models/transactions/vault_delete.py (2)

20-21: Implementation of the vault_id field looks good

The required vault_id field is properly defined with appropriate documentation.


23-26: Transaction type definition looks good

The transaction_type is correctly set to TransactionType.VAULT_DELETE with appropriate initialization parameters.

CHANGELOG.md (1)

15-15: Appropriate changelog entry

The addition of "Support for Single Asset Vault (XLS-65d)" to the changelog correctly documents this new feature following the project's changelog format.

xrpl/asyncio/transaction/main.py (1)

483-487: LGTM! Good addition of VAULT_CREATE transaction type fee calculation.

The addition of TransactionType.VAULT_CREATE to the list of transaction types that require owner reserve fee is consistent with the existing pattern for similar transaction types (ACCOUNT_DELETE and AMM_CREATE).

xrpl/models/transactions/types/transaction_type.py (1)

55-60: LGTM! Properly added new transaction types.

The six new vault-related transaction types have been added correctly to the TransactionType enumeration, following the established pattern.

xrpl/models/requests/ledger_entry.py (3)

44-44: New LedgerEntryType for Single Asset Vault looks good

The addition of a new enumeration value for the Single Asset Vault is appropriate and follows the established naming convention in the class.


319-320: Good documentation for vault_id field

The comment and field definition for the vault_id are clear and follow the established pattern. The comment explaining that Single Asset Vault ledger objects can only be retrieved by index is helpful for API users.


355-355: Error handling update complete

The addition of self.vault_id to the query parameters list in _get_errors ensures proper validation for the newly added field.

xrpl/models/transactions/vault_set.py (1)

21-39: VaultSet implementation looks good

The transaction definition follows the established pattern for XRPL transaction types with appropriate attributes, typing, and documentation. Good job implementing the VaultSet transaction.

🧰 Tools
🪛 GitHub Actions: Unit test

[warning] 31-31: W291 trailing whitespace

xrpl/models/transactions/vault_clawback.py (1)

17-43: VaultClawback implementation is well documented

The implementation of the VaultClawback transaction includes comprehensive documentation that clearly explains the transaction's purpose, behavior with insufficient funds, and how it handles future fees or penalties. The required and optional fields are properly defined following the established pattern.

🧰 Tools
🪛 GitHub Actions: Unit test

[warning] 36-36: W291 trailing whitespace

xrpl/models/transactions/__init__.py (2)

99-104: LGTM! Vault transaction imports added correctly

The new vault-related transaction models are properly imported and will be available for library users.


202-207: LGTM! Vault transaction classes added to all list

The vault-related transaction classes are correctly added to the __all__ list, making them accessible when importing from xrpl.models.transactions.

ckeshava and others added 3 commits March 6, 2025 14:20
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)
tests/unit/core/binarycodec/types/test_number.py (1)

6-42: Consider adding more test coverage

The current tests provide good coverage but could be enhanced by adding:

  1. Tests for zero in scientific notation (e.g., "0e0")
  2. Tests for negative exponents in the extreme limits test
  3. Tests for error handling with invalid inputs
🧰 Tools
🪛 GitHub Actions: Unit test

[error] 38-38: AttributeError: 'Number' object has no attribute 'hex'

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 18bfd1c and f967f23.

📒 Files selected for processing (1)
  • tests/unit/core/binarycodec/types/test_number.py (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: Unit test
tests/unit/core/binarycodec/types/test_number.py

[error] 38-38: AttributeError: 'Number' object has no attribute 'hex'

⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Snippet test (3.11)
  • GitHub Check: Snippet test (3.13)
  • GitHub Check: Snippet test (3.12)
  • GitHub Check: Snippet test (3.10)
  • GitHub Check: Snippet test (3.9)
  • GitHub Check: Snippet test (3.8)
🔇 Additional comments (2)
tests/unit/core/binarycodec/types/test_number.py (2)

1-6: Good job with the test organization.

The imports and test class declaration look correct. The test class follows proper unittest conventions.


7-34: Good comprehensive test coverage for serialization.

Your test cases cover a good range of scenarios including positive/negative integers, decimals, and scientific notation values. Each assertion is clear and properly formatted.

@ckeshava
Copy link
Collaborator Author

ckeshava commented Mar 7, 2025

Note: The integration tests will not pass until the C++ code is merged into the rippled:develop branch. After this, a new docker container needs to be generated for the said branch.

@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added
- Improved validation for models to also check param types
- Support for Single Asset Vault (XLS-65d)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- Support for Single Asset Vault (XLS-65d)
- Support for `Single Asset Vault` (XLS-65d)

@@ -196,6 +196,7 @@ fixEnforceNFTokenTrustline
fixReducedOffersV2
DeepFreeze
PermissionedDomains
SingleAssetVault
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this all still a part of 2.3.0 (no new releases)?

@@ -315,6 +316,8 @@ class LedgerEntry(Request, LookupByLedgerRequest):
payment_channel: Optional[str] = None
Copy link
Collaborator

Choose a reason for hiding this comment

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

how come there is no Vault class definition in this file?

Comment on lines +57 to +58
VAULT_DEPOSIT = "VaultDeposit"
VAULT_DELETE = "VaultDelete"
Copy link
Collaborator

Choose a reason for hiding this comment

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

tiny nit: flip these two for alphabetical order

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