Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Commit

Permalink
Replace import star with explicit imports (#404)
Browse files Browse the repository at this point in the history
* handle all from neocore.Cryptography.Helper import *

* handle all from neo.VM.InteropService import *

* handle all from neocore.Cryptography.Crypto import *

* handle all from neo.Core.TX.Transaction import *

* handle all from neo.Core.TX.TransactionAttribute import *

* handle all from neocore.Cryptography.Helper import *

* handle all two import *

* handle all from neo.VM.OpCode import *

* handle all from neo.VM.OpCode import *
  • Loading branch information
iddoberger authored and metachris committed Apr 30, 2018
1 parent 854a1c4 commit cffe649
Show file tree
Hide file tree
Showing 20 changed files with 50 additions and 31 deletions.
3 changes: 2 additions & 1 deletion neo/Core/BlockBase.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import ctypes
from .Mixins import VerifiableMixin
from neocore.Cryptography.Helper import *
from neocore.Cryptography.Helper import bin_dbl_sha256
import binascii
from neo.Core.Helper import Helper
from neo.Blockchain import GetBlockchain, GetGenesis
from neo.Core.Witness import Witness
Expand Down
9 changes: 5 additions & 4 deletions neo/Core/Blockchain.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import pytz
from itertools import groupby
from datetime import datetime
from events import Events
from neo.Core.Block import Block
from neo.Core.TX.Transaction import *
from neo.Core.TX.Transaction import TransactionOutput
from neo.Core.AssetType import AssetType
from neocore.Cryptography.Crypto import Crypto
from neo.Core.TX.RegisterTransaction import RegisterTransaction
from neo.Core.TX.MinerTransaction import MinerTransaction
from neo.Core.TX.IssueTransaction import IssueTransaction
from neo.Core.Witness import Witness
from neo.VM.OpCode import *
from neo.VM.OpCode import PUSHF, PUSHT
from neo.Core.State.SpentCoinState import SpentCoin
from neo.SmartContract.Contract import Contract
from neo.Settings import settings
from neocore.Cryptography.Crypto import *
from neocore.Cryptography.Helper import *
from collections import Counter
from neocore.Fixed8 import Fixed8
from neocore.Cryptography.ECCurve import ECDSA
Expand Down
4 changes: 3 additions & 1 deletion neo/Core/Helper.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from base58 import b58decode
from logzero import logger
import binascii
from neo.Blockchain import GetBlockchain, GetStateReader
from neocore.Cryptography.Crypto import *
from neocore.Cryptography.Crypto import Crypto
from neocore.IO.BinaryWriter import BinaryWriter
from neocore.UInt160 import UInt160
from neo.IO.MemoryStream import StreamManager
Expand Down
5 changes: 4 additions & 1 deletion neo/Core/TX/ClaimTransaction.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from neo.Core.TX.Transaction import *
import sys
from itertools import groupby
from logzero import logger
from neo.Core.TX.Transaction import TransactionType, Transaction
from neocore.Fixed8 import Fixed8
from neo.Core.Blockchain import Blockchain
from neo.Core.CoinReference import CoinReference
Expand Down
2 changes: 1 addition & 1 deletion neo/Core/TX/StateTransaction.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from neo.Core.TX.Transaction import *
from neo.Core.TX.Transaction import Transaction, TransactionType
from neocore.Fixed8 import Fixed8


Expand Down
10 changes: 7 additions & 3 deletions neo/Core/TX/Transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@
Usage:
from neo.Core.Transaction import Transaction
"""
import sys
from itertools import groupby
from neo.Blockchain import *
from neo.Core.TX.TransactionAttribute import *
import binascii
from logzero import logger
from neocore.UInt160 import UInt160
from neo.Blockchain import GetBlockchain
from neo.Core.TX.TransactionAttribute import TransactionAttributeUsage
from neocore.Fixed8 import Fixed8

from neo.Network.InventoryType import InventoryType
from neo.Network.Mixins import InventoryMixin
from neocore.Cryptography.Crypto import *
from neocore.Cryptography.Crypto import Crypto
from neocore.IO.Mixins import SerializableMixin
from neo.IO.MemoryStream import StreamManager
from neocore.IO.BinaryReader import BinaryReader
Expand Down
3 changes: 2 additions & 1 deletion neo/Core/test_block_hash.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from neo.Utils.NeoTestCase import NeoTestCase
from neocore.Cryptography.Helper import *
from neocore.Cryptography.Helper import bin_dbl_sha256
import binascii


class BlockHashTest(NeoTestCase):
Expand Down
5 changes: 3 additions & 2 deletions neo/Core/test_genesis_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
from neo.Core.TX.RegisterTransaction import RegisterTransaction
from neo.Core.TX.MinerTransaction import MinerTransaction
from neo.Core.TX.IssueTransaction import IssueTransaction
from neo.Core.TX.Transaction import *
from neo.Core.TX.Transaction import TransactionOutput
from neo.Blockchain import GetSystemShare, GetGenesis, GetSystemCoin
from neo.SmartContract.Contract import Contract
from neo.Core.Blockchain import Blockchain
from neo.Core.Witness import Witness
from neo.VM.OpCode import *
from neo.VM.OpCode import PUSHT
from neo.Settings import settings
from neocore.Cryptography.Crypto import Crypto

Expand Down
5 changes: 3 additions & 2 deletions neo/Network/Message.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import ctypes
import binascii
from logzero import logger
from neocore.IO.Mixins import SerializableMixin
from neo.Settings import settings
from neo.Core.Helper import Helper
from neocore.Cryptography.Helper import *
from logzero import logger
from neocore.Cryptography.Helper import bin_dbl_sha256


class ChecksumException(Exception):
Expand Down
2 changes: 1 addition & 1 deletion neo/Network/Payloads/ConsensusPayload.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from neocore.IO.Mixins import SerializableMixin
from neocore.Cryptography.Helper import *
from neocore.Cryptography.Helper import bin_dbl_sha256
from neo.Core.Helper import Helper
from neo.Network.InventoryType import InventoryType

Expand Down
3 changes: 2 additions & 1 deletion neo/Prompt/Commands/Invoke.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import binascii
from neo.Blockchain import GetBlockchain
from neo.VM.ScriptBuilder import ScriptBuilder
from neo.VM.InteropService import InteropInterface
Expand Down Expand Up @@ -32,7 +33,7 @@
from neo.EventHub import events
from logzero import logger

from neo.VM.OpCode import *
from neo.VM.OpCode import PACK

DEFAULT_MIN_FEE = Fixed8.FromDecimal(.0001)

Expand Down
4 changes: 3 additions & 1 deletion neo/SmartContract/ApplicationEngine.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import binascii
from logzero import logger

from neo.VM.ExecutionEngine import ExecutionEngine
from neo.VM.OpCode import *
from neo.VM.OpCode import CALL, APPCALL, CHECKSIG, HASH160, HASH256, NOP, SHA1, SHA256, DEPTH, DUP, PACK, TUCK, OVER, \
SYSCALL, TAILCALL, NEWARRAY, NEWSTRUCT, PUSH16, UNPACK, CAT, CHECKMULTISIG, PUSHDATA4
from neo.VM import VMState
from neocore.Cryptography.Crypto import Crypto
from neocore.Fixed8 import Fixed8
Expand Down
6 changes: 3 additions & 3 deletions neo/SmartContract/Contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
Usage:
from neo.SmartContract.Contract import Contract
"""
from neo.VM.OpCode import *
import binascii
from neo.VM.OpCode import CHECKMULTISIG, CHECKSIG
from neo.VM.ScriptBuilder import ScriptBuilder
from neocore.Cryptography.Crypto import *
from neocore.Cryptography.Crypto import bin_hash160, from_int_to_byte, Crypto
from neocore.IO.Mixins import SerializableMixin
from neo.Core.VerificationCode import VerificationCode
from neo.Core.Helper import Helper
from neocore.Cryptography.Helper import *
from neocore.Cryptography.ECCurve import ECDSA


Expand Down
2 changes: 1 addition & 1 deletion neo/SmartContract/test_contract_parameters.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from unittest import TestCase
from neo.VM.InteropService import *
from neo.VM.InteropService import ByteArray, Integer, BigInteger, Boolean
from neo.SmartContract.ContractParameter import ContractParameter
from neo.SmartContract.ContractParameterType import ContractParameterType
from neocore.UInt256 import UInt256
Expand Down
2 changes: 1 addition & 1 deletion neo/VM/ExecutionEngine.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import hashlib
import datetime

from neo.VM.OpCode import *
from logzero import logger
from neo.VM.RandomAccessStack import RandomAccessStack
from neo.VM.ExecutionContext import ExecutionContext
from neo.VM import VMState
from neo.VM.OpCode import *
from neo.VM.InteropService import Array, Struct, CollectionMixin, Map, Boolean
from neocore.UInt160 import UInt160
from neo.Settings import settings
Expand Down
7 changes: 4 additions & 3 deletions neo/VM/ScriptBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
Usage:
from neo.Core.Scripts.ScriptBuilder import ScriptBuilder
"""

from neo.VM.OpCode import *
import struct
import binascii
from neo.VM.OpCode import PUSHDATA1, PUSHDATA2, PUSHDATA4, PUSHF, PUSHT, PACK, PUSH0, PUSH1, PUSHM1, PUSHBYTES75, \
APPCALL, TAILCALL, SYSCALL
from neo.IO.MemoryStream import MemoryStream
from neocore.BigInteger import BigInteger
import struct


class ScriptBuilder:
Expand Down
2 changes: 1 addition & 1 deletion neo/VM/tests/test_execution_engine.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from unittest import TestCase
from neo.VM.InteropService import *
from neo.VM.InteropService import StackItem
from neo.VM.ExecutionEngine import ExecutionEngine
from neo.VM.ExecutionEngine import ExecutionContext
from neo.VM import OpCode
Expand Down
2 changes: 1 addition & 1 deletion neo/VM/tests/test_interop_map.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from unittest import TestCase
from neo.VM.InteropService import *
from neo.VM.InteropService import Integer, BigInteger, ByteArray, StackItem, Map, Array
from neo.VM.ExecutionEngine import ExecutionEngine
from neo.VM.ExecutionContext import ExecutionContext
from neo.VM import OpCode
Expand Down
2 changes: 1 addition & 1 deletion neo/VM/tests/test_interop_serialize.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from unittest import TestCase
from neo.VM.InteropService import *
from neo.VM.InteropService import Struct, StackItem, Array, Boolean, Map
from neo.VM.ExecutionEngine import ExecutionEngine
from neo.VM.ExecutionEngine import ExecutionContext
from neo.SmartContract.StateReader import StateReader
Expand Down
3 changes: 2 additions & 1 deletion neo/Wallets/Wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from neo.Wallets.Wallet import Wallet
"""
import traceback
import hashlib
from itertools import groupby
from base58 import b58decode
from decimal import Decimal
Expand All @@ -18,7 +19,7 @@
from neo.Core.Blockchain import Blockchain
from neo.Core.CoinReference import CoinReference
from neo.Core.TX.ClaimTransaction import ClaimTransaction
from neocore.Cryptography.Helper import *
from neocore.Cryptography.Helper import scripthash_to_address
from neocore.Cryptography.Crypto import Crypto
from neo.Wallets.AddressState import AddressState
from neo.Wallets.Coin import Coin
Expand Down

0 comments on commit cffe649

Please sign in to comment.