use a specific `spec` rather than the pre-defined phases

This commit is contained in:
Alex Stokes 2021-12-07 18:50:00 +01:00
parent 55c9c03f08
commit db2be42baa
No known key found for this signature in database
GPG Key ID: 99B3D88FD6C55A69
1 changed files with 3 additions and 4 deletions

View File

@ -86,10 +86,9 @@ class SpecForks(TypedDict, total=False):
def _prepare_state(balances_fn: Callable[[Any], Sequence[int]], threshold_fn: Callable[[Any], int],
spec: Spec, phases: SpecForks):
phase = phases[spec.fork]
balances = balances_fn(phase)
activation_threshold = threshold_fn(phase)
state = create_genesis_state(spec=phase, validator_balances=balances,
balances = balances_fn(spec)
activation_threshold = threshold_fn(spec)
state = create_genesis_state(spec=spec, validator_balances=balances,
activation_threshold=activation_threshold)
return state