mirror of
https://github.com/planetmint/planetmint.git
synced 2025-11-24 14:35:45 +00:00
removed unused imports and reordered them
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
This commit is contained in:
parent
e4bce1cb21
commit
0347b251f6
@ -4,6 +4,7 @@
|
|||||||
# Code is Apache-2.0 and docs are CC-BY-4.0
|
# Code is Apache-2.0 and docs are CC-BY-4.0
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from transactions.types.assets.create import Create
|
from transactions.types.assets.create import Create
|
||||||
from transactions.types.assets.transfer import Transfer
|
from transactions.types.assets.transfer import Transfer
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import random
|
|
||||||
|
|
||||||
from transactions.types.assets.create import Create
|
from transactions.types.assets.create import Create
|
||||||
from transactions.types.assets.transfer import Transfer
|
from transactions.types.assets.transfer import Transfer
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import json
|
import json
|
||||||
import base58
|
import base58
|
||||||
|
|
||||||
from hashlib import sha3_256
|
from hashlib import sha3_256
|
||||||
from zenroom import zencode_exec
|
from zenroom import zencode_exec
|
||||||
from cryptoconditions.types.zenroom import ZenroomSha256
|
from cryptoconditions.types.zenroom import ZenroomSha256
|
||||||
|
|||||||
@ -3,11 +3,11 @@
|
|||||||
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
|
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
|
||||||
# Code is Apache-2.0 and docs are CC-BY-4.0
|
# Code is Apache-2.0 and docs are CC-BY-4.0
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
from functools import singledispatch
|
from functools import singledispatch
|
||||||
from types import ModuleType
|
from types import ModuleType
|
||||||
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def mock_module():
|
def mock_module():
|
||||||
|
|||||||
@ -3,9 +3,9 @@
|
|||||||
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
|
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
|
||||||
# Code is Apache-2.0 and docs are CC-BY-4.0
|
# Code is Apache-2.0 and docs are CC-BY-4.0
|
||||||
|
|
||||||
from argparse import Namespace
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
from argparse import Namespace
|
||||||
from planetmint.config import Config
|
from planetmint.config import Config
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -5,18 +5,15 @@
|
|||||||
|
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
|
import pytest
|
||||||
|
|
||||||
from unittest.mock import Mock, patch
|
from unittest.mock import Mock, patch
|
||||||
from argparse import Namespace
|
from argparse import Namespace
|
||||||
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
from planetmint.config import Config
|
from planetmint.config import Config
|
||||||
from planetmint import ValidatorElection
|
from planetmint import ValidatorElection
|
||||||
from planetmint.commands.planetmint import run_election_show
|
from planetmint.commands.planetmint import run_election_show
|
||||||
from planetmint.lib import Block
|
from planetmint.lib import Block
|
||||||
from transactions.types.elections.chain_migration_election import ChainMigrationElection
|
from transactions.types.elections.chain_migration_election import ChainMigrationElection
|
||||||
|
|
||||||
from tests.utils import generate_election, generate_validators
|
from tests.utils import generate_election, generate_validators
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -4,10 +4,10 @@
|
|||||||
# Code is Apache-2.0 and docs are CC-BY-4.0
|
# Code is Apache-2.0 and docs are CC-BY-4.0
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
from argparse import Namespace
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
from argparse import Namespace
|
||||||
from planetmint.config import Config
|
from planetmint.config import Config
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
|
|||||||
@ -14,17 +14,14 @@ import os
|
|||||||
import random
|
import random
|
||||||
import tempfile
|
import tempfile
|
||||||
import codecs
|
import codecs
|
||||||
|
import pytest
|
||||||
|
|
||||||
from ipld import marshal, multihash
|
from ipld import marshal, multihash
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
from logging.config import dictConfig
|
from logging.config import dictConfig
|
||||||
from planetmint.backend.connection import connect
|
from planetmint.backend.connection import connect
|
||||||
from planetmint.backend.tarantool.connection import TarantoolDBConnection
|
from planetmint.backend.tarantool.connection import TarantoolDBConnection
|
||||||
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
# from pymongo import MongoClient
|
|
||||||
|
|
||||||
from transactions.common import crypto
|
from transactions.common import crypto
|
||||||
from transactions.common.transaction_mode_types import BROADCAST_TX_COMMIT
|
from transactions.common.transaction_mode_types import BROADCAST_TX_COMMIT
|
||||||
from planetmint.tendermint_utils import key_from_base64
|
from planetmint.tendermint_utils import key_from_base64
|
||||||
@ -35,7 +32,6 @@ from planetmint.lib import Block
|
|||||||
from tests.utils import gen_vote
|
from tests.utils import gen_vote
|
||||||
from planetmint.config import Config
|
from planetmint.config import Config
|
||||||
from transactions.types.elections.validator_election import ValidatorElection # noqa
|
from transactions.types.elections.validator_election import ValidatorElection # noqa
|
||||||
|
|
||||||
from tendermint.abci import types_pb2 as types
|
from tendermint.abci import types_pb2 as types
|
||||||
from tendermint.crypto import keys_pb2
|
from tendermint.crypto import keys_pb2
|
||||||
|
|
||||||
|
|||||||
@ -3,13 +3,15 @@
|
|||||||
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
|
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
|
||||||
# Code is Apache-2.0 and docs are CC-BY-4.0
|
# Code is Apache-2.0 and docs are CC-BY-4.0
|
||||||
import warnings
|
import warnings
|
||||||
|
import random
|
||||||
|
import pytest
|
||||||
|
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
from transactions.types.assets.create import Create
|
from transactions.types.assets.create import Create
|
||||||
from transactions.types.assets.transfer import Transfer
|
from transactions.types.assets.transfer import Transfer
|
||||||
from ipld import marshal, multihash
|
from ipld import marshal, multihash
|
||||||
import pytest
|
|
||||||
from base58 import b58decode
|
from base58 import b58decode
|
||||||
import random
|
|
||||||
|
|
||||||
pytestmark = pytest.mark.bdb
|
pytestmark = pytest.mark.bdb
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from tests.utils import generate_election, generate_validators
|
from tests.utils import generate_election, generate_validators
|
||||||
|
|
||||||
from planetmint.lib import Block
|
from planetmint.lib import Block
|
||||||
from transactions.types.elections.election import Election
|
from transactions.types.elections.election import Election
|
||||||
from transactions.types.elections.chain_migration_election import ChainMigrationElection
|
from transactions.types.elections.chain_migration_election import ChainMigrationElection
|
||||||
|
|||||||
@ -8,13 +8,13 @@ import random
|
|||||||
import multiprocessing as mp
|
import multiprocessing as mp
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from tendermint.abci import types_pb2 as types
|
from tendermint.abci import types_pb2 as types
|
||||||
from tendermint.crypto import keys_pb2
|
from tendermint.crypto import keys_pb2
|
||||||
from transactions import ValidatorElection, ChainMigrationElection
|
from transactions import ValidatorElection, ChainMigrationElection
|
||||||
from transactions.common.crypto import generate_key_pair
|
from transactions.common.crypto import generate_key_pair
|
||||||
from transactions.types.assets.create import Create
|
from transactions.types.assets.create import Create
|
||||||
from transactions.types.assets.transfer import Transfer
|
from transactions.types.assets.transfer import Transfer
|
||||||
|
|
||||||
from planetmint import App
|
from planetmint import App
|
||||||
from planetmint.backend import query
|
from planetmint.backend import query
|
||||||
from planetmint.core import OkCode, CodeTypeError, rollback
|
from planetmint.core import OkCode, CodeTypeError, rollback
|
||||||
@ -22,7 +22,6 @@ from planetmint.lib import Block
|
|||||||
from planetmint.tendermint_utils import new_validator_set
|
from planetmint.tendermint_utils import new_validator_set
|
||||||
from planetmint.tendermint_utils import public_key_to_base64
|
from planetmint.tendermint_utils import public_key_to_base64
|
||||||
from planetmint.version import __tm_supported_versions__
|
from planetmint.version import __tm_supported_versions__
|
||||||
|
|
||||||
from tests.utils import generate_election, generate_validators
|
from tests.utils import generate_election, generate_validators
|
||||||
|
|
||||||
pytestmark = pytest.mark.bdb
|
pytestmark = pytest.mark.bdb
|
||||||
|
|||||||
@ -4,17 +4,14 @@
|
|||||||
# Code is Apache-2.0 and docs are CC-BY-4.0
|
# Code is Apache-2.0 and docs are CC-BY-4.0
|
||||||
|
|
||||||
import codecs
|
import codecs
|
||||||
from transactions.types.assets.create import Create
|
|
||||||
from transactions.types.assets.transfer import Transfer
|
|
||||||
|
|
||||||
from tendermint.abci import types_pb2 as types
|
|
||||||
import json
|
import json
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
from transactions.types.assets.create import Create
|
||||||
|
from transactions.types.assets.transfer import Transfer
|
||||||
|
from tendermint.abci import types_pb2 as types
|
||||||
from abci.server import ProtocolHandler
|
from abci.server import ProtocolHandler
|
||||||
from abci.utils import read_messages
|
from abci.utils import read_messages
|
||||||
|
|
||||||
from transactions.common.transaction_mode_types import BROADCAST_TX_COMMIT, BROADCAST_TX_SYNC
|
from transactions.common.transaction_mode_types import BROADCAST_TX_COMMIT, BROADCAST_TX_SYNC
|
||||||
from planetmint.version import __tm_supported_versions__
|
from planetmint.version import __tm_supported_versions__
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
|
|||||||
@ -3,17 +3,16 @@
|
|||||||
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
|
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
|
||||||
# Code is Apache-2.0 and docs are CC-BY-4.0
|
# Code is Apache-2.0 and docs are CC-BY-4.0
|
||||||
|
|
||||||
from operator import index
|
|
||||||
import os
|
import os
|
||||||
|
import pytest
|
||||||
|
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
from transactions.types.assets.create import Create
|
from transactions.types.assets.create import Create
|
||||||
from transactions.types.assets.transfer import Transfer
|
from transactions.types.assets.transfer import Transfer
|
||||||
|
from operator import index
|
||||||
from hashlib import sha3_256
|
from hashlib import sha3_256
|
||||||
|
|
||||||
import pytest
|
|
||||||
from pymongo import MongoClient
|
from pymongo import MongoClient
|
||||||
|
|
||||||
from planetmint import backend
|
from planetmint import backend
|
||||||
from transactions.common.transaction_mode_types import (
|
from transactions.common.transaction_mode_types import (
|
||||||
BROADCAST_TX_COMMIT,
|
BROADCAST_TX_COMMIT,
|
||||||
|
|||||||
@ -5,8 +5,8 @@
|
|||||||
|
|
||||||
import base64
|
import base64
|
||||||
import json
|
import json
|
||||||
from pytest import mark
|
|
||||||
|
|
||||||
|
from pytest import mark
|
||||||
from hashlib import sha3_256
|
from hashlib import sha3_256
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,12 +3,10 @@
|
|||||||
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
|
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
|
||||||
# Code is Apache-2.0 and docs are CC-BY-4.0
|
# Code is Apache-2.0 and docs are CC-BY-4.0
|
||||||
|
|
||||||
import copy
|
|
||||||
from unittest.mock import mock_open, patch
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
import planetmint
|
import planetmint
|
||||||
|
|
||||||
|
from unittest.mock import mock_open, patch
|
||||||
from planetmint.config import Config
|
from planetmint.config import Config
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
# Code is Apache-2.0 and docs are CC-BY-4.0
|
# Code is Apache-2.0 and docs are CC-BY-4.0
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from planetmint.version import __tm_supported_versions__
|
from planetmint.version import __tm_supported_versions__
|
||||||
from transactions.types.assets.create import Create
|
from transactions.types.assets.create import Create
|
||||||
from transactions.types.assets.transfer import Transfer
|
from transactions.types.assets.transfer import Transfer
|
||||||
|
|||||||
@ -3,9 +3,7 @@
|
|||||||
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
|
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
|
||||||
# Code is Apache-2.0 and docs are CC-BY-4.0
|
# Code is Apache-2.0 and docs are CC-BY-4.0
|
||||||
|
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
def test_build_root_docs():
|
def test_build_root_docs():
|
||||||
|
|||||||
@ -4,10 +4,10 @@
|
|||||||
# Code is Apache-2.0 and docs are CC-BY-4.0
|
# Code is Apache-2.0 and docs are CC-BY-4.0
|
||||||
|
|
||||||
import queue
|
import queue
|
||||||
from unittest.mock import patch, call
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
from unittest.mock import patch, call
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def mock_queue(monkeypatch):
|
def mock_queue(monkeypatch):
|
||||||
|
|||||||
@ -2,10 +2,10 @@
|
|||||||
# Planetmint and IPDB software contributors.
|
# Planetmint and IPDB software contributors.
|
||||||
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
|
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
|
||||||
# Code is Apache-2.0 and docs are CC-BY-4.0
|
# Code is Apache-2.0 and docs are CC-BY-4.0
|
||||||
from unittest.mock import patch
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
from unittest.mock import patch
|
||||||
from planetmint.backend import query
|
from planetmint.backend import query
|
||||||
from transactions.types.elections.validator_election import ValidatorElection
|
from transactions.types.elections.validator_election import ValidatorElection
|
||||||
|
|
||||||
|
|||||||
@ -2,11 +2,11 @@
|
|||||||
# Planetmint and IPDB software contributors.
|
# Planetmint and IPDB software contributors.
|
||||||
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
|
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
|
||||||
# Code is Apache-2.0 and docs are CC-BY-4.0
|
# Code is Apache-2.0 and docs are CC-BY-4.0
|
||||||
from argparse import Namespace
|
|
||||||
from unittest.mock import patch
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
from argparse import Namespace
|
||||||
|
from unittest.mock import patch
|
||||||
from planetmint.tendermint_utils import public_key_to_base64
|
from planetmint.tendermint_utils import public_key_to_base64
|
||||||
from transactions.types.elections.validator_election import ValidatorElection
|
from transactions.types.elections.validator_election import ValidatorElection
|
||||||
from transactions.common.exceptions import (
|
from transactions.common.exceptions import (
|
||||||
|
|||||||
@ -8,7 +8,6 @@ import base64
|
|||||||
import random
|
import random
|
||||||
|
|
||||||
from functools import singledispatch
|
from functools import singledispatch
|
||||||
|
|
||||||
from planetmint.backend.localmongodb.connection import LocalMongoDBConnection
|
from planetmint.backend.localmongodb.connection import LocalMongoDBConnection
|
||||||
from planetmint.backend.tarantool.connection import TarantoolDBConnection
|
from planetmint.backend.tarantool.connection import TarantoolDBConnection
|
||||||
from planetmint.backend.schema import TABLES, SPACE_NAMES
|
from planetmint.backend.schema import TABLES, SPACE_NAMES
|
||||||
|
|||||||
@ -8,12 +8,10 @@ structural / schematic issues are caught when reading a transaction
|
|||||||
(ie going from dict -> transaction).
|
(ie going from dict -> transaction).
|
||||||
"""
|
"""
|
||||||
import json
|
import json
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
import hashlib as sha3
|
import hashlib as sha3
|
||||||
from unittest.mock import MagicMock
|
|
||||||
|
|
||||||
|
from unittest.mock import MagicMock
|
||||||
from transactions.common.exceptions import AmountError, SchemaValidationError, ThresholdTooDeep
|
from transactions.common.exceptions import AmountError, SchemaValidationError, ThresholdTooDeep
|
||||||
from transactions.common.transaction import Transaction
|
from transactions.common.transaction import Transaction
|
||||||
from transactions.common.utils import _fulfillment_to_details, _fulfillment_from_details
|
from transactions.common.utils import _fulfillment_to_details, _fulfillment_from_details
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
# Code is Apache-2.0 and docs are CC-BY-4.0
|
# Code is Apache-2.0 and docs are CC-BY-4.0
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from transactions.types.assets.create import Create
|
from transactions.types.assets.create import Create
|
||||||
from ipld import marshal, multihash
|
from ipld import marshal, multihash
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
# Code is Apache-2.0 and docs are CC-BY-4.0
|
# Code is Apache-2.0 and docs are CC-BY-4.0
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from transactions.types.assets.create import Create
|
from transactions.types.assets.create import Create
|
||||||
from ipld import marshal, multihash
|
from ipld import marshal, multihash
|
||||||
|
|
||||||
|
|||||||
@ -3,8 +3,8 @@
|
|||||||
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
|
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
|
||||||
# Code is Apache-2.0 and docs are CC-BY-4.0
|
# Code is Apache-2.0 and docs are CC-BY-4.0
|
||||||
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from transactions.types.assets.create import Create
|
from transactions.types.assets.create import Create
|
||||||
from transactions.types.assets.transfer import Transfer
|
from transactions.types.assets.transfer import Transfer
|
||||||
from unittest.mock import MagicMock, patch
|
from unittest.mock import MagicMock, patch
|
||||||
|
|||||||
@ -4,15 +4,13 @@
|
|||||||
# Code is Apache-2.0 and docs are CC-BY-4.0
|
# Code is Apache-2.0 and docs are CC-BY-4.0
|
||||||
|
|
||||||
import json
|
import json
|
||||||
from unittest.mock import Mock, patch
|
|
||||||
|
|
||||||
import base58
|
import base58
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
from unittest.mock import Mock, patch
|
||||||
from cryptoconditions import Ed25519Sha256
|
from cryptoconditions import Ed25519Sha256
|
||||||
from ipld import multihash, marshal
|
from ipld import multihash, marshal
|
||||||
|
|
||||||
from hashlib import sha3_256
|
from hashlib import sha3_256
|
||||||
|
|
||||||
from transactions.common import crypto
|
from transactions.common import crypto
|
||||||
from transactions.common.transaction import Transaction
|
from transactions.common.transaction import Transaction
|
||||||
from transactions.types.assets.create import Create
|
from transactions.types.assets.create import Create
|
||||||
|
|||||||
@ -7,15 +7,13 @@ import asyncio
|
|||||||
import json
|
import json
|
||||||
import queue
|
import queue
|
||||||
import threading
|
import threading
|
||||||
|
import pytest
|
||||||
|
|
||||||
# from unittest.mock import patch
|
# from unittest.mock import patch
|
||||||
from transactions.types.assets.create import Create
|
from transactions.types.assets.create import Create
|
||||||
from transactions.types.assets.transfer import Transfer
|
from transactions.types.assets.transfer import Transfer
|
||||||
from ipld import multihash, marshal
|
from ipld import multihash, marshal
|
||||||
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
|
|
||||||
class MockWebSocket:
|
class MockWebSocket:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.received = []
|
self.received = []
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user