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

Commit

Permalink
merge feature-consensus with current tree and feature-network-impleme…
Browse files Browse the repository at this point in the history
…nation
  • Loading branch information
localhuman committed Apr 7, 2018
1 parent 9bedea4 commit 4613730
Show file tree
Hide file tree
Showing 37 changed files with 92 additions and 97 deletions.
4 changes: 2 additions & 2 deletions neo/Core/Block.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def Deserialize(self, reader):
Deserialize full object.
Args:
reader (neo.IO.BinaryReader):
reader (neocore.IO.BinaryReader):
"""
super(Block, self).Deserialize(reader)

Expand Down Expand Up @@ -241,7 +241,7 @@ def Serialize(self, writer):
Serialize full object.
Args:
writer (neo.IO.BinaryWriter):
writer (neocore.IO.BinaryWriter):
"""
super(Block, self).Serialize(writer)
writer.WriteSerializableArray(self.Transactions)
Expand Down
8 changes: 4 additions & 4 deletions neo/Core/BlockBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def Deserialize(self, reader):
Deserialize full object.
Args:
reader (neo.IO.BinaryReader):
reader (neocore.IO.BinaryReader):
"""
self.DeserializeUnsigned(reader)
byt = reader.ReadByte()
Expand All @@ -131,7 +131,7 @@ def DeserializeUnsigned(self, reader):
Deserialize unsigned data only.
Args:
reader (neo.IO.BinaryReader):
reader (neocore.IO.BinaryReader):
"""
self.Version = reader.ReadUInt32()
self.PrevHash = reader.ReadUInt256()
Expand All @@ -146,7 +146,7 @@ def SerializeUnsigned(self, writer):
Serialize unsigned data only.
Args:
writer (neo.IO.BinaryWriter):
writer (neocore.IO.BinaryWriter):
"""
writer.WriteUInt32(self.Version)
writer.WriteUInt256(self.PrevHash)
Expand Down Expand Up @@ -195,7 +195,7 @@ def Serialize(self, writer):
Serialize full object.
Args:
writer (neo.IO.BinaryWriter):
writer (neocore.IO.BinaryWriter):
"""
self.SerializeUnsigned(writer)
writer.WriteByte(1)
Expand Down
4 changes: 2 additions & 2 deletions neo/Core/CoinReference.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def Deserialize(self, reader):
Deserialize full object.
Args:
reader (neo.IO.BinaryReader):
reader (neocore.IO.BinaryReader):
"""
self.PrevHash = reader.ReadUInt256()
self.PrevIndex = reader.ReadUInt16()
Expand All @@ -43,7 +43,7 @@ def Serialize(self, writer):
Serialize full object.
Args:
writer (neo.IO.BinaryWriter):
writer (neocore.IO.BinaryWriter):
"""
writer.WriteUInt256(self.PrevHash)
writer.WriteUInt16(self.PrevIndex)
Expand Down
4 changes: 2 additions & 2 deletions neo/Core/FunctionCode.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def Deserialize(self, reader):
Deserialize full object.
Args:
reader (neo.IO.BinaryReader):
reader (neocore.IO.BinaryReader):
"""
self.Script = reader.ReadVarBytes()
self.ParameterList = reader.ReadVarBytes()
Expand All @@ -74,7 +74,7 @@ def Serialize(self, writer):
Serialize full object.
Args:
writer (neo.IO.BinaryWriter):
writer (neocore.IO.BinaryWriter):
"""
writer.WriteVarBytes(self.Script)
writer.WriteVarBytes(self.ParameterList)
Expand Down
4 changes: 2 additions & 2 deletions neo/Core/Header.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def Deserialize(self, reader):
Deserialize full object.
Args:
reader (neo.IO.BinaryReader):
reader (neocore.IO.BinaryReader):
"""
super(Header, self).Deserialize(reader)
if reader.ReadByte() != 0:
Expand Down Expand Up @@ -93,7 +93,7 @@ def Serialize(self, writer):
Serialize full object.
Args:
writer (neo.IO.BinaryWriter):
writer (neocore.IO.BinaryWriter):
"""
super(Header, self).Serialize(writer)
writer.WriteByte(0)
11 changes: 6 additions & 5 deletions neo/Core/Helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from logzero import logger
import binascii


class Helper(object):

@staticmethod
Expand Down Expand Up @@ -145,11 +146,11 @@ def VerifyScripts(verifiable):
Returns:
bool: True if verification is successful. False otherwise.
"""
# try:
hashes = verifiable.GetScriptHashesForVerifying()
# except Exception as e:
# logger.error("couldn't get script hashes %s " % e)
# return False
try:
hashes = verifiable.GetScriptHashesForVerifying()
except Exception as e:
logger.error("couldn't get script hashes %s " % e)
return False

if len(hashes) != len(verifiable.Scripts):
return False
Expand Down
2 changes: 1 addition & 1 deletion neo/Core/State/AccountState.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def Serialize(self, writer):
Serialize full object.
Args:
writer (neo.IO.BinaryWriter):
writer (neocore.IO.BinaryWriter):
"""
super(AccountState, self).Serialize(writer)
writer.WriteUInt160(self.ScriptHash)
Expand Down
2 changes: 1 addition & 1 deletion neo/Core/State/AssetState.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def Serialize(self, writer):
Serialize full object.
Args:
writer (neo.IO.BinaryWriter):
writer (neocore.IO.BinaryWriter):
"""
super(AssetState, self).Serialize(writer)
writer.WriteUInt256(self.AssetId)
Expand Down
2 changes: 1 addition & 1 deletion neo/Core/State/ContractState.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def Serialize(self, writer):
Serialize full object.
Args:
writer (neo.IO.BinaryWriter):
writer (neocore.IO.BinaryWriter):
"""
super(ContractState, self).Serialize(writer)

