diff --git a/silkaj/auth.py b/silkaj/auth.py index d69a9c7f308b211027c848bc3d5a053dc8caa47b..7b1195609b57e75bf9f9cfa75ee75da6d69d9456 100644 --- a/silkaj/auth.py +++ b/silkaj/auth.py @@ -18,8 +18,8 @@ import sys from pathlib import Path import rich_click as click -from duniterpy.key import SigningKey from duniterpy.key.scrypt_params import ScryptParams +from duniterpy.key.signing_key import SigningKey, SigningKeyException from silkaj.constants import FAILURE_EXIT_STATUS, PUBKEY_PATTERN from silkaj.public_key import gen_pubkey_checksum @@ -97,8 +97,7 @@ def auth_by_seed() -> SigningKey: try: return SigningKey.from_seedhex(seedhex) # To be fixed upstream in DuniterPy - # pylint: disable=broad-except - except Exception as error: + except SigningKeyException as error: print(error) sys.exit(FAILURE_EXIT_STATUS) @@ -120,7 +119,6 @@ def auth_by_scrypt(ctx: click.Context) -> SigningKey: n, r, p = ctx.obj["AUTH_SCRYPT_PARAMS"].split(",") if n.isnumeric() and r.isnumeric() and p.isnumeric(): - # pylint: disable=too-many-boolean-expressions n, r, p = int(n), int(r), int(p) if n <= 0 or n > 65536 or r <= 0 or r > 512 or p <= 0 or p > 32: sys.exit("Error: the values of Scrypt parameters are not good") @@ -149,7 +147,6 @@ def auth_by_wif() -> SigningKey: try: return SigningKey.from_wif_or_ewif_hex(wif_hex, password) # To be fixed upstream in DuniterPy - # pylint: disable=broad-except - except Exception as error: + except SigningKeyException as error: print(error) sys.exit(FAILURE_EXIT_STATUS) diff --git a/silkaj/money/history.py b/silkaj/money/history.py index 4fa0b1db0466b29e7f94cbba2c251446563db240..5854020cec6e986f18b12c5e9e47d3645aa45589 100644 --- a/silkaj/money/history.py +++ b/silkaj/money/history.py @@ -202,7 +202,6 @@ def parse_sent_tx( uids: bool, full_pubkey: bool, ) -> None: - # pylint: disable=too-many-locals """ Extract recipients` pubkeys from outputs Get identities from pubkeys diff --git a/silkaj/tools.py b/silkaj/tools.py index 3a3bb8bf70c9136c50d730d7d652fce998c716a9..a80e5a410da6658c30f47012e21eed242090cc60 100644 --- a/silkaj/tools.py +++ b/silkaj/tools.py @@ -36,7 +36,6 @@ def message_exit(message: str) -> None: sys.exit(FAILURE_EXIT_STATUS) -# pylint: disable=too-few-public-methods class MutuallyExclusiveOption(click.Option): def __init__(self, *args: Any, **kwargs: Any) -> None: self.mutually_exclusive = set(kwargs.pop("mutually_exclusive", [])) diff --git a/silkaj/wot/certification.py b/silkaj/wot/certification.py index f195c38eb7eef585d5562214e8aed6c62d54cce1..0cc4702a84058467d6649b7d1a18b5d54edf9396 100644 --- a/silkaj/wot/certification.py +++ b/silkaj/wot/certification.py @@ -43,7 +43,6 @@ def certify(ctx: click.Context, uid_pubkey_to_certify: str) -> None: if checked_pubkey: uid_pubkey_to_certify = str(checked_pubkey) - # pylint: disable=unused-variable idty_to_certify, pubkey_to_certify, send_certs = wot_tools.choose_identity( uid_pubkey_to_certify, ) diff --git a/tests/patched/money.py b/tests/patched/money.py index 0c2b4998cc18961603b637c581e9d056e7dd6e3f..b5624d296c12a1b6c3ddb903e0c6c7f1a1163bdb 100644 --- a/tests/patched/money.py +++ b/tests/patched/money.py @@ -144,5 +144,4 @@ def patched_get_sources(pubkey): class Counter: - # pylint: disable=too-few-public-methods counter = 0 diff --git a/tests/unit/money/test_transfer.py b/tests/unit/money/test_transfer.py index a8f09d6be9f0648166ebfb506d3510ff4a8e448a..321cd7bd8018ba41dc340ae00f54f6f7b88f28ee 100644 --- a/tests/unit/money/test_transfer.py +++ b/tests/unit/money/test_transfer.py @@ -1009,7 +1009,6 @@ def test_handle_intermediaries_transactions( ), ], ) -# pylint: disable=too-many-locals def test_send_transaction( amounts, amountsud, diff --git a/tests/unit/wot/test_tools.py b/tests/unit/wot/test_tools.py index 8331a2e926958489853b49e880201559b59b9180..111c42e463096af5608bb2db0d8e2abbcfad655b 100644 --- a/tests/unit/wot/test_tools.py +++ b/tests/unit/wot/test_tools.py @@ -151,7 +151,6 @@ def test_choose_identity( ): monkeypatch.setattr(w_tools, "wot_lookup", patched_lookup) monkeypatch.setattr(click, "prompt", patched_prompt) - # pylint: disable=unused-variable idty_card, get_pubkey, signed = w_tools.choose_identity(pubkey) expected_pubkey = pubkey.split(":")[0] assert expected_pubkey == get_pubkey