mirror of
https://github.com/ethereum/consensus-specs.git
synced 2026-02-02 01:25:16 -05:00
ceillog2 accepts positive integers now
This commit is contained in:
4
setup.py
4
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 = '''
|
||||
|
||||
Reference in New Issue
Block a user