Skip to content

Commit

Permalink
Merge pull request #584 from Chia-Network/altendky-patch-3
Browse files Browse the repository at this point in the history
add `bytes32.zeros` etc
  • Loading branch information
Rigidity authored Jul 3, 2024
2 parents b1369f0 + b11d1b2 commit ea7d8b0
Showing 1 changed file with 13 additions and 1 deletion.
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)

0 comments on commit ea7d8b0

Please sign in to comment.