Update instances of int_to_bytes

This commit is contained in:
Justin Drake
2019-05-07 10:57:41 +01:00
parent b1520ea967
commit 22b06d581d
5 changed files with 7 additions and 11 deletions

View File

@@ -15,15 +15,11 @@ from typing import (
from eth2spec.utils.minimal_ssz import *
from eth2spec.utils.bls_stub import *
""")
for i in (1, 2, 3, 4, 8, 32, 48, 96):
code_lines.append("def int_to_bytes%d(x): return x.to_bytes(%d, 'little')" % (i, i))
code_lines.append("""
# stub, will get overwritten by real var
SLOTS_PER_EPOCH = 64
def int_to_bytes(integer: int, length: int) -> bytes:
return integer.to_bytes(length, 'little')
Slot = NewType('Slot', int) # uint64
Epoch = NewType('Epoch', int) # uint64