Skip to content
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

fix: remove # type: ignore after each REQUIRED #765

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/generate_tx_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def _generate_param_line(param: str, is_required: bool) -> str:
param_name = param[2:]
param_type = sfields[param_name][0]
if is_required:
param_type_output = f"{TYPE_MAP[param_type]} = REQUIRED # type: ignore"
param_type_output = f"{TYPE_MAP[param_type]} = REQUIRED"
else:
param_type_output = f"Optional[{TYPE_MAP[param_type]}] = None"
return f" {_key_to_json(param_name)}: {param_type_output}"
Expand Down
2 changes: 1 addition & 1 deletion xrpl/models/amounts/issued_currency_amount.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class IssuedCurrencyAmount(IssuedCurrency):
See https://xrpl.org/currency-formats.html#issued-currency-amounts.
"""

value: Union[str, int, float] = REQUIRED # type: ignore
value: Union[str, int, float] = REQUIRED
"""
This field is required.

Expand Down
2 changes: 1 addition & 1 deletion xrpl/models/auth_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class AuthAccount(NestedModel):
"""Represents one entry in a list of AuthAccounts used in AMMBid transaction."""

account: str = REQUIRED # type: ignore
account: str = REQUIRED
"""
This field is required.

Expand Down
4 changes: 2 additions & 2 deletions xrpl/models/currencies/issued_currency.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ class IssuedCurrency(BaseModel):
See https://xrpl.org/currency-formats.html#specifying-currency-amounts
"""

currency: str = REQUIRED # type: ignore
currency: str = REQUIRED
"""
This field is required.

:meta hide-value:
"""

issuer: str = REQUIRED # type: ignore
issuer: str = REQUIRED
"""
This field is required.

Expand Down
2 changes: 1 addition & 1 deletion xrpl/models/requests/account_channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class AccountChannels(Request, LookupByLedgerRequest):
"""

method: RequestMethod = field(default=RequestMethod.ACCOUNT_CHANNELS, init=False)
account: str = REQUIRED # type: ignore
account: str = REQUIRED
"""
This field is required.

Expand Down
2 changes: 1 addition & 1 deletion xrpl/models/requests/account_currencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class AccountCurrencies(Request, LookupByLedgerRequest):
`See account_currencies <https://xrpl.org/account_currencies.html>`_
"""

account: str = REQUIRED # type: ignore
account: str = REQUIRED
"""
This field is required.

Expand Down
2 changes: 1 addition & 1 deletion xrpl/models/requests/account_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class AccountInfo(Request, LookupByLedgerRequest):
`See account_info <https://xrpl.org/account_info.html>`_
"""

account: str = REQUIRED # type: ignore
account: str = REQUIRED
"""
This field is required.

Expand Down
2 changes: 1 addition & 1 deletion xrpl/models/requests/account_lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class AccountLines(Request, LookupByLedgerRequest):
`See account_lines <https://xrpl.org/account_lines.html>`_
"""

account: str = REQUIRED # type: ignore
account: str = REQUIRED
"""
This field is required.

Expand Down
2 changes: 1 addition & 1 deletion xrpl/models/requests/account_nfts.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class AccountNFTs(Request, LookupByLedgerRequest):
"""

method: RequestMethod = field(default=RequestMethod.ACCOUNT_NFTS, init=False)
account: str = REQUIRED # type: ignore
account: str = REQUIRED
"""
The unique identifier of an account, typically the account's address. The
request returns NFTs owned by this account. This value is required.
Expand Down
2 changes: 1 addition & 1 deletion xrpl/models/requests/account_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class AccountObjects(Request, LookupByLedgerRequest):
`See account_objects <https://xrpl.org/account_objects.html>`_
"""

account: str = REQUIRED # type: ignore
account: str = REQUIRED
"""
This field is required.

Expand Down
2 changes: 1 addition & 1 deletion xrpl/models/requests/account_offers.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AccountOffers(Request, LookupByLedgerRequest):
`See account_offers <https://xrpl.org/account_offers.html>`_
"""

account: str = REQUIRED # type: ignore
account: str = REQUIRED
"""
This field is required.

Expand Down
2 changes: 1 addition & 1 deletion xrpl/models/requests/account_tx.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AccountTx(Request, LookupByLedgerRequest):
`See account_tx <https://xrpl.org/account_tx.html>`_
"""

