Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address.py 中校验地址”校验和“部分代码是否存在逻辑Bug? #14

Open
logan059 opened this issue Sep 6, 2019 · 0 comments

Comments

@logan059
Copy link

logan059 commented Sep 6, 2019

(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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant