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

add bytes32.zeros etc #584

Merged
merged 2 commits into from
Jul 3, 2024
Merged
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
14 changes: 13 additions & 1 deletion wheel/python/chia_rs/sized_bytes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,39 @@

class bytes4(SizedBytes):
_size = 4

zeros: bytes4

class bytes8(SizedBytes):
_size = 8
zeros: bytes8


class bytes32(SizedBytes):
_size = 32
zeros: bytes32


class bytes48(SizedBytes):
_size = 48
zeros: bytes48


class bytes96(SizedBytes):
_size = 96
zeros: bytes96


class bytes100(SizedBytes):
_size = 100
zeros: bytes100


class bytes480(SizedBytes):
_size = 480
zeros: bytes480


def _add_zeros():
for cls in list(globals().values()):
if isinstance(cls, type) and cls is not SizedBytes and issubclass(cls, SizedBytes):
cls.zeros = cls(b"\x00" * cls._size)
Loading