cleanup minor var errors

This commit is contained in:
Danny Ryan 2019-03-11 12:38:11 -06:00
parent 36efb4498f
commit bf6bdbb021
No known key found for this signature in database
GPG Key ID: 2765A792E42CE07A
1 changed files with 5 additions and 5 deletions

View File

@ -768,12 +768,12 @@ def set_balance(state: BeaconState, index: int, new_balance: int) -> None:
validator = state.validator_registry[index]
HALF_INCREMENT = HIGH_BALANCE_INCREMENT // 2
if (
validator.rounded_balance * HIGH_BALANCE_INCREMENT > new_balance or
validator.rounded_balance * HIGH_BALANCE_INCREMENT + HALF_INCREMENT * 3 < new_balance
validator.high_balance * HIGH_BALANCE_INCREMENT > new_balance or
validator.high_balance * HIGH_BALANCE_INCREMENT + HALF_INCREMENT * 3 < new_balance
):
validator.rounded_balance = new_balance // HIGH_BALANCE_INCREMENT
state.validator_fractional_balances[index] = (
new_balance - validator.rounded_balance * HIGH_BALANCE_INCREMENT
validator.high_balance = new_balance // HIGH_BALANCE_INCREMENT
state.low_balances[index] = (
new_balance - validator.high_balance * HIGH_BALANCE_INCREMENT
)
````