diff --git a/duniterpy/api/bma/__init__.py b/duniterpy/api/bma/__init__.py index fdde5b5c854ea8e131f7729b3e7217749629303b..37d73b2dd9cd30ece54b635197ad2c064a686f5a 100644 --- a/duniterpy/api/bma/__init__.py +++ b/duniterpy/api/bma/__init__.py @@ -16,7 +16,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ import logging -from . import network, blockchain, tx, wot, node, ud, ws + +from . import blockchain, network, node, tx, ud, wot, ws __all__ = ["network", "blockchain", "tx", "wot", "node", "ud", "ws"] diff --git a/duniterpy/api/bma/blockchain.py b/duniterpy/api/bma/blockchain.py index 57faf3c232f155513ab2fb09f65d8c9b74dc7768..fbe2b87b6fe7195f979922986e26e92439f2326d 100644 --- a/duniterpy/api/bma/blockchain.py +++ b/duniterpy/api/bma/blockchain.py @@ -16,11 +16,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ import logging -from typing import Union - from http.client import HTTPResponse +from typing import Union -from duniterpy.api.client import Client, RESPONSE_HTTP +from duniterpy.api.client import RESPONSE_HTTP, Client logger = logging.getLogger("duniter/blockchain") diff --git a/duniterpy/api/bma/network.py b/duniterpy/api/bma/network.py index b29eb6e41a3fc5932b6cc8c48024311abd006c65..5fe4cf17b5fcca2ebdc47e36d02c5e9316cc917e 100644 --- a/duniterpy/api/bma/network.py +++ b/duniterpy/api/bma/network.py @@ -16,10 +16,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ import logging - from http.client import HTTPResponse -from duniterpy.api.client import Client, RESPONSE_HTTP +from duniterpy.api.client import RESPONSE_HTTP, Client logger = logging.getLogger("duniter/network") diff --git a/duniterpy/api/bma/tx.py b/duniterpy/api/bma/tx.py index 06c9876a015388775fd6629b9aafd9424de41942..9e6524ceb58be7c85a3e831fffd4809c3e6b388c 100644 --- a/duniterpy/api/bma/tx.py +++ b/duniterpy/api/bma/tx.py @@ -16,10 +16,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ import logging - from http.client import HTTPResponse -from duniterpy.api.client import Client, RESPONSE_HTTP +from duniterpy.api.client import RESPONSE_HTTP, Client logger = logging.getLogger("duniter/tx") diff --git a/duniterpy/api/bma/wot.py b/duniterpy/api/bma/wot.py index 4c01fa4a27a0043dd4745ab5b50de398cafb6889..430365ce5d2c3e0fe5129f61878bcd38d0f450f7 100644 --- a/duniterpy/api/bma/wot.py +++ b/duniterpy/api/bma/wot.py @@ -16,10 +16,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ import logging - from http.client import HTTPResponse -from duniterpy.api.client import Client, RESPONSE_HTTP +from duniterpy.api.client import RESPONSE_HTTP, Client logger = logging.getLogger("duniter/wot") diff --git a/duniterpy/api/client.py b/duniterpy/api/client.py index 709e4c4bce0d493f778c40910776be8cf8307e6e..e61db0d19a2e5027d7c95e37b7490a295d8c23ec 100644 --- a/duniterpy/api/client.py +++ b/duniterpy/api/client.py @@ -17,14 +17,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. import copy import json import logging -from typing import Callable, Union, Any, Optional, Dict -from urllib import request, parse +from http.client import HTTPResponse +from typing import Any, Callable, Dict, Optional, Union +from urllib import parse, request import jsonschema from websocket import WebSocket -from http.client import HTTPResponse import duniterpy.api.endpoint as endpoint + from .errors import DuniterError logger = logging.getLogger("duniter") diff --git a/duniterpy/api/endpoint.py b/duniterpy/api/endpoint.py index 44ee2c698cdd9ec786441654e3ddf19e15594eba..acb3eb7d41a2ca480da28d352cbefe5e446d9a74 100644 --- a/duniterpy/api/endpoint.py +++ b/duniterpy/api/endpoint.py @@ -16,9 +16,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ import re -from typing import Any, Optional, TypeVar, Type, Dict +from typing import Any, Dict, Optional, Type, TypeVar import duniterpy.constants as constants + from ..documents import MalformedDocumentError diff --git a/duniterpy/api/ws2p/__init__.py b/duniterpy/api/ws2p/__init__.py index 45aa7e01b09323d5dca10b01e7c3de31319865cd..6a372e8708f64b4f0d68f7a74ab7b8d7a58a0766 100644 --- a/duniterpy/api/ws2p/__init__.py +++ b/duniterpy/api/ws2p/__init__.py @@ -16,6 +16,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ import logging + from . import network, requests __all__ = ["network", "requests"] diff --git a/duniterpy/api/ws2p/requests.py b/duniterpy/api/ws2p/requests.py index 1679277592f0b0ba4458132664f65cf937ae0e6e..1fd61dc16ac1fc5e97a32cfe63f459031dea44e2 100644 --- a/duniterpy/api/ws2p/requests.py +++ b/duniterpy/api/ws2p/requests.py @@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. import json import re + from duniterpy.api.bma.blockchain import BLOCK_SCHEMA, BLOCKS_SCHEMA ERROR_RESPONSE_SCHEMA = { diff --git a/duniterpy/documents/__init__.py b/duniterpy/documents/__init__.py index 9ce20d1d63b3bc6a08ad0b761d2e80425912ad32..cfe5669e756bd0eaabf638917c4de8625a5a1a1a 100644 --- a/duniterpy/documents/__init__.py +++ b/duniterpy/documents/__init__.py @@ -17,18 +17,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. from .block import Block from .block_uid import BlockUID, block_uid -from .document import Document, MalformedDocumentError from .certification import Certification -from .revocation import Revocation +from .crc_pubkey import CRCPubkey +from .document import Document, MalformedDocumentError from .identity import Identity from .membership import Membership +from .revocation import Revocation from .transaction import ( - SimpleTransaction, - Transaction, InputSource, OutputSource, SIGParameter, + SimpleTransaction, + Transaction, Unlock, UnlockParameter, ) -from .crc_pubkey import CRCPubkey diff --git a/duniterpy/documents/block.py b/duniterpy/documents/block.py index 2c304758a0bc6a7fc9eff0f734633465aab1bb65..1db0a77fef4f906f1755cfc8533597ef176a6557 100644 --- a/duniterpy/documents/block.py +++ b/duniterpy/documents/block.py @@ -18,16 +18,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. import base64 import hashlib import re -from typing import TypeVar, Type, Optional, List, Sequence +from typing import List, Optional, Sequence, Type, TypeVar + +from ..constants import BLOCK_HASH_REGEX, PUBKEY_REGEX from .block_uid import BlockUID from .certification import Certification -from .revocation import Revocation -from .identity import Identity from .document import Document, MalformedDocumentError +from .identity import Identity from .membership import Membership +from .revocation import Revocation from .transaction import Transaction -from ..constants import PUBKEY_REGEX, BLOCK_HASH_REGEX - # required to type hint cls in classmethod BlockType = TypeVar("BlockType", bound="Block") diff --git a/duniterpy/documents/block_uid.py b/duniterpy/documents/block_uid.py index bf3f816218c2335d138993480fdc23cb270ff5e3..33d7e3e5ee1819231660449c309beed3ae11daf6 100644 --- a/duniterpy/documents/block_uid.py +++ b/duniterpy/documents/block_uid.py @@ -16,10 +16,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ import re -from typing import Union, TypeVar, Type +from typing import Type, TypeVar, Union +from ..constants import BLOCK_HASH_REGEX, BLOCK_ID_REGEX, EMPTY_HASH from .document import MalformedDocumentError -from ..constants import EMPTY_HASH, BLOCK_ID_REGEX, BLOCK_HASH_REGEX # required to type hint cls in classmethod BlockUIDType = TypeVar("BlockUIDType", bound="BlockUID") diff --git a/duniterpy/documents/certification.py b/duniterpy/documents/certification.py index 04714a824201a9711184f822127ac179571b3b97..776a4af1551c40e96777a2cf5f761718319024ab 100644 --- a/duniterpy/documents/certification.py +++ b/duniterpy/documents/certification.py @@ -18,19 +18,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. import base64 import logging import re -from typing import Optional, TypeVar, Type, Union +from typing import Optional, Type, TypeVar, Union -from .identity import Identity -from .block_uid import BlockUID from ..constants import ( - PUBKEY_REGEX, - SIGNATURE_REGEX, BLOCK_ID_REGEX, BLOCK_UID_REGEX, + PUBKEY_REGEX, + SIGNATURE_REGEX, UID_REGEX, ) +from .block_uid import BlockUID from .document import Document, MalformedDocumentError - +from .identity import Identity # required to type hint cls in classmethod CertificationType = TypeVar("CertificationType", bound="Certification") diff --git a/duniterpy/documents/crc_pubkey.py b/duniterpy/documents/crc_pubkey.py index 834c30ec67c3c77b918e1dcdfc2b4a37dfd54aad..93b11d632350e0983e2bef5a8be613c3589de748 100644 --- a/duniterpy/documents/crc_pubkey.py +++ b/duniterpy/documents/crc_pubkey.py @@ -15,11 +15,12 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ -from typing import TypeVar, Type +import hashlib +import re +from typing import Type, TypeVar import base58 -import re -import hashlib + from ..constants import PUBKEY_REGEX from ..tools import ensure_str diff --git a/duniterpy/documents/document.py b/duniterpy/documents/document.py index f14a4d19a90eded523366a890aff12b5705dc096..bccc1109f3e417e525d011d96a4c9f54b527879d 100644 --- a/duniterpy/documents/document.py +++ b/duniterpy/documents/document.py @@ -19,7 +19,7 @@ import base64 import hashlib import logging import re -from typing import TypeVar, Type, Any, List +from typing import Any, List, Type, TypeVar from ..constants import SIGNATURE_REGEX diff --git a/duniterpy/documents/identity.py b/duniterpy/documents/identity.py index aa8aaf17567fe8d51d005f7e886f99928ffe0ffe..9d2b8d348054481916d5cab276288ebd09505123 100644 --- a/duniterpy/documents/identity.py +++ b/duniterpy/documents/identity.py @@ -16,10 +16,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ import re -from typing import Optional, TypeVar, Type +from typing import Optional, Type, TypeVar +from ..constants import BLOCK_UID_REGEX, PUBKEY_REGEX, SIGNATURE_REGEX, UID_REGEX from .block_uid import BlockUID -from ..constants import PUBKEY_REGEX, SIGNATURE_REGEX, BLOCK_UID_REGEX, UID_REGEX from .document import Document, MalformedDocumentError # required to type hint cls in classmethod diff --git a/duniterpy/documents/membership.py b/duniterpy/documents/membership.py index 3e62f874f8c6a88e0a546d11c644950e254d5800..28beecb6991ac1c3605e4ad45b285ba865247bc5 100644 --- a/duniterpy/documents/membership.py +++ b/duniterpy/documents/membership.py @@ -16,11 +16,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ import re -from typing import TypeVar, Type, Optional +from typing import Optional, Type, TypeVar +from ..constants import BLOCK_UID_REGEX, PUBKEY_REGEX, SIGNATURE_REGEX from .block_uid import BlockUID from .document import Document, MalformedDocumentError -from ..constants import BLOCK_UID_REGEX, SIGNATURE_REGEX, PUBKEY_REGEX # required to type hint cls in classmethod MembershipType = TypeVar("MembershipType", bound="Membership") diff --git a/duniterpy/documents/peer.py b/duniterpy/documents/peer.py index 2a382e91d67ef3f4ab9325e85681b6ea497a50a4..7e881f3a837044a5cd028ef98d324815548230b4 100644 --- a/duniterpy/documents/peer.py +++ b/duniterpy/documents/peer.py @@ -16,12 +16,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ import re -from typing import TypeVar, List, Type +from typing import List, Type, TypeVar + +from duniterpy.api.endpoint import Endpoint, endpoint -from duniterpy.api.endpoint import endpoint, Endpoint -from .document import Document, MalformedDocumentError -from .block_uid import BlockUID from ..constants import BLOCK_HASH_REGEX, PUBKEY_REGEX +from .block_uid import BlockUID +from .document import Document, MalformedDocumentError # required to type hint cls in classmethod PeerType = TypeVar("PeerType", bound="Peer") diff --git a/duniterpy/documents/revocation.py b/duniterpy/documents/revocation.py index 15cee33eb96e69495774d98f8702fd1eb61322a3..ee38b268c71e0d8cb65a944202bd25904830159a 100644 --- a/duniterpy/documents/revocation.py +++ b/duniterpy/documents/revocation.py @@ -17,9 +17,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. import base64 import re -from typing import Union, Type, TypeVar +from typing import Type, TypeVar, Union -from ..constants import PUBKEY_REGEX, SIGNATURE_REGEX, BLOCK_UID_REGEX +from ..constants import BLOCK_UID_REGEX, PUBKEY_REGEX, SIGNATURE_REGEX from .document import Document, MalformedDocumentError from .identity import Identity diff --git a/duniterpy/documents/transaction.py b/duniterpy/documents/transaction.py index 4f64007038bf993c3e70be35ef364f54b410db3e..ae8f499afa7d259ff56dbed5cbd0cfa78b5c06a2 100644 --- a/duniterpy/documents/transaction.py +++ b/duniterpy/documents/transaction.py @@ -16,20 +16,21 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ import re -from typing import TypeVar, List, Any, Type, Optional, Dict, Union, Tuple +from typing import Any, Dict, List, Optional, Tuple, Type, TypeVar, Union import pypeg2 from duniterpy.grammars.output import Condition -from .block_uid import BlockUID -from .document import Document, MalformedDocumentError + from ..constants import ( - PUBKEY_REGEX, - TRANSACTION_HASH_REGEX, BLOCK_ID_REGEX, BLOCK_UID_REGEX, + PUBKEY_REGEX, + TRANSACTION_HASH_REGEX, ) from ..grammars import output +from .block_uid import BlockUID +from .document import Document, MalformedDocumentError def reduce_base(amount: int, base: int) -> Tuple[int, int]: diff --git a/duniterpy/documents/ws2p/heads.py b/duniterpy/documents/ws2p/heads.py index 2016f793acb4b72a6d28d7d39daa182ca40a2031..799d2927c92cc3e798ec097c9230bc852ffe9875 100644 --- a/duniterpy/documents/ws2p/heads.py +++ b/duniterpy/documents/ws2p/heads.py @@ -16,19 +16,20 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ import re + import attr -from ..block_uid import BlockUID -from ..document import MalformedDocumentError from ...constants import ( - WS2P_PUBLIC_PREFIX_REGEX, - WS2P_PRIVATE_PREFIX_REGEX, - WS2P_HEAD_REGEX, + BLOCK_UID_REGEX, PUBKEY_REGEX, SIGNATURE_REGEX, + WS2P_HEAD_REGEX, + WS2P_PRIVATE_PREFIX_REGEX, + WS2P_PUBLIC_PREFIX_REGEX, WS2PID_REGEX, - BLOCK_UID_REGEX, ) +from ..block_uid import BlockUID +from ..document import MalformedDocumentError @attr.s() diff --git a/duniterpy/documents/ws2p/messages.py b/duniterpy/documents/ws2p/messages.py index d790a496f458bd858d6696093cc5fe9af593d9f4..540b3ce41279e836c0e78744369e85afbbfd0c3d 100644 --- a/duniterpy/documents/ws2p/messages.py +++ b/duniterpy/documents/ws2p/messages.py @@ -16,11 +16,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ import json - from typing import Optional from duniterpy.documents import Document -from duniterpy.key import VerifyingKey, SigningKey +from duniterpy.key import SigningKey, VerifyingKey from duniterpy.tools import get_ws2p_challenge diff --git a/duniterpy/grammars/output.py b/duniterpy/grammars/output.py index e754bfbef5fb5e4a35795440801d0646f32787eb..1ffbaf280727520f39544be6eaf7abfe42237820 100644 --- a/duniterpy/grammars/output.py +++ b/duniterpy/grammars/output.py @@ -15,11 +15,11 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ -from typing import Optional, TypeVar, Type, Any, Union +from typing import Any, Optional, Type, TypeVar, Union -from pypeg2 import re, attr, Keyword, Enum, contiguous, maybe_some, whitespace, K +from pypeg2 import Enum, K, Keyword, attr, contiguous, maybe_some, re, whitespace -from ..constants import PUBKEY_REGEX, HASH_REGEX +from ..constants import HASH_REGEX, PUBKEY_REGEX class Pubkey(str): diff --git a/duniterpy/helpers/blockchain.py b/duniterpy/helpers/blockchain.py index 46f4fdeed362165a4b63eedcb17539f6e95f026e..9afc47a893fb8f30c2ac1f89eabf09cbe82b1a7d 100644 --- a/duniterpy/helpers/blockchain.py +++ b/duniterpy/helpers/blockchain.py @@ -29,6 +29,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. import json import pathlib + from ..documents import Block CHUNK_SIZE = 250 diff --git a/duniterpy/helpers/money.py b/duniterpy/helpers/money.py index 6f9076ebb851a541fe091c6669f4e93f60ee2c11..910e4bcd36047d606a6de264f2bb8f04b17a1061 100644 --- a/duniterpy/helpers/money.py +++ b/duniterpy/helpers/money.py @@ -15,8 +15,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ -from typing import Union, Any -from duniterpy.grammars.output import SIG, CSV, CLTV, XHX, Condition +from typing import Any, Union + +from duniterpy.grammars.output import CLTV, CSV, SIG, XHX, Condition def output_available( diff --git a/duniterpy/helpers/network.py b/duniterpy/helpers/network.py index af15122335c4378d126f127fc17a8fa4676a4e93..87e21f42c3a046b5a160397aa798dc0e9352f3d8 100644 --- a/duniterpy/helpers/network.py +++ b/duniterpy/helpers/network.py @@ -15,14 +15,13 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ -from typing import List, Dict, Any +from itertools import groupby +from typing import Any, Dict, List from duniterpy.api import bma from duniterpy.api.client import Client -from duniterpy.documents.peer import Peer, MalformedDocumentError +from duniterpy.documents.peer import MalformedDocumentError, Peer from duniterpy.documents.ws2p.heads import HeadV2 -from itertools import groupby - from duniterpy.key import VerifyingKey diff --git a/duniterpy/helpers/ws2p.py b/duniterpy/helpers/ws2p.py index 80e671f0607321024d6de6f674d724bea93f6575..6c9828b698696691f3a61c75a9b06f832f31717e 100644 --- a/duniterpy/helpers/ws2p.py +++ b/duniterpy/helpers/ws2p.py @@ -15,14 +15,16 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ -import jsonschema +import logging from typing import Union -from duniterpy.api import ws2p, bma -from duniterpy.api.client import WSConnection, Client + +import jsonschema + +from duniterpy.api import bma, ws2p +from duniterpy.api.client import Client, WSConnection from duniterpy.api.endpoint import BMAEndpoint, SecuredBMAEndpoint, WS2PEndpoint -from duniterpy.documents.ws2p.messages import Connect, Ack, Ok +from duniterpy.documents.ws2p.messages import Ack, Connect, Ok from duniterpy.key import SigningKey -import logging def handshake(ws: WSConnection, signing_key: SigningKey, currency: str): diff --git a/duniterpy/key/__init__.py b/duniterpy/key/__init__.py index a3cf1acdd162cde23f0940053039ccf540075ca7..cc2ea0d9b3b1340f63b93df7c055dfbad4f23140 100644 --- a/duniterpy/key/__init__.py +++ b/duniterpy/key/__init__.py @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ +from .ascii_armor import AsciiArmor +from .encryption_key import PublicKey, SecretKey from .signing_key import SigningKey from .verifying_key import VerifyingKey -from .encryption_key import SecretKey, PublicKey -from .ascii_armor import AsciiArmor diff --git a/duniterpy/key/ascii_armor.py b/duniterpy/key/ascii_armor.py index 154eab3e214d0319756f8771395304f77908ed2e..3879ee3931f932e485edde1cd8f7a2e752fb22e9 100644 --- a/duniterpy/key/ascii_armor.py +++ b/duniterpy/key/ascii_armor.py @@ -16,12 +16,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ import base64 +import re +from typing import Any, Dict, List, Optional + import libnacl from libnacl.version import version as libnacl_version -import re -from typing import Optional, List, Dict, Any -from duniterpy.key import SigningKey, PublicKey, VerifyingKey +from duniterpy.key import PublicKey, SigningKey, VerifyingKey # Headers constants BEGIN_MESSAGE_HEADER = "-----BEGIN DUNITER MESSAGE-----" diff --git a/duniterpy/key/base58.py b/duniterpy/key/base58.py index 5b1afe2c72c2933ebd27402d6a46d946d0c28406..b8a4172f99e48db80fa4c2a892e66fed5b589088 100644 --- a/duniterpy/key/base58.py +++ b/duniterpy/key/base58.py @@ -19,7 +19,7 @@ from typing import Union import base58 -from ..tools import ensure_str, ensure_bytes +from ..tools import ensure_bytes, ensure_str class Base58Encoder: diff --git a/duniterpy/key/encryption_key.py b/duniterpy/key/encryption_key.py index b575bca4744ec9d9c4400f2e53713ee8b3070015..9157ebbd098ca2ed401cb96374338a50f7fd93ea 100644 --- a/duniterpy/key/encryption_key.py +++ b/duniterpy/key/encryption_key.py @@ -15,14 +15,14 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ -from typing import Union, Optional +from hashlib import scrypt +from typing import Optional, Union import libnacl.public -from hashlib import scrypt -from .scrypt_params import ScryptParams -from .base58 import Base58Encoder from ..tools import ensure_bytes +from .base58 import Base58Encoder +from .scrypt_params import ScryptParams class SecretKey(libnacl.public.SecretKey): diff --git a/duniterpy/key/signing_key.py b/duniterpy/key/signing_key.py index 45696723d0eb68cc88f65e7f97f737abee8e9b83..b1c798c8337095548428db36a4c79e441ac21841 100644 --- a/duniterpy/key/signing_key.py +++ b/duniterpy/key/signing_key.py @@ -17,21 +17,21 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. import base64 import re -from typing import Optional, Union, TypeVar, Type +from hashlib import scrypt +from typing import Optional, Type, TypeVar, Union import libnacl.sign import pyaes from libnacl.utils import load_key -from hashlib import scrypt -from .scrypt_params import ScryptParams -from .base58 import Base58Encoder from ..tools import ( + convert_seed_to_seedhex, + convert_seedhex_to_seed, ensure_bytes, xor_bytes, - convert_seedhex_to_seed, - convert_seed_to_seedhex, ) +from .base58 import Base58Encoder +from .scrypt_params import ScryptParams # required to type hint cls in classmethod SigningKeyType = TypeVar("SigningKeyType", bound="SigningKey") diff --git a/duniterpy/key/verifying_key.py b/duniterpy/key/verifying_key.py index 5577a18cd9e771a2a6d1f1fccfb1eb12e4b52420..ce1390597dad173dccda3965a0e46f82f826519b 100644 --- a/duniterpy/key/verifying_key.py +++ b/duniterpy/key/verifying_key.py @@ -18,11 +18,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. import base64 from typing import Any -import libnacl.sign import libnacl.encode +import libnacl.sign from duniterpy.documents import Document from duniterpy.documents.block import Block + from .base58 import Base58Encoder diff --git a/duniterpy/tools.py b/duniterpy/tools.py index a613e642defd524876c65534bfd12529b44e5504..c1ae4e9bcd78d385ef2b5e3d50810141dcaae518 100644 --- a/duniterpy/tools.py +++ b/duniterpy/tools.py @@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. import uuid from typing import Union + from libnacl.encode import hex_decode, hex_encode diff --git a/examples/create_public_key.py b/examples/create_public_key.py index 8c088a651f7155b3422abe9315785e96e1e6c21b..808b72b6f9b5eb671b139b942b837894fc07ea67 100644 --- a/examples/create_public_key.py +++ b/examples/create_public_key.py @@ -16,6 +16,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ import getpass + from duniterpy.key import SigningKey ################################################ diff --git a/examples/listen_ws2p.py b/examples/listen_ws2p.py index 6a8c4f2471252af77e2fcc9f5c6580c259539c5b..aaced06fe0bf692e835a636cec75d5589681284e 100644 --- a/examples/listen_ws2p.py +++ b/examples/listen_ws2p.py @@ -17,13 +17,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. import json import sys + import jsonschema from jsonschema import ValidationError -from duniterpy.key import SigningKey - -from duniterpy.helpers.ws2p import handshake, generate_ws2p_endpoint from duniterpy.api.client import Client +from duniterpy.helpers.ws2p import generate_ws2p_endpoint, handshake +from duniterpy.key import SigningKey # CONFIG ####################################### diff --git a/examples/request_available_nodes.py b/examples/request_available_nodes.py index e4a394bd7e2ea350dc7f393297678c75e37db261..8965ca0eae514b379d4fcd792898a50c92b0386b 100644 --- a/examples/request_available_nodes.py +++ b/examples/request_available_nodes.py @@ -15,8 +15,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ -from duniterpy.helpers import network from duniterpy.api.client import Client +from duniterpy.helpers import network # CONFIG ####################################### diff --git a/examples/request_data.py b/examples/request_data.py index f86b7a4552ed5aa2c680084a14dc348295757a50..8f833d966d08848db3f99ff67315608c3427d1fb 100644 --- a/examples/request_data.py +++ b/examples/request_data.py @@ -15,8 +15,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ -from duniterpy.api.client import Client, RESPONSE_HTTP from duniterpy.api import bma +from duniterpy.api.client import RESPONSE_HTTP, Client # CONFIG ####################################### diff --git a/examples/request_data_graphql.py b/examples/request_data_graphql.py index e9fa5f1fd7e670a84da7db32696f1a29262cd090..554d5acbe97bf32c2158f62dca2de382de97fe68 100644 --- a/examples/request_data_graphql.py +++ b/examples/request_data_graphql.py @@ -1,10 +1,11 @@ -import sys import json +import sys -from duniterpy.api.client import Client -from graphql import get_introspection_query, build_client_schema, language, validate +from graphql import build_client_schema, get_introspection_query, language, validate from graphql.error import GraphQLSyntaxError +from duniterpy.api.client import Client + # CONFIG ####################################### # You can either use a complete defined endpoint : [NAME_OF_THE_API] [DOMAIN] [IPv4] [IPv6] [PORT] diff --git a/examples/request_ws2p.py b/examples/request_ws2p.py index 73c441b061fff73811240e64fb594643852cea9c..cdb798595b92b6b5e324246eebdc5be1b7adba63 100644 --- a/examples/request_ws2p.py +++ b/examples/request_ws2p.py @@ -16,19 +16,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ import json -import time import sys +import time +from typing import Any import jsonschema from jsonschema import ValidationError -from typing import Any -from duniterpy.tools import get_ws2p_challenge -from duniterpy.key import SigningKey - -from duniterpy.helpers.ws2p import handshake, generate_ws2p_endpoint -from duniterpy.api.ws2p import requests from duniterpy.api.client import Client, WSConnection +from duniterpy.api.ws2p import requests +from duniterpy.helpers.ws2p import generate_ws2p_endpoint, handshake +from duniterpy.key import SigningKey +from duniterpy.tools import get_ws2p_challenge # CONFIG ####################################### diff --git a/examples/save_and_load_private_key_file.py b/examples/save_and_load_private_key_file.py index 8e3c477f8ea30950302e14577dca39d633ede48f..14ebee8f053db097b47d0760f024e204d873ded9 100644 --- a/examples/save_and_load_private_key_file.py +++ b/examples/save_and_load_private_key_file.py @@ -15,11 +15,12 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ -from duniterpy.key import SigningKey import getpass import os import sys +from duniterpy.key import SigningKey + if "XDG_CONFIG_HOME" in os.environ: home_path = os.environ["XDG_CONFIG_HOME"] elif "HOME" in os.environ: diff --git a/examples/save_and_load_private_key_file_ewif.py b/examples/save_and_load_private_key_file_ewif.py index 135ed2026eae2708f6f13ec16db6b773c0721745..196c61458e497c3b953765b5d7fefb5c0e1d4100 100644 --- a/examples/save_and_load_private_key_file_ewif.py +++ b/examples/save_and_load_private_key_file_ewif.py @@ -15,11 +15,12 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ -from duniterpy.key import SigningKey import getpass import os import sys +from duniterpy.key import SigningKey + if "XDG_CONFIG_HOME" in os.environ: home_path = os.environ["XDG_CONFIG_HOME"] elif "HOME" in os.environ: diff --git a/examples/save_and_load_private_key_file_pubsec.py b/examples/save_and_load_private_key_file_pubsec.py index afe41a370ed61c0f56d1738e00df366fed0311c1..774fa401a1b70d396b12a3b067bb6ad86ac578c8 100644 --- a/examples/save_and_load_private_key_file_pubsec.py +++ b/examples/save_and_load_private_key_file_pubsec.py @@ -15,11 +15,12 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ -from duniterpy.key import SigningKey import getpass import os import sys +from duniterpy.key import SigningKey + if "XDG_CONFIG_HOME" in os.environ: home_path = os.environ["XDG_CONFIG_HOME"] elif "HOME" in os.environ: diff --git a/examples/save_and_load_private_key_file_wif.py b/examples/save_and_load_private_key_file_wif.py index fd78982dd24dff71ba576827877d12769bdc711c..a76f38722c03286d547775938a4d05a377ce3187 100644 --- a/examples/save_and_load_private_key_file_wif.py +++ b/examples/save_and_load_private_key_file_wif.py @@ -15,11 +15,12 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ -from duniterpy.key import SigningKey import getpass import os import sys +from duniterpy.key import SigningKey + if "XDG_CONFIG_HOME" in os.environ: home_path = os.environ["XDG_CONFIG_HOME"] elif "HOME" in os.environ: diff --git a/examples/save_cleartext_ascii_armor_message.py b/examples/save_cleartext_ascii_armor_message.py index 2efb6c2d1ebd5eda862f969a3bca5c3618e7c247..405d9f5cc6e729f667f1e56ad4cf1bf9ecb905f2 100644 --- a/examples/save_cleartext_ascii_armor_message.py +++ b/examples/save_cleartext_ascii_armor_message.py @@ -19,7 +19,6 @@ import getpass import sys from duniterpy import __version__ - from duniterpy.key import AsciiArmor, SigningKey # CONFIG ####################################### diff --git a/examples/save_encrypted_ascii_armor_message.py b/examples/save_encrypted_ascii_armor_message.py index d5cc6a1b68c1fa488be2b0c6029b064092bf094b..a1d8881fc196a59b6a80e4e9b8f9a2348960002b 100644 --- a/examples/save_encrypted_ascii_armor_message.py +++ b/examples/save_encrypted_ascii_armor_message.py @@ -16,8 +16,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ import getpass -from duniterpy import __version__ +from duniterpy import __version__ from duniterpy.key import AsciiArmor, SigningKey # CONFIG ####################################### diff --git a/examples/save_revoke_document.py b/examples/save_revoke_document.py index 1496f7d45f6264c4862e2865252e9c103c7bd8ea..12ffd84ba3a8c95147278b26c469a8ce368333c3 100644 --- a/examples/save_revoke_document.py +++ b/examples/save_revoke_document.py @@ -22,7 +22,7 @@ from typing import Optional from duniterpy.api import bma from duniterpy.api.client import Client -from duniterpy.documents import Revocation, BlockUID, Identity +from duniterpy.documents import BlockUID, Identity, Revocation from duniterpy.key import SigningKey if "XDG_CONFIG_HOME" in os.environ: diff --git a/examples/send_certification.py b/examples/send_certification.py index 0d50c041dcf68e555fdc54957b264cd3538a37f1..2be1907eb665c206944d30e4a978ec53a984a696 100644 --- a/examples/send_certification.py +++ b/examples/send_certification.py @@ -15,13 +15,13 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ -import sys import getpass +import sys from typing import Optional from duniterpy.api import bma from duniterpy.api.client import Client -from duniterpy.documents import BlockUID, Identity, Certification +from duniterpy.documents import BlockUID, Certification, Identity from duniterpy.key import SigningKey # CONFIG ####################################### diff --git a/examples/send_transaction.py b/examples/send_transaction.py index f841adcdea2531b130b29616b8759e529875dc82..e9e2c8f539434b8d8c74d8b2b4ea66669647a2bd 100644 --- a/examples/send_transaction.py +++ b/examples/send_transaction.py @@ -15,8 +15,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ -import sys import getpass +import sys from duniterpy.api import bma from duniterpy.api.client import Client @@ -24,8 +24,8 @@ from duniterpy.documents import BlockUID, Transaction from duniterpy.documents.transaction import ( InputSource, OutputSource, - Unlock, SIGParameter, + Unlock, ) from duniterpy.key import SigningKey diff --git a/tests/api/bma/test_bma.py b/tests/api/bma/test_bma.py index 8fee431469db5f0aa6f045fdf10c175b75311a57..9cdcd112ebfa81132aea7eb8dcaecc4ec98a3ff5 100644 --- a/tests/api/bma/test_bma.py +++ b/tests/api/bma/test_bma.py @@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. import unittest from duniterpy.api.client import API, parse_error -from duniterpy.api.endpoint import BMAEndpoint, SecuredBMAEndpoint, GVAEndpoint +from duniterpy.api.endpoint import BMAEndpoint, GVAEndpoint, SecuredBMAEndpoint class TestBmaApi(unittest.TestCase): diff --git a/tests/api/bma/test_network.py b/tests/api/bma/test_network.py index ac7f1543dabd6854c03e05073154326c7f01aa81..32b8f5b6671f7bcbadb17c33af828b4a707d6430 100644 --- a/tests/api/bma/test_network.py +++ b/tests/api/bma/test_network.py @@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. import unittest import jsonschema -from jsonschema import ValidationError, SchemaError +from jsonschema import SchemaError, ValidationError from duniterpy.api.bma import network diff --git a/tests/api/bma/test_tx.py b/tests/api/bma/test_tx.py index 6f8c5f13fcfdb2bc97e6281e7ece0e7e1f951f54..524f203ca59eae729ade81297d39364744a42f5e 100644 --- a/tests/api/bma/test_tx.py +++ b/tests/api/bma/test_tx.py @@ -20,10 +20,7 @@ import unittest import jsonschema from jsonschema import SchemaError, ValidationError -from duniterpy.api.bma.tx import ( - HISTORY_SCHEMA, - SOURCES_SCHEMA, -) +from duniterpy.api.bma.tx import HISTORY_SCHEMA, SOURCES_SCHEMA class TestBmaTx(unittest.TestCase): diff --git a/tests/api/bma/test_wot.py b/tests/api/bma/test_wot.py index 995088ba2088480fc2cc0a28cc28d7006c97b9c2..e5cfa3ba121e02703fbb62b00a1b59e14bdaf21c 100644 --- a/tests/api/bma/test_wot.py +++ b/tests/api/bma/test_wot.py @@ -21,10 +21,10 @@ import jsonschema from jsonschema import SchemaError, ValidationError from duniterpy.api.bma.wot import ( - REQUIREMENTS_SCHEMA, CERTIFICATIONS_SCHEMA, LOOKUP_SCHEMA, MEMBERS_SCHEMA, + REQUIREMENTS_SCHEMA, ) diff --git a/tests/api/ws2p/test_ws2p.py b/tests/api/ws2p/test_ws2p.py index 9a5c39b5b381686b9d714488efa6d59cc8f11f55..784bf49a1f98ffa17c6f1fe032b0c1e2f3adbcfa 100644 --- a/tests/api/ws2p/test_ws2p.py +++ b/tests/api/ws2p/test_ws2p.py @@ -20,15 +20,15 @@ import unittest import jsonschema -from duniterpy.api.client import parse_text from duniterpy.api.bma.network import WS2P_HEADS_SCHEMA +from duniterpy.api.client import parse_text from duniterpy.api.ws2p.requests import ( BLOCK_RESPONSE_SCHEMA, - ERROR_RESPONSE_SCHEMA, BLOCKS_RESPONSE_SCHEMA, + ERROR_RESPONSE_SCHEMA, REQUIREMENTS_RESPONSE_SCHEMA, ) -from duniterpy.documents import Identity, BlockUID +from duniterpy.documents import BlockUID, Identity from duniterpy.documents.ws2p.messages import DocumentMessage diff --git a/tests/documents/test_block.py b/tests/documents/test_block.py index 37446e1f67a37207247d34adfa5473c476f894c6..227eb4d9d6756c16164615981a59a656d08f73e8 100644 --- a/tests/documents/test_block.py +++ b/tests/documents/test_block.py @@ -15,8 +15,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ -import unittest import json +import unittest from duniterpy.documents.block import Block from duniterpy.documents.block_uid import BlockUID, block_uid diff --git a/tests/documents/test_certification.py b/tests/documents/test_certification.py index ddb4099fd438d5d7122963648d96eefeb0f90e31..8b4e802ab42b00dd0e47bda03fad7f4813f23ea4 100644 --- a/tests/documents/test_certification.py +++ b/tests/documents/test_certification.py @@ -16,11 +16,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ import unittest + +from duniterpy.constants import EMPTY_HASH +from duniterpy.documents.block import BlockUID from duniterpy.documents.certification import Certification -from duniterpy.documents.revocation import Revocation from duniterpy.documents.identity import Identity -from duniterpy.documents.block import BlockUID -from duniterpy.constants import EMPTY_HASH +from duniterpy.documents.revocation import Revocation selfcert_inlines = [ "HnFcSms8jzwngtVomTTnzudZx7SHUQY8sVE1y8yBmULk:\ diff --git a/tests/documents/test_crc_pubkey.py b/tests/documents/test_crc_pubkey.py index c7f5d3a08d5b3f9d252f779047689f0eddc21987..cd0b09653431c91691fc5082dc7c474ad53a045a 100644 --- a/tests/documents/test_crc_pubkey.py +++ b/tests/documents/test_crc_pubkey.py @@ -16,6 +16,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ import unittest + from duniterpy.documents.crc_pubkey import CRCPubkey diff --git a/tests/documents/test_membership.py b/tests/documents/test_membership.py index f39fde54f935c2531bd112e914e7fe894f62c1c1..a03bbfc1ed896c655314b8bed21e632c1d9361c5 100644 --- a/tests/documents/test_membership.py +++ b/tests/documents/test_membership.py @@ -16,6 +16,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ import unittest + from duniterpy.documents.membership import Membership membership_inline = "HnFcSms8jzwngtVomTTnzudZx7SHUQY8sVE1y8yBmULk:\ diff --git a/tests/documents/test_transaction.py b/tests/documents/test_transaction.py index f2d82d67982510f47e60d77d5e4adae6daa532c9..9d17fdab73da414c2dc006bbeab38cfb328201a1 100644 --- a/tests/documents/test_transaction.py +++ b/tests/documents/test_transaction.py @@ -15,18 +15,20 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ import unittest + import pypeg2 -from duniterpy.grammars import output + from duniterpy.documents import BlockUID from duniterpy.documents.transaction import ( - Transaction, - reduce_base, - SimpleTransaction, InputSource, OutputSource, - Unlock, SIGParameter, + SimpleTransaction, + Transaction, + Unlock, + reduce_base, ) +from duniterpy.grammars import output compact_change = """TX:10:1:1:1:1:1:0 13410-000041DF0CCA173F09B5FBA48F619D4BC934F12ADF1D0B798639EB2149C4A8CC diff --git a/tests/documents/test_ws2p_heads.py b/tests/documents/test_ws2p_heads.py index 9ce8c0783abc518615ef349a891d3ca39407b009..c2a28c286c8535ff2a3f2c8b182d16161255d559 100644 --- a/tests/documents/test_ws2p_heads.py +++ b/tests/documents/test_ws2p_heads.py @@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. import unittest -from duniterpy.documents.ws2p.heads import HeadV0, HeadV1, HeadV2, BlockUID +from duniterpy.documents.ws2p.heads import BlockUID, HeadV0, HeadV1, HeadV2 headv1_clear = "" diff --git a/tests/grammars/test_output.py b/tests/grammars/test_output.py index 51aef5017d447f30c54805e07ebc0dc6c88da3a0..6d00c45f96ead47f110bf2c12bf2618df28a176d 100644 --- a/tests/grammars/test_output.py +++ b/tests/grammars/test_output.py @@ -19,7 +19,7 @@ import unittest import pypeg2 -from duniterpy.grammars.output import SIG, CLTV, CSV, XHX, Operator, Condition +from duniterpy.grammars.output import CLTV, CSV, SIG, XHX, Condition, Operator pubkey = "DNann1Lh55eZMEDXeYt59bzHbA3NJR46DeQYCS2qQdLV" diff --git a/tests/helpers/money.py b/tests/helpers/money.py index 2ff81d149267918950de2ef247f05b12cb0551dd..ea2f426d1451b1aba7194ac6b876a6981ade7749 100644 --- a/tests/helpers/money.py +++ b/tests/helpers/money.py @@ -16,10 +16,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ import unittest -from operator import eq, ne, lt, ge -from duniterpy.helpers.money import output_available -from duniterpy.grammars.output import SIG, XHX, CLTV, CSV +from operator import eq, ge, lt, ne + from duniterpy.documents.transaction import OutputSource +from duniterpy.grammars.output import CLTV, CSV, SIG, XHX +from duniterpy.helpers.money import output_available class TestHelpersMoney(unittest.TestCase): diff --git a/tests/helpers/ws2p.py b/tests/helpers/ws2p.py index 1d8523ee08ac36d267bfa532f7b86acaa593cdc9..1327be5e5ef939126ae09cf46c1885708a6b8494 100644 --- a/tests/helpers/ws2p.py +++ b/tests/helpers/ws2p.py @@ -17,8 +17,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. import pytest +from duniterpy.api.endpoint import BMAEndpoint, SecuredBMAEndpoint, WS2PEndpoint from duniterpy.helpers.ws2p import generate_ws2p_endpoint -from duniterpy.api.endpoint import WS2PEndpoint, SecuredBMAEndpoint, BMAEndpoint def peering_no_ws2p(self): diff --git a/tests/key/test_ascii_armor.py b/tests/key/test_ascii_armor.py index d50205c1dc75277c518e1d3f50d932a5ae0872f0..ad045eeb56dd4abd53f950d4e9c1ca980ba8148b 100644 --- a/tests/key/test_ascii_armor.py +++ b/tests/key/test_ascii_armor.py @@ -15,14 +15,15 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ +import unittest + from duniterpy.key import AsciiArmor, SigningKey from duniterpy.key.ascii_armor import ( BEGIN_MESSAGE_HEADER, BEGIN_SIGNATURE_HEADER, - END_SIGNATURE_HEADER, END_MESSAGE_HEADER, + END_SIGNATURE_HEADER, ) -import unittest class TestAsciiArmor(unittest.TestCase): diff --git a/tests/key/test_encryption_key.py b/tests/key/test_encryption_key.py index 339f94fd27a969fe7c13c79285a0732642c8ea4e..146bee2d95589d7163fae4f86ff154fc7278015c 100644 --- a/tests/key/test_encryption_key.py +++ b/tests/key/test_encryption_key.py @@ -15,9 +15,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ -from duniterpy.key import SecretKey import unittest +from duniterpy.key import SecretKey + class TestEncryptionKey(unittest.TestCase): def test_from_bob_to_alice(self): diff --git a/tests/key/test_public_key.py b/tests/key/test_public_key.py index ba1771a13ac43de615348f99a128e6bbafa13cac..ace6d04eacdd40a2c05bae6cfdf339d6fee51dda 100644 --- a/tests/key/test_public_key.py +++ b/tests/key/test_public_key.py @@ -15,10 +15,11 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ -from duniterpy.key import SigningKey, PublicKey -from duniterpy.key.scrypt_params import ScryptParams import unittest +from duniterpy.key import PublicKey, SigningKey +from duniterpy.key.scrypt_params import ScryptParams + class TestPublicKey(unittest.TestCase): def test_encrypt_seal(self): diff --git a/tests/key/test_signing_key.py b/tests/key/test_signing_key.py index 1bd9a4ae02935d36c14efd464a512cd49c62cee7..67a1e448fc43aa9b6a1635ebee245467c2b583d0 100644 --- a/tests/key/test_signing_key.py +++ b/tests/key/test_signing_key.py @@ -16,10 +16,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ import os +import unittest -from duniterpy.key import VerifyingKey, SigningKey, PublicKey +from duniterpy.key import PublicKey, SigningKey, VerifyingKey from duniterpy.key.scrypt_params import ScryptParams -import unittest TEST_FILE_PATH = "/tmp/test_file.txt" diff --git a/tests/key/test_verifying_key.py b/tests/key/test_verifying_key.py index 1ae08ab16c8cf8d61c628231058295a16f020955..2ceb67bd315ce7041d475bb615f4ffde57379874 100644 --- a/tests/key/test_verifying_key.py +++ b/tests/key/test_verifying_key.py @@ -15,13 +15,14 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ -from duniterpy.key import VerifyingKey, SigningKey -from duniterpy.key.scrypt_params import ScryptParams -from duniterpy.documents.peer import Peer -from duniterpy.documents.ws2p.heads import HeadV0, HeadV1, HeadV2 +import unittest + from duniterpy.documents import Block +from duniterpy.documents.peer import Peer from duniterpy.documents.transaction import Transaction -import unittest +from duniterpy.documents.ws2p.heads import HeadV0, HeadV1, HeadV2 +from duniterpy.key import SigningKey, VerifyingKey +from duniterpy.key.scrypt_params import ScryptParams class TestVerifyingKey(unittest.TestCase):