From 4d26ae255a1c9127fe4cc9dc3ed2ac830b1bf1f3 Mon Sep 17 00:00:00 2001 From: Justin Drake Date: Sat, 20 Apr 2019 15:31:15 +1000 Subject: [PATCH] Bug fix --- specs/core/0_beacon-chain.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index 84e9e4230..ba17691bc 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -731,10 +731,10 @@ def get_active_validator_indices(state: BeaconState, epoch: Epoch) -> List[Valid return [i for i, v in enumerate(state.validator_registry) if is_active_validator(v, epoch)] ``` -### `get_next_epoch_effective_balance` +### `get_current_epoch_effective_balance` ```python -def get_next_epoch_effective_balance(state: BeaconState, index: ValidatorIndex) -> None: +def get_current_epoch_effective_balance(state: BeaconState, index: ValidatorIndex) -> None: """ Get validator effective balance for the next epoch """ @@ -1020,7 +1020,7 @@ def get_effective_balance(state: BeaconState, index: ValidatorIndex, epoch: Epoc """ Return the effective balance (also known as "balance at stake") for a validator with the given ``index``. """ - return state.validator_registry[index].effective_balance if epoch == get_current_epoch(state) else get_next_epoch_effective_balance(state, index) + return get_current_epoch_effective_balance(state, index) if epoch == get_current_epoch(state) else state.validator_registry[index].effective_balance ``` ### `get_total_balance` @@ -1860,7 +1860,7 @@ def process_final_updates(state: BeaconState) -> None: state.eth1_data_votes = [] # Update effective balances for index, validator in enumerate(state.validator_registry): - validator.effective_balance = get_next_epoch_effective_balance(state, index) + validator.effective_balance = get_current_epoch_effective_balance(state, index) # Update start shard state.latest_start_shard = (state.latest_start_shard + get_shard_delta(state, current_epoch)) % SHARD_COUNT # Set active index root