Skip to content

Commit 2f0f8ec

Browse files
committed
exonum => exonum_client
1 parent 0391ded commit 2f0f8ec

39 files changed

+43
-40
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# workspaces
2+
.vscode
3+
14
# Byte-compiled / optimized / DLL files
25
__pycache__/
36
*.py[cod]

examples/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""Example of a Basic API Interaction via Exonum Python Light Client."""
2-
from exonum import ExonumClient
2+
from exonum_client import ExonumClient
33

44

55
def run() -> None:

examples/proofs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"""Example of Obtaining and Verifying Proofs."""
22

33
from typing import Dict, Any
4-
from exonum import ExonumClient, MessageGenerator, ModuleManager
5-
from exonum.crypto import Hash
6-
from exonum.proofs import (
4+
from exonum_client import ExonumClient, MessageGenerator, ModuleManager
5+
from exonum_client.crypto import Hash
6+
from exonum_client.proofs import (
77
ListProof,
88
MapProof,
99
MalformedMapProofError,

examples/protobuf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Protobuf Example"""
2-
from exonum.protobuf_provider import ProtobufProvider
3-
from exonum import ExonumClient, ModuleManager
2+
from exonum_client.protobuf_provider import ProtobufProvider
3+
from exonum_client import ExonumClient, ModuleManager
44

55
RUST_RUNTIME_ID = 0
66

examples/transactions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
from typing import Tuple
66
import time
77
import requests
8-
from exonum import ExonumClient, ModuleManager, MessageGenerator
9-
from exonum.crypto import KeyPair, PublicKey
8+
from exonum_client import ExonumClient, ModuleManager, MessageGenerator
9+
from exonum_client.crypto import KeyPair, PublicKey
1010

1111
from examples.protobuf import cryptocurrency_advanced_protobuf_provider
1212

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

exonum/proofs/hasher.py renamed to exonum_client/proofs/hasher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import struct
44

55
# From pysodium import crypto_hash_sha256, crypto_hash_sha256_BYTES
6-
from exonum.crypto import HASH_BYTES_LEN, Hash
6+
from exonum_client.crypto import HASH_BYTES_LEN, Hash
77

88
# Default hash value for empty ProofMapIndex.
99
EMPTY_MAP_HASH = bytes.fromhex("7324b5c72b51bb5d4c180f1109cfd347b60473882145841c39f3e584576296f9")

exonum/proofs/list_proof/list_proof.py renamed to exonum_client/proofs/list_proof/list_proof.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from typing import List, Tuple, Any, Dict, Callable
44

5-
from exonum.crypto import Hash
5+
from exonum_client.crypto import Hash
66
from .key import ProofListKey
77
from .list_proof_element import ListProofElement, ListProofElementType
88
from .proof_parser import ProofParser

exonum/proofs/map_proof/branch_node.py renamed to exonum_client/proofs/map_proof/branch_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
""" Module with a MapProof Representation of the Branch Node. """
2-
from exonum.crypto import Hash
2+
from exonum_client.crypto import Hash
33
from .constants import PROOF_PATH_SIZE
44
from .proof_path import ProofPath
55
from ..hasher import Hasher

exonum/proofs/map_proof/map_proof.py renamed to exonum_client/proofs/map_proof/map_proof.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""MapProof Module."""
22
from typing import Optional, Dict, Any, List, Iterator, Callable
33

4-
from exonum.crypto import Hash
4+
from exonum_client.crypto import Hash
55
from .proof_path import ProofPath
66
from .errors import MalformedMapProofError
77
from .optional_entry import OptionalEntry

exonum/proofs/map_proof/map_proof_builder.py renamed to exonum_client/proofs/map_proof/map_proof_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""MapProofBuilder module."""
22
from typing import Optional, Dict, Any
33

4-
from exonum.module_manager import ModuleManager
4+
from exonum_client.module_manager import ModuleManager
55
from .map_proof import MapProof
66
from .errors import MapProofBuilderError
77
from ..encoder import build_encoder_function
File renamed without changes.
File renamed without changes.

exonum/protobuf_provider.py renamed to exonum_client/protobuf_provider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import os
66
import requests
77

8-
from exonum.protobuf_loader import ProtobufProviderInterface, ProtoFile
8+
from exonum_client.protobuf_loader import ProtobufProviderInterface, ProtoFile
99

1010

1111
class _GithubProtobufProvider(ProtobufProviderInterface):
File renamed without changes.

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
LONG_DESCRIPTION = readme.read()
1111

