mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-13 12:14:19 +00:00
py docs fixes
This commit is contained in:
parent
b2ad6069d4
commit
0cc50725ed
@ -29,10 +29,18 @@ def with_custom_state(balances_fn: Callable[[Any], Sequence[int]],
|
|||||||
|
|
||||||
|
|
||||||
def default_activation_threshold(spec):
|
def default_activation_threshold(spec):
|
||||||
|
"""
|
||||||
|
Helper method to use the default balance activation threshold for state creation for tests.
|
||||||
|
Usage: `@with_custom_state(threshold_fn=default_activation_threshold, ...)`
|
||||||
|
"""
|
||||||
return spec.MAX_EFFECTIVE_BALANCE
|
return spec.MAX_EFFECTIVE_BALANCE
|
||||||
|
|
||||||
|
|
||||||
def default_balances(spec):
|
def default_balances(spec):
|
||||||
|
"""
|
||||||
|
Helper method to create a series of default balances.
|
||||||
|
Usage: `@with_custom_state(balances_fn=default_balances, ...)`
|
||||||
|
"""
|
||||||
num_validators = spec.SLOTS_PER_EPOCH * 8
|
num_validators = spec.SLOTS_PER_EPOCH * 8
|
||||||
return [spec.MAX_EFFECTIVE_BALANCE] * num_validators
|
return [spec.MAX_EFFECTIVE_BALANCE] * num_validators
|
||||||
|
|
||||||
@ -42,7 +50,8 @@ with_state = with_custom_state(default_balances, default_activation_threshold)
|
|||||||
|
|
||||||
def low_balances(spec):
|
def low_balances(spec):
|
||||||
"""
|
"""
|
||||||
Helper method to create a series of low balances. Usage: `@with_validator_balances(low_balances)`
|
Helper method to create a series of low balances.
|
||||||
|
Usage: `@with_custom_state(balances_fn=low_balances, ...)`
|
||||||
"""
|
"""
|
||||||
num_validators = spec.SLOTS_PER_EPOCH * 8
|
num_validators = spec.SLOTS_PER_EPOCH * 8
|
||||||
# Technically the balances cannot be this low starting from genesis, but it is useful for testing
|
# Technically the balances cannot be this low starting from genesis, but it is useful for testing
|
||||||
@ -53,7 +62,7 @@ def low_balances(spec):
|
|||||||
def misc_balances(spec):
|
def misc_balances(spec):
|
||||||
"""
|
"""
|
||||||
Helper method to create a series of balances that includes some misc. balances.
|
Helper method to create a series of balances that includes some misc. balances.
|
||||||
Usage: `@with_validator_balances(misc_balances)`
|
Usage: `@with_custom_state(balances_fn=misc_balances, ...)`
|
||||||
"""
|
"""
|
||||||
num_validators = spec.SLOTS_PER_EPOCH * 8
|
num_validators = spec.SLOTS_PER_EPOCH * 8
|
||||||
num_misc_validators = spec.SLOTS_PER_EPOCH
|
num_misc_validators = spec.SLOTS_PER_EPOCH
|
||||||
|
Loading…
x
Reference in New Issue
Block a user