Skip to content

Commit

Permalink
pacify linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ckeshava committed Mar 6, 2025
1 parent 2765937 commit 18bfd1c
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 40 deletions.
8 changes: 8 additions & 0 deletions xrpl/core/binarycodec/types/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,14 @@ def from_parser( # noqa: D102

@classmethod
def from_value(cls: Type[Self], value: str) -> Self:
"""Construct a Number from a string.
Args:
value: The string to construct the Number from
Returns:
A Number instance
"""
number_parts: NumberParts = extractNumberPartsFromString(value)

# `0` value is represented as a mantissa with 0 and an exponent of
Expand Down
2 changes: 1 addition & 1 deletion xrpl/models/amounts/mpt_amount.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ class MPTIssue:

mpt_issuance_id: str = REQUIRED # type: ignore
"""
mpt_issuance_id is a 192-bit concatenation of a 32-bit account sequence and a
mpt_issuance_id is a 192-bit concatenation of a 32-bit account sequence and a
160-bit account id.
"""
6 changes: 2 additions & 4 deletions xrpl/models/transactions/vault_clawback.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""
Represents a VaultClawback transaction on the XRP Ledger.
"""
"""Represents a VaultClawback transaction on the XRP Ledger."""

from dataclasses import dataclass, field
from typing import Optional
Expand Down Expand Up @@ -33,7 +31,7 @@ class VaultClawback(Transaction):
"""The account ID from which to clawback the assets."""

amount: Optional[Amount] = None
"""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.
"""

Expand Down
50 changes: 39 additions & 11 deletions xrpl/models/transactions/vault_create.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""
Represents a VaultCreate transaction on the XRP Ledger.
"""
"""Represents a VaultCreate transaction on the XRP Ledger."""

from dataclasses import dataclass, field
from enum import Enum
Expand All @@ -16,23 +14,54 @@


class VaultCreateFlag(int, Enum):
"""Flags for the VaultCreate transaction."""

TF_VAULT_PRIVATE = 0x0001
TF_VAULT_SHARE_NON_TRANSFERABLE = 0x0002
TF_FREEZE = 0x0001
"""
Indicates that the vault should be frozen.
"""
TF_UNFREEZE = 0x0002
"""
Indicates that the vault should be unfrozen.
"""

TF_VAULT_PRIVATE = 0x0003
"""
Indicates that the vault is private. It can only be set during Vault creation.
"""
TF_VAULT_SHARE_NON_TRANSFERABLE = 0x0004
"""
Indicates the vault share is non-transferable. It can only be set during Vault
creation.
"""


class VaultCreateFlagInterface(FlagInterface):
"""Interface for the VaultCreate transaction flags."""

TF_FREEZE: bool
"""
Indicates that the vault should be frozen.
"""
TF_UNFREEZE: bool
"""
Indicates that the vault should be unfrozen.
"""
TF_VAULT_PRIVATE: bool
"""
Indicates that the vault is private. It can only be set during Vault creation.
"""
TF_VAULT_SHARE_NON_TRANSFERABLE: bool
"""
Indicates the vault share is non-transferable. It can only be set during Vault
creation.
"""


@require_kwargs_on_init
@dataclass(frozen=True, **KW_ONLY_DATACLASS)
class VaultCreate(Transaction):
"""
The VaultCreate transaction creates a new Vault object.
"""
"""The VaultCreate transaction creates a new Vault object."""

asset: Union[Currency, MPTIssue] = REQUIRED # type: ignore
"""The asset (XRP, IOU or MPT) of the Vault."""
Expand All @@ -50,9 +79,8 @@ class VaultCreate(Transaction):
"""The PermissionedDomain object ID associated with the shares of this Vault."""

withdrawal_policy: Optional[int] = None
"""Indicates the withdrawal strategy used by the Vault.
The below withdrawal policy is supported:
"""Indicates the withdrawal strategy used by the Vault. The below withdrawal policy
is supported:
Strategy Name Value Description
strFirstComeFirstServe 1 Requests are processed on a first-come-first-
Expand Down
8 changes: 2 additions & 6 deletions xrpl/models/transactions/vault_delete.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""
Represents a VaultDelete transaction on the XRP Ledger.
"""
"""Represents a VaultDelete transaction on the XRP Ledger."""

from dataclasses import dataclass, field

Expand All @@ -13,9 +11,7 @@
@require_kwargs_on_init
@dataclass(frozen=True, **KW_ONLY_DATACLASS)
class VaultDelete(Transaction):
"""
The VaultDelete transaction deletes an existing vault object.
"""
"""The VaultDelete transaction deletes an existing vault object."""

vault_id: str = REQUIRED # type: ignore
"""The ID of the vault to be deleted."""
Expand Down
8 changes: 2 additions & 6 deletions xrpl/models/transactions/vault_deposit.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""
Represents a VaultDeposit transaction on the XRP Ledger.
"""
"""Represents a VaultDeposit transaction on the XRP Ledger."""

from dataclasses import dataclass, field

Expand All @@ -14,9 +12,7 @@
@require_kwargs_on_init
@dataclass(frozen=True, **KW_ONLY_DATACLASS)
class VaultDeposit(Transaction):
"""
The VaultDeposit transaction adds Liqudity in exchange for vault shares.
"""
"""The VaultDeposit transaction adds Liqudity in exchange for vault shares."""

vault_id: str = REQUIRED # type: ignore
"""The ID of the vault to which the assets are deposited."""
Expand Down
10 changes: 3 additions & 7 deletions xrpl/models/transactions/vault_set.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""
Represents a VaultSet transaction on the XRP Ledger.
"""
"""Represents a VaultSet transaction on the XRP Ledger."""

from dataclasses import dataclass, field
from typing import Optional
Expand All @@ -14,9 +12,7 @@
@require_kwargs_on_init
@dataclass(frozen=True, **KW_ONLY_DATACLASS)
class VaultSet(Transaction):
"""
The VaultSet updates an existing Vault ledger object.
"""
"""The VaultSet updates an existing Vault ledger object."""

vault_id: str = REQUIRED # type: ignore
"""The ID of the Vault to be modified. Must be included when updating the Vault."""
Expand All @@ -28,7 +24,7 @@ class VaultSet(Transaction):
"""Arbitrary Vault metadata, limited to 256 bytes."""

asset_maximum: Optional[str] = None
"""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.
"""

Expand Down
8 changes: 3 additions & 5 deletions xrpl/models/transactions/vault_withdraw.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""
Represents a VaultWithdraw transaction on the XRP Ledger.
"""
"""Represents a VaultWithdraw transaction on the XRP Ledger."""

from dataclasses import dataclass, field
from typing import Optional
Expand All @@ -15,8 +13,8 @@
@require_kwargs_on_init
@dataclass(frozen=True, **KW_ONLY_DATACLASS)
class VaultWithdraw(Transaction):
"""
The VaultWithdraw transaction withdraws assets in exchange for the vault's shares.
"""The VaultWithdraw transaction withdraws assets in exchange for the vault's
shares.
"""

vault_id: str = REQUIRED # type: ignore
Expand Down

0 comments on commit 18bfd1c

Please sign in to comment.