22 spec_state_test ,
33 with_all_phases ,
44)
5- from eth2spec .test .helpers .constants import MAX_UINT_64
5+ from eth2spec .test .helpers .constants import UINT64_MAX
66from eth2spec .test .helpers .forks import (
77 is_post_altair , is_post_bellatrix ,
88)
@@ -16,9 +16,9 @@ def check_bound(value, lower_bound, upper_bound):
1616@with_all_phases
1717@spec_state_test
1818def test_validators (spec , state ):
19- check_bound (spec .VALIDATOR_REGISTRY_LIMIT , 1 , MAX_UINT_64 )
20- check_bound (spec .MAX_COMMITTEES_PER_SLOT , 1 , MAX_UINT_64 )
21- check_bound (spec .TARGET_COMMITTEE_SIZE , 1 , MAX_UINT_64 )
19+ check_bound (spec .VALIDATOR_REGISTRY_LIMIT , 1 , UINT64_MAX )
20+ check_bound (spec .MAX_COMMITTEES_PER_SLOT , 1 , UINT64_MAX )
21+ check_bound (spec .TARGET_COMMITTEE_SIZE , 1 , UINT64_MAX )
2222
2323 # Note: can be less if you assume stricters bounds on validator set based on total ETH supply
2424 maximum_validators_per_committee = (
@@ -30,24 +30,24 @@ def test_validators(spec, state):
3030 check_bound (spec .config .MIN_PER_EPOCH_CHURN_LIMIT , 1 , spec .VALIDATOR_REGISTRY_LIMIT )
3131 check_bound (spec .config .CHURN_LIMIT_QUOTIENT , 1 , spec .VALIDATOR_REGISTRY_LIMIT )
3232
33- check_bound (spec .config .MIN_GENESIS_ACTIVE_VALIDATOR_COUNT , spec .TARGET_COMMITTEE_SIZE , MAX_UINT_64 )
33+ check_bound (spec .config .MIN_GENESIS_ACTIVE_VALIDATOR_COUNT , spec .TARGET_COMMITTEE_SIZE , UINT64_MAX )
3434
3535
3636@with_all_phases
3737@spec_state_test
3838def test_balances (spec , state ):
3939 assert spec .MAX_EFFECTIVE_BALANCE % spec .EFFECTIVE_BALANCE_INCREMENT == 0
40- check_bound (spec .MIN_DEPOSIT_AMOUNT , 1 , MAX_UINT_64 )
41- check_bound (spec .MAX_EFFECTIVE_BALANCE , spec .MIN_DEPOSIT_AMOUNT , MAX_UINT_64 )
42- check_bound (spec .MAX_EFFECTIVE_BALANCE , spec .EFFECTIVE_BALANCE_INCREMENT , MAX_UINT_64 )
40+ check_bound (spec .MIN_DEPOSIT_AMOUNT , 1 , UINT64_MAX )
41+ check_bound (spec .MAX_EFFECTIVE_BALANCE , spec .MIN_DEPOSIT_AMOUNT , UINT64_MAX )
42+ check_bound (spec .MAX_EFFECTIVE_BALANCE , spec .EFFECTIVE_BALANCE_INCREMENT , UINT64_MAX )
4343
4444
4545@with_all_phases
4646@spec_state_test
4747def test_hysteresis_quotient (spec , state ):
48- check_bound (spec .HYSTERESIS_QUOTIENT , 1 , MAX_UINT_64 )
48+ check_bound (spec .HYSTERESIS_QUOTIENT , 1 , UINT64_MAX )
4949 check_bound (spec .HYSTERESIS_DOWNWARD_MULTIPLIER , 1 , spec .HYSTERESIS_QUOTIENT )
50- check_bound (spec .HYSTERESIS_UPWARD_MULTIPLIER , spec .HYSTERESIS_QUOTIENT , MAX_UINT_64 )
50+ check_bound (spec .HYSTERESIS_UPWARD_MULTIPLIER , spec .HYSTERESIS_QUOTIENT , UINT64_MAX )
5151
5252
5353@with_all_phases
@@ -68,7 +68,7 @@ def test_time(spec, state):
6868 assert spec .SLOTS_PER_EPOCH <= spec .SLOTS_PER_HISTORICAL_ROOT
6969 assert spec .MIN_SEED_LOOKAHEAD < spec .MAX_SEED_LOOKAHEAD
7070 assert spec .SLOTS_PER_HISTORICAL_ROOT % spec .SLOTS_PER_EPOCH == 0
71- check_bound (spec .SLOTS_PER_HISTORICAL_ROOT , spec .SLOTS_PER_EPOCH , MAX_UINT_64 )
71+ check_bound (spec .SLOTS_PER_HISTORICAL_ROOT , spec .SLOTS_PER_EPOCH , UINT64_MAX )
7272 check_bound (spec .MIN_ATTESTATION_INCLUSION_DELAY , 1 , spec .SLOTS_PER_EPOCH )
7373
7474
0 commit comments