From b0ea3a1c77ac39fecbf4c60a95d0d5c8afb8fecd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 19:33:30 +0000 Subject: [PATCH 01/15] chore(deps-dev): bump black from 23.3.0 to 24.8.0 Bumps [black](https://github.com/psf/black) from 23.3.0 to 24.8.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/23.3.0...24.8.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- poetry.lock | 57 ++++++++++++++++++++++++-------------------------- pyproject.toml | 2 +- 2 files changed, 28 insertions(+), 31 deletions(-) diff --git a/poetry.lock b/poetry.lock index 9e30a272d..0e488a24b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -80,36 +80,33 @@ tests = ["PyHamcrest (>=2.0.2)", "mypy", "pytest (>=4.6)", "pytest-benchmark", " [[package]] name = "black" -version = "23.3.0" +version = "24.8.0" description = "The uncompromising code formatter." optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "black-23.3.0-cp310-cp310-macosx_10_16_arm64.whl", hash = "sha256:0945e13506be58bf7db93ee5853243eb368ace1c08a24c65ce108986eac65915"}, - {file = "black-23.3.0-cp310-cp310-macosx_10_16_universal2.whl", hash = "sha256:67de8d0c209eb5b330cce2469503de11bca4085880d62f1628bd9972cc3366b9"}, - {file = "black-23.3.0-cp310-cp310-macosx_10_16_x86_64.whl", hash = "sha256:7c3eb7cea23904399866c55826b31c1f55bbcd3890ce22ff70466b907b6775c2"}, - {file = "black-23.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:32daa9783106c28815d05b724238e30718f34155653d4d6e125dc7daec8e260c"}, - {file = "black-23.3.0-cp310-cp310-win_amd64.whl", hash = "sha256:35d1381d7a22cc5b2be2f72c7dfdae4072a3336060635718cc7e1ede24221d6c"}, - {file = "black-23.3.0-cp311-cp311-macosx_10_16_arm64.whl", hash = "sha256:a8a968125d0a6a404842fa1bf0b349a568634f856aa08ffaff40ae0dfa52e7c6"}, - {file = "black-23.3.0-cp311-cp311-macosx_10_16_universal2.whl", hash = "sha256:c7ab5790333c448903c4b721b59c0d80b11fe5e9803d8703e84dcb8da56fec1b"}, - {file = "black-23.3.0-cp311-cp311-macosx_10_16_x86_64.whl", hash = "sha256:a6f6886c9869d4daae2d1715ce34a19bbc4b95006d20ed785ca00fa03cba312d"}, - {file = "black-23.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6f3c333ea1dd6771b2d3777482429864f8e258899f6ff05826c3a4fcc5ce3f70"}, - {file = "black-23.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:11c410f71b876f961d1de77b9699ad19f939094c3a677323f43d7a29855fe326"}, - {file = "black-23.3.0-cp37-cp37m-macosx_10_16_x86_64.whl", hash = "sha256:1d06691f1eb8de91cd1b322f21e3bfc9efe0c7ca1f0e1eb1db44ea367dff656b"}, - {file = "black-23.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:50cb33cac881766a5cd9913e10ff75b1e8eb71babf4c7104f2e9c52da1fb7de2"}, - {file = "black-23.3.0-cp37-cp37m-win_amd64.whl", hash = "sha256:e114420bf26b90d4b9daa597351337762b63039752bdf72bf361364c1aa05925"}, - {file = "black-23.3.0-cp38-cp38-macosx_10_16_arm64.whl", hash = "sha256:48f9d345675bb7fbc3dd85821b12487e1b9a75242028adad0333ce36ed2a6d27"}, - {file = "black-23.3.0-cp38-cp38-macosx_10_16_universal2.whl", hash = "sha256:714290490c18fb0126baa0fca0a54ee795f7502b44177e1ce7624ba1c00f2331"}, - {file = "black-23.3.0-cp38-cp38-macosx_10_16_x86_64.whl", hash = "sha256:064101748afa12ad2291c2b91c960be28b817c0c7eaa35bec09cc63aa56493c5"}, - {file = "black-23.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:562bd3a70495facf56814293149e51aa1be9931567474993c7942ff7d3533961"}, - {file = "black-23.3.0-cp38-cp38-win_amd64.whl", hash = "sha256:e198cf27888ad6f4ff331ca1c48ffc038848ea9f031a3b40ba36aced7e22f2c8"}, - {file = "black-23.3.0-cp39-cp39-macosx_10_16_arm64.whl", hash = "sha256:3238f2aacf827d18d26db07524e44741233ae09a584273aa059066d644ca7b30"}, - {file = "black-23.3.0-cp39-cp39-macosx_10_16_universal2.whl", hash = "sha256:f0bd2f4a58d6666500542b26354978218a9babcdc972722f4bf90779524515f3"}, - {file = "black-23.3.0-cp39-cp39-macosx_10_16_x86_64.whl", hash = "sha256:92c543f6854c28a3c7f39f4d9b7694f9a6eb9d3c5e2ece488c327b6e7ea9b266"}, - {file = "black-23.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3a150542a204124ed00683f0db1f5cf1c2aaaa9cc3495b7a3b5976fb136090ab"}, - {file = "black-23.3.0-cp39-cp39-win_amd64.whl", hash = "sha256:6b39abdfb402002b8a7d030ccc85cf5afff64ee90fa4c5aebc531e3ad0175ddb"}, - {file = "black-23.3.0-py3-none-any.whl", hash = "sha256:ec751418022185b0c1bb7d7736e6933d40bbb14c14a0abcf9123d1b159f98dd4"}, - {file = "black-23.3.0.tar.gz", hash = "sha256:1c7b8d606e728a41ea1ccbd7264677e494e87cf630e399262ced92d4a8dac940"}, + {file = "black-24.8.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:09cdeb74d494ec023ded657f7092ba518e8cf78fa8386155e4a03fdcc44679e6"}, + {file = "black-24.8.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:81c6742da39f33b08e791da38410f32e27d632260e599df7245cccee2064afeb"}, + {file = "black-24.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:707a1ca89221bc8a1a64fb5e15ef39cd755633daa672a9db7498d1c19de66a42"}, + {file = "black-24.8.0-cp310-cp310-win_amd64.whl", hash = "sha256:d6417535d99c37cee4091a2f24eb2b6d5ec42b144d50f1f2e436d9fe1916fe1a"}, + {file = "black-24.8.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:fb6e2c0b86bbd43dee042e48059c9ad7830abd5c94b0bc518c0eeec57c3eddc1"}, + {file = "black-24.8.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:837fd281f1908d0076844bc2b801ad2d369c78c45cf800cad7b61686051041af"}, + {file = "black-24.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:62e8730977f0b77998029da7971fa896ceefa2c4c4933fcd593fa599ecbf97a4"}, + {file = "black-24.8.0-cp311-cp311-win_amd64.whl", hash = "sha256:72901b4913cbac8972ad911dc4098d5753704d1f3c56e44ae8dce99eecb0e3af"}, + {file = "black-24.8.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:7c046c1d1eeb7aea9335da62472481d3bbf3fd986e093cffd35f4385c94ae368"}, + {file = "black-24.8.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:649f6d84ccbae73ab767e206772cc2d7a393a001070a4c814a546afd0d423aed"}, + {file = "black-24.8.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2b59b250fdba5f9a9cd9d0ece6e6d993d91ce877d121d161e4698af3eb9c1018"}, + {file = "black-24.8.0-cp312-cp312-win_amd64.whl", hash = "sha256:6e55d30d44bed36593c3163b9bc63bf58b3b30e4611e4d88a0c3c239930ed5b2"}, + {file = "black-24.8.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:505289f17ceda596658ae81b61ebbe2d9b25aa78067035184ed0a9d855d18afd"}, + {file = "black-24.8.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:b19c9ad992c7883ad84c9b22aaa73562a16b819c1d8db7a1a1a49fb7ec13c7d2"}, + {file = "black-24.8.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1f13f7f386f86f8121d76599114bb8c17b69d962137fc70efe56137727c7047e"}, + {file = "black-24.8.0-cp38-cp38-win_amd64.whl", hash = "sha256:f490dbd59680d809ca31efdae20e634f3fae27fba3ce0ba3208333b713bc3920"}, + {file = "black-24.8.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:eab4dd44ce80dea27dc69db40dab62d4ca96112f87996bca68cd75639aeb2e4c"}, + {file = "black-24.8.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3c4285573d4897a7610054af5a890bde7c65cb466040c5f0c8b732812d7f0e5e"}, + {file = "black-24.8.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9e84e33b37be070ba135176c123ae52a51f82306def9f7d063ee302ecab2cf47"}, + {file = "black-24.8.0-cp39-cp39-win_amd64.whl", hash = "sha256:73bbf84ed136e45d451a260c6b73ed674652f90a2b3211d6a35e78054563a9bb"}, + {file = "black-24.8.0-py3-none-any.whl", hash = "sha256:972085c618ee94f402da1af548a4f218c754ea7e5dc70acb168bfaca4c2542ed"}, + {file = "black-24.8.0.tar.gz", hash = "sha256:2500945420b6784c38b9ee885af039f5e7471ef284ab03fa35ecdde4688cd83f"}, ] [package.dependencies] @@ -119,11 +116,11 @@ packaging = ">=22.0" pathspec = ">=0.9.0" platformdirs = ">=2" tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing-extensions = {version = ">=3.10.0.0", markers = "python_version < \"3.10\""} +typing-extensions = {version = ">=4.0.1", markers = "python_version < \"3.11\""} [package.extras] colorama = ["colorama (>=0.4.3)"] -d = ["aiohttp (>=3.7.4)"] +d = ["aiohttp (>=3.7.4)", "aiohttp (>=3.7.4,!=3.9.0)"] jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] uvloop = ["uvloop (>=0.15.2)"] @@ -1370,4 +1367,4 @@ test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "43914b88cb50aad0fa0d8a0bf9a3a95af35b18420393cb460ca305d60257a342" +content-hash = "9e4941eca50b8f56cdaa2c92d34249c246742c5c20fd544e0100c90b09c45cd5" diff --git a/pyproject.toml b/pyproject.toml index f8e5b7a9f..696a62071 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,7 +42,7 @@ pycryptodome = "^3.16.0" [tool.poetry.dev-dependencies] flake8 = "^4.0.1" -black = "23.3.0" +black = "24.8.0" flake8-black = "^0.3.6" flake8-docstrings = "^1.7.0" mypy = "^1" From d912d6d84887c567410e4513ec1fc4721014f65f Mon Sep 17 00:00:00 2001 From: Chenna Keshava B S Date: Tue, 5 Nov 2024 09:25:13 -0800 Subject: [PATCH 02/15] updated poetry lock file --- poetry.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/poetry.lock b/poetry.lock index 179978a76..a400118e3 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.4 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "aiounittest" @@ -1478,4 +1478,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "6ca56c6efee80d09118640eb46b31db894e595ca2f9a984d5ce1471338d71728" \ No newline at end of file +content-hash = "947e225df53d2bf1e2619903d15914add47936bb01f9d9f8af0792077e072965" From 487b5da8feacddb80d5ddd3c718c50f6040c232a Mon Sep 17 00:00:00 2001 From: Chenna Keshava B S Date: Wed, 6 Nov 2024 09:49:43 -0800 Subject: [PATCH 03/15] updates from black formatter --- docs/conf.py | 1 + poetry.lock | 65 ++++++++----------- pyproject.toml | 5 +- snippets/get_transaction.py | 1 + snippets/partial_payment.py | 1 + snippets/set_regular_key.py | 1 + snippets/submit_payment.py | 1 + xrpl/__init__.py | 1 + xrpl/account/__init__.py | 1 + xrpl/account/transaction_history.py | 1 + xrpl/asyncio/__init__.py | 1 + xrpl/asyncio/account/__init__.py | 1 + xrpl/asyncio/account/transaction_history.py | 1 + xrpl/asyncio/clients/__init__.py | 1 + xrpl/asyncio/clients/async_json_rpc_client.py | 1 + xrpl/asyncio/ledger/__init__.py | 1 + xrpl/asyncio/wallet/__init__.py | 1 + xrpl/asyncio/wallet/wallet_generation.py | 1 + xrpl/clients/__init__.py | 1 + xrpl/clients/json_rpc_client.py | 1 + xrpl/constants.py | 1 + xrpl/core/__init__.py | 1 + xrpl/core/addresscodec/__init__.py | 1 + xrpl/core/addresscodec/exceptions.py | 1 + xrpl/core/addresscodec/utils.py | 7 +- xrpl/core/binarycodec/__init__.py | 1 + .../binarycodec/binary_wrappers/__init__.py | 1 + xrpl/core/binarycodec/definitions/__init__.py | 1 + xrpl/core/binarycodec/exceptions.py | 1 + xrpl/core/binarycodec/types/__init__.py | 1 + xrpl/core/keypairs/__init__.py | 1 + xrpl/core/keypairs/exceptions.py | 1 + xrpl/core/keypairs/helpers.py | 1 + xrpl/core/keypairs/main.py | 1 + xrpl/ledger/__init__.py | 1 + xrpl/models/__init__.py | 1 + xrpl/models/amounts/__init__.py | 1 + xrpl/models/amounts/amount.py | 1 + xrpl/models/auth_account.py | 1 + xrpl/models/base_model.py | 2 +- xrpl/models/currencies/__init__.py | 1 + xrpl/models/currencies/currency.py | 1 + xrpl/models/exceptions.py | 1 + xrpl/models/requests/account_channels.py | 1 + xrpl/models/requests/account_currencies.py | 1 + xrpl/models/requests/account_info.py | 1 + xrpl/models/requests/account_lines.py | 1 + xrpl/models/requests/account_nfts.py | 1 + xrpl/models/requests/account_objects.py | 1 + xrpl/models/requests/account_offers.py | 1 + xrpl/models/requests/account_tx.py | 1 + xrpl/models/requests/amm_info.py | 1 + xrpl/models/requests/book_offers.py | 1 + xrpl/models/requests/channel_authorize.py | 6 +- xrpl/models/requests/channel_verify.py | 1 + xrpl/models/requests/deposit_authorized.py | 1 + xrpl/models/requests/fee.py | 1 + xrpl/models/requests/gateway_balances.py | 1 + xrpl/models/requests/get_aggregate_price.py | 6 +- xrpl/models/requests/ledger.py | 1 + xrpl/models/requests/ledger_closed.py | 1 + xrpl/models/requests/ledger_current.py | 1 + xrpl/models/requests/ledger_data.py | 1 + xrpl/models/requests/ledger_entry.py | 6 +- xrpl/models/requests/manifest.py | 1 + xrpl/models/requests/nft_buy_offers.py | 1 + xrpl/models/requests/nft_history.py | 1 + xrpl/models/requests/nft_info.py | 1 + xrpl/models/requests/nft_sell_offers.py | 1 + xrpl/models/requests/nfts_by_issuer.py | 1 + xrpl/models/requests/no_ripple_check.py | 1 + xrpl/models/requests/path_find.py | 1 + xrpl/models/requests/ping.py | 1 + xrpl/models/requests/random.py | 1 + xrpl/models/requests/ripple_path_find.py | 1 + xrpl/models/requests/server_definitions.py | 1 + xrpl/models/requests/server_info.py | 1 + xrpl/models/requests/server_state.py | 1 + xrpl/models/requests/sign.py | 6 +- xrpl/models/requests/sign_and_submit.py | 6 +- xrpl/models/requests/sign_for.py | 6 +- xrpl/models/requests/subscribe.py | 1 + xrpl/models/requests/tx.py | 6 +- xrpl/models/requests/unsubscribe.py | 1 + xrpl/models/transactions/amm_delete.py | 1 + xrpl/models/transactions/check_cancel.py | 1 + xrpl/models/transactions/check_cash.py | 6 +- xrpl/models/transactions/check_create.py | 1 + xrpl/models/transactions/deposit_preauth.py | 6 +- xrpl/models/transactions/escrow_create.py | 6 +- xrpl/models/transactions/escrow_finish.py | 12 ++-- xrpl/models/transactions/offer_cancel.py | 1 + xrpl/models/transactions/offer_create.py | 1 + xrpl/models/transactions/oracle_set.py | 12 ++-- xrpl/models/transactions/payment.py | 12 ++-- .../transactions/payment_channel_claim.py | 1 + .../transactions/payment_channel_create.py | 1 + .../transactions/payment_channel_fund.py | 1 + .../pseudo_transactions/__init__.py | 1 + .../pseudo_transactions/set_fee.py | 1 + .../pseudo_transactions/unl_modify.py | 6 +- xrpl/models/transactions/set_regular_key.py | 1 + xrpl/models/transactions/signer_list_set.py | 6 +- xrpl/models/transactions/trust_set.py | 1 + xrpl/models/transactions/xchain_claim.py | 6 +- .../transactions/xchain_create_bridge.py | 24 +++---- .../transactions/xchain_create_claim_id.py | 6 +- .../transactions/xchain_modify_bridge.py | 18 ++--- xrpl/models/types.py | 1 + xrpl/models/utils.py | 1 + xrpl/transaction/multisign.py | 1 + xrpl/utils/get_nftoken_id.py | 1 + xrpl/utils/get_xchain_claim_id.py | 1 + xrpl/utils/parse_nftoken_id.py | 1 + xrpl/utils/xrp_conversions.py | 1 + xrpl/wallet/__init__.py | 1 + xrpl/wallet/wallet_generation.py | 1 + 117 files changed, 208 insertions(+), 127 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 46aa7cba9..4fe1ee495 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,4 +1,5 @@ """Sphinx configuration for xrpl-py.""" + # Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full diff --git a/poetry.lock b/poetry.lock index a400118e3..257528155 100644 --- a/poetry.lock +++ b/poetry.lock @@ -424,46 +424,33 @@ test = ["pytest (>=6)"] [[package]] name = "flake8" -version = "4.0.1" +version = "7.1.1" description = "the modular source code checker: pep8 pyflakes and co" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8.1" files = [ - {file = "flake8-4.0.1-py2.py3-none-any.whl", hash = "sha256:479b1304f72536a55948cb40a32dce8bb0ffe3501e26eaf292c7e60eb5e0428d"}, - {file = "flake8-4.0.1.tar.gz", hash = "sha256:806e034dda44114815e23c16ef92f95c91e4c71100ff52813adf7132a6ad870d"}, + {file = "flake8-7.1.1-py2.py3-none-any.whl", hash = "sha256:597477df7860daa5aa0fdd84bf5208a043ab96b8e96ab708770ae0364dd03213"}, + {file = "flake8-7.1.1.tar.gz", hash = "sha256:049d058491e228e03e67b390f311bbf88fce2dbaa8fa673e7aea87b7198b8d38"}, ] [package.dependencies] -mccabe = ">=0.6.0,<0.7.0" -pycodestyle = ">=2.8.0,<2.9.0" -pyflakes = ">=2.4.0,<2.5.0" +mccabe = ">=0.7.0,<0.8.0" +pycodestyle = ">=2.12.0,<2.13.0" +pyflakes = ">=3.2.0,<3.3.0" [[package]] name = "flake8-absolute-import" -version = "1.0.0.1" +version = "1.0.0.2" description = "flake8 plugin to require absolute imports" optional = false -python-versions = ">=3.4" -files = [ - {file = "flake8_absolute_import-1.0.0.1-py3-none-any.whl", hash = "sha256:d24f189bca52ffc0d13e8046606ea42d22a9ad9d409bf39e52b93493cf2ffd2c"}, -] - -[package.dependencies] -flake8 = ">=3.7" - -[[package]] -name = "flake8-annotations" -version = "2.7.0" -description = "Flake8 Type Annotation Checks" -optional = false -python-versions = ">=3.6.2,<4.0.0" +python-versions = ">=3.6" files = [ - {file = "flake8-annotations-2.7.0.tar.gz", hash = "sha256:52e53c05b0c06cac1c2dec192ea2c36e85081238add3bd99421d56f574b9479b"}, - {file = "flake8_annotations-2.7.0-py3-none-any.whl", hash = "sha256:3edfbbfb58e404868834fe6ec3eaf49c139f64f0701259f707d043185545151e"}, + {file = "flake8-absolute-import-1.0.0.2.tar.gz", hash = "sha256:fcb734ac5a9639fa4ffbc6242ae9d6e9d8063f9cd078d6d218597ee883a99d48"}, + {file = "flake8_absolute_import-1.0.0.2-py3-none-any.whl", hash = "sha256:b72142db999ec5e0ac4f4ac57fb8776a2959d07346c4d3742c446f206d45fcef"}, ] [package.dependencies] -flake8 = ">=3.7,<5.0" +flake8 = ">=5.0" [[package]] name = "flake8-black" @@ -724,13 +711,13 @@ files = [ [[package]] name = "mccabe" -version = "0.6.1" +version = "0.7.0" description = "McCabe checker, plugin for flake8" optional = false -python-versions = "*" +python-versions = ">=3.6" files = [ - {file = "mccabe-0.6.1-py2.py3-none-any.whl", hash = "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42"}, - {file = "mccabe-0.6.1.tar.gz", hash = "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"}, + {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, + {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, ] [[package]] @@ -867,13 +854,13 @@ poetry-plugin = ["poetry (>=1.0,<2.0)"] [[package]] name = "pycodestyle" -version = "2.8.0" +version = "2.12.1" description = "Python style guide checker" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +python-versions = ">=3.8" files = [ - {file = "pycodestyle-2.8.0-py2.py3-none-any.whl", hash = "sha256:720f8b39dde8b293825e7ff02c475f3077124006db4f440dcbc9a20b76548a20"}, - {file = "pycodestyle-2.8.0.tar.gz", hash = "sha256:eddd5847ef438ea1c7870ca7eb78a9d47ce0cdb4851a5523949f2601d0cbbe7f"}, + {file = "pycodestyle-2.12.1-py2.py3-none-any.whl", hash = "sha256:46f0fb92069a7c28ab7bb558f05bfc0110dac69a0cd23c61ea0040283a9d78b3"}, + {file = "pycodestyle-2.12.1.tar.gz", hash = "sha256:6838eae08bbce4f6accd5d5572075c63626a15ee3e6f842df996bf62f6d73521"}, ] [[package]] @@ -936,13 +923,13 @@ toml = ["tomli (>=1.2.3)"] [[package]] name = "pyflakes" -version = "2.4.0" +version = "3.2.0" description = "passive checker of Python programs" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +python-versions = ">=3.8" files = [ - {file = "pyflakes-2.4.0-py2.py3-none-any.whl", hash = "sha256:3bb3a3f256f4b7968c9c788781e4ff07dce46bdf12339dcda61053375426ee2e"}, - {file = "pyflakes-2.4.0.tar.gz", hash = "sha256:05a85c2872edf37a4ed30b0cce2f6093e1d0581f8c19d7393122da7e25b2b24c"}, + {file = "pyflakes-3.2.0-py2.py3-none-any.whl", hash = "sha256:84b5be138a2dfbb40689ca07e2152deb896a65c3a3e24c251c5c62489568074a"}, + {file = "pyflakes-3.2.0.tar.gz", hash = "sha256:1c61603ff154621fb2a9172037d84dca3500def8c8b630657d1701f026f8af3f"}, ] [[package]] @@ -1477,5 +1464,5 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" -python-versions = "^3.8" -content-hash = "947e225df53d2bf1e2619903d15914add47936bb01f9d9f8af0792077e072965" +python-versions = ">=3.8.1,<3.14" +content-hash = "9270d1d85ab675863bfd63c205de98dd11f40d282419680c6af8b64a3de68b3a" diff --git a/pyproject.toml b/pyproject.toml index 8a4ba15e6..d33a273c9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ include = ["LICENSE"] packages = [{ include = "xrpl" }] [tool.poetry.dependencies] -python = "^3.8" +python = ">=3.8.1,<3.14" base58 = "^2.1.0" ECPy = "^1.2.5" typing-extensions = "^4.2.0" @@ -34,14 +34,13 @@ types-Deprecated = "^1.2.9" pycryptodome = "^3.16.0" [tool.poetry.dev-dependencies] -flake8 = "^4.0.1" +flake8 = "^7.0.0" black = "24.8.0" flake8-black = "^0.3.6" flake8-docstrings = "^1.7.0" mypy = "^1" isort = "^5.11.5" flake8-isort = "^6.0.0" -flake8-annotations = "2.7.0" flake8-absolute-import = "^1.0" darglint = "^1.5.8" sphinx-rtd-theme = "^3.0.0" diff --git a/snippets/get_transaction.py b/snippets/get_transaction.py index f22b15c8c..bb833ecdc 100644 --- a/snippets/get_transaction.py +++ b/snippets/get_transaction.py @@ -1,4 +1,5 @@ """Example of how we can see a transaction that was validated on the ledger""" + from xrpl.clients import JsonRpcClient from xrpl.models import Ledger, Tx diff --git a/snippets/partial_payment.py b/snippets/partial_payment.py index 02ff0fd84..d0f5474f1 100644 --- a/snippets/partial_payment.py +++ b/snippets/partial_payment.py @@ -1,4 +1,5 @@ """Example of how to handle partial payments""" + from xrpl.clients import JsonRpcClient from xrpl.models import ( AccountLines, diff --git a/snippets/set_regular_key.py b/snippets/set_regular_key.py index 39ad5f207..e1888d8c4 100644 --- a/snippets/set_regular_key.py +++ b/snippets/set_regular_key.py @@ -1,4 +1,5 @@ """Example of how we can setting a regular key""" + from xrpl.account import get_balance from xrpl.clients import JsonRpcClient from xrpl.models import Payment, SetRegularKey diff --git a/snippets/submit_payment.py b/snippets/submit_payment.py index 8dbbb4f25..97584e680 100644 --- a/snippets/submit_payment.py +++ b/snippets/submit_payment.py @@ -1,4 +1,5 @@ """Example of how to send a transaction and see its validation response""" + from xrpl.account import get_balance from xrpl.clients import JsonRpcClient from xrpl.models import Payment, Tx diff --git a/xrpl/__init__.py b/xrpl/__init__.py index 4c61f86ed..4bd22c9d9 100644 --- a/xrpl/__init__.py +++ b/xrpl/__init__.py @@ -1,4 +1,5 @@ """High-level XRPL exports.""" + from xrpl import account, clients, core, ledger, models, transaction, utils, wallet from xrpl.constants import CryptoAlgorithm, XRPLException diff --git a/xrpl/account/__init__.py b/xrpl/account/__init__.py index 5f575c43b..2eeb954c7 100644 --- a/xrpl/account/__init__.py +++ b/xrpl/account/__init__.py @@ -1,4 +1,5 @@ """Methods for interacting with XRPL accounts.""" + from xrpl.account.main import ( does_account_exist, get_account_root, diff --git a/xrpl/account/transaction_history.py b/xrpl/account/transaction_history.py index 79677dcd8..c757610bc 100644 --- a/xrpl/account/transaction_history.py +++ b/xrpl/account/transaction_history.py @@ -1,4 +1,5 @@ """High-level methods to obtain information about account transaction history.""" + import asyncio from xrpl.asyncio.account import transaction_history diff --git a/xrpl/asyncio/__init__.py b/xrpl/asyncio/__init__.py index 641deb4ab..219a957e6 100644 --- a/xrpl/asyncio/__init__.py +++ b/xrpl/asyncio/__init__.py @@ -1,4 +1,5 @@ """High-level XRPL exports for async support.""" + from xrpl.asyncio import account, clients, ledger, transaction, wallet __all__ = ["account", "clients", "ledger", "transaction", "wallet"] diff --git a/xrpl/asyncio/account/__init__.py b/xrpl/asyncio/account/__init__.py index 44b5907df..fc7614529 100644 --- a/xrpl/asyncio/account/__init__.py +++ b/xrpl/asyncio/account/__init__.py @@ -1,4 +1,5 @@ """Async methods for interacting with XRPL accounts.""" + from xrpl.asyncio.account.main import ( does_account_exist, get_account_root, diff --git a/xrpl/asyncio/account/transaction_history.py b/xrpl/asyncio/account/transaction_history.py index 84767aed7..572a3ff70 100644 --- a/xrpl/asyncio/account/transaction_history.py +++ b/xrpl/asyncio/account/transaction_history.py @@ -1,4 +1,5 @@ """High-level methods to obtain information about account transaction history.""" + from xrpl.asyncio.clients import Client, XRPLRequestFailureException from xrpl.core.addresscodec import is_valid_xaddress, xaddress_to_classic_address from xrpl.models.requests import AccountTx diff --git a/xrpl/asyncio/clients/__init__.py b/xrpl/asyncio/clients/__init__.py index 7a4143731..8dd0661a9 100644 --- a/xrpl/asyncio/clients/__init__.py +++ b/xrpl/asyncio/clients/__init__.py @@ -1,4 +1,5 @@ """Asynchronous network clients for interacting with the XRPL.""" + from xrpl.asyncio.clients.async_json_rpc_client import AsyncJsonRpcClient from xrpl.asyncio.clients.async_websocket_client import AsyncWebsocketClient from xrpl.asyncio.clients.client import Client diff --git a/xrpl/asyncio/clients/async_json_rpc_client.py b/xrpl/asyncio/clients/async_json_rpc_client.py index d4b72f4ff..f7c8cc72c 100644 --- a/xrpl/asyncio/clients/async_json_rpc_client.py +++ b/xrpl/asyncio/clients/async_json_rpc_client.py @@ -1,4 +1,5 @@ """An async client for interacting with the rippled JSON RPC.""" + from xrpl.asyncio.clients.async_client import AsyncClient from xrpl.asyncio.clients.json_rpc_base import JsonRpcBase diff --git a/xrpl/asyncio/ledger/__init__.py b/xrpl/asyncio/ledger/__init__.py index 2d2ec70ac..8f99f4854 100644 --- a/xrpl/asyncio/ledger/__init__.py +++ b/xrpl/asyncio/ledger/__init__.py @@ -1,4 +1,5 @@ """Async methods for obtaining information about the status of the XRP Ledger.""" + from xrpl.asyncio.ledger.main import ( get_fee, get_latest_open_ledger_sequence, diff --git a/xrpl/asyncio/wallet/__init__.py b/xrpl/asyncio/wallet/__init__.py index 220964348..ab803be63 100644 --- a/xrpl/asyncio/wallet/__init__.py +++ b/xrpl/asyncio/wallet/__init__.py @@ -1,4 +1,5 @@ """Async methods for working with XRPL wallets.""" + from xrpl.asyncio.wallet.wallet_generation import ( XRPLFaucetException, generate_faucet_wallet, diff --git a/xrpl/asyncio/wallet/wallet_generation.py b/xrpl/asyncio/wallet/wallet_generation.py index 08cb36418..32a9e22bc 100644 --- a/xrpl/asyncio/wallet/wallet_generation.py +++ b/xrpl/asyncio/wallet/wallet_generation.py @@ -1,4 +1,5 @@ """Handles wallet generation from a faucet.""" + import asyncio from typing import Optional from urllib.parse import urlparse, urlunparse diff --git a/xrpl/clients/__init__.py b/xrpl/clients/__init__.py index 66108d5e4..504eabbac 100644 --- a/xrpl/clients/__init__.py +++ b/xrpl/clients/__init__.py @@ -1,4 +1,5 @@ """Synchronous network clients for interacting with the XRPL.""" + from xrpl.asyncio.clients.client import Client from xrpl.asyncio.clients.exceptions import XRPLRequestFailureException from xrpl.asyncio.clients.utils import ( diff --git a/xrpl/clients/json_rpc_client.py b/xrpl/clients/json_rpc_client.py index b5877dd79..4a09cd2cd 100644 --- a/xrpl/clients/json_rpc_client.py +++ b/xrpl/clients/json_rpc_client.py @@ -1,4 +1,5 @@ """A sync client for interacting with the rippled JSON RPC.""" + from xrpl.asyncio.clients.json_rpc_base import JsonRpcBase from xrpl.clients.sync_client import SyncClient diff --git a/xrpl/constants.py b/xrpl/constants.py index 7f8dd8138..b633c93f5 100644 --- a/xrpl/constants.py +++ b/xrpl/constants.py @@ -1,4 +1,5 @@ """Collection of public constants for XRPL.""" + import re from decimal import Context from enum import Enum diff --git a/xrpl/core/__init__.py b/xrpl/core/__init__.py index d8250d894..f16b8c042 100644 --- a/xrpl/core/__init__.py +++ b/xrpl/core/__init__.py @@ -1,4 +1,5 @@ """Core codec functions for interacting with the XRPL.""" + from xrpl.core import addresscodec, binarycodec, keypairs __all__ = ["addresscodec", "binarycodec", "keypairs"] diff --git a/xrpl/core/addresscodec/__init__.py b/xrpl/core/addresscodec/__init__.py index 0d3826e36..2f8cc2cb4 100644 --- a/xrpl/core/addresscodec/__init__.py +++ b/xrpl/core/addresscodec/__init__.py @@ -1,4 +1,5 @@ """Functions for encoding and decoding XRP Ledger addresses and seeds.""" + from xrpl.core.addresscodec.codec import ( SEED_LENGTH, decode_account_public_key, diff --git a/xrpl/core/addresscodec/exceptions.py b/xrpl/core/addresscodec/exceptions.py index 5f7182e16..44e3b57b9 100644 --- a/xrpl/core/addresscodec/exceptions.py +++ b/xrpl/core/addresscodec/exceptions.py @@ -1,4 +1,5 @@ """General XRPL Address Codec Exceptions.""" + from xrpl.constants import XRPLException diff --git a/xrpl/core/addresscodec/utils.py b/xrpl/core/addresscodec/utils.py index 42e571736..bcb185ede 100644 --- a/xrpl/core/addresscodec/utils.py +++ b/xrpl/core/addresscodec/utils.py @@ -1,7 +1,8 @@ """This module contains commonly-used constants.""" + from typing_extensions import Final # The dictionary used for XRPL base58 encodings -XRPL_ALPHABET: Final[ - bytes -] = b"rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz" +XRPL_ALPHABET: Final[bytes] = ( + b"rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz" +) diff --git a/xrpl/core/binarycodec/__init__.py b/xrpl/core/binarycodec/__init__.py index b73ffeb68..5362fa334 100644 --- a/xrpl/core/binarycodec/__init__.py +++ b/xrpl/core/binarycodec/__init__.py @@ -2,6 +2,7 @@ Functions for encoding objects into the XRP Ledger's canonical binary format and decoding them. """ + from xrpl.core.binarycodec.exceptions import XRPLBinaryCodecException from xrpl.core.binarycodec.main import ( decode, diff --git a/xrpl/core/binarycodec/binary_wrappers/__init__.py b/xrpl/core/binarycodec/binary_wrappers/__init__.py index ec27a6694..f3d527fd7 100644 --- a/xrpl/core/binarycodec/binary_wrappers/__init__.py +++ b/xrpl/core/binarycodec/binary_wrappers/__init__.py @@ -1,4 +1,5 @@ """Wrapper classes around byte buffers used for serialization and deserialization.""" + from xrpl.core.binarycodec.binary_wrappers.binary_parser import BinaryParser from xrpl.core.binarycodec.binary_wrappers.binary_serializer import BinarySerializer diff --git a/xrpl/core/binarycodec/definitions/__init__.py b/xrpl/core/binarycodec/definitions/__init__.py index b8287cde2..75bc00fd7 100644 --- a/xrpl/core/binarycodec/definitions/__init__.py +++ b/xrpl/core/binarycodec/definitions/__init__.py @@ -1,4 +1,5 @@ """Handles the XRPL type and definition specifics.""" + from xrpl.core.binarycodec.definitions.definitions import ( get_field_header_from_name, get_field_instance, diff --git a/xrpl/core/binarycodec/exceptions.py b/xrpl/core/binarycodec/exceptions.py index 85fb09552..ce62ac7c4 100644 --- a/xrpl/core/binarycodec/exceptions.py +++ b/xrpl/core/binarycodec/exceptions.py @@ -1,4 +1,5 @@ """General XRPL Binary Codec Exceptions.""" + from xrpl.constants import XRPLException diff --git a/xrpl/core/binarycodec/types/__init__.py b/xrpl/core/binarycodec/types/__init__.py index e9d31a608..c50d85f37 100644 --- a/xrpl/core/binarycodec/types/__init__.py +++ b/xrpl/core/binarycodec/types/__init__.py @@ -1,4 +1,5 @@ """Top-level exports for types used in binary_codec.""" + from xrpl.core.binarycodec.types.account_id import AccountID from xrpl.core.binarycodec.types.amount import Amount from xrpl.core.binarycodec.types.blob import Blob diff --git a/xrpl/core/keypairs/__init__.py b/xrpl/core/keypairs/__init__.py index 5ebf2306f..1f9e9fd25 100644 --- a/xrpl/core/keypairs/__init__.py +++ b/xrpl/core/keypairs/__init__.py @@ -2,6 +2,7 @@ Low-level functions for creating and using cryptographic keys with the XRP Ledger. """ + from xrpl.core.keypairs.exceptions import XRPLKeypairsException from xrpl.core.keypairs.main import ( derive_classic_address, diff --git a/xrpl/core/keypairs/exceptions.py b/xrpl/core/keypairs/exceptions.py index 9ddd4dea6..ad2b381e8 100644 --- a/xrpl/core/keypairs/exceptions.py +++ b/xrpl/core/keypairs/exceptions.py @@ -1,4 +1,5 @@ """XRPL keypair codec exceptions.""" + from xrpl.constants import XRPLException diff --git a/xrpl/core/keypairs/helpers.py b/xrpl/core/keypairs/helpers.py index b49fc0fb7..557313597 100644 --- a/xrpl/core/keypairs/helpers.py +++ b/xrpl/core/keypairs/helpers.py @@ -1,4 +1,5 @@ """Miscellaneous functions that are private to xrpl.core.keypairs.""" + import hashlib import Crypto.Hash.RIPEMD160 as RIPEMD160 diff --git a/xrpl/core/keypairs/main.py b/xrpl/core/keypairs/main.py index 7eae73c52..9cbcbd785 100644 --- a/xrpl/core/keypairs/main.py +++ b/xrpl/core/keypairs/main.py @@ -1,4 +1,5 @@ """Interface for cryptographic key pairs for use with the XRP Ledger.""" + from secrets import token_bytes from typing import Dict, Optional, Tuple, Type, Union diff --git a/xrpl/ledger/__init__.py b/xrpl/ledger/__init__.py index 756e1797d..5d70e3c8c 100644 --- a/xrpl/ledger/__init__.py +++ b/xrpl/ledger/__init__.py @@ -1,4 +1,5 @@ """Methods for obtaining information about the status of the XRP Ledger.""" + from xrpl.ledger.main import ( get_fee, get_latest_open_ledger_sequence, diff --git a/xrpl/models/__init__.py b/xrpl/models/__init__.py index 8d7d4e63a..6cbdaf9a0 100644 --- a/xrpl/models/__init__.py +++ b/xrpl/models/__init__.py @@ -1,4 +1,5 @@ """Top-level exports for the models package.""" + from xrpl.models import amounts, currencies, requests, transactions from xrpl.models.amounts import * # noqa: F401, F403 from xrpl.models.auth_account import AuthAccount diff --git a/xrpl/models/amounts/__init__.py b/xrpl/models/amounts/__init__.py index 1f1b5aa73..d95f68dc9 100644 --- a/xrpl/models/amounts/__init__.py +++ b/xrpl/models/amounts/__init__.py @@ -3,6 +3,7 @@ of that currency, and the counterparty (issuer) on the trustline that holds the value. For XRP, there is no counterparty. """ + from xrpl.models.amounts.amount import ( Amount, get_amount_value, diff --git a/xrpl/models/amounts/amount.py b/xrpl/models/amounts/amount.py index 4b06933c1..27735787b 100644 --- a/xrpl/models/amounts/amount.py +++ b/xrpl/models/amounts/amount.py @@ -3,6 +3,7 @@ counterparty (issuer) on the trustline that holds the value. For XRP, there is no counterparty. """ + from typing import Union, cast from xrpl.models.amounts.issued_currency_amount import IssuedCurrencyAmount diff --git a/xrpl/models/auth_account.py b/xrpl/models/auth_account.py index e03393f41..da4fddbba 100644 --- a/xrpl/models/auth_account.py +++ b/xrpl/models/auth_account.py @@ -1,4 +1,5 @@ """Model used in AMMBid transaction.""" + from __future__ import annotations from dataclasses import dataclass diff --git a/xrpl/models/base_model.py b/xrpl/models/base_model.py index 84c0416fc..c4dc9a767 100644 --- a/xrpl/models/base_model.py +++ b/xrpl/models/base_model.py @@ -177,7 +177,7 @@ def _from_dict_single_param( # no more collections (no params expect a Dict) - if param_type is Any: # type: ignore + if param_type is Any: # param_type is Any (e.g. will accept anything) return param_value diff --git a/xrpl/models/currencies/__init__.py b/xrpl/models/currencies/__init__.py index 256b2b203..00be88436 100644 --- a/xrpl/models/currencies/__init__.py +++ b/xrpl/models/currencies/__init__.py @@ -3,6 +3,7 @@ currencies. Both types have high precision, although their formats are different. """ + from xrpl.models.currencies.currency import Currency from xrpl.models.currencies.issued_currency import IssuedCurrency from xrpl.models.currencies.xrp import XRP diff --git a/xrpl/models/currencies/currency.py b/xrpl/models/currencies/currency.py index 1c665ff72..33f10df09 100644 --- a/xrpl/models/currencies/currency.py +++ b/xrpl/models/currencies/currency.py @@ -3,6 +3,7 @@ currencies. Both types have high precision, although their formats are different. """ + from typing import Union from xrpl.models.currencies.issued_currency import IssuedCurrency diff --git a/xrpl/models/exceptions.py b/xrpl/models/exceptions.py index 2982d3027..a20533030 100644 --- a/xrpl/models/exceptions.py +++ b/xrpl/models/exceptions.py @@ -1,4 +1,5 @@ """General XRPL Model Exceptions.""" + from xrpl.constants import XRPLException diff --git a/xrpl/models/requests/account_channels.py b/xrpl/models/requests/account_channels.py index 9739c492e..5383a0a98 100644 --- a/xrpl/models/requests/account_channels.py +++ b/xrpl/models/requests/account_channels.py @@ -7,6 +7,7 @@ `See account_channels `_ """ + from dataclasses import dataclass, field from typing import Any, Optional diff --git a/xrpl/models/requests/account_currencies.py b/xrpl/models/requests/account_currencies.py index 8fdb51d92..bc54f42f4 100644 --- a/xrpl/models/requests/account_currencies.py +++ b/xrpl/models/requests/account_currencies.py @@ -7,6 +7,7 @@ `See account_currencies `_ """ + from dataclasses import dataclass, field from xrpl.models.requests.request import LookupByLedgerRequest, Request, RequestMethod diff --git a/xrpl/models/requests/account_info.py b/xrpl/models/requests/account_info.py index 2bd342055..5d7ba7a92 100644 --- a/xrpl/models/requests/account_info.py +++ b/xrpl/models/requests/account_info.py @@ -6,6 +6,7 @@ `See account_info `_ """ + from dataclasses import dataclass, field from xrpl.models.requests.request import LookupByLedgerRequest, Request, RequestMethod diff --git a/xrpl/models/requests/account_lines.py b/xrpl/models/requests/account_lines.py index ec8245748..f6927be81 100644 --- a/xrpl/models/requests/account_lines.py +++ b/xrpl/models/requests/account_lines.py @@ -5,6 +5,7 @@ `See account_lines `_ """ + from dataclasses import dataclass, field from typing import Any, Optional diff --git a/xrpl/models/requests/account_nfts.py b/xrpl/models/requests/account_nfts.py index 01fbfda0a..4d8ac93af 100644 --- a/xrpl/models/requests/account_nfts.py +++ b/xrpl/models/requests/account_nfts.py @@ -1,4 +1,5 @@ """This method retrieves all of the NFTs currently owned by the specified account.""" + from dataclasses import dataclass, field from typing import Any, Optional diff --git a/xrpl/models/requests/account_objects.py b/xrpl/models/requests/account_objects.py index 321e83abf..a0db3f66a 100644 --- a/xrpl/models/requests/account_objects.py +++ b/xrpl/models/requests/account_objects.py @@ -6,6 +6,7 @@ `See account_objects `_ """ + from dataclasses import dataclass, field from enum import Enum from typing import Any, Optional diff --git a/xrpl/models/requests/account_offers.py b/xrpl/models/requests/account_offers.py index bb5077b35..7d118e7c2 100644 --- a/xrpl/models/requests/account_offers.py +++ b/xrpl/models/requests/account_offers.py @@ -4,6 +4,7 @@ `See account_offers `_ """ + from dataclasses import dataclass, field from typing import Any, Optional diff --git a/xrpl/models/requests/account_tx.py b/xrpl/models/requests/account_tx.py index 862074094..75ebb5bc5 100644 --- a/xrpl/models/requests/account_tx.py +++ b/xrpl/models/requests/account_tx.py @@ -4,6 +4,7 @@ `See account_tx `_ """ + from dataclasses import dataclass, field from typing import Any, Optional diff --git a/xrpl/models/requests/amm_info.py b/xrpl/models/requests/amm_info.py index 9c2e8a235..01a8179e5 100644 --- a/xrpl/models/requests/amm_info.py +++ b/xrpl/models/requests/amm_info.py @@ -1,4 +1,5 @@ """This request gets information about an Automated Market Maker (AMM) instance.""" + from __future__ import annotations from dataclasses import dataclass, field diff --git a/xrpl/models/requests/book_offers.py b/xrpl/models/requests/book_offers.py index 877b3ed77..9201d2719 100644 --- a/xrpl/models/requests/book_offers.py +++ b/xrpl/models/requests/book_offers.py @@ -2,6 +2,7 @@ The book_offers method retrieves a list of offers, also known as the order book, between two currencies. """ + from dataclasses import dataclass, field from typing import Optional diff --git a/xrpl/models/requests/channel_authorize.py b/xrpl/models/requests/channel_authorize.py index 5b7304390..8612c95a3 100644 --- a/xrpl/models/requests/channel_authorize.py +++ b/xrpl/models/requests/channel_authorize.py @@ -79,7 +79,7 @@ def _get_errors(self: Self) -> Dict[str, str]: if method is not None ] if len(signing_methods) != 1: - errors[ - "ChannelAuthorize" - ] = "Must set exactly one of `secret`, `seed`, `seed_hex`, or `passphrase`." + errors["ChannelAuthorize"] = ( + "Must set exactly one of `secret`, `seed`, `seed_hex`, or `passphrase`." + ) return errors diff --git a/xrpl/models/requests/channel_verify.py b/xrpl/models/requests/channel_verify.py index 08057f00d..ed4638e6c 100644 --- a/xrpl/models/requests/channel_verify.py +++ b/xrpl/models/requests/channel_verify.py @@ -3,6 +3,7 @@ signature that can be used to redeem a specific amount of XRP from a payment channel. """ + from dataclasses import dataclass, field from xrpl.models.requests.request import Request, RequestMethod diff --git a/xrpl/models/requests/deposit_authorized.py b/xrpl/models/requests/deposit_authorized.py index d15ec459a..44737f641 100644 --- a/xrpl/models/requests/deposit_authorized.py +++ b/xrpl/models/requests/deposit_authorized.py @@ -4,6 +4,7 @@ Deposit Authorization for information on how to require authorization to deliver money to your account. """ + from dataclasses import dataclass, field from xrpl.models.requests.request import LookupByLedgerRequest, Request, RequestMethod diff --git a/xrpl/models/requests/fee.py b/xrpl/models/requests/fee.py index 5aaed7eb7..b7cce028c 100644 --- a/xrpl/models/requests/fee.py +++ b/xrpl/models/requests/fee.py @@ -5,6 +5,7 @@ This is a public command available to unprivileged users. """ + from dataclasses import dataclass, field from xrpl.models.requests.request import Request, RequestMethod diff --git a/xrpl/models/requests/gateway_balances.py b/xrpl/models/requests/gateway_balances.py index 3cb49e621..d6970f18f 100644 --- a/xrpl/models/requests/gateway_balances.py +++ b/xrpl/models/requests/gateway_balances.py @@ -4,6 +4,7 @@ `See gateway_balances `_ """ + from dataclasses import dataclass, field from typing import List, Optional, Union diff --git a/xrpl/models/requests/get_aggregate_price.py b/xrpl/models/requests/get_aggregate_price.py index 853a10ef4..d2d65e9fb 100644 --- a/xrpl/models/requests/get_aggregate_price.py +++ b/xrpl/models/requests/get_aggregate_price.py @@ -46,7 +46,7 @@ class GetAggregatePrice(Request): def _get_errors(self: Self) -> Dict[str, str]: errors = super()._get_errors() if len(self.oracles) == 0: - errors[ - "GetAggregatePrice" - ] = "Oracles array must contain at least one element" + errors["GetAggregatePrice"] = ( + "Oracles array must contain at least one element" + ) return errors diff --git a/xrpl/models/requests/ledger.py b/xrpl/models/requests/ledger.py index de84b8a37..038ff5ef8 100644 --- a/xrpl/models/requests/ledger.py +++ b/xrpl/models/requests/ledger.py @@ -2,6 +2,7 @@ Retrieve information about the public ledger. `See ledger `_ """ + from dataclasses import dataclass, field from xrpl.models.requests.request import LookupByLedgerRequest, Request, RequestMethod diff --git a/xrpl/models/requests/ledger_closed.py b/xrpl/models/requests/ledger_closed.py index 0ca61bc44..006e60ddf 100644 --- a/xrpl/models/requests/ledger_closed.py +++ b/xrpl/models/requests/ledger_closed.py @@ -4,6 +4,7 @@ (This ledger is not necessarily validated and immutable yet.) """ + from dataclasses import dataclass, field from xrpl.models.requests.request import Request, RequestMethod diff --git a/xrpl/models/requests/ledger_current.py b/xrpl/models/requests/ledger_current.py index 7e718da91..68f8e4ebc 100644 --- a/xrpl/models/requests/ledger_current.py +++ b/xrpl/models/requests/ledger_current.py @@ -4,6 +4,7 @@ This command is mostly useful for testing, because the ledger returned is still in flux. """ + from dataclasses import dataclass, field from xrpl.models.requests.request import Request, RequestMethod diff --git a/xrpl/models/requests/ledger_data.py b/xrpl/models/requests/ledger_data.py index 858e4bccd..867279d17 100644 --- a/xrpl/models/requests/ledger_data.py +++ b/xrpl/models/requests/ledger_data.py @@ -5,6 +5,7 @@ of a single ledger version. `See ledger data `_ """ + from dataclasses import dataclass, field from typing import Any, Optional diff --git a/xrpl/models/requests/ledger_entry.py b/xrpl/models/requests/ledger_entry.py index 974c7abbf..e82de695d 100644 --- a/xrpl/models/requests/ledger_entry.py +++ b/xrpl/models/requests/ledger_entry.py @@ -257,9 +257,9 @@ class LedgerEntry(Request, LookupByLedgerRequest): bridge_account: Optional[str] = None bridge: Optional[XChainBridge] = None xchain_claim_id: Optional[Union[str, XChainClaimID]] = None - xchain_create_account_claim_id: Optional[ - Union[str, XChainCreateAccountClaimID] - ] = None + xchain_create_account_claim_id: Optional[Union[str, XChainCreateAccountClaimID]] = ( + None + ) binary: bool = False nft_page: Optional[str] = None diff --git a/xrpl/models/requests/manifest.py b/xrpl/models/requests/manifest.py index 21363f9af..3aef6e06d 100644 --- a/xrpl/models/requests/manifest.py +++ b/xrpl/models/requests/manifest.py @@ -4,6 +4,7 @@ public key. The "manifest" is the public portion of that validator's configured token. """ + from dataclasses import dataclass, field from xrpl.models.requests.request import Request, RequestMethod diff --git a/xrpl/models/requests/nft_buy_offers.py b/xrpl/models/requests/nft_buy_offers.py index fb30770e4..a6ebd5270 100644 --- a/xrpl/models/requests/nft_buy_offers.py +++ b/xrpl/models/requests/nft_buy_offers.py @@ -2,6 +2,7 @@ The `nft_buy_offers` method retrieves all of buy offers for the specified NFToken. """ + from dataclasses import dataclass, field from xrpl.models.requests.request import LookupByLedgerRequest, Request, RequestMethod diff --git a/xrpl/models/requests/nft_history.py b/xrpl/models/requests/nft_history.py index 3d04537e9..c9c0f5c41 100644 --- a/xrpl/models/requests/nft_history.py +++ b/xrpl/models/requests/nft_history.py @@ -2,6 +2,7 @@ The `nft_history` method retreives a list of transactions that involved the specified NFToken. """ + from dataclasses import dataclass, field from typing import Any, Optional diff --git a/xrpl/models/requests/nft_info.py b/xrpl/models/requests/nft_info.py index 6389a3f9f..072d252e8 100644 --- a/xrpl/models/requests/nft_info.py +++ b/xrpl/models/requests/nft_info.py @@ -2,6 +2,7 @@ The `nft_info` method retrieves all the information about the NFToken """ + from dataclasses import dataclass, field from xrpl.models.requests.request import LookupByLedgerRequest, Request, RequestMethod diff --git a/xrpl/models/requests/nft_sell_offers.py b/xrpl/models/requests/nft_sell_offers.py index 6ee22f516..34a2cdcfc 100644 --- a/xrpl/models/requests/nft_sell_offers.py +++ b/xrpl/models/requests/nft_sell_offers.py @@ -2,6 +2,7 @@ The `nft_sell_offers` method retrieves all of sell offers for the specified NFToken. """ + from dataclasses import dataclass, field from xrpl.models.requests.request import LookupByLedgerRequest, Request, RequestMethod diff --git a/xrpl/models/requests/nfts_by_issuer.py b/xrpl/models/requests/nfts_by_issuer.py index 87af80b05..ef01b755c 100644 --- a/xrpl/models/requests/nfts_by_issuer.py +++ b/xrpl/models/requests/nfts_by_issuer.py @@ -2,6 +2,7 @@ The `nfts_by_issuer` method retrieves all of the NFTokens issued by an account """ + from dataclasses import dataclass, field from typing import Any, Optional diff --git a/xrpl/models/requests/no_ripple_check.py b/xrpl/models/requests/no_ripple_check.py index 1cdf7ec61..780ec337f 100644 --- a/xrpl/models/requests/no_ripple_check.py +++ b/xrpl/models/requests/no_ripple_check.py @@ -5,6 +5,7 @@ `See noripple_check `_ """ + from dataclasses import dataclass, field from enum import Enum from typing import Optional diff --git a/xrpl/models/requests/path_find.py b/xrpl/models/requests/path_find.py index 2a3863276..dca6abca2 100644 --- a/xrpl/models/requests/path_find.py +++ b/xrpl/models/requests/path_find.py @@ -26,6 +26,7 @@ results is not necessarily proof of malicious behavior; it could also be a symptom of heavy server load.) """ + from __future__ import annotations from dataclasses import dataclass, field diff --git a/xrpl/models/requests/ping.py b/xrpl/models/requests/ping.py index 25951c0a3..2dec6d5cd 100644 --- a/xrpl/models/requests/ping.py +++ b/xrpl/models/requests/ping.py @@ -2,6 +2,7 @@ The ping command returns an acknowledgement, so that clients can test the connection status and latency. """ + from dataclasses import dataclass, field from xrpl.models.requests.request import Request, RequestMethod diff --git a/xrpl/models/requests/random.py b/xrpl/models/requests/random.py index a0a27197d..836bbc859 100644 --- a/xrpl/models/requests/random.py +++ b/xrpl/models/requests/random.py @@ -2,6 +2,7 @@ The random command provides a random number to be used as a source of entropy for random number generation by clients. """ + from dataclasses import dataclass, field from xrpl.models.requests.request import Request, RequestMethod diff --git a/xrpl/models/requests/ripple_path_find.py b/xrpl/models/requests/ripple_path_find.py index 2e82ca2b2..08ad77c6d 100644 --- a/xrpl/models/requests/ripple_path_find.py +++ b/xrpl/models/requests/ripple_path_find.py @@ -11,6 +11,7 @@ combination of paths for making a payment, it is not guaranteed that the paths returned by this method are, in fact, the best paths. """ + from dataclasses import dataclass, field from typing import List, Optional diff --git a/xrpl/models/requests/server_definitions.py b/xrpl/models/requests/server_definitions.py index b20b73123..0ec32b440 100644 --- a/xrpl/models/requests/server_definitions.py +++ b/xrpl/models/requests/server_definitions.py @@ -3,6 +3,7 @@ human-readable version of various information about the rippled server being queried. """ + from dataclasses import dataclass, field from typing import Optional diff --git a/xrpl/models/requests/server_info.py b/xrpl/models/requests/server_info.py index cb8f6a36b..31697d2cb 100644 --- a/xrpl/models/requests/server_info.py +++ b/xrpl/models/requests/server_info.py @@ -3,6 +3,7 @@ human-readable version of various information about the rippled server being queried. """ + from dataclasses import dataclass, field from xrpl.models.requests.request import Request, RequestMethod diff --git a/xrpl/models/requests/server_state.py b/xrpl/models/requests/server_state.py index e2e1296b9..1d798d40c 100644 --- a/xrpl/models/requests/server_state.py +++ b/xrpl/models/requests/server_state.py @@ -8,6 +8,7 @@ notation or decimal values, and time is given in milliseconds instead of seconds.) """ + from dataclasses import dataclass, field from xrpl.models.requests.request import Request, RequestMethod diff --git a/xrpl/models/requests/sign.py b/xrpl/models/requests/sign.py index 3b18041f5..67479f51b 100644 --- a/xrpl/models/requests/sign.py +++ b/xrpl/models/requests/sign.py @@ -100,9 +100,9 @@ def to_dict(self: Self) -> Dict[str, Any]: def _get_errors(self: Self) -> Dict[str, str]: errors = super()._get_errors() if not self._has_only_one_seed(): - errors[ - "Sign" - ] = "Must have only one of `secret`, `seed`, `seed_hex`, and `passphrase`." + errors["Sign"] = ( + "Must have only one of `secret`, `seed`, `seed_hex`, and `passphrase`." + ) if self.secret is not None and self.key_type is not None: errors["key_type"] = "Must omit `key_type` if `secret` is provided." diff --git a/xrpl/models/requests/sign_and_submit.py b/xrpl/models/requests/sign_and_submit.py index bae4d1805..b36e8c279 100644 --- a/xrpl/models/requests/sign_and_submit.py +++ b/xrpl/models/requests/sign_and_submit.py @@ -109,9 +109,9 @@ def to_dict(self: Self) -> Dict[str, Any]: def _get_errors(self: Self) -> Dict[str, str]: errors = super()._get_errors() if not self._has_only_one_seed(): - errors[ - "SignAndSubmit" - ] = "Must have only one of `secret`, `seed`, `seed_hex`, and `passphrase`." + errors["SignAndSubmit"] = ( + "Must have only one of `secret`, `seed`, `seed_hex`, and `passphrase`." + ) if self.secret is not None and self.key_type is not None: errors["key_type"] = "Must omit `key_type` if `secret` is provided." diff --git a/xrpl/models/requests/sign_for.py b/xrpl/models/requests/sign_for.py index 5c6c17486..f44abe23a 100644 --- a/xrpl/models/requests/sign_for.py +++ b/xrpl/models/requests/sign_for.py @@ -91,9 +91,9 @@ def to_dict(self: Self) -> Dict[str, Any]: def _get_errors(self: Self) -> Dict[str, str]: errors = super()._get_errors() if not self._has_only_one_seed(): - errors[ - "SignFor" - ] = "Must have only one of `secret`, `seed`, `seed_hex`, and `passphrase`." + errors["SignFor"] = ( + "Must have only one of `secret`, `seed`, `seed_hex`, and `passphrase`." + ) if self.secret is not None and self.key_type is not None: errors["key_type"] = "Must omit `key_type` if `secret` is provided." diff --git a/xrpl/models/requests/subscribe.py b/xrpl/models/requests/subscribe.py index 4a72c08a9..b05a2d561 100644 --- a/xrpl/models/requests/subscribe.py +++ b/xrpl/models/requests/subscribe.py @@ -6,6 +6,7 @@ `See subscribe `_ """ + from dataclasses import dataclass, field from enum import Enum from typing import List, Optional diff --git a/xrpl/models/requests/tx.py b/xrpl/models/requests/tx.py index 7d9ead48a..d25715a36 100644 --- a/xrpl/models/requests/tx.py +++ b/xrpl/models/requests/tx.py @@ -76,9 +76,9 @@ class Tx(Request): def _get_errors(self: Self) -> Dict[str, str]: errors = super()._get_errors() if not self._has_only_one_input(): - errors[ - "Tx" - ] = "Must have only one of `ctid` or `transaction`, but not both." + errors["Tx"] = ( + "Must have only one of `ctid` or `transaction`, but not both." + ) return errors def _has_only_one_input(self: Self) -> bool: diff --git a/xrpl/models/requests/unsubscribe.py b/xrpl/models/requests/unsubscribe.py index 045e2ed7b..e9b5a2148 100644 --- a/xrpl/models/requests/unsubscribe.py +++ b/xrpl/models/requests/unsubscribe.py @@ -6,6 +6,7 @@ `See unsubscribe `_ """ + from dataclasses import dataclass, field from typing import List, Optional diff --git a/xrpl/models/transactions/amm_delete.py b/xrpl/models/transactions/amm_delete.py index 2def520b3..03d6895e3 100644 --- a/xrpl/models/transactions/amm_delete.py +++ b/xrpl/models/transactions/amm_delete.py @@ -1,4 +1,5 @@ """Model for AMMDelete transaction type.""" + from __future__ import annotations from dataclasses import dataclass, field diff --git a/xrpl/models/transactions/check_cancel.py b/xrpl/models/transactions/check_cancel.py index ad6c960e3..1a5521f9e 100644 --- a/xrpl/models/transactions/check_cancel.py +++ b/xrpl/models/transactions/check_cancel.py @@ -1,4 +1,5 @@ """Model for CheckCancel transaction type.""" + from dataclasses import dataclass, field from xrpl.models.required import REQUIRED diff --git a/xrpl/models/transactions/check_cash.py b/xrpl/models/transactions/check_cash.py index 9966e0999..ce1dbc8fb 100644 --- a/xrpl/models/transactions/check_cash.py +++ b/xrpl/models/transactions/check_cash.py @@ -55,7 +55,7 @@ class CheckCash(Transaction): def _get_errors(self: Self) -> Dict[str, str]: errors = super()._get_errors() if not (self.amount is None) ^ (self.deliver_min is None): - errors[ - "CheckCash" - ] = "either amount or deliver_min must be set but not both" + errors["CheckCash"] = ( + "either amount or deliver_min must be set but not both" + ) return errors diff --git a/xrpl/models/transactions/check_create.py b/xrpl/models/transactions/check_create.py index 1ca3a296a..0e5c802cc 100644 --- a/xrpl/models/transactions/check_create.py +++ b/xrpl/models/transactions/check_create.py @@ -1,4 +1,5 @@ """Model for CheckCreate transaction type.""" + from dataclasses import dataclass, field from typing import Optional diff --git a/xrpl/models/transactions/deposit_preauth.py b/xrpl/models/transactions/deposit_preauth.py index b3c94e8c7..5afc9797a 100644 --- a/xrpl/models/transactions/deposit_preauth.py +++ b/xrpl/models/transactions/deposit_preauth.py @@ -42,9 +42,9 @@ class DepositPreauth(Transaction): def _get_errors(self: Self) -> Dict[str, str]: errors = super()._get_errors() if self.authorize and self.unauthorize: - errors[ - "DepositPreauth" - ] = "One of authorize and unauthorize must be set, not both." + errors["DepositPreauth"] = ( + "One of authorize and unauthorize must be set, not both." + ) if not self.authorize and not self.unauthorize: errors["DepositPreauth"] = "One of authorize and unauthorize must be set." diff --git a/xrpl/models/transactions/escrow_create.py b/xrpl/models/transactions/escrow_create.py index fa170df2c..3d564ed53 100644 --- a/xrpl/models/transactions/escrow_create.py +++ b/xrpl/models/transactions/escrow_create.py @@ -79,8 +79,8 @@ def _get_errors(self: Self) -> Dict[str, str]: and self.finish_after is not None and self.finish_after >= self.cancel_after ): - errors[ - "EscrowCreate" - ] = "The finish_after time must be before the cancel_after time." + errors["EscrowCreate"] = ( + "The finish_after time must be before the cancel_after time." + ) return errors diff --git a/xrpl/models/transactions/escrow_finish.py b/xrpl/models/transactions/escrow_finish.py index 130e2d5b2..f525bfcac 100644 --- a/xrpl/models/transactions/escrow_finish.py +++ b/xrpl/models/transactions/escrow_finish.py @@ -58,12 +58,12 @@ class EscrowFinish(Transaction): def _get_errors(self: Self) -> Dict[str, str]: errors = super()._get_errors() if self.condition and not self.fulfillment: - errors[ - "fulfillment" - ] = "If condition is specified, fulfillment must also be specified." + errors["fulfillment"] = ( + "If condition is specified, fulfillment must also be specified." + ) if self.fulfillment and not self.condition: - errors[ - "condition" - ] = "If fulfillment is specified, condition must also be specified." + errors["condition"] = ( + "If fulfillment is specified, condition must also be specified." + ) return errors diff --git a/xrpl/models/transactions/offer_cancel.py b/xrpl/models/transactions/offer_cancel.py index 492d153e4..0ddd3df03 100644 --- a/xrpl/models/transactions/offer_cancel.py +++ b/xrpl/models/transactions/offer_cancel.py @@ -1,4 +1,5 @@ """Model for OfferCancel transaction type.""" + from dataclasses import dataclass, field from xrpl.models.required import REQUIRED diff --git a/xrpl/models/transactions/offer_create.py b/xrpl/models/transactions/offer_create.py index cce104c16..6d95900c9 100644 --- a/xrpl/models/transactions/offer_create.py +++ b/xrpl/models/transactions/offer_create.py @@ -1,4 +1,5 @@ """Model for OfferCreate transaction type.""" + from dataclasses import dataclass, field from enum import Enum from typing import Optional diff --git a/xrpl/models/transactions/oracle_set.py b/xrpl/models/transactions/oracle_set.py index 17b7f0147..69d3f546e 100644 --- a/xrpl/models/transactions/oracle_set.py +++ b/xrpl/models/transactions/oracle_set.py @@ -130,17 +130,17 @@ def _get_errors(self: Self) -> Dict[str, str]: errors["provider"] = "Field must have a length greater than 0." if self.provider is not None and len(self.provider) > MAX_ORACLE_PROVIDER: - errors[ - "provider" - ] = f"Field must have a length less than or equal to {MAX_ORACLE_PROVIDER}." + errors["provider"] = ( + f"Field must have a length less than or equal to {MAX_ORACLE_PROVIDER}." + ) if self.uri is not None and len(self.uri) == 0: errors["uri"] = "Field must have a length greater than 0." if self.uri is not None and len(self.uri) > MAX_ORACLE_URI: - errors[ - "uri" - ] = f"Field must have a length less than or equal to {MAX_ORACLE_URI}." + errors["uri"] = ( + f"Field must have a length less than or equal to {MAX_ORACLE_URI}." + ) # check on the last_update_time if self.last_update_time < EPOCH_OFFSET: diff --git a/xrpl/models/transactions/payment.py b/xrpl/models/transactions/payment.py index 8fa8ccb6b..01765572c 100644 --- a/xrpl/models/transactions/payment.py +++ b/xrpl/models/transactions/payment.py @@ -148,9 +148,9 @@ def _get_errors(self: Self) -> Dict[str, str]: elif self.deliver_min is not None and not self.has_flag( PaymentFlag.TF_PARTIAL_PAYMENT ): - errors[ - "deliver_min" - ] = "A non-partial payment cannot have a `deliver_min` field." + errors["deliver_min"] = ( + "A non-partial payment cannot have a `deliver_min` field." + ) elif ( is_xrp(self.amount) @@ -165,8 +165,8 @@ def _get_errors(self: Self) -> Dict[str, str]: # currency conversion errors elif self.account == self.destination: if self.send_max is None: - errors[ - "send_max" - ] = "A currency conversion requires a `send_max` value." + errors["send_max"] = ( + "A currency conversion requires a `send_max` value." + ) return errors diff --git a/xrpl/models/transactions/payment_channel_claim.py b/xrpl/models/transactions/payment_channel_claim.py index 8e3b32c74..928efcee9 100644 --- a/xrpl/models/transactions/payment_channel_claim.py +++ b/xrpl/models/transactions/payment_channel_claim.py @@ -1,4 +1,5 @@ """Model for PaymentChannelClaim transaction type.""" + from dataclasses import dataclass, field from enum import Enum from typing import Optional diff --git a/xrpl/models/transactions/payment_channel_create.py b/xrpl/models/transactions/payment_channel_create.py index 5eacd574a..7e16004ee 100644 --- a/xrpl/models/transactions/payment_channel_create.py +++ b/xrpl/models/transactions/payment_channel_create.py @@ -1,4 +1,5 @@ """Model for PaymentChannelCreate transaction type.""" + from dataclasses import dataclass, field from typing import Optional diff --git a/xrpl/models/transactions/payment_channel_fund.py b/xrpl/models/transactions/payment_channel_fund.py index 296a23bb6..32dfb17c1 100644 --- a/xrpl/models/transactions/payment_channel_fund.py +++ b/xrpl/models/transactions/payment_channel_fund.py @@ -1,4 +1,5 @@ """Model for a PaymentChannelFund transaction type.""" + from dataclasses import dataclass, field from typing import Optional diff --git a/xrpl/models/transactions/pseudo_transactions/__init__.py b/xrpl/models/transactions/pseudo_transactions/__init__.py index 86757b03b..b28173597 100644 --- a/xrpl/models/transactions/pseudo_transactions/__init__.py +++ b/xrpl/models/transactions/pseudo_transactions/__init__.py @@ -2,6 +2,7 @@ Model objects for specific `types of Pseudo-Transactions `_ in the XRP Ledger. """ + from xrpl.models.transactions.pseudo_transactions.enable_amendment import ( EnableAmendment, EnableAmendmentFlag, diff --git a/xrpl/models/transactions/pseudo_transactions/set_fee.py b/xrpl/models/transactions/pseudo_transactions/set_fee.py index dffc693b0..37b58c98e 100644 --- a/xrpl/models/transactions/pseudo_transactions/set_fee.py +++ b/xrpl/models/transactions/pseudo_transactions/set_fee.py @@ -1,4 +1,5 @@ """Model for SetFee pseudo-transaction type.""" + from __future__ import annotations from dataclasses import dataclass, field diff --git a/xrpl/models/transactions/pseudo_transactions/unl_modify.py b/xrpl/models/transactions/pseudo_transactions/unl_modify.py index 32065c7bd..506a9eb41 100644 --- a/xrpl/models/transactions/pseudo_transactions/unl_modify.py +++ b/xrpl/models/transactions/pseudo_transactions/unl_modify.py @@ -66,8 +66,8 @@ class UNLModify(PseudoTransaction): def _get_errors(self: Self) -> Dict[str, str]: errors = super()._get_errors() if self.unl_modify_disabling not in {0, 1}: - errors[ - "unl_modify_disabling" - ] = "`unl_modify_disabling` is not equal to 0 or 1." + errors["unl_modify_disabling"] = ( + "`unl_modify_disabling` is not equal to 0 or 1." + ) return errors diff --git a/xrpl/models/transactions/set_regular_key.py b/xrpl/models/transactions/set_regular_key.py index 24946cb98..f8b52fd8c 100644 --- a/xrpl/models/transactions/set_regular_key.py +++ b/xrpl/models/transactions/set_regular_key.py @@ -1,4 +1,5 @@ """Model for SetRegularKey transaction type.""" + from dataclasses import dataclass, field from typing import Optional diff --git a/xrpl/models/transactions/signer_list_set.py b/xrpl/models/transactions/signer_list_set.py index 374c45a6c..032bd64b7 100644 --- a/xrpl/models/transactions/signer_list_set.py +++ b/xrpl/models/transactions/signer_list_set.py @@ -107,9 +107,9 @@ def _get_errors(self: Self) -> Dict[str, str]: ) if not isinstance(self.signer_entries, list): - errors[ - "signer_entries" - ] = "`signer_entries` must be a list of `SignerEntry` objects." + errors["signer_entries"] = ( + "`signer_entries` must be a list of `SignerEntry` objects." + ) return errors if ( diff --git a/xrpl/models/transactions/trust_set.py b/xrpl/models/transactions/trust_set.py index bc01269fa..b8f568aa8 100644 --- a/xrpl/models/transactions/trust_set.py +++ b/xrpl/models/transactions/trust_set.py @@ -4,6 +4,7 @@ `See TrustSet `_ """ + from dataclasses import dataclass, field from enum import Enum from typing import Optional diff --git a/xrpl/models/transactions/xchain_claim.py b/xrpl/models/transactions/xchain_claim.py index d7dadb5ff..760f44151 100644 --- a/xrpl/models/transactions/xchain_claim.py +++ b/xrpl/models/transactions/xchain_claim.py @@ -82,8 +82,8 @@ def _get_errors(self: Self) -> Dict[str, str]: currency != bridge.locking_chain_issue and currency != bridge.issuing_chain_issue ): - errors[ - "amount" - ] = "amount must match either locking chain issue or issuing chain issue." + errors["amount"] = ( + "amount must match either locking chain issue or issuing chain issue." + ) return errors diff --git a/xrpl/models/transactions/xchain_create_bridge.py b/xrpl/models/transactions/xchain_create_bridge.py index 29097864d..8ea2a9838 100644 --- a/xrpl/models/transactions/xchain_create_bridge.py +++ b/xrpl/models/transactions/xchain_create_bridge.py @@ -61,14 +61,14 @@ def _get_errors(self: Self) -> Dict[str, str]: bridge = self.xchain_bridge if bridge.locking_chain_door == bridge.issuing_chain_door: - errors[ - "xchain_bridge" - ] = "Cannot have the same door accounts on the locking and issuing chain." + errors["xchain_bridge"] = ( + "Cannot have the same door accounts on the locking and issuing chain." + ) if self.account not in [bridge.locking_chain_door, bridge.issuing_chain_door]: - errors[ - "account" - ] = "account must be either locking chain door or issuing chain door." + errors["account"] = ( + "account must be either locking chain door or issuing chain door." + ) if (bridge.locking_chain_issue == XRP()) != ( bridge.issuing_chain_issue == XRP() @@ -79,9 +79,9 @@ def _get_errors(self: Self) -> Dict[str, str]: self.min_account_create_amount is not None and bridge.locking_chain_issue != XRP() ): - errors[ - "min_account_create_amount" - ] = "Cannot have MinAccountCreateAmount if bridge is IOU-IOU." + errors["min_account_create_amount"] = ( + "Cannot have MinAccountCreateAmount if bridge is IOU-IOU." + ) if self.signature_reward != REQUIRED and not self.signature_reward.isnumeric(): errors["signature_reward"] = "signature_reward must be numeric." @@ -90,8 +90,8 @@ def _get_errors(self: Self) -> Dict[str, str]: self.min_account_create_amount is not None and not self.min_account_create_amount.isnumeric() ): - errors[ - "min_account_create_amount_value" - ] = "min_account_create_amount must be numeric." + errors["min_account_create_amount_value"] = ( + "min_account_create_amount must be numeric." + ) return errors diff --git a/xrpl/models/transactions/xchain_create_claim_id.py b/xrpl/models/transactions/xchain_create_claim_id.py index 48906d587..77ab27486 100644 --- a/xrpl/models/transactions/xchain_create_claim_id.py +++ b/xrpl/models/transactions/xchain_create_claim_id.py @@ -63,8 +63,8 @@ def _get_errors(self: Self) -> Dict[str, str]: if self.other_chain_source != REQUIRED and not is_valid_classic_address( self.other_chain_source ): - errors[ - "other_chain_source" - ] = "`other_chain_source` must be a valid XRPL address." + errors["other_chain_source"] = ( + "`other_chain_source` must be a valid XRPL address." + ) return errors diff --git a/xrpl/models/transactions/xchain_modify_bridge.py b/xrpl/models/transactions/xchain_modify_bridge.py index ec0be90c4..884cc4e0d 100644 --- a/xrpl/models/transactions/xchain_modify_bridge.py +++ b/xrpl/models/transactions/xchain_modify_bridge.py @@ -89,9 +89,9 @@ def _get_errors(self: Self) -> Dict[str, str]: ) if self.account not in [bridge.locking_chain_door, bridge.issuing_chain_door]: - errors[ - "account" - ] = "account must be either locking chain door or issuing chain door." + errors["account"] = ( + "account must be either locking chain door or issuing chain door." + ) if self.signature_reward is not None and not self.signature_reward.isnumeric(): errors["signature_reward"] = "`signature_reward` must be numeric." @@ -100,16 +100,16 @@ def _get_errors(self: Self) -> Dict[str, str]: self.min_account_create_amount is not None and bridge.locking_chain_issue != XRP() ): - errors[ - "min_account_create_amount" - ] = "Cannot have MinAccountCreateAmount if bridge is IOU-IOU." + errors["min_account_create_amount"] = ( + "Cannot have MinAccountCreateAmount if bridge is IOU-IOU." + ) if ( self.min_account_create_amount is not None and not self.min_account_create_amount.isnumeric() ): - errors[ - "min_account_create_amount_value" - ] = "`min_account_create_amount` must be numeric." + errors["min_account_create_amount_value"] = ( + "`min_account_create_amount` must be numeric." + ) return errors diff --git a/xrpl/models/types.py b/xrpl/models/types.py index b9f26d8e2..a050b7fbf 100644 --- a/xrpl/models/types.py +++ b/xrpl/models/types.py @@ -3,6 +3,7 @@ :meta private: """ + from typing import Any, Dict, List, Union # The type of a parsed model in python, after it is loaded from a JSON string diff --git a/xrpl/models/utils.py b/xrpl/models/utils.py index 1ecf53709..9ddb9d2ab 100644 --- a/xrpl/models/utils.py +++ b/xrpl/models/utils.py @@ -1,4 +1,5 @@ """Helper util functions for the models module.""" + from dataclasses import dataclass, is_dataclass from typing import Any, Dict, List, Type, TypeVar, cast diff --git a/xrpl/transaction/multisign.py b/xrpl/transaction/multisign.py index b6b1af2e4..f2f690b0c 100644 --- a/xrpl/transaction/multisign.py +++ b/xrpl/transaction/multisign.py @@ -1,4 +1,5 @@ """Multisign transaction methods with XRPL transactions.""" + from typing import List from xrpl.core.addresscodec import decode_classic_address diff --git a/xrpl/utils/get_nftoken_id.py b/xrpl/utils/get_nftoken_id.py index 52a77b4c5..fbeae697e 100644 --- a/xrpl/utils/get_nftoken_id.py +++ b/xrpl/utils/get_nftoken_id.py @@ -1,4 +1,5 @@ """Utils to get an NFTokenID from metadata""" + from typing import Callable, List, TypeVar, Union from xrpl.models.transactions.metadata import ( diff --git a/xrpl/utils/get_xchain_claim_id.py b/xrpl/utils/get_xchain_claim_id.py index 8da6f8c42..1a57c4336 100644 --- a/xrpl/utils/get_xchain_claim_id.py +++ b/xrpl/utils/get_xchain_claim_id.py @@ -1,4 +1,5 @@ """Utils to get an XChainClaimID from metadata.""" + from xrpl.models.transactions.metadata import TransactionMetadata, isCreatedNode diff --git a/xrpl/utils/parse_nftoken_id.py b/xrpl/utils/parse_nftoken_id.py index 9ed3bdf60..d973a3f71 100644 --- a/xrpl/utils/parse_nftoken_id.py +++ b/xrpl/utils/parse_nftoken_id.py @@ -1,4 +1,5 @@ """Utils to parse NFTokenIDs.""" + from typing_extensions import TypedDict from xrpl.constants import XRPLException diff --git a/xrpl/utils/xrp_conversions.py b/xrpl/utils/xrp_conversions.py index d8aa2cf3c..735af06da 100644 --- a/xrpl/utils/xrp_conversions.py +++ b/xrpl/utils/xrp_conversions.py @@ -1,4 +1,5 @@ """Conversions between XRP drops and native number types.""" + import re from decimal import Decimal, InvalidOperation, localcontext from typing import Pattern, Union diff --git a/xrpl/wallet/__init__.py b/xrpl/wallet/__init__.py index 4410e593d..a55e5069c 100644 --- a/xrpl/wallet/__init__.py +++ b/xrpl/wallet/__init__.py @@ -1,4 +1,5 @@ """Methods for working with XRPL wallets.""" + from xrpl.asyncio.wallet import XRPLFaucetException from xrpl.wallet.main import Wallet from xrpl.wallet.wallet_generation import generate_faucet_wallet diff --git a/xrpl/wallet/wallet_generation.py b/xrpl/wallet/wallet_generation.py index af9511962..a0096205f 100644 --- a/xrpl/wallet/wallet_generation.py +++ b/xrpl/wallet/wallet_generation.py @@ -1,4 +1,5 @@ """Handles wallet generation from a faucet.""" + import asyncio from typing import Optional From a66707ddc8eac5096d4aba6db8e741fa48a227af Mon Sep 17 00:00:00 2001 From: Chenna Keshava B S Date: Wed, 6 Nov 2024 10:03:07 -0800 Subject: [PATCH 04/15] address errors raised by flake8 --- tests/unit/core/binarycodec/types/test_serialized_type.py | 2 +- xrpl/core/addresscodec/codec.py | 4 ++-- xrpl/utils/xrp_conversions.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/unit/core/binarycodec/types/test_serialized_type.py b/tests/unit/core/binarycodec/types/test_serialized_type.py index 79e3ca1ba..3fa9d2acb 100644 --- a/tests/unit/core/binarycodec/types/test_serialized_type.py +++ b/tests/unit/core/binarycodec/types/test_serialized_type.py @@ -48,7 +48,7 @@ class TestSerializedType(TestCase): def fixture_test(self, fixture: ValueTest): """Run the appropriate test for given fixture case.""" serialized_type: SerializedType = TYPE_MAP[fixture.type] - if type(fixture.test_json) == dict: + if isinstance(fixture.test_json, dict): json_value = fixture.test_json else: json_value = str(fixture.test_json) diff --git a/xrpl/core/addresscodec/codec.py b/xrpl/core/addresscodec/codec.py index 479023acf..c64aa2c38 100644 --- a/xrpl/core/addresscodec/codec.py +++ b/xrpl/core/addresscodec/codec.py @@ -40,8 +40,8 @@ def _encode(bytestring: bytes, prefix: List[int], expected_length: int) -> str: length. """ if expected_length and len(bytestring) != expected_length: - error_message = """unexpected_payload_length: len(bytestring) does not match expected_length. - Ensure that the bytes are a bytestring.""" + error_message = """unexpected_payload_length: len(bytestring) does not match + expected_length. Ensure that the bytes are a bytestring.""" raise XRPLAddressCodecException(error_message) encoded_prefix = bytes(prefix) payload = encoded_prefix + bytestring diff --git a/xrpl/utils/xrp_conversions.py b/xrpl/utils/xrp_conversions.py index 735af06da..5eaaa4829 100644 --- a/xrpl/utils/xrp_conversions.py +++ b/xrpl/utils/xrp_conversions.py @@ -36,7 +36,7 @@ def xrp_to_drops(xrp: Union[int, float, Decimal]) -> str: TypeError: if ``xrp`` is given as a string XRPRangeException: if the given amount of XRP is invalid """ - if type(xrp) == str: # type: ignore + if isinstance(xrp, str): # This protects people from passing drops to this function and getting # a million times as many drops back. raise TypeError( @@ -84,7 +84,7 @@ def drops_to_xrp(drops: str) -> Decimal: TypeError: if ``drops`` not given as a string XRPRangeException: if the given number of drops is invalid """ - if type(drops) != str: + if not isinstance(drops, str): raise TypeError(f"Drops must be provided as string (got {type(drops)})") drops = drops.strip() with localcontext(DROPS_DECIMAL_CONTEXT): From 0e43f75709df831e1f66ced688b5157c5af78380 Mon Sep 17 00:00:00 2001 From: Chenna Keshava B S Date: Wed, 6 Nov 2024 10:24:04 -0800 Subject: [PATCH 05/15] address errors raised by mypy --- xrpl/models/base_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xrpl/models/base_model.py b/xrpl/models/base_model.py index c4dc9a767..84c0416fc 100644 --- a/xrpl/models/base_model.py +++ b/xrpl/models/base_model.py @@ -177,7 +177,7 @@ def _from_dict_single_param( # no more collections (no params expect a Dict) - if param_type is Any: + if param_type is Any: # type: ignore # param_type is Any (e.g. will accept anything) return param_value From 8ba6c030506107d0bab3adb6d73d800d121fe1d4 Mon Sep 17 00:00:00 2001 From: Chenna Keshava B S <21219765+ckeshava@users.noreply.github.com> Date: Wed, 6 Nov 2024 14:22:12 -0800 Subject: [PATCH 06/15] Update pyproject.toml --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d33a273c9..c58011440 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ include = ["LICENSE"] packages = [{ include = "xrpl" }] [tool.poetry.dependencies] -python = ">=3.8.1,<3.14" +python = ">=3.8.1" base58 = "^2.1.0" ECPy = "^1.2.5" typing-extensions = "^4.2.0" From 0b1144362942f02053ae12c39bab53522aad6a4a Mon Sep 17 00:00:00 2001 From: Chenna Keshava B S Date: Wed, 6 Nov 2024 14:26:03 -0800 Subject: [PATCH 07/15] Revert "Update pyproject.toml" This reverts commit 8ba6c030506107d0bab3adb6d73d800d121fe1d4. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c58011440..d33a273c9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ include = ["LICENSE"] packages = [{ include = "xrpl" }] [tool.poetry.dependencies] -python = ">=3.8.1" +python = ">=3.8.1,<3.14" base58 = "^2.1.0" ECPy = "^1.2.5" typing-extensions = "^4.2.0" From 45479e389df8fb122bcf632702b157dfafa7ce79 Mon Sep 17 00:00:00 2001 From: Chenna Keshava B S Date: Wed, 6 Nov 2024 14:35:37 -0800 Subject: [PATCH 08/15] remove the MarkupSafe dev-dependency --- poetry.lock | 2 +- pyproject.toml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/poetry.lock b/poetry.lock index 257528155..8749206a1 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1465,4 +1465,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = ">=3.8.1,<3.14" -content-hash = "9270d1d85ab675863bfd63c205de98dd11f40d282419680c6af8b64a3de68b3a" +content-hash = "c3043b2ca97be62b9f77e096c50426f48f55253d9079b7c0ab506e584fb3673a" diff --git a/pyproject.toml b/pyproject.toml index d33a273c9..a754b7a6a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,6 @@ sphinx-rtd-theme = "^3.0.0" aiounittest = "^1.4.0" coverage = "^7.2.7" Jinja2 = "^3.1.4" -MarkupSafe = "2.1.5" Sphinx = "^7.1.2" poethepoet = "^0.29.0" From 27e7972a41e1677cd8abc8165d5633763e5a6913 Mon Sep 17 00:00:00 2001 From: Chenna Keshava B S Date: Wed, 6 Nov 2024 15:10:49 -0800 Subject: [PATCH 09/15] Update flake8-annotations to the latest version --- poetry.lock | 36 +++++++++++++++++++++++++++++++++++- pyproject.toml | 1 + 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/poetry.lock b/poetry.lock index 8749206a1..22ac848a7 100644 --- a/poetry.lock +++ b/poetry.lock @@ -47,6 +47,25 @@ doc = ["Sphinx (>=7.4,<8.0)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "truststore (>=0.9.1)", "uvloop (>=0.21.0b1)"] trio = ["trio (>=0.26.1)"] +[[package]] +name = "attrs" +version = "24.2.0" +description = "Classes Without Boilerplate" +optional = false +python-versions = ">=3.7" +files = [ + {file = "attrs-24.2.0-py3-none-any.whl", hash = "sha256:81921eb96de3191c8258c199618104dd27ac608d9366f5e35d011eae1867ede2"}, + {file = "attrs-24.2.0.tar.gz", hash = "sha256:5cfb1b9148b5b086569baec03f20d7b6bf3bcacc9a42bebf87ffaaca362f6346"}, +] + +[package.extras] +benchmark = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-codspeed", "pytest-mypy-plugins", "pytest-xdist[psutil]"] +cov = ["cloudpickle", "coverage[toml] (>=5.3)", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] +dev = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pre-commit", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] +docs = ["cogapp", "furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier (<24.7)"] +tests = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] +tests-mypy = ["mypy (>=1.11.1)", "pytest-mypy-plugins"] + [[package]] name = "babel" version = "2.16.0" @@ -452,6 +471,21 @@ files = [ [package.dependencies] flake8 = ">=5.0" +[[package]] +name = "flake8-annotations" +version = "3.1.1" +description = "Flake8 Type Annotation Checks" +optional = false +python-versions = ">=3.8.1" +files = [ + {file = "flake8_annotations-3.1.1-py3-none-any.whl", hash = "sha256:102935bdcbfa714759a152aeb07b14aee343fc0b6f7c55ad16968ce3e0e91a8a"}, + {file = "flake8_annotations-3.1.1.tar.gz", hash = "sha256:6c98968ccc6bdc0581d363bf147a87df2f01d0d078264b2da805799d911cf5fe"}, +] + +[package.dependencies] +attrs = ">=21.4" +flake8 = ">=5.0" + [[package]] name = "flake8-black" version = "0.3.6" @@ -1465,4 +1499,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = ">=3.8.1,<3.14" -content-hash = "c3043b2ca97be62b9f77e096c50426f48f55253d9079b7c0ab506e584fb3673a" +content-hash = "0f843ba78cfed6e7079c370182dd9509a44e2ca0ec9f5979bfd41593f9cc7dac" diff --git a/pyproject.toml b/pyproject.toml index a754b7a6a..c022a2412 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,6 +41,7 @@ flake8-docstrings = "^1.7.0" mypy = "^1" isort = "^5.11.5" flake8-isort = "^6.0.0" +flake8-annotations = "^3.1.1" flake8-absolute-import = "^1.0" darglint = "^1.5.8" sphinx-rtd-theme = "^3.0.0" From 3c647b6ab3fa61a4466e79ecd5e6f9f8187d5f59 Mon Sep 17 00:00:00 2001 From: Chenna Keshava B S Date: Wed, 6 Nov 2024 15:13:23 -0800 Subject: [PATCH 10/15] remove Jinja2 dev-dependency --- poetry.lock | 2 +- pyproject.toml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/poetry.lock b/poetry.lock index 22ac848a7..78ac94cb0 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1499,4 +1499,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = ">=3.8.1,<3.14" -content-hash = "0f843ba78cfed6e7079c370182dd9509a44e2ca0ec9f5979bfd41593f9cc7dac" +content-hash = "9e30c45369ed90a3f876e1949950187f1f21fd5b62e662b1efabc93f56182575" diff --git a/pyproject.toml b/pyproject.toml index c022a2412..6a7816394 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,6 @@ darglint = "^1.5.8" sphinx-rtd-theme = "^3.0.0" aiounittest = "^1.4.0" coverage = "^7.2.7" -Jinja2 = "^3.1.4" Sphinx = "^7.1.2" poethepoet = "^0.29.0" From 563897fb6277cc941962bba4f440075a8b2ff687 Mon Sep 17 00:00:00 2001 From: Chenna Keshava B S Date: Wed, 6 Nov 2024 15:52:52 -0800 Subject: [PATCH 11/15] rectify flake8-annotations errors --- xrpl/core/binarycodec/types/serialized_type.py | 8 +++++--- xrpl/core/binarycodec/types/st_object.py | 4 ++-- xrpl/models/base_model.py | 9 +++++---- xrpl/models/nested_model.py | 2 +- xrpl/models/requests/generic_request.py | 2 +- xrpl/models/response.py | 4 ++-- 6 files changed, 16 insertions(+), 13 deletions(-) diff --git a/xrpl/core/binarycodec/types/serialized_type.py b/xrpl/core/binarycodec/types/serialized_type.py index 4feb90a75..cb78b778a 100644 --- a/xrpl/core/binarycodec/types/serialized_type.py +++ b/xrpl/core/binarycodec/types/serialized_type.py @@ -25,13 +25,15 @@ def from_parser( # noqa: D102 cls: Type[Self], parser: BinaryParser, # length_hint is Any so that subclasses can choose whether or not to require it. - length_hint: Any, + length_hint: Any, # noqa: ANN401 ) -> Self: pass @classmethod @abstractmethod - def from_value(cls: Type[Self], value: Any) -> Self: # noqa: D102 + def from_value(cls: Type[Self], value: Any) -> Self: # noqa: D102, ANN401 + # Note: Its difficult to specify a concrete type for value parameter because + # child-classes accept a variety of types. pass def to_byte_sink(self: Self, bytesink: bytearray) -> None: @@ -54,7 +56,7 @@ def __bytes__(self: Self) -> bytes: """ return self.buffer - def to_json(self: Self) -> Any: + def to_json(self: Self) -> Any: # noqa: ANN401 """ Returns the JSON representation of a SerializedType. diff --git a/xrpl/core/binarycodec/types/st_object.py b/xrpl/core/binarycodec/types/st_object.py index 272ce19e5..704ba6746 100644 --- a/xrpl/core/binarycodec/types/st_object.py +++ b/xrpl/core/binarycodec/types/st_object.py @@ -58,7 +58,7 @@ def _handle_xaddress(field: str, xaddress: str) -> Dict[str, Union[str, int]]: return {field: classic_address} -def _str_to_enum(field: str, value: Any) -> Any: +def _str_to_enum(field: str, value: str) -> Union[str, int]: # all of these fields have enum values that are used for serialization # converts the string name to the corresponding enum code if field == "TransactionType": @@ -70,7 +70,7 @@ def _str_to_enum(field: str, value: Any) -> Any: return value -def _enum_to_str(field: str, value: Any) -> Any: +def _enum_to_str(field: str, value: int) -> Union[str, int]: # reverse of the above function if field == "TransactionType": return get_transaction_type_name(value) diff --git a/xrpl/models/base_model.py b/xrpl/models/base_model.py index 84c0416fc..34fb86000 100644 --- a/xrpl/models/base_model.py +++ b/xrpl/models/base_model.py @@ -85,7 +85,7 @@ class BaseModel(ABC): """The base class for all model types.""" @classmethod - def is_dict_of_model(cls: Type[Self], dictionary: Any) -> bool: + def is_dict_of_model(cls: Type[Self], dictionary: Any) -> bool: # noqa: ANN401 """ Checks whether the provided ``dictionary`` is a dictionary representation of this class. @@ -95,7 +95,8 @@ def is_dict_of_model(cls: Type[Self], dictionary: Any) -> bool: a subclass of this class. Args: - dictionary: The dictionary to check. + dictionary: The dictionary to check. Note: The input `dictionary` can be of + non-dict type. For instance, a `str` representation of JSON. Returns: True if dictionary is a ``dict`` representation of an instance of this @@ -148,7 +149,7 @@ def from_dict(cls: Type[Self], value: Dict[str, XRPL_VALUE_TYPE]) -> Self: def _from_dict_single_param( cls: Type[Self], param: str, - param_type: Type[Any], + param_type: Type[Any], # noqa: ANN401 param_value: Union[int, str, bool, BaseModel, Enum, List[Any], Dict[str, Any]], ) -> Any: """Recursively handles each individual param in `from_dict`.""" @@ -321,7 +322,7 @@ def to_dict(self: Self) -> Dict[str, Any]: if getattr(self, key) is not None } - def _to_dict_elem(self: Self, elem: Any) -> Any: + def _to_dict_elem(self: Self, elem: Any) -> Any: # noqa: ANN401 if isinstance(elem, BaseModel): return elem.to_dict() if isinstance(elem, Enum): diff --git a/xrpl/models/nested_model.py b/xrpl/models/nested_model.py index 96a400e5e..43f20d9ff 100644 --- a/xrpl/models/nested_model.py +++ b/xrpl/models/nested_model.py @@ -21,7 +21,7 @@ class NestedModel(BaseModel): """The base class for models that involve a nested dictionary e.g. memos.""" @classmethod - def is_dict_of_model(cls: Type[Self], dictionary: Any) -> bool: + def is_dict_of_model(cls: Type[Self], dictionary: Any) -> bool: # noqa: ANN401 """ Returns True if the input dictionary was derived by the `to_dict` method of an instance of this class. In other words, True if this is diff --git a/xrpl/models/requests/generic_request.py b/xrpl/models/requests/generic_request.py index d11b89244..f1c34fba2 100644 --- a/xrpl/models/requests/generic_request.py +++ b/xrpl/models/requests/generic_request.py @@ -28,7 +28,7 @@ class GenericRequest(Request): :meta hide-value: """ - def __init__(self: Self, **kwargs: Any) -> None: + def __init__(self: Self, **kwargs: Any) -> None: # noqa: ANN401 """ Initializes a GenericRequest. diff --git a/xrpl/models/response.py b/xrpl/models/response.py index 84e369a6f..fd24133b4 100644 --- a/xrpl/models/response.py +++ b/xrpl/models/response.py @@ -92,7 +92,7 @@ def contains_partial_payment(self: Self) -> bool: """ return self._do_contains_partial_payment(self.result) - def _do_contains_partial_payment(self: Self, val: Any) -> bool: + def _do_contains_partial_payment(self: Self, val: Any) -> bool: # noqa: ANN401 flagged = [] if isinstance(val, dict): formatted = {key.strip().lower(): value for key, value in val.items()} @@ -111,7 +111,7 @@ def _do_contains_partial_payment(self: Self, val: Any) -> bool: ] return len(flagged) > 0 - def _is_partial_payment(self: Self, key: str, val: Any) -> bool: + def _is_partial_payment(self: Self, key: str, val: Any) -> bool: # noqa: ANN401 if isinstance(val, dict): return self._do_contains_partial_payment(val) try: From 0a6794b6613785761ab3a004354cc312d7a5f7d7 Mon Sep 17 00:00:00 2001 From: Chenna Keshava B S Date: Wed, 6 Nov 2024 15:55:27 -0800 Subject: [PATCH 12/15] include one additional noqa: ANN401 exception --- xrpl/models/base_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xrpl/models/base_model.py b/xrpl/models/base_model.py index 34fb86000..3b3b8441e 100644 --- a/xrpl/models/base_model.py +++ b/xrpl/models/base_model.py @@ -151,7 +151,7 @@ def _from_dict_single_param( param: str, param_type: Type[Any], # noqa: ANN401 param_value: Union[int, str, bool, BaseModel, Enum, List[Any], Dict[str, Any]], - ) -> Any: + ) -> Any: # noqa: ANN401 """Recursively handles each individual param in `from_dict`.""" param_type_origin = get_origin(param_type) # returns `list` if a List, `Union` if a Union, None otherwise From 43fc8755d20dcab960c9fc3f44de76efe2d5e306 Mon Sep 17 00:00:00 2001 From: Chenna Keshava B S Date: Wed, 6 Nov 2024 15:57:53 -0800 Subject: [PATCH 13/15] remove minor versions of Python in the gating mechanism --- poetry.lock | 4 ++-- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/poetry.lock b/poetry.lock index 78ac94cb0..ef2d4539b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1498,5 +1498,5 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" -python-versions = ">=3.8.1,<3.14" -content-hash = "9e30c45369ed90a3f876e1949950187f1f21fd5b62e662b1efabc93f56182575" +python-versions = ">=3.8.1,<4.0" +content-hash = "23754155d850851d210cc6ab45bdc9431ffa98928e17e75c2c6b7c88bec0ee8a" diff --git a/pyproject.toml b/pyproject.toml index 6a7816394..f5b144592 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ include = ["LICENSE"] packages = [{ include = "xrpl" }] [tool.poetry.dependencies] -python = ">=3.8.1,<3.14" +python = ">=3.8.1,<4.0" base58 = "^2.1.0" ECPy = "^1.2.5" typing-extensions = "^4.2.0" From 02fc14a551ce6ede38316bf64c20b5912842e11c Mon Sep 17 00:00:00 2001 From: Chenna Keshava B S Date: Thu, 7 Nov 2024 13:09:55 -0800 Subject: [PATCH 14/15] remove Deprecated, types-Deprecated dependencies --- poetry.lock | 30 +----------------------------- pyproject.toml | 2 -- 2 files changed, 1 insertion(+), 31 deletions(-) diff --git a/poetry.lock b/poetry.lock index ef2d4539b..acebdf925 100644 --- a/poetry.lock +++ b/poetry.lock @@ -388,23 +388,6 @@ files = [ {file = "darglint-1.8.1.tar.gz", hash = "sha256:080d5106df149b199822e7ee7deb9c012b49891538f14a11be681044f0bb20da"}, ] -[[package]] -name = "deprecated" -version = "1.2.14" -description = "Python @deprecated decorator to deprecate old python classes, functions or methods." -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -files = [ - {file = "Deprecated-1.2.14-py2.py3-none-any.whl", hash = "sha256:6fac8b097794a90302bdbb17b9b815e732d3c4720583ff1b198499d78470466c"}, - {file = "Deprecated-1.2.14.tar.gz", hash = "sha256:e5323eb936458dccc2582dc6f9c322c852a775a27065ff2b0c4970b9d53d01b3"}, -] - -[package.dependencies] -wrapt = ">=1.10,<2" - -[package.extras] -dev = ["PyTest", "PyTest-Cov", "bump2version (<1)", "sphinx (<2)", "tox"] - [[package]] name = "docutils" version = "0.20.1" @@ -1264,17 +1247,6 @@ files = [ {file = "tomli-2.0.2.tar.gz", hash = "sha256:d46d457a85337051c36524bc5349dd91b1877838e2979ac5ced3e710ed8a60ed"}, ] -[[package]] -name = "types-deprecated" -version = "1.2.9.20240311" -description = "Typing stubs for Deprecated" -optional = false -python-versions = ">=3.8" -files = [ - {file = "types-Deprecated-1.2.9.20240311.tar.gz", hash = "sha256:0680e89989a8142707de8103f15d182445a533c1047fd9b7e8c5459101e9b90a"}, - {file = "types_Deprecated-1.2.9.20240311-py3-none-any.whl", hash = "sha256:d7793aaf32ff8f7e49a8ac781de4872248e0694c4b75a7a8a186c51167463f9d"}, -] - [[package]] name = "typing-extensions" version = "4.12.2" @@ -1499,4 +1471,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = ">=3.8.1,<4.0" -content-hash = "23754155d850851d210cc6ab45bdc9431ffa98928e17e75c2c6b7c88bec0ee8a" +content-hash = "f6c71c1ff2549c6f0c98da003296cbfffaf5ce57a5a396ab5e6a759c64ec0161" diff --git a/pyproject.toml b/pyproject.toml index f5b144592..b72a26bf5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,8 +29,6 @@ ECPy = "^1.2.5" typing-extensions = "^4.2.0" httpx = ">=0.18.1,<0.28.0" websockets = ">=11,<14" -Deprecated = "^1.2.13" -types-Deprecated = "^1.2.9" pycryptodome = "^3.16.0" [tool.poetry.dev-dependencies] From 5cf0624fed3359fe7a17c4351772e3a25a3025bf Mon Sep 17 00:00:00 2001 From: Chenna Keshava B S Date: Thu, 7 Nov 2024 15:54:24 -0800 Subject: [PATCH 15/15] Revert "remove Deprecated, types-Deprecated dependencies" This reverts commit 02fc14a551ce6ede38316bf64c20b5912842e11c. --- poetry.lock | 30 +++++++++++++++++++++++++++++- pyproject.toml | 2 ++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/poetry.lock b/poetry.lock index acebdf925..ef2d4539b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -388,6 +388,23 @@ files = [ {file = "darglint-1.8.1.tar.gz", hash = "sha256:080d5106df149b199822e7ee7deb9c012b49891538f14a11be681044f0bb20da"}, ] +[[package]] +name = "deprecated" +version = "1.2.14" +description = "Python @deprecated decorator to deprecate old python classes, functions or methods." +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +files = [ + {file = "Deprecated-1.2.14-py2.py3-none-any.whl", hash = "sha256:6fac8b097794a90302bdbb17b9b815e732d3c4720583ff1b198499d78470466c"}, + {file = "Deprecated-1.2.14.tar.gz", hash = "sha256:e5323eb936458dccc2582dc6f9c322c852a775a27065ff2b0c4970b9d53d01b3"}, +] + +[package.dependencies] +wrapt = ">=1.10,<2" + +[package.extras] +dev = ["PyTest", "PyTest-Cov", "bump2version (<1)", "sphinx (<2)", "tox"] + [[package]] name = "docutils" version = "0.20.1" @@ -1247,6 +1264,17 @@ files = [ {file = "tomli-2.0.2.tar.gz", hash = "sha256:d46d457a85337051c36524bc5349dd91b1877838e2979ac5ced3e710ed8a60ed"}, ] +[[package]] +name = "types-deprecated" +version = "1.2.9.20240311" +description = "Typing stubs for Deprecated" +optional = false +python-versions = ">=3.8" +files = [ + {file = "types-Deprecated-1.2.9.20240311.tar.gz", hash = "sha256:0680e89989a8142707de8103f15d182445a533c1047fd9b7e8c5459101e9b90a"}, + {file = "types_Deprecated-1.2.9.20240311-py3-none-any.whl", hash = "sha256:d7793aaf32ff8f7e49a8ac781de4872248e0694c4b75a7a8a186c51167463f9d"}, +] + [[package]] name = "typing-extensions" version = "4.12.2" @@ -1471,4 +1499,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = ">=3.8.1,<4.0" -content-hash = "f6c71c1ff2549c6f0c98da003296cbfffaf5ce57a5a396ab5e6a759c64ec0161" +content-hash = "23754155d850851d210cc6ab45bdc9431ffa98928e17e75c2c6b7c88bec0ee8a" diff --git a/pyproject.toml b/pyproject.toml index b72a26bf5..f5b144592 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,6 +29,8 @@ ECPy = "^1.2.5" typing-extensions = "^4.2.0" httpx = ">=0.18.1,<0.28.0" websockets = ">=11,<14" +Deprecated = "^1.2.13" +types-Deprecated = "^1.2.9" pycryptodome = "^3.16.0" [tool.poetry.dev-dependencies]