Expand Down
2 changes: 1 addition & 1 deletion neo/Core/State/SpentCoinState.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def Serialize(self, writer):
Serialize full object.
Args:
writer (neo.IO.BinaryWriter):
writer (neocore.IO.BinaryWriter):
"""
super(SpentCoinState, self).Serialize(writer)

Expand Down
2 changes: 1 addition & 1 deletion neo/Core/State/StorageKey.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def Serialize(self, writer):
Serialize full object.
Args:
writer (neo.IO.BinaryWriter):
writer (neocore.IO.BinaryWriter):
"""
writer.WriteUInt160(self.ScriptHash)
writer.WriteVarBytes(self.Key)
Expand Down
2 changes: 1 addition & 1 deletion neo/Core/State/UnspentCoinState.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def Serialize(self, writer):
Serialize full object.
Args:
writer (neo.IO.BinaryWriter):
writer (neocore.IO.BinaryWriter):
"""
super(UnspentCoinState, self).Serialize(writer)

Expand Down
2 changes: 1 addition & 1 deletion neo/Core/State/ValidatorState.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def Serialize(self, writer):
Serialize full object.
Args:
writer (neo.IO.BinaryWriter):
writer (neocore.IO.BinaryWriter):
"""
super(ValidatorState, self).Serialize(writer)
self.PublicKey.Serialize(writer)
Expand Down
4 changes: 2 additions & 2 deletions neo/Core/TX/ClaimTransaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def DeserializeExclusiveData(self, reader):
Deserialize full object.
Args:
reader (neo.IO.BinaryReader):
reader (neocore.IO.BinaryReader):
Raises:
Exception: If the transaction type is incorrect or if there are no claims.
Expand Down Expand Up @@ -99,7 +99,7 @@ def SerializeExclusiveData(self, writer):
Serialize object.
Args:
writer (neo.IO.BinaryWriter):
writer (neocore.IO.BinaryWriter):
"""
writer.WriteSerializableArray(self.Claims)

Expand Down
4 changes: 2 additions & 2 deletions neo/Core/TX/EnrollmentTransaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def DeserializeExclusiveData(self, reader):
Deserialize full object.
Args:
reader (neo.IO.BinaryReader):
reader (neocore.IO.BinaryReader):
Raises:
Exception: If the version read is incorrect.
Expand All @@ -58,7 +58,7 @@ def SerializeExclusiveData(self, writer):
Serialize object.
Args:
writer (neo.IO.BinaryWriter):
writer (neocore.IO.BinaryWriter):
"""
self.PublicKey.Serialize(writer, True)

Expand Down
4 changes: 2 additions & 2 deletions neo/Core/TX/InvocationTransaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def DeserializeExclusiveData(self, reader):
Deserialize full object.
Args:
reader (neo.IO.BinaryReader):
reader (neocore.IO.BinaryReader):
Raises:
Exception: If the version read is incorrect.
Expand All @@ -67,7 +67,7 @@ def SerializeExclusiveData(self, writer):
Serialize object.
Args:
writer (neo.IO.BinaryWriter):
writer (neocore.IO.BinaryWriter):
"""
writer.WriteVarBytes(self.Script)
if self.Version >= 1:
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 @@ -55,7 +55,7 @@ def DeserializeExclusiveData(self, reader):
Deserialize full object.
Args:
reader (neo.IO.BinaryReader):
reader (neocore.IO.BinaryReader):
"""

self.Type = TransactionType.IssueTransaction
Expand Down
4 changes: 2 additions & 2 deletions neo/Core/TX/MinerTransaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def DeserializeExclusiveData(self, reader):
Deserialize full object.
Args:
reader (neo.IO.BinaryReader):
reader (neocore.IO.BinaryReader):
"""
self.Nonce = reader.ReadUInt32()
self.Type = TransactionType.MinerTransaction
Expand All @@ -61,7 +61,7 @@ def SerializeExclusiveData(self, writer):
Serialize object.
Args:
writer (neo.IO.BinaryWriter):
writer (neocore.IO.BinaryWriter):
"""
self.SerializeExclusiveDataAlternative(writer)

Expand Down
4 changes: 2 additions & 2 deletions neo/Core/TX/PublishTransaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def DeserializeExclusiveData(self, reader):
Deserialize full object.
Args:
reader (neo.IO.BinaryReader):
reader (neocore.IO.BinaryReader):
"""
if self.Version > 1:
logger.error("format exception...")
Expand All @@ -63,7 +63,7 @@ def SerializeExclusiveData(self, writer):
Serialize object.
Args:
writer (neo.IO.BinaryWriter):
writer (neocore.IO.BinaryWriter):
"""
self.Code.Serialize(writer)

Expand Down
Loading

0 comments on commit 4613730

Please sign in to comment.