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

Move base datatypes to neocore #146

Merged
merged 5 commits into from
Jan 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions neo/Core/Block.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
from neo.Network.InventoryType import InventoryType
from neo.Core.BlockBase import BlockBase
from neo.Core.TX.Transaction import Transaction, TransactionType
from neocore.IO.BinaryReader import BinaryReader
from neocore.IO.BinaryWriter import BinaryWriter
from neo.IO.MemoryStream import StreamManager
from neo.IO.BinaryReader import BinaryReader
from neo.IO.BinaryWriter import BinaryWriter
from neo.Cryptography.MerkleTree import MerkleTree
from neo.Core.Header import Header
from neo.Core.Witness import Witness
from neo.Fixed8 import Fixed8
from neocore.Fixed8 import Fixed8
from neo.Blockchain import GetBlockchain


Expand Down
2 changes: 1 addition & 1 deletion neo/Core/BlockBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from neo.Core.Helper import Helper
from neo.Blockchain import GetBlockchain, GetGenesis
from neo.Core.Witness import Witness
from neo.UInt256 import UInt256
from neocore.UInt256 import UInt256


class BlockBase(VerifiableMixin):
Expand Down
4 changes: 2 additions & 2 deletions neo/Core/Blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
from neo.Cryptography.Crypto import *
from neo.Cryptography.Helper import *
from collections import Counter
from neo.Fixed8 import Fixed8
from neocore.Fixed8 import Fixed8
from neo.Cryptography.ECCurve import ECDSA
from neo.UInt256 import UInt256
from neocore.UInt256 import UInt256


class Blockchain(object):
Expand Down
2 changes: 1 addition & 1 deletion neo/Core/FunctionCode.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from neo.IO.Mixins import SerializableMixin
from neocore.IO.Mixins import SerializableMixin
from neo.Cryptography.Crypto import Crypto


Expand Down
2 changes: 1 addition & 1 deletion neo/Core/Header.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- coding: UTF-8 -*-

from neo.Core.BlockBase import BlockBase
from neocore.IO.BinaryReader import BinaryReader
from neo.IO.MemoryStream import StreamManager
from neo.IO.BinaryReader import BinaryReader
from neo.Core.Witness import Witness


Expand Down
6 changes: 3 additions & 3 deletions neo/Core/Helper.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from base58 import b58decode
from neo.Blockchain import GetBlockchain, GetStateReader
from neo.Cryptography.Crypto import *
from neo.IO.BinaryWriter import BinaryWriter
from neocore.IO.BinaryWriter import BinaryWriter
from neocore.UInt160 import UInt160
from neo.IO.MemoryStream import StreamManager
from neo.UInt160 import UInt160
from neo.VM.ScriptBuilder import ScriptBuilder
from neo.SmartContract.ApplicationEngine import ApplicationEngine
from neo.Fixed8 import Fixed8
from neocore.Fixed8 import Fixed8
from neo.SmartContract import TriggerType
from neo.Settings import settings

Expand Down
2 changes: 1 addition & 1 deletion neo/Core/Mixins.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: UTF-8 -*-

from neo.IO.Mixins import SerializableMixin
from neocore.IO.Mixins import SerializableMixin


class ClonableMixin(object):
Expand Down
8 changes: 4 additions & 4 deletions neo/Core/State/AccountState.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import sys
from .StateBase import StateBase
from neo.Fixed8 import Fixed8
from neo.IO.BinaryReader import BinaryReader
from neocore.Fixed8 import Fixed8
from neocore.IO.BinaryReader import BinaryReader
from neo.IO.MemoryStream import StreamManager
from neo.Cryptography.Crypto import Crypto
from neo.IO.BinaryWriter import BinaryWriter
from neocore.IO.BinaryWriter import BinaryWriter


class AccountState(StateBase):
Expand Down Expand Up @@ -111,7 +111,7 @@ def Deserialize(self, reader):
Deserialize full object.

