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 771240ca0c321a2de3e1040c8797719d2c6b15c6..3d7c670da7a78edf5f60202063c76beb5a97ce46 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 from duniterpy.api import endpoint + from .errors import DuniterError logger = logging.getLogger("duniter") diff --git a/duniterpy/api/endpoint.py b/duniterpy/api/endpoint.py index 135172fc1e7e4a9ae0829bcb69234caaa3a84a4f..55757131063ec22b684b783798dc8f7192f50acd 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 from duniterpy import 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 0baab0e9f78f38d53ef1c9d5444f72a3ebe92439..28959f8f9e1c630f0f8ce8679ab1a990ac9b18ed 100644 --- a/duniterpy/documents/revocation.py +++ b/duniterpy/documents/revocation.py @@ -17,10 +17,10 @@ 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 BLOCK_UID_REGEX, PUBKEY_REGEX, SIGNATURE_REGEX from .block_uid import BlockUID -from ..constants import PUBKEY_REGEX, SIGNATURE_REGEX, BLOCK_UID_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 547163f9e3e7567028e8fcef3ec9deffe567bac2..b6293f6ebab7a64ae36f453104db32edd3eb23dc 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, sha256 +from typing import Optional, Type, TypeVar, Union import libnacl.sign import pyaes from libnacl.utils import load_key -from hashlib import scrypt, sha256 -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 cd4345b7bf41d78248f3e9901fbe798c38df8e92..c888086159ffc7ff84f7c9cd4cf26b659e61280c 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 ef4d9057ba642d9ecb3d61aa683dde8d9de1c455..76cafb6aab4525495ed2e401796baa2d545072ac 100644 --- a/examples/listen_ws2p.py +++ b/examples/listen_ws2p.py @@ -16,11 +16,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ import json + import jsonschema -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 7b806d002c6646da2ecc520a645be2a5e9c905a4..38ee97f8fd623d27e7f37535f5821c413d0a2d1f 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 caea39bfda3558558889cd2f45ccdefbb09abcf4..5b2b053efdaa5eae055e4e6e38628474be29e59b 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 b486addac08792f86fbfd61a4dcd0b54cb5a9c11..62e94a1c76ce69b37094bfffa84ea93dfb6a1804 100644 --- a/examples/request_data_graphql.py +++ b/examples/request_data_graphql.py @@ -1,9 +1,10 @@ import json -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 858f73642699e290e6fc84d42b97019bd67c7f9e..48fcc8d90b380c263db08e7ecb157a5e92fb8b5a 100644 --- a/examples/request_ws2p.py +++ b/examples/request_ws2p.py @@ -17,17 +17,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. import json 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 5bd4da9e317e78b1f6e632e6309e9f7d6446216c..406fe3dc431e4ef4b4cf7ee4fc283c51b8b0b026 100644 --- a/examples/save_and_load_private_key_file.py +++ b/examples/save_and_load_private_key_file.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 import getpass import os +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 9a11e39e20d5aa5e633f38e053a3200cbbf8cf22..8061635b1bf8bad4e94fbf1b217fd68515e91df3 100644 --- a/examples/save_and_load_private_key_file_ewif.py +++ b/examples/save_and_load_private_key_file_ewif.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 import getpass import os +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 2f44dcf6c039470bc68131dee64a13570b7e2134..00870909efe9e32cee12ec8afb74e18a2466260d 100644 --- a/examples/save_and_load_private_key_file_pubsec.py +++ b/examples/save_and_load_private_key_file_pubsec.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 import getpass import os +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 9c76cbd56601ae93b596bed2e916aa223d6205f0..9cfd39eb5fc13605d4623407602c1165ef58bea6 100644 --- a/examples/save_and_load_private_key_file_wif.py +++ b/examples/save_and_load_private_key_file_wif.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 import getpass import os +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 b402edd46f151b8a4e7112786183bbbe6e065dcf..c31421044f0b1d74523e0b6a205bd665d81954fa 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 b99be22963131499e44c38b54d3f615f7ce465d0..2954969aae5c8e81d468738b61ba01a1596eb33e 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 4eab17a4bf2e85ea8124420f3558b38b3fb2f5f5..d6f4057614771fcbb395b97562ff832260eb06f8 100644 --- a/examples/save_revoke_document.py +++ b/examples/save_revoke_document.py @@ -21,7 +21,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 5c9919d861d0526e3eb457ab06e0153faba51ecb..8353165547c905099131a0e5bfe0785da0b77eb2 100644 --- a/examples/send_certification.py +++ b/examples/send_certification.py @@ -16,12 +16,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ import getpass -from typing import Optional import urllib +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 50e5f2783f4590db3935d8e6492ec010e52aa3dc..062f18530a0808e66b080c7a8072222bd8a8526c 100644 --- a/examples/send_transaction.py +++ b/examples/send_transaction.py @@ -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 3ddf8b2fcd8304f3f3e9cf073c978a4bf7ed9fe2..a65cd7d7173bdfae21a29984011275268f3c9122 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 base64 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):