Merge pull request #2032 from ericsson49/ericsson49/fix_ceillog2_output_type
Make `cellog2` return `uint64`
This commit is contained in:
commit
3da7e32068
6
setup.py
6
setup.py
|
@ -152,8 +152,10 @@ GeneralizedIndex = NewType('GeneralizedIndex', int)
|
||||||
SSZObject = TypeVar('SSZObject', bound=View)
|
SSZObject = TypeVar('SSZObject', bound=View)
|
||||||
'''
|
'''
|
||||||
SUNDRY_CONSTANTS_FUNCTIONS = '''
|
SUNDRY_CONSTANTS_FUNCTIONS = '''
|
||||||
def ceillog2(x: uint64) -> int:
|
def ceillog2(x: int) -> uint64:
|
||||||
return (x - 1).bit_length()
|
if x < 1:
|
||||||
|
raise ValueError(f"ceillog2 accepts only positive values, x={x}")
|
||||||
|
return uint64((x - 1).bit_length())
|
||||||
'''
|
'''
|
||||||
PHASE0_SUNDRY_FUNCTIONS = '''
|
PHASE0_SUNDRY_FUNCTIONS = '''
|
||||||
def get_eth1_data(block: Eth1Block) -> Eth1Data:
|
def get_eth1_data(block: Eth1Block) -> Eth1Data:
|
||||||
|
|
Loading…
Reference in New Issue