Args:
reader (neo.IO.BinaryReader):
reader (neocore.IO.BinaryReader):
"""
super(AccountState, self).Deserialize(reader)
self.ScriptHash = reader.ReadUInt160()
Expand Down
8 changes: 4 additions & 4 deletions neo/Core/State/AssetState.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from .StateBase import StateBase
from neo.Fixed8 import Fixed8
from neo.IO.BinaryReader import BinaryReader
from neocore.Fixed8 import Fixed8
from neocore.IO.BinaryReader import BinaryReader
from neo.IO.MemoryStream import StreamManager
from neo.Core.AssetType import AssetType
from neo.UInt160 import UInt160
from neocore.UInt160 import UInt160
from neo.Cryptography.Crypto import Crypto
from neo.Cryptography.ECCurve import EllipticCurve, ECDSA

Expand Down Expand Up @@ -94,7 +94,7 @@ def Deserialize(self, reader):
Deserialize full object.

Args:
reader (neo.IO.BinaryReader):
reader (neocore.IO.BinaryReader):
"""
super(AssetState, self).Deserialize(reader)
self.AssetId = reader.ReadUInt256()
Expand Down
4 changes: 2 additions & 2 deletions neo/Core/State/ContractState.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .StateBase import StateBase
from neo.IO.BinaryReader import BinaryReader
from neocore.IO.BinaryReader import BinaryReader
from neo.IO.MemoryStream import StreamManager
from neo.Core.FunctionCode import FunctionCode
from enum import IntEnum
Expand Down Expand Up @@ -76,7 +76,7 @@ def Deserialize(self, reader):
Deserialize full object.

Args:
reader (neo.IO.BinaryReader):
reader (neocore.IO.BinaryReader):
"""
super(ContractState, self).Deserialize(reader)

Expand Down
4 changes: 2 additions & 2 deletions neo/Core/State/SpentCoinState.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from collections import namedtuple
from .StateBase import StateBase
from neo.IO.BinaryReader import BinaryReader
from neocore.IO.BinaryReader import BinaryReader
from neo.IO.MemoryStream import StreamManager


Expand Down Expand Up @@ -152,7 +152,7 @@ def Deserialize(self, reader):
Deserialize full object.

Args:
reader (neo.IO.BinaryReader):
reader (neocore.IO.BinaryReader):
"""
super(SpentCoinState, self).Deserialize(reader)

Expand Down
6 changes: 3 additions & 3 deletions neo/Core/State/StateBase.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from neo.IO.Mixins import SerializableMixin
from neo.IO.BinaryWriter import BinaryWriter
from neocore.IO.Mixins import SerializableMixin
from neocore.IO.BinaryWriter import BinaryWriter
from neo.IO.MemoryStream import StreamManager
import ctypes

Expand Down Expand Up @@ -31,7 +31,7 @@ def Deserialize(self, reader):
Deserialize full object.

Args:
reader (neo.IO.BinaryReader):
reader (neocore.IO.BinaryReader):

Raises:
Exception: if the state version is incorrect.
Expand Down
4 changes: 2 additions & 2 deletions neo/Core/State/StorageItem.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .StateBase import StateBase
from neo.IO.BinaryReader import BinaryReader
from neocore.IO.BinaryReader import BinaryReader
from neo.IO.MemoryStream import StreamManager


Expand Down Expand Up @@ -52,7 +52,7 @@ def Deserialize(self, reader):
Deserialize full object.

