diff --git a/setup.py b/setup.py index 153888aae..c7f9470f7 100644 --- a/setup.py +++ b/setup.py @@ -152,7 +152,9 @@ GeneralizedIndex = NewType('GeneralizedIndex', int) SSZObject = TypeVar('SSZObject', bound=View) ''' SUNDRY_CONSTANTS_FUNCTIONS = ''' -def ceillog2(x: uint64) -> uint64: +def ceillog2(x: int) -> uint64: + if x < 1: + raise ValueError(f"ceillog2 accepts only positive values, x={x}") return uint64((x - 1).bit_length()) ''' PHASE0_SUNDRY_FUNCTIONS = '''