account: str = REQUIRED # type: ignore
account: str = REQUIRED
"""
This field is required.

Expand Down
4 changes: 2 additions & 2 deletions xrpl/models/requests/book_offers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ class BookOffers(Request, LookupByLedgerRequest):
as the order book, between two currencies.
"""

taker_gets: Currency = REQUIRED # type: ignore
taker_gets: Currency = REQUIRED
"""
This field is required.

:meta hide-value:
"""

taker_pays: Currency = REQUIRED # type: ignore
taker_pays: Currency = REQUIRED
"""
This field is required.

Expand Down
4 changes: 2 additions & 2 deletions xrpl/models/requests/channel_authorize.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ class ChannelAuthorize(Request):
"""

method: RequestMethod = field(default=RequestMethod.CHANNEL_AUTHORIZE, init=False)
channel_id: str = REQUIRED # type: ignore
channel_id: str = REQUIRED
"""
This field is required.

:meta hide-value:
"""

amount: str = REQUIRED # type: ignore
amount: str = REQUIRED
"""
This field is required.

Expand Down
8 changes: 4 additions & 4 deletions xrpl/models/requests/channel_verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,28 @@ class ChannelVerify(Request):
"""

method: RequestMethod = field(default=RequestMethod.CHANNEL_VERIFY, init=False)
channel_id: str = REQUIRED # type: ignore
channel_id: str = REQUIRED
mvadari marked this conversation as resolved.
Show resolved Hide resolved
"""
This field is required.

:meta hide-value:
"""

amount: str = REQUIRED # type: ignore
amount: str = REQUIRED
"""
This field is required.

:meta hide-value:
"""

public_key: str = REQUIRED # type: ignore
public_key: str = REQUIRED
"""
This field is required.

:meta hide-value:
"""

signature: str = REQUIRED # type: ignore
signature: str = REQUIRED
"""
This field is required.

Expand Down
4 changes: 2 additions & 2 deletions xrpl/models/requests/deposit_authorized.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ class DepositAuthorized(Request, LookupByLedgerRequest):
authorization to deliver money to your account.
"""

source_account: str = REQUIRED # type: ignore
source_account: str = REQUIRED
"""
This field is required.

:meta hide-value:
"""

destination_account: str = REQUIRED # type: ignore
destination_account: str = REQUIRED
"""
This field is required.

Expand Down
2 changes: 1 addition & 1 deletion xrpl/models/requests/gateway_balances.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class GatewayBalances(Request, LookupByLedgerRequest):
`See gateway_balances <https://xrpl.org/gateway_balances.html>`_
"""

account: str = REQUIRED # type: ignore
account: str = REQUIRED
"""
This field is required.

Expand Down
6 changes: 3 additions & 3 deletions xrpl/models/requests/get_aggregate_price.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ class GetAggregatePrice(Request):

method: RequestMethod = field(default=RequestMethod.GET_AGGREGATE_PRICE, init=False)

base_asset: str = REQUIRED # type: ignore
base_asset: str = REQUIRED
"""The currency code of the asset to be priced"""

quote_asset: str = REQUIRED # type: ignore
quote_asset: str = REQUIRED
"""The currency code of the asset to quote the price of the base asset"""

oracles: List[Oracle] = REQUIRED # type: ignore
oracles: List[Oracle] = REQUIRED
"""The oracle identifier"""

trim: Optional[int] = None
Expand Down
32 changes: 16 additions & 16 deletions xrpl/models/requests/ledger_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ class DepositPreauth(BaseModel):
object ID.
"""

owner: str = REQUIRED # type: ignore
owner: str = REQUIRED
"""
This field is required.

:meta hide-value:
"""

authorized: str = REQUIRED # type: ignore
authorized: str = REQUIRED
"""
This field is required.

Expand All @@ -74,14 +74,14 @@ class Directory(BaseModel):
object ID.
"""

owner: str = REQUIRED # type: ignore
owner: str = REQUIRED
"""
This field is required.

:meta hide-value:
"""

dir_root: str = REQUIRED # type: ignore
dir_root: str = REQUIRED
"""
This field is required.

Expand All @@ -98,14 +98,14 @@ class Escrow(BaseModel):
object ID.
"""

