From 2c32fa64739a338a2de621b18b92808ec20a2b73 Mon Sep 17 00:00:00 2001 From: Potuz Date: Tue, 26 Jul 2022 17:34:02 -0300 Subject: [PATCH] Do not overload index with WithdrawalIndex and ValidatorIndex --- specs/capella/beacon-chain.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/specs/capella/beacon-chain.md b/specs/capella/beacon-chain.md index 06659349a..40592a9bd 100644 --- a/specs/capella/beacon-chain.md +++ b/specs/capella/beacon-chain.md @@ -269,13 +269,13 @@ class BeaconState(Container): #### `withdraw` ```python -def withdraw_balance(state: BeaconState, index: ValidatorIndex, amount: Gwei) -> None: +def withdraw_balance(state: BeaconState, validator_index: ValidatorIndex, amount: Gwei) -> None: # Decrease the validator's balance - decrease_balance(state, index, amount) + decrease_balance(state, validator_index, amount) # Create a corresponding withdrawal receipt withdrawal = Withdrawal( index=state.next_withdrawal_index, - address=ExecutionAddress(state.validators[index].withdrawal_credentials[12:]), + address=ExecutionAddress(state.validators[validator_index].withdrawal_credentials[12:]), amount=amount, ) state.next_withdrawal_index = WithdrawalIndex(state.next_withdrawal_index + 1)