Repository: lidofinance/lido-python-sdk (language: python)

Issue:
Format Python code with psf/black push
There appear to be some python formatting errors in 533360e1a19ae266a6c3b9dcb3e61735298cf9a0. This pull request
uses the [psf/black](https://github.com/psf/black) formatter to fix these issues.


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 3b07973..dbe0af5 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -29,7 +29,7 @@ jobs:
 
       - name: Setup SWIG
         run: |
-          git clone https://github.com/swig/swig;
+          git clone --branch v4.0.2 https://github.com/swig/swig;
           cd swig;
           ./autogen.sh;
           ./configure --prefix=$HOME/swig;
@@ -78,6 +78,11 @@ jobs:
         if: matrix.os == 'windows-latest'
         uses: ilammy/msvc-dev-cmd@v1
 
+      - name: Print CPU info
+        if: matrix.os == 'ubuntu-latest'
+        run: |
+          ./cpuinfo.sh
+
       - name: Build 'blst' dynamic library (windows)
         if: matrix.os == 'windows-latest'
         run: |
@@ -91,6 +96,7 @@ jobs:
         if: matrix.os == 'ubuntu-latest'
         run: |
           cd blst/
+          sed -i 's/cflags="-D__ADX__ $cflags"/echo "adx skip"/' build.sh
           ./build.sh
           cd ..
           mkdir -p ./blst-lib/linux/
@@ -142,6 +148,11 @@ jobs:
           python --version
           python3 --version
 
+      - name: Print CPU info
+        if: matrix.os == 'ubuntu-latest'
+        run: |
+          ./cpuinfo.sh
+
       - name: Installing pip packages
         run: |
           pip install wheel
@@ -157,7 +168,7 @@ jobs:
         uses: actions/download-artifact@v2
         with:
           name: blst_swig_bindings_py
-          path: ./lido/blstverify/
+          path: ./lido_sdk/blstverify/
 
       - name: Get static blst library from artifact storage
         uses: actions/download-artifact@v2
@@ -180,7 +191,7 @@ jobs:
       - name: Testing (native blst tests)
         run: |
           python setup.py build_ext --inplace
-          python ./lido/blstverify/test.py
+          python ./lido_sdk/blstverify/test.py
 
       - name: Testing (pytest)
         run: |
diff --git a/.gitignore b/.gitignore
index cdd6691..b9ec881 100644
--- a/.gitignore
+++ b/.gitignore
@@ -151,4 +151,5 @@ blst-lib/*.h
 blst-lib/*.hpp
 !blst-lib/blst_wrap.cpp
 lido/blstverify/*.so
-lido/blstverify/*.pyd
\ No newline at end of file
+lido/blstverify/*.pyd
+lido/blstverify/*.dll
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9ae7470..47e5188 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,7 +5,11 @@ All notable changes to this project are documented in this file.
 This changelog format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 
-## [1.0.1](https://github.com/lidofinance/lido-python-sdk) - 2021-10-31
+## [Unreleased](https://github.com/lidofinance/lido-python-sdk) - 2021-09-01
+### Changed
+- Renamed library root package to `lido_sdk`, added more tests, fixed ABIs packaging [#0029](https://github.com/lidofinance/lido-python-sdk/pull/29)
+
+## [1.0.1](https://github.com/lidofinance/lido-python-sdk) - 2021-08-31
 ### Added
 - Lido public class [#0020](https://github.com/lidofinance/lido-python-sdk/pull/20)
 - Added fast BLS verification [#0019](https://github.com/lidofinance/lido-python-sdk/pull/19)
@@ -13,11 +17,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 ### Changed
 - If strict is false, for validation we will try possible WC only for already used keys [#0024](https://github.com/lidofinance/lido-python-sdk/pull/24)
 
-## [0.3.0](https://github.com/lidofinance/lido-python-sdk) - 2021-10-26
+## [0.3.0](https://github.com/lidofinance/lido-python-sdk) - 2021-08-26
 ### Fixed
 - Move eth2deposit code to repository
 
-## [0.2.0](https://github.com/lidofinance/lido-python-sdk) - 2021-10-26
+## [0.2.0](https://github.com/lidofinance/lido-python-sdk) - 2021-08-26
 ### Added
 - Github actions ([#0005](https://github.com/lidofinance/lido-python-sdk/pull/5))
 - Contract interact and contract's multicall support ([#0006](https://github.com/lidofinance/lido-python-sdk/pull/6))
@@ -28,7 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 ### Fixed
 - Code coverage ([#0014](https://github.com/lidofinance/lido-python-sdk/pull/14))
 
-## [0.1.0](https://github.com/lidofinance/lido-python-sdk) - 2021-10-20
+## [0.1.0](https://github.com/lidofinance/lido-python-sdk) - 2021-08-20
 ### Added
 - Initial release
 - Setup configuration ([#0002](https://github.com/lidofinance/lido-python-sdk/pull/2))
diff --git a/MANIFEST.in b/MANIFEST.in
index b85c21e..abf46f1 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,5 +1,6 @@
 recursive-include blst-lib *.cpp *.hpp *.h *.a *.lib
-recursive-include blst/bindings/vectors *.json
+recursive-include blst/bindings/vectors/hash_to_curve *.json
+recursive-include lido_sdk/contract/abi *.json
 include README.md
 include CHANGELOG.md
 include LICENSE
diff --git a/README.md b/README.md
index 06b6125..0ee4dbe 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,7 @@ w3 = Web3(Web3.HTTPProvider('https://mainnet.infura.io/v3/{INFURA_PROJECT_ID}'))
 
 2. Create Lido instance and provide web3 provider
 ```python
-from lido import Lido
+from lido_sdk import Lido
 
 lido = Lido(w3)
 ```
diff --git a/cpuinfo.sh b/cpuinfo.sh
new file mode 100755
index 0000000..cc1f8f4
--- /dev/null
+++ b/cpuinfo.sh
@@ -0,0 +1,17 @@
+#!/bin/sh -e
+
+if (grep -q -e '^flags.*\badx\b' /proc/cpuinfo) 2>/dev/null; then
+    echo "[present] adx"
+else
+    echo "[absent] adx"
+fi
+if (grep -q -e '^flags.*\bavx\b' /proc/cpuinfo) 2>/dev/null; then
+    echo "[present] avx"
+else
+    echo "[absent] avx"
+fi
+if (grep -q -e '^flags.*\bavx2\b' /proc/cpuinfo) 2>/dev/null; then
+    echo "[present] avx2"
+else
+    echo "[absent] avx2"
+fi
\ No newline at end of file
diff --git a/lido/__init__.py b/lido/__init__.py
deleted file mode 100644
index 0762e58..0000000
--- a/lido/__init__.py
+++ /dev/null
@@ -1,1 +0,0 @@
-from lido.lido import Lido
diff --git a/lido/blstverify/__init__.py b/lido/blstverify/__init__.py
deleted file mode 100644
index ef46dbd..0000000
--- a/lido/blstverify/__init__.py
+++ /dev/null
@@ -1,1 +0,0 @@
-from lido.blstverify.verifier import verify
diff --git a/lido/contract/__init__.py b/lido/contract/__init__.py
deleted file mode 100644
index 237fe27..0000000
--- a/lido/contract/__init__.py
+++ /dev/null
@@ -1,1 +0,0 @@
-from lido.contract.load_contract import LidoContract, NodeOpsContract
diff --git a/lido/methods/__init__.py b/lido/methods/__init__.py
deleted file mode 100644
index 2a83f88..0000000
--- a/lido/methods/__init__.py
+++ /dev/null
@@ -1,7 +0,0 @@
-from lido.methods.keys import find_duplicated_keys, validate_keys, validate_key
-from lido.methods.operators import (
-    get_operators_indexes,
-    get_operators_data,
-    get_operators_keys,
-)
-from lido.methods.stats import get_status
diff --git a/lido/multicall/__init__.py b/lido/multicall/__init__.py
deleted file mode 100644
index 87aacb9..0000000
--- a/lido/multicall/__init__.py
+++ /dev/null
@@ -1,1 +0,0 @@
-from lido.multicall.multicall import Multicall
diff --git a/lido/network/__init__.py b/lido/network/__init__.py
deleted file mode 100644
index e572239..0000000
--- a/lido/network/__init__.py
+++ /dev/null
@@ -1,1 +0,0 @@
-from lido.network.type import Network
diff --git a/lido_sdk/__init__.py b/lido_sdk/__init__.py
new file mode 100644
index 0000000..7e2545d
--- /dev/null
+++ b/lido_sdk/__init__.py
@@ -0,0 +1,1 @@
+from lido_sdk.lido import Lido
diff --git a/lido_sdk/blstverify/__init__.py b/lido_sdk/blstverify/__init__.py
new file mode 100644
index 0000000..ce50bf3
--- /dev/null
+++ b/lido_sdk/blstverify/__init__.py
@@ -0,0 +1,1 @@
+from lido_sdk.blstverify.verifier import verify
diff --git a/lido/blstverify/blst.py b/lido_sdk/blstverify/blst.py
similarity index 100%
rename from lido/blstverify/blst.py
rename to lido_sdk/blstverify/blst.py
diff --git a/lido/blstverify/verifier.py b/lido_sdk/blstverify/verifier.py
similarity index 73%
rename from lido/blstverify/verifier.py
rename to lido_sdk/blstverify/verifier.py
index 5ac6a80..d245b0a 100644
--- a/lido/blstverify/verifier.py
+++ b/lido_sdk/blstverify/verifier.py
@@ -2,9 +2,17 @@
 
 HASH_OR_ENCODE = True
 DST = "BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_"
+VALID_TYPES = (bytes, bytearray)
 
 
 def verify(pubkey: bytes, message: bytes, signature: bytes) -> bool:
+    if (
+        (not isinstance(pubkey, VALID_TYPES))
+        or (not isinstance(message, VALID_TYPES))
+        or (not isinstance(signature, VALID_TYPES))
+    ):
+        return False
+
     try:
         pk_affine = P1_Affine(pubkey)
         sig_affine = P2_Affine(signature)
diff --git a/lido_sdk/contract/__init__.py b/lido_sdk/contract/__init__.py
new file mode 100644
index 0000000..cab1ee4
--- /dev/null
+++ b/lido_sdk/contract/__init__.py
@@ -0,0 +1,1 @@
+from lido_sdk.contract.load_contract import LidoContract, NodeOpsContract
diff --git a/lido/contract/abi/Lido.json b/lido_sdk/contract/abi/Lido.json
similarity index 100%
rename from lido/contract/abi/Lido.json
rename to lido_sdk/contract/abi/Lido.json
diff --git a/lido/contract/abi/NodeOperatorsRegistry.json b/lido_sdk/contract/abi/NodeOperatorsRegistry.json
similarity index 100%
rename from lido/contract/abi/NodeOperatorsRegistry.json
rename to lido_sdk/contract/abi/NodeOperatorsRegistry.json
diff --git a/lido/contract/contract.py b/lido_sdk/contract/contract.py
similarity index 93%
rename from lido/contract/contract.py
rename to lido_sdk/contract/contract.py
index 630e511..85d6976 100644
--- a/lido/contract/contract.py
+++ b/lido_sdk/contract/contract.py
@@ -38,7 +38,7 @@ def _create_contract_method(self, abi_function):
         """Create all methods announced in contract's abi"""
 
         def call(w3: Web3, args: Optional[List] = None):
-            from lido.contract.execute_contract import execute_contract_call
+            from lido_sdk.contract.execute_contract import execute_contract_call
 
             return execute_contract_call(
                 w3,
@@ -50,7 +50,7 @@ def call(w3: Web3, args: Optional[List] = None):
             )
 
         def multicall(w3: Web3, args_list: Optional[List[List]] = None):
-            from lido.contract.execute_contract import execute_contract_multicall
+            from lido_sdk.contract.execute_contract import execute_contract_multicall
 
             args_list = args_list or [[]]
 
diff --git a/lido/contract/execute_contract.py b/lido_sdk/contract/execute_contract.py
similarity index 98%
rename from lido/contract/execute_contract.py
rename to lido_sdk/contract/execute_contract.py
index 8059103..81444cd 100644
--- a/lido/contract/execute_contract.py
+++ b/lido_sdk/contract/execute_contract.py
@@ -3,7 +3,7 @@
 from multicall import Call
 from web3 import Web3
 
-from lido.multicall import Multicall
+from lido_sdk.multicall import Multicall
 
 
 def execute_contract_multicall(
diff --git a/lido/contract/load_contract.py b/lido_sdk/contract/load_contract.py
similarity index 91%
rename from lido/contract/load_contract.py
rename to lido_sdk/contract/load_contract.py
index 9c2a32d..cb82411 100644
--- a/lido/contract/load_contract.py
+++ b/lido_sdk/contract/load_contract.py
@@ -1,8 +1,8 @@
 import json
 import os
 
-from lido.contract.contract import Contract
-from lido.network import Network
+from lido_sdk.contract.contract import Contract
+from lido_sdk.network import Network
 
 
 LIDO_ADDRESSES = {
diff --git a/lido/eth2deposit/__init__.py b/lido_sdk/eth2deposit/__init__.py
similarity index 100%
rename from lido/eth2deposit/__init__.py
rename to lido_sdk/eth2deposit/__init__.py
diff --git a/lido/eth2deposit/ssz.py b/lido_sdk/eth2deposit/ssz.py
similarity index 100%
rename from lido/eth2deposit/ssz.py
rename to lido_sdk/eth2deposit/ssz.py
diff --git a/lido/lido.py b/lido_sdk/lido.py
similarity index 97%
rename from lido/lido.py
rename to lido_sdk/lido.py
index 2969105..af18d2b 100644
--- a/lido/lido.py
+++ b/lido_sdk/lido.py
@@ -2,7 +2,7 @@
 
 from web3 import Web3
 
-from lido.methods import (
+from lido_sdk.methods import (
     find_duplicated_keys,
     validate_keys,
     get_operators_indexes,
@@ -10,8 +10,8 @@
     get_operators_keys,
     get_status,
 )
-from lido.methods.typing import Operator, OperatorKey
-from lido.network import Network
+from lido_sdk.methods.typing import Operator, OperatorKey
+from lido_sdk.network import Network
 
 
 class LidoException(Exception):
diff --git a/lido_sdk/methods/__init__.py b/lido_sdk/methods/__init__.py
new file mode 100644
index 0000000..5cb3633
--- /dev/null
+++ b/lido_sdk/methods/__init__.py
@@ -0,0 +1,7 @@
+from lido_sdk.methods.keys import find_duplicated_keys, validate_keys, validate_key
+from lido_sdk.methods.operators import (
+    get_operators_indexes,
+    get_operators_data,
+    get_operators_keys,
+)
+from lido_sdk.methods.stats import get_status
diff --git a/lido/methods/keys.py b/lido_sdk/methods/keys.py
similarity index 92%
rename from lido/methods/keys.py
rename to lido_sdk/methods/keys.py
index 66ac1f3..7f7509f 100644
--- a/lido/methods/keys.py
+++ b/lido_sdk/methods/keys.py
@@ -1,16 +1,16 @@
 from concurrent.futures import ProcessPoolExecutor
 from typing import List, Tuple
-from lido.eth2deposit.ssz import (
+from lido_sdk.eth2deposit.ssz import (
     compute_deposit_domain,
     DepositMessage,
     compute_signing_root,
 )
 from web3 import Web3
 
-from lido.contract import LidoContract
-from lido.methods.typing import OperatorKey
-from lido.network.type import WITHDRAWAL_CREDENTIALS, GENESIS_FORK_VERSION
-from lido.blstverify.verifier import verify
+from lido_sdk.contract import LidoContract
+from lido_sdk.methods.typing import OperatorKey
+from lido_sdk.network.type import WITHDRAWAL_CREDENTIALS, GENESIS_FORK_VERSION
+from lido_sdk.blstverify.verifier import verify
 
 
 def find_duplicated_keys(
diff --git a/lido/methods/operators.py b/lido_sdk/methods/operators.py
similarity index 93%
rename from lido/methods/operators.py
rename to lido_sdk/methods/operators.py
index 4067d73..cf2bb5f 100644
--- a/lido/methods/operators.py
+++ b/lido_sdk/methods/operators.py
@@ -2,8 +2,8 @@
 
 from web3 import Web3
 
-from lido.contract.load_contract import NodeOpsContract
-from lido.methods.typing import Operator, OperatorKey
+from lido_sdk.contract.load_contract import NodeOpsContract
+from lido_sdk.methods.typing import Operator, OperatorKey
 
 
 def get_operators_indexes(w3: Web3) -> List[int]:
diff --git a/lido/methods/stats.py b/lido_sdk/methods/stats.py
similarity index 93%
rename from lido/methods/stats.py
rename to lido_sdk/methods/stats.py
index 4d425d3..8b5a25a 100644
--- a/lido/methods/stats.py
+++ b/lido_sdk/methods/stats.py
@@ -1,6 +1,6 @@
 from web3 import Web3
 
-from lido.contract import LidoContract
+from lido_sdk.contract import LidoContract
 
 
 def get_status(w3: Web3):
diff --git a/lido/methods/typing.py b/lido_sdk/methods/typing.py
similarity index 100%
rename from lido/methods/typing.py
rename to lido_sdk/methods/typing.py
diff --git a/lido_sdk/multicall/__init__.py b/lido_sdk/multicall/__init__.py
new file mode 100644
index 0000000..2995835
--- /dev/null
+++ b/lido_sdk/multicall/__init__.py
@@ -0,0 +1,1 @@
+from lido_sdk.multicall.multicall import Multicall
diff --git a/lido/multicall/multicall.py b/lido_sdk/multicall/multicall.py
similarity index 96%
rename from lido/multicall/multicall.py
rename to lido_sdk/multicall/multicall.py
index 9936ff3..0e92c16 100644
--- a/lido/multicall/multicall.py
+++ b/lido_sdk/multicall/multicall.py
@@ -2,7 +2,7 @@
 
 from multicall import Call, Multicall as DefaultMulticall
 
-from lido.multicall.multicall_address import MULTICALL_ADDRESSES
+from lido_sdk.multicall.multicall_address import MULTICALL_ADDRESSES
 
 
 class Multicall(DefaultMulticall):
diff --git a/lido/multicall/multicall_address.py b/lido_sdk/multicall/multicall_address.py
similarity index 91%
rename from lido/multicall/multicall_address.py
rename to lido_sdk/multicall/multicall_address.py
index 301f000..eff4b56 100644
--- a/lido/multicall/multicall_address.py
+++ b/lido_sdk/multicall/multicall_address.py
@@ -1,4 +1,4 @@
-from lido.network import Network
+from lido_sdk.network import Network
 
 
 MULTICALL_ADDRESSES = {
diff --git a/lido_sdk/network/__init__.py b/lido_sdk/network/__init__.py
new file mode 100644
index 0000000..333f2a6
--- /dev/null
+++ b/lido_sdk/network/__init__.py
@@ -0,0 +1,1 @@
+from lido_sdk.network.type import Network
diff --git a/lido/network/type.py b/lido_sdk/network/type.py
similarity index 100%
rename from lido/network/type.py
rename to lido_sdk/network/type.py
diff --git a/setup.py b/setup.py
index 2d21fe8..6fa007f 100644
--- a/setup.py
+++ b/setup.py
@@ -36,7 +36,7 @@
 EMAIL = "info@lido.fi"
 AUTHOR = "Lido"
 REQUIRES_PYTHON = ">=3.7,<4"
-VERSION = "1.0.1"
+VERSION = "2.0.1"
 
 
 # C/C++ Extensions
@@ -71,7 +71,7 @@
 
 ext_modules = [
     Extension(
-        "lido.blstverify._blst",
+        "lido_sdk.blstverify._blst",
         sources=SOURCES,
         depends=DEPENDS,
         include_dirs=INCLUDE_DIRS,
@@ -113,6 +113,7 @@
     url=URL,
     package_dir={"": "."},
     packages=find_packages(exclude=("tests",)),
+    package_data={"lido_sdk.contract": ["abi/*.json"]},
     # If your package is a single module, use this instead of "packages":
     # py_modules=["mypackage"],
     # entry_points={
@@ -123,8 +124,15 @@
     include_package_data=True,
     license="MIT",
     classifiers=[
+        # Pick your license as you wish (should match "license" above)
         "License :: OSI Approved :: MIT License",
-        "Development Status :: 2 - Pre-Alpha",
+        # How mature is this project? Common values are
+        #   2 - Pre-Alpha
+        #   3 - Alpha
+        #   4 - Beta
+        #   5 - Production/Stable
+        "Development Status :: 4 - Beta",
+        # Supported Python versions
         "Programming Language :: Python :: 3 :: Only",
         "Programming Language :: Python :: 3.7",
         "Programming Language :: Python :: 3.8",


Test patch:
diff --git a/lido/blstverify/test.py b/lido_sdk/blstverify/test.py
similarity index 100%
rename from lido/blstverify/test.py
rename to lido_sdk/blstverify/test.py
diff --git a/tests/fixtures.py b/tests/fixtures.py
index 4c13202..25df0e9 100644
--- a/tests/fixtures.py
+++ b/tests/fixtures.py
@@ -79,3 +79,63 @@
         "used": True,
     },
 ]
+
+VALID_KEY_BYTEARRAY = {
+    "pubkey": bytearray(
+        b"\xad\xd9\xa5\x0b\xc6\xde5B\xc8\x81\xe3e\x07\x99JRh5&\xf7]\xdc\xef,"
+        b"U\xe5\x05t\xc5\xc6^\xbd\x97?\xffHGWb\x9d\xed\x05\xe4~\xf2\xbf\xd56 "
+    ),
+    "signing_root": bytearray(
+        b"\x84\xd6\xcd{l\xb0\xfb\x00\x94\x95A\x07}-in,\x8f\xf0.\xc1i\x98\xd5!\x9d\xed^\xd2\x84\xf9l"
+    ),
+    "signature": bytearray(
+        b"\x85\xe6\x14_\xee\x91np\xbb\xa6\x95\x15F1\x03\x1b\x97r\xedS\xe5Y\x0b<2XP7g)\x88\xcbg-\t\xab\xcd\x17\x12\x9e"
+        b"\x87\x0f\x15SdK\xa2^\x10)\xf5\xf9\xd2\xeb\x11\xc0\xe8c\xb3P\xb4\x1dm1\x8b\x9eC\xb7\xa2\xdb\xec\xf2\xdb["
+        b"\xb3\x12\xf4\x0c\xab\x99\x0bG\x1f5\xfb\x10\x15w\xc4\xaby#\xca{\x03l "
+    ),
+}
+
+VALID_KEY_BYTES = {
+    "pubkey": bytes(
+        b"\xad\xd9\xa5\x0b\xc6\xde5B\xc8\x81\xe3e\x07\x99JRh5&\xf7]\xdc\xef,"
+        b"U\xe5\x05t\xc5\xc6^\xbd\x97?\xffHGWb\x9d\xed\x05\xe4~\xf2\xbf\xd56 "
+    ),
+    "signing_root": bytes(
+        b"\x84\xd6\xcd{l\xb0\xfb\x00\x94\x95A\x07}-in,\x8f\xf0.\xc1i\x98\xd5!\x9d\xed^\xd2\x84\xf9l"
+    ),
+    "signature": bytes(
+        b"\x85\xe6\x14_\xee\x91np\xbb\xa6\x95\x15F1\x03\x1b\x97r\xedS\xe5Y\x0b<2XP7g)\x88\xcbg-\t\xab\xcd\x17\x12\x9e"
+        b"\x87\x0f\x15SdK\xa2^\x10)\xf5\xf9\xd2\xeb\x11\xc0\xe8c\xb3P\xb4\x1dm1\x8b\x9eC\xb7\xa2\xdb\xec\xf2\xdb["
+        b"\xb3\x12\xf4\x0c\xab\x99\x0bG\x1f5\xfb\x10\x15w\xc4\xaby#\xca{\x03l "
+    ),
+}
+
+INVALID_KEY_BYTEARRAY = {
+    "pubkey": bytearray(
+        b"\xad\xd9\xa5\x0b\xc6\xde4B\xc8\x81\xe3e\x07\x99JRh5&\xf7]\xdc\xef,"
+        b"U\xe5\x05t\xc5\xc6^\xbd\x97?\xffHGWb\x9d\xed\x05\xe4~\xf2\xbf\xd56 "
+    ),
+    "signing_root": bytearray(
+        b"\x84\xd6\xcd{l\xb0\xfb\x00\x94\x94A\x07}-in,\x8f\xf0.\xc1i\x98\xd5!\x9d\xed^\xd2\x84\xf9l"
+    ),
+    "signature": bytearray(
+        b"\x85\xe6\x14_\xee\x91np\xbb\xa6\x95\x15F1\x03\x1b\x97r\xedS\xe5Y\x0b<2XP7g)\x88\xcbg-\t\xab\xcd\x17\x12\x9e"
+        b"\x87\x0f\x15SdK\xa2^\x10)\xf5\xf8\xd2\xeb\x11\xc0\xe8c\xb3P\xb4\x1dm1\x8b\x9eC\xb7\xa2\xdb\xec\xf2\xdb["
+        b"\xb3\x12\xf4\x0c\xab\x99\x0bG\x1f5\xfb\x10\x15w\xc4\xaby#\xca{\x03l "
+    ),
+}
+
+INVALID_KEY_BYTES = {
+    "pubkey": bytearray(
+        b"\xad\xd9\xa5\x0b\xc6\xde4B\xc8\x81\xe3e\x07\x99JRh5&\xf7]\xdc\xef,"
+        b"U\xe5\x05t\xc5\xc6^\xbd\x97?\xffHGWb\x9d\xed\x05\xe4~\xf2\xbf\xd56 "
+    ),
+    "signing_root": bytearray(
+        b"\x84\xd6\xcd{l\xb0\xfb\x00\x94\x94A\x07}-in,\x8f\xf0.\xc1i\x98\xd5!\x9d\xed^\xd2\x84\xf9l"
+    ),
+    "signature": bytearray(
+        b"\x85\xe6\x14_\xee\x91np\xbb\xa6\x95\x15F1\x03\x1b\x97r\xedS\xe5Y\x0b<2XP7g)\x88\xcbg-\t\xab\xcd\x17\x12\x9e"
+        b"\x87\x0f\x15SdK\xa2^\x10)\xf5\xf8\xd2\xeb\x11\xc0\xe8c\xb3P\xb4\x1dm1\x8b\x9eC\xb7\xa2\xdb\xec\xf2\xdb["
+        b"\xb3\x12\xf4\x0c\xab\x99\x0bG\x1f5\xfb\x10\x15w\xc4\xaby#\xca{\x03l "
+    ),
+}
diff --git a/tests/test_blst_verifier.py b/tests/test_blst_verifier.py
index 5adae82..2b0b734 100644
--- a/tests/test_blst_verifier.py
+++ b/tests/test_blst_verifier.py
@@ -1,30 +1,56 @@
-from lido.blstverify import verify
+from lido_sdk.blstverify import verify
+from tests.fixtures import (
+    VALID_KEY_BYTEARRAY,
+    VALID_KEY_BYTES,
+    INVALID_KEY_BYTEARRAY,
+    INVALID_KEY_BYTES,
+)
 
 
-def test_valid_bls():
-    pubkey = bytearray(
-        b"\xad\xd9\xa5\x0b\xc6\xde5B\xc8\x81\xe3e\x07\x99JRh5&\xf7]\xdc\xef,U\xe5\x05t\xc5\xc6^\xbd\x97?\xffHGWb\x9d\xed\x05\xe4~\xf2\xbf\xd56"
-    )
-    signing_root = bytearray(
-        b"\x84\xd6\xcd{l\xb0\xfb\x00\x94\x95A\x07}-in,\x8f\xf0.\xc1i\x98\xd5!\x9d\xed^\xd2\x84\xf9l"
-    )
-    signature = bytearray(
-        b"\x85\xe6\x14_\xee\x91np\xbb\xa6\x95\x15F1\x03\x1b\x97r\xedS\xe5Y\x0b<2XP7g)\x88\xcbg-\t\xab\xcd\x17\x12\x9e\x87\x0f\x15SdK\xa2^\x10)\xf5\xf9\xd2\xeb\x11\xc0\xe8c\xb3P\xb4\x1dm1\x8b\x9eC\xb7\xa2\xdb\xec\xf2\xdb[\xb3\x12\xf4\x0c\xab\x99\x0bG\x1f5\xfb\x10\x15w\xc4\xaby#\xca{\x03l"
-    )
+def test_valid_bls_bytearray():
+    pubkey = VALID_KEY_BYTEARRAY["pubkey"]
+    signing_root = VALID_KEY_BYTEARRAY["signing_root"]
+    signature = VALID_KEY_BYTEARRAY["signature"]
 
     res = verify(pubkey, signing_root, signature)
 
     assert res is True
 
 
+def test_invalid_bls_bytearray():
+    pubkey = INVALID_KEY_BYTEARRAY["pubkey"]
+    signing_root = INVALID_KEY_BYTEARRAY["signing_root"]
+    signature = INVALID_KEY_BYTEARRAY["signature"]
+
+    res = verify(pubkey, signing_root, signature)
+
+    assert res is False
+
+
+def test_valid_bls_bytes():
+    pubkey = VALID_KEY_BYTES["pubkey"]
+    signing_root = VALID_KEY_BYTES["signing_root"]
+    signature = VALID_KEY_BYTES["signature"]
+
+    res = verify(pubkey, signing_root, signature)
+
+    assert res is True
+
+
+def test_invalid_bls_bytes():
+    pubkey = INVALID_KEY_BYTES["pubkey"]
+    signing_root = INVALID_KEY_BYTES["signing_root"]
+    signature = INVALID_KEY_BYTES["signature"]
+
+    res = verify(pubkey, signing_root, signature)
+
+    assert res is False
+
+
 def test_empty_pubkey():
     pubkey = bytearray()
-    signing_root = bytearray(
-        b"\x84\xd6\xcd{l\xb0\xfb\x00\x94\x95A\x07}-in,\x8f\xf0.\xc1i\x98\xd5!\x9d\xed^\xd2\x84\xf9l"
-    )
-    signature = bytearray(
-        b"\x85\xe6\x14_\xee\x91np\xbb\xa6\x95\x15F1\x03\x1b\x97r\xedS\xe5Y\x0b<2XP7g)\x88\xcbg-\t\xab\xcd\x17\x12\x9e\x87\x0f\x15SdK\xa2^\x10)\xf5\xf9\xd2\xeb\x11\xc0\xe8c\xb3P\xb4\x1dm1\x8b\x9eC\xb7\xa2\xdb\xec\xf2\xdb[\xb3\x12\xf4\x0c\xab\x99\x0bG\x1f5\xfb\x10\x15w\xc4\xaby#\xca{\x03l"
-    )
+    signing_root = VALID_KEY_BYTEARRAY["signing_root"]
+    signature = VALID_KEY_BYTEARRAY["signature"]
 
     res = verify(pubkey, signing_root, signature)
 
@@ -32,15 +58,9 @@ def test_empty_pubkey():
 
 
 def test_invalid_pubkey():
-    pubkey = bytearray(
-        b"\xaa\xd9\xa5\x0b\xc6\xde5B\xc8\x81\xe3e\x07\x99JRh5&\xf7]\xdc\xef,U\xe5\x05t\xc5\xc6^\xbd\x97?\xffHGWb\x9d\xed\x05\xe4~\xf2\xbf\xd56"
-    )
-    signing_root = bytearray(
-        b"\x84\xd6\xcd{l\xb0\xfb\x00\x94\x95A\x07}-in,\x8f\xf0.\xc1i\x98\xd5!\x9d\xed^\xd2\x84\xf9l"
-    )
-    signature = bytearray(
-        b"\x85\xe6\x14_\xee\x91np\xbb\xa6\x95\x15F1\x03\x1b\x97r\xedS\xe5Y\x0b<2XP7g)\x88\xcbg-\t\xab\xcd\x17\x12\x9e\x87\x0f\x15SdK\xa2^\x10)\xf5\xf9\xd2\xeb\x11\xc0\xe8c\xb3P\xb4\x1dm1\x8b\x9eC\xb7\xa2\xdb\xec\xf2\xdb[\xb3\x12\xf4\x0c\xab\x99\x0bG\x1f5\xfb\x10\x15w\xc4\xaby#\xca{\x03l"
-    )
+    pubkey = INVALID_KEY_BYTEARRAY["pubkey"]
+    signing_root = VALID_KEY_BYTEARRAY["signing_root"]
+    signature = VALID_KEY_BYTEARRAY["signature"]
 
     res = verify(pubkey, signing_root, signature)
 
@@ -48,15 +68,9 @@ def test_invalid_pubkey():
 
 
 def test_invalid_signing_root():
-    pubkey = bytearray(
-        b"\xad\xd9\xa5\x0b\xc6\xde5B\xc8\x81\xe3e\x07\x99JRh5&\xf7]\xdc\xef,U\xe5\x05t\xc5\xc6^\xbd\x97?\xffHGWb\x9d\xed\x05\xe4~\xf2\xbf\xd56"
-    )
-    signing_root = bytearray(
-        b"\x83\xd6\xcd{l\xb0\xfb\x00\x94\x95A\x07}-in,\x8f\xf0.\xc1i\x98\xd5!\x9d\xed^\xd2\x84\xf9l"
-    )
-    signature = bytearray(
-        b"\x85\xe6\x14_\xee\x91np\xbb\xa6\x95\x15F1\x03\x1b\x97r\xedS\xe5Y\x0b<2XP7g)\x88\xcbg-\t\xab\xcd\x17\x12\x9e\x87\x0f\x15SdK\xa2^\x10)\xf5\xf9\xd2\xeb\x11\xc0\xe8c\xb3P\xb4\x1dm1\x8b\x9eC\xb7\xa2\xdb\xec\xf2\xdb[\xb3\x12\xf4\x0c\xab\x99\x0bG\x1f5\xfb\x10\x15w\xc4\xaby#\xca{\x03l"
-    )
+    pubkey = VALID_KEY_BYTEARRAY["pubkey"]
+    signing_root = INVALID_KEY_BYTEARRAY["signing_root"]
+    signature = VALID_KEY_BYTEARRAY["signature"]
 
     res = verify(pubkey, signing_root, signature)
 
@@ -64,13 +78,9 @@ def test_invalid_signing_root():
 
 
 def test_empty_signing_root():
-    pubkey = bytearray(
-        b"\xad\xd9\xa5\x0b\xc6\xde5B\xc8\x81\xe3e\x07\x99JRh5&\xf7]\xdc\xef,U\xe5\x05t\xc5\xc6^\xbd\x97?\xffHGWb\x9d\xed\x05\xe4~\xf2\xbf\xd56"
-    )
+    pubkey = VALID_KEY_BYTEARRAY["pubkey"]
     signing_root = bytearray()
-    signature = bytearray(
-        b"\x85\xe6\x14_\xee\x91np\xbb\xa6\x95\x15F1\x03\x1b\x97r\xedS\xe5Y\x0b<2XP7g)\x88\xcbg-\t\xab\xcd\x17\x12\x9e\x87\x0f\x15SdK\xa2^\x10)\xf5\xf9\xd2\xeb\x11\xc0\xe8c\xb3P\xb4\x1dm1\x8b\x9eC\xb7\xa2\xdb\xec\xf2\xdb[\xb3\x12\xf4\x0c\xab\x99\x0bG\x1f5\xfb\x10\x15w\xc4\xaby#\xca{\x03l"
-    )
+    signature = VALID_KEY_BYTEARRAY["signature"]
 
     res = verify(pubkey, signing_root, signature)
 
@@ -78,15 +88,9 @@ def test_empty_signing_root():
 
 
 def test_invalid_signature():
-    pubkey = bytearray(
-        b"\xad\xd9\xa5\x0b\xc6\xde5B\xc8\x81\xe3e\x07\x99JRh5&\xf7]\xdc\xef,U\xe5\x05t\xc5\xc6^\xbd\x97?\xffHGWb\x9d\xed\x05\xe4~\xf2\xbf\xd56"
-    )
-    signing_root = bytearray(
-        b"\x84\xd6\xcd{l\xb0\xfb\x00\x94\x95A\x07}-in,\x8f\xf0.\xc1i\x98\xd5!\x9d\xed^\xd2\x84\xf9l"
-    )
-    signature = bytearray(
-        b"\x85\xe5\x14_\xee\x91np\xbb\xa6\x95\x15F1\x03\x1b\x97r\xedS\xe5Y\x0b<2XP7g)\x88\xcbg-\t\xab\xcd\x17\x12\x9e\x87\x0f\x15SdK\xa2^\x10)\xf5\xf9\xd2\xeb\x11\xc0\xe8c\xb3P\xb4\x1dm1\x8b\x9eC\xb7\xa2\xdb\xec\xf2\xdb[\xb3\x12\xf4\x0c\xab\x99\x0bG\x1f5\xfb\x10\x15w\xc4\xaby#\xca{\x03l"
-    )
+    pubkey = VALID_KEY_BYTEARRAY["pubkey"]
+    signing_root = INVALID_KEY_BYTEARRAY["signing_root"]
+    signature = INVALID_KEY_BYTEARRAY["signature"]
 
     res = verify(pubkey, signing_root, signature)
 
@@ -94,14 +98,50 @@ def test_invalid_signature():
 
 
 def test_empty_signature():
-    pubkey = bytearray(
-        b"\xad\xd9\xa5\x0b\xc6\xde5B\xc8\x81\xe3e\x07\x99JRh5&\xf7]\xdc\xef,U\xe5\x05t\xc5\xc6^\xbd\x97?\xffHGWb\x9d\xed\x05\xe4~\xf2\xbf\xd56"
-    )
-    signing_root = bytearray(
-        b"\x84\xd6\xcd{l\xb0\xfb\x00\x94\x95A\x07}-in,\x8f\xf0.\xc1i\x98\xd5!\x9d\xed^\xd2\x84\xf9l"
-    )
+    pubkey = VALID_KEY_BYTEARRAY["pubkey"]
+    signing_root = VALID_KEY_BYTEARRAY["signing_root"]
     signature = bytearray()
 
     res = verify(pubkey, signing_root, signature)
 
     assert res is False
+
+
+def test_invalid_string_arguments():
+    pubkey = ""
+    signing_root = ""
+    signature = ""
+
+    res = verify(pubkey, signing_root, signature)
+
+    assert res is False
+
+
+def test_invalid_int_arguments():
+    pubkey = 10
+    signing_root = 20
+    signature = 30
+
+    res = verify(pubkey, signing_root, signature)
+
+    assert res is False
+
+
+def test_invalid_bool_arguments():
+    pubkey = True
+    signing_root = False
+    signature = True
+
+    res = verify(pubkey, signing_root, signature)
+
+    assert res is False
+
+
+def test_invalid_bytes_arguments():
+    pubkey = bytes()
+    signing_root = bytes()
+    signature = bytes()
+
+    res = verify(pubkey, signing_root, signature)
+
+    assert res is False
diff --git a/tests/test_contracts.py b/tests/test_contracts.py
index 51c0e13..c134e71 100644
--- a/tests/test_contracts.py
+++ b/tests/test_contracts.py
@@ -3,14 +3,14 @@
 
 from web3 import Web3
 
-from lido.contract.contract import Contract
-from lido.contract.load_contract import _get_contract_abi
+from lido_sdk.contract.contract import Contract
+from lido_sdk.contract.load_contract import _get_contract_abi
 from tests.utils import MockTestCase
 
 
 class ContractTest(MockTestCase):
     def test_load_contract(self):
-        from lido.contract.load_contract import LidoContract, NodeOpsContract
+        from lido_sdk.contract.load_contract import LidoContract, NodeOpsContract
 
         lido_abi = _get_contract_abi("Lido.json")
 
@@ -27,7 +27,7 @@ def _check_all_methods_exists(self, contract: Contract, contract_abi: List[Dict]
 
     def test_contract_call_function(self):
         call = self.mocker.patch(
-            "lido.contract.execute_contract.execute_contract_call", return_value=2
+            "lido_sdk.contract.execute_contract.execute_contract_call", return_value=2
         )
         contract_multicall = self.mocker.patch(
             "multicall.Call.__call__",
@@ -43,7 +43,7 @@ def test_contract_call_function(self):
             "web3.eth.Eth.chain_id", return_value=1, new_callable=PropertyMock
         )
 
-        from lido.contract.load_contract import NodeOpsContract
+        from lido_sdk.contract.load_contract import NodeOpsContract
 
         w3 = Web3()
 
diff --git a/tests/test_lido.py b/tests/test_lido.py
index 685c345..ab8cd93 100644
--- a/tests/test_lido.py
+++ b/tests/test_lido.py
@@ -2,8 +2,8 @@
 
 from web3 import Web3
 
-from lido import Lido
-from lido.methods import (
+from lido_sdk import Lido
+from lido_sdk.methods import (
     get_operators_indexes,
     get_operators_data,
     get_operators_keys,
@@ -39,7 +39,7 @@ def test_main_flow_methods(self):
 
     def test_get_operators_indexes(self):
         self.mocker.patch(
-            "lido.contract.load_contract.NodeOpsContract.getNodeOperatorsCount",
+            "lido_sdk.contract.load_contract.NodeOpsContract.getNodeOperatorsCount",
             return_value={"": 5},
         )
 
@@ -49,7 +49,7 @@ def test_get_operators_indexes(self):
     def test_get_operators_data(self):
         """We are checking that indexes are assigned correctly"""
         self.mocker.patch(
-            "lido.contract.load_contract.NodeOpsContract.getNodeOperator_multicall",
+            "lido_sdk.contract.load_contract.NodeOpsContract.getNodeOperator_multicall",
             return_value=OPERATORS_DATA,
         )
 
@@ -60,7 +60,7 @@ def test_get_operators_data(self):
 
     def test_get_operators_keys(self):
         self.mocker.patch(
-            "lido.contract.load_contract.NodeOpsContract.getSigningKey_multicall",
+            "lido_sdk.contract.load_contract.NodeOpsContract.getSigningKey_multicall",
             return_value=OPERATORS_KEYS,
         )
 
@@ -85,7 +85,7 @@ def test_get_operators_keys(self):
 
     def test_validate_keys(self):
         self.mocker.patch(
-            "lido.contract.load_contract.LidoContract.getWithdrawalCredentials",
+            "lido_sdk.contract.load_contract.LidoContract.getWithdrawalCredentials",
             return_value={
                 "": b"\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb9\xd7\x93Hx\xb5\xfb\x96\x10\xb3\xfe\x8a^D\x1e\x8f\xad~)?"
             },
diff --git a/tests/test_validation.py b/tests/test_validation.py
index 8926d5d..a5ff2bb 100644
--- a/tests/test_validation.py
+++ b/tests/test_validation.py
@@ -4,7 +4,7 @@
 
 from web3 import Web3
 
-from lido.methods import validate_keys
+from lido_sdk.methods import validate_keys
 from tests.fixtures import OPERATORS_KEYS
 from tests.utils import MockTestCase
 
@@ -17,7 +17,7 @@ def setUp(self) -> None:
         self.w3 = Web3()
 
         self.mocker.patch(
-            "lido.contract.load_contract.LidoContract.getWithdrawalCredentials",
+            "lido_sdk.contract.load_contract.LidoContract.getWithdrawalCredentials",
             return_value={
                 "": b"\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb9\xd7\x93Hx\xb5\xfb\x96\x10\xb3\xfe\x8a^D\x1e\x8f\xad~)?"
             },