owner: str = REQUIRED # type: ignore
owner: str = REQUIRED
"""
This field is required.

:meta hide-value:
"""

seq: int = REQUIRED # type: ignore
seq: int = REQUIRED
"""
This field is required.

Expand All @@ -121,14 +121,14 @@ class Offer(BaseModel):
object ID.
"""

account: str = REQUIRED # type: ignore
account: str = REQUIRED
"""
This field is required.

:meta hide-value:
"""

seq: int = REQUIRED # type: ignore
seq: int = REQUIRED
"""
This field is required.

Expand All @@ -144,14 +144,14 @@ class Oracle(BaseModel):
object ID.
"""

account: str = REQUIRED # type: ignore
account: str = REQUIRED
"""
This field is required.

:meta hide-value:
"""

oracle_document_id: Union[str, int] = REQUIRED # type: ignore
oracle_document_id: Union[str, int] = REQUIRED
"""
This field is required.

Expand All @@ -164,14 +164,14 @@ class Oracle(BaseModel):
class RippleState(BaseModel):
"""Required fields for requesting a RippleState if not querying by object ID."""

accounts: List[str] = REQUIRED # type: ignore
accounts: List[str] = REQUIRED
"""
This field is required.

:meta hide-value:
"""

currency: str = REQUIRED # type: ignore
currency: str = REQUIRED
"""
This field is required.

Expand All @@ -184,14 +184,14 @@ class RippleState(BaseModel):
class Ticket(BaseModel):
"""Required fields for requesting a Ticket if not querying by object ID."""

owner: str = REQUIRED # type: ignore
owner: str = REQUIRED
"""
This field is required.

:meta hide-value:
"""

ticket_sequence: int = REQUIRED # type: ignore
ticket_sequence: int = REQUIRED
"""
This field is required.

Expand All @@ -204,7 +204,7 @@ class Ticket(BaseModel):
class XChainClaimID(XChainBridge):
"""Required fields for requesting an XChainClaimID if not querying by object ID."""

xchain_claim_id: Union[int, str] = REQUIRED # type: ignore
xchain_claim_id: Union[int, str] = REQUIRED
"""
The `XChainClaimID` associated with a cross-chain transfer, which was created in an
`XChainCreateClaimID` transaction. This field is required.
Expand All @@ -221,7 +221,7 @@ class XChainCreateAccountClaimID(XChainBridge):
object ID.
"""

xchain_create_account_claim_id: Union[int, str] = REQUIRED # type: ignore
xchain_create_account_claim_id: Union[int, str] = REQUIRED
"""
The `XChainCreateAccountClaimID` associated with a cross-chain account create. This
field is required.
Expand Down
2 changes: 1 addition & 1 deletion xrpl/models/requests/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Manifest(Request):
"""

method: RequestMethod = field(default=RequestMethod.MANIFEST, init=False)
public_key: str = REQUIRED # type: ignore
public_key: str = REQUIRED
"""
This field is required.

Expand Down
2 changes: 1 addition & 1 deletion xrpl/models/requests/nft_buy_offers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class NFTBuyOffers(Request, LookupByLedgerRequest):
"""

method: RequestMethod = field(default=RequestMethod.NFT_BUY_OFFERS, init=False)
nft_id: str = REQUIRED # type: ignore
nft_id: str = REQUIRED
"""
The unique identifier of an NFToken.
The request returns buy offers for this NFToken. This value is required.
Expand Down
2 changes: 1 addition & 1 deletion xrpl/models/requests/nft_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class NFTHistory(Request, LookupByLedgerRequest):
"""

method: RequestMethod = field(default=RequestMethod.NFT_HISTORY, init=False)
nft_id: str = REQUIRED # type: ignore
nft_id: str = REQUIRED
"""
The unique identifier of an NFToken.
The request returns past transactions of this NFToken. This value is required.
Expand Down
2 changes: 1 addition & 1 deletion xrpl/models/requests/nft_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class NFTInfo(Request, LookupByLedgerRequest):
"""

method: RequestMethod = field(default=RequestMethod.NFT_INFO, init=False)
nft_id: str = REQUIRED # type: ignore
nft_id: str = REQUIRED
"""
The unique identifier of an NFToken.
The request returns information of this NFToken. This value is required.
Expand Down
Loading