From e0c28a3cd06309caa61b72c83feafefd983df226 Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Fri, 15 Feb 2019 18:25:30 +0800 Subject: [PATCH] Fix `slash_validator` Define `validator` before using it. --- specs/core/0_beacon-chain.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index a48d881fa..e181fc28c 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -1372,9 +1372,9 @@ def slash_validator(state: BeaconState, index: ValidatorIndex) -> None: Slash the validator with index ``index``. Note that this function mutates ``state``. """ + validator = state.validator_registry[index] assert state.slot < validator.withdrawable_epoch # [TO BE REMOVED IN PHASE 2] exit_validator(state, index) - validator = state.validator_registry[index] state.latest_slashed_balances[get_current_epoch(state) % LATEST_SLASHED_EXIT_LENGTH] += get_effective_balance(state, index) whistleblower_index = get_beacon_proposer_index(state, state.slot)