neb.py
neb.py copied to clipboard
Address.py 中校验地址”校验和“部分代码是否存在逻辑Bug?
(https://github.com/nebulasio/neb.py/blob/master/nebpysdk/src/core/Address.py#L125)
@classmethod
def parse_from_bytes(cls, byte):
if len(byte) != cls.__AddressLength or byte[0] != cls.__PaddingByte[0]:
raise Exception("invalid address bytes")
checksum = byte[cls.__AddressLength - cls.__AddressChecksumLength:]
checkdata = byte[:cls.__AddressLength - cls.__AddressChecksumLength]
if not cls.byte_equal(cls.check_sum(checkdata), checksum):
raise Exception("invalid address check sum")
return Address(byte)
@ideaalloc