This commit is contained in:
Hsiao-Wei Wang 2018-11-26 21:43:59 +08:00
parent 7bde8c415a
commit 4067e0f25a
No known key found for this signature in database
GPG Key ID: 95B070122902DEA4

View File

@ -796,7 +796,7 @@ def get_new_validators(current_validators: List[ValidatorRecord],
index = min_empty_validator(current_validators) index = min_empty_validator(current_validators)
if index is None: if index is None:
new_validators.append(rec) new_validators.append(rec)
return new_validators, len(new_validators.validators) - 1, return new_validators, len(new_validators.validators) - 1
else: else:
new_validators[index] = rec new_validators[index] = rec
return new_validators, index return new_validators, index
@ -811,7 +811,7 @@ def add_validator(state: BeaconState,
withdrawal_credentials: Hash32, withdrawal_credentials: Hash32,
randao_commitment: Hash32, randao_commitment: Hash32,
status: int, status: int,
current_slot: int) -> index: current_slot: int) -> int:
state.validators, index = get_new_validators( state.validators, index = get_new_validators(
current_validators=state.validators, current_validators=state.validators,
pre_fork_version=state.pre_fork_version, pre_fork_version=state.pre_fork_version,