Args:
reader (neo.IO.BinaryReader):
reader (neocore.IO.BinaryReader):
"""
super(StorageItem, self).Deserialize(reader)
self.Value = reader.ReadVarBytes()
Expand Down
6 changes: 3 additions & 3 deletions neo/Core/State/StorageKey.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from neo.IO.Mixins import SerializableMixin
from neocore.IO.Mixins import SerializableMixin
import mmh3
from neo.BigInteger import BigInteger
from neocore.BigInteger import BigInteger


class StorageKey(SerializableMixin):
Expand Down Expand Up @@ -51,7 +51,7 @@ def Deserialize(self, reader):
Deserialize full object.

Args:
reader (neo.IO.BinaryReader):
reader (neocore.IO.BinaryReader):
"""
self.ScriptHash = reader.ReadUInt160()
self.Key = reader.ReadBytes()
Expand Down
4 changes: 2 additions & 2 deletions neo/Core/State/UnspentCoinState.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
from .StateBase import StateBase
from .CoinState import CoinState
from neo.IO.BinaryReader import BinaryReader
from neocore.IO.BinaryReader import BinaryReader
from neo.IO.MemoryStream import StreamManager


Expand Down Expand Up @@ -72,7 +72,7 @@ def Deserialize(self, reader):
Deserialize full object.

Args:
reader (neo.IO.BinaryReader):
reader (neocore.IO.BinaryReader):
"""
super(UnspentCoinState, self).Deserialize(reader)

Expand Down
4 changes: 2 additions & 2 deletions neo/Core/State/ValidatorState.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .StateBase import StateBase
from neo.IO.BinaryReader import BinaryReader
from neocore.IO.BinaryReader import BinaryReader
from neo.IO.MemoryStream import StreamManager
from neo.Cryptography.ECCurve import EllipticCurve, ECDSA

Expand Down Expand Up @@ -36,7 +36,7 @@ def Deserialize(self, reader):
Deserialize full object.

Args:
reader (neo.IO.BinaryReader):
reader (neocore.IO.BinaryReader):
"""
super(ValidatorState, self).Deserialize(reader)
self.PublicKey = ECDSA.Deserialize_Secp256r1(reader)
Expand Down
8 changes: 4 additions & 4 deletions neo/Core/State/test_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
from neo.Core.State.AssetState import AssetState
from neo.Core.State.ContractState import ContractState
from neo.Core.State.AccountState import AccountState
from neo.UInt160 import UInt160
from neo.Fixed8 import Fixed8
from neocore.UInt160 import UInt160
from neocore.Fixed8 import Fixed8
from neo.IO.MemoryStream import StreamManager
from neo.IO.BinaryReader import BinaryReader
from neo.IO.BinaryWriter import BinaryWriter
from neocore.IO.BinaryReader import BinaryReader
from neocore.IO.BinaryWriter import BinaryWriter
from neo.Core.Blockchain import Blockchain


Expand Down
2 changes: 1 addition & 1 deletion neo/Core/TX/ClaimTransaction.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from neo.Core.TX.Transaction import *
from neo.Fixed8 import Fixed8
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/EnrollmentTransaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys
from neo.Cryptography.ECCurve import ECDSA
from neo.Settings import settings
from neo.Fixed8 import Fixed8
from neocore.Fixed8 import Fixed8


class EnrollmentTransaction(Transaction):
Expand Down
2 changes: 1 addition & 1 deletion neo/Core/TX/InvocationTransaction.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from neo.Core.TX.Transaction import Transaction, TransactionType
import sys
from neo.Fixed8 import Fixed8
from neocore.Fixed8 import Fixed8