1212
setuptools.setup(
13-
name="python-exonum",
13+
name="exonum-python-client",
1414
version="0.3.0",
1515
author="The Exonum team",
1616
author_email="[email protected]",
1717
description="Exonum Python Light Client",
1818
long_description=LONG_DESCRIPTION,
1919
long_description_content_type="text/markdown",
20-
url="https://github.com/exonum/python-client",
21-
packages=["exonum"],
20+
url="https://github.com/exonum/exonum-python-client",
21+
packages=["exonum_client"],
2222
install_requires=INSTALL_REQUIRES,
2323
python_requires=PYTHON_REQUIRES,
2424
classifiers=[

tests/test_crypto.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
crypto_sign_BYTES,
1111
)
1212

13-
from exonum.crypto import (
13+
from exonum_client.crypto import (
1414
_FixedByteArray,
1515
Hash,
1616
Signature,

tests/test_exonum_client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
import sys
55
import os
66

7-
from exonum.client import ExonumClient
8-
from exonum.module_manager import ModuleManager
9-
from exonum.protobuf_loader import ProtobufLoader, ProtobufProviderInterface, ProtoFile
7+
from exonum_client.client import ExonumClient
8+
from exonum_client.module_manager import ModuleManager
9+
from exonum_client.protobuf_loader import ProtobufLoader, ProtobufProviderInterface, ProtoFile
1010

1111
from .module_user import ModuleUserTestCase
1212

@@ -180,23 +180,23 @@ class TestExonumClient(unittest.TestCase):
180180
# This test case replaces the get function from the Exonum client with the mock one.
181181
# Thus testing of HTTP interacting could be done without actual Exonum client:
182182

183-
@patch("exonum.client._get", new=mock_requests_get)
183+
@patch("exonum_client.client._get", new=mock_requests_get)
184184
def test_helthcheck(self):
185185
client = ExonumClient(
186186
hostname=EXONUM_IP, public_api_port=EXONUM_PUBLIC_PORT, private_api_port=EXONUM_PRIVATE_PORT
187187
)
188188
resp = client.health_info()
189189
self.assertEqual(resp.status_code, 200)
190190

191-
@patch("exonum.client._get", new=mock_requests_get)
191+
@patch("exonum_client.client._get", new=mock_requests_get)
192192
def test_stats(self):
193193
client = ExonumClient(
194194
hostname=EXONUM_IP, public_api_port=EXONUM_PUBLIC_PORT, private_api_port=EXONUM_PRIVATE_PORT
195195
)
196196
resp = client.stats()
197197
self.assertEqual(resp.status_code, 200)
198198

199-
@patch("exonum.client._get", new=mock_requests_get)
199+
@patch("exonum_client.client._get", new=mock_requests_get)
200200
def test_user_agent(self):
201201
client = ExonumClient(
202202
hostname=EXONUM_IP, public_api_port=EXONUM_PUBLIC_PORT, private_api_port=EXONUM_PRIVATE_PORT

tests/test_list_proof.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import unittest
22

3-
from exonum.crypto import Hash
4-
from exonum.proofs.list_proof import ListProof
5-
from exonum.proofs.list_proof.proof_parser import ProofParser
6-
from exonum.proofs.list_proof.list_proof_element import ListProofElement
7-
from exonum.proofs.list_proof.errors import MalformedListProofError, ListProofVerificationError
3+
from exonum_client.crypto import Hash
4+
from exonum_client.proofs.list_proof import ListProof
5+
from exonum_client.proofs.list_proof.proof_parser import ProofParser
6+
from exonum_client.proofs.list_proof.list_proof_element import ListProofElement
7+
from exonum_client.proofs.list_proof.errors import MalformedListProofError, ListProofVerificationError
88

99
Left = ListProofElement.Left
1010
Right = ListProofElement.Right

tests/test_map_proof.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import unittest
22
import random
33

4-
from exonum.crypto import Hash
5-
from exonum.proofs.encoder import build_encoder_function
6-
from exonum.proofs.map_proof import MapProof
7-
from exonum.proofs.map_proof.proof_path import ProofPath
8-
from exonum.proofs.map_proof.constants import KEY_SIZE
9-
from exonum.module_manager import ModuleManager
4+
from exonum_client.crypto import Hash
5+
from exonum_client.proofs.encoder import build_encoder_function
6+
from exonum_client.proofs.map_proof import MapProof
7+
from exonum_client.proofs.map_proof.proof_path import ProofPath
8+
from exonum_client.proofs.map_proof.constants import KEY_SIZE
9+
from exonum_client.module_manager import ModuleManager
1010

1111
from .module_user import PrecompiledModuleUserTestCase
1212

tests/test_module_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import sys
33
import os
44

5-
from exonum.module_manager import ModuleManager
5+
from exonum_client.module_manager import ModuleManager
66

77
from .module_user import PrecompiledModuleUserTestCase
88

tests/test_protoc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import tempfile
44
import shutil
55

6-
from exonum.protoc import Protoc
6+
from exonum_client.protoc import Protoc
77

88

99
class TestProtoc(unittest.TestCase):

tests/test_tx_parse.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
import sys
55
import os
66

7-
from exonum.message import ExonumMessage, MessageGenerator
8-
from exonum.crypto import KeyPair
9-
from exonum.module_manager import ModuleManager
7+
from exonum_client.message import ExonumMessage, MessageGenerator
8+
from exonum_client.crypto import KeyPair
9+
from exonum_client.module_manager import ModuleManager
1010

1111

1212
class TestTxParse(unittest.TestCase):

0 commit comments

Comments
 (0)