fix style issue with deposit processing helper

This commit is contained in:
protolambda 2019-05-22 20:50:18 +02:00
parent dad89ae926
commit 58fd712607
No known key found for this signature in database
GPG Key ID: EC89FDBB2B4C7623
1 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@ from eth2spec.test.helpers.state import get_balance
from eth2spec.test.helpers.keys import privkeys from eth2spec.test.helpers.keys import privkeys
def run_deposit_processing(state, deposit, validator_index, valid=True, non_effective=False): def run_deposit_processing(state, deposit, validator_index, valid=True, effective=True):
""" """
Run ``process_deposit``, yielding: Run ``process_deposit``, yielding:
- pre-state ('pre') - pre-state ('pre')
@ -34,7 +34,7 @@ def run_deposit_processing(state, deposit, validator_index, valid=True, non_effe
yield 'post', state yield 'post', state
if non_effective: if not effective:
assert len(state.validator_registry) == pre_validator_count assert len(state.validator_registry) == pre_validator_count
assert len(state.balances) == pre_validator_count assert len(state.balances) == pre_validator_count
if validator_index < pre_validator_count: if validator_index < pre_validator_count:
@ -70,7 +70,7 @@ def test_invalid_sig_new_deposit(state):
validator_index = len(state.validator_registry) validator_index = len(state.validator_registry)
amount = spec.MAX_EFFECTIVE_BALANCE amount = spec.MAX_EFFECTIVE_BALANCE
deposit = prepare_state_and_deposit(state, validator_index, amount, signed=False) deposit = prepare_state_and_deposit(state, validator_index, amount, signed=False)
yield from run_deposit_processing(state, deposit, validator_index, valid=True, non_effective=True) yield from run_deposit_processing(state, deposit, validator_index, valid=True, effective=False)
@spec_state_test @spec_state_test
@ -90,7 +90,7 @@ def test_invalid_sig_top_up(state):
deposit = prepare_state_and_deposit(state, validator_index, amount, signed=False) deposit = prepare_state_and_deposit(state, validator_index, amount, signed=False)
# invalid signatures, in top-ups, are allowed! # invalid signatures, in top-ups, are allowed!
yield from run_deposit_processing(state, deposit, validator_index, valid=True, non_effective=False) yield from run_deposit_processing(state, deposit, validator_index, valid=True, effective=True)
@spec_state_test @spec_state_test