class InvocationTransaction(Transaction):
Expand Down
2 changes: 1 addition & 1 deletion neo/Core/TX/IssueTransaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"""
from neo.Core.TX.Transaction import Transaction, TransactionType
from neo.Settings import settings
from neo.Fixed8 import Fixed8
from neocore.Fixed8 import Fixed8
from neo.Blockchain import GetSystemCoin, GetSystemShare


Expand Down
2 changes: 1 addition & 1 deletion neo/Core/TX/MinerTransaction.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from neo.Core.TX.Transaction import Transaction, TransactionType
import sys
import binascii
from neo.Fixed8 import Fixed8
from neocore.Fixed8 import Fixed8


class MinerTransaction(Transaction):
Expand Down
2 changes: 1 addition & 1 deletion neo/Core/TX/PublishTransaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from neo.Core.TX.Transaction import Transaction, TransactionType
from neo.Core.FunctionCode import FunctionCode
from neo.Settings import settings
from neo.Fixed8 import Fixed8
from neocore.Fixed8 import Fixed8


class PublishTransaction(Transaction):
Expand Down
2 changes: 1 addition & 1 deletion neo/Core/TX/RegisterTransaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from neo.Cryptography.Crypto import Crypto
from neo.Cryptography.ECCurve import EllipticCurve, ECDSA
from neo.Settings import settings
from neo.Fixed8 import Fixed8
from neocore.Fixed8 import Fixed8


class RegisterTransaction(Transaction):
Expand Down
8 changes: 4 additions & 4 deletions neo/Core/TX/Transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@
from itertools import groupby
from neo.Blockchain import *
from neo.Core.TX.TransactionAttribute import *
from neo.Fixed8 import Fixed8
from neocore.Fixed8 import Fixed8
from neo.Network.Inventory import Inventory
from neo.Network.InventoryType import InventoryType
from neo.Network.Mixins import InventoryMixin
from neo.Cryptography.Crypto import *
from neo.IO.Mixins import SerializableMixin
from neocore.IO.Mixins import SerializableMixin
from neo.IO.MemoryStream import StreamManager
from neo.IO.BinaryReader import BinaryReader
from neocore.IO.BinaryReader import BinaryReader
from neo.Core.Mixins import EquatableMixin
from neo.Core.Helper import Helper
from neo.Core.Witness import Witness
from neo.UInt256 import UInt256
from neocore.UInt256 import UInt256
from neo.Core.AssetType import AssetType


Expand Down
2 changes: 1 addition & 1 deletion neo/Core/TX/TransactionAttribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"""
from logzero import logger
from neo.Network.Inventory import Inventory
from neo.IO.Mixins import SerializableMixin
from neocore.IO.Mixins import SerializableMixin


class TransactionAttributeUsage(object):
Expand Down
4 changes: 2 additions & 2 deletions neo/Core/TX/test_transactions.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from neo.Utils.NeoTestCase import NeoTestCase
from neo.Core.TX.MinerTransaction import MinerTransaction
from neo.Core.TX.Transaction import Transaction
from neo.IO.BinaryWriter import BinaryWriter
from neo.IO.BinaryReader import BinaryReader
from neocore.IO.BinaryWriter import BinaryWriter
from neocore.IO.BinaryReader import BinaryReader
from neo.IO.MemoryStream import MemoryStream, StreamManager
import binascii
import json
Expand Down
2 changes: 1 addition & 1 deletion neo/Core/Witness.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from logzero import logger

from neo.IO.Mixins import SerializableMixin
from neocore.IO.Mixins import SerializableMixin


class Witness(SerializableMixin):
Expand Down
2 changes: 1 addition & 1 deletion neo/Core/test_block_hash.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from neo.Utils.NeoTestCase import NeoTestCase
import binascii
from neo.Cryptography.Helper import *
from neo.UInt256 import UInt256
from neocore.UInt256 import UInt256


class BlockHashTest(NeoTestCase):
Expand Down
2 changes: 1 addition & 1 deletion neo/Cryptography/Crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from ecdsa import NIST256p, VerifyingKey
from logzero import logger
from .Helper import *
from neo.UInt160 import UInt160
from neocore.UInt160 import UInt160
from neo.Cryptography.ECCurve import EllipticCurve


Expand Down
2 changes: 1 addition & 1 deletion neo/Cryptography/MerkleTree.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from neo.Cryptography.Crypto import *
from neo.UInt256 import UInt256
from neocore.UInt256 import UInt256


class MerkleTreeNode(object):
Expand Down
Loading