different new-deposit tests

This commit is contained in:
protolambda 2019-06-25 04:19:02 +02:00
parent 6266133572
commit c4b88e68e1
No known key found for this signature in database
GPG Key ID: EC89FDBB2B4C7623
1 changed files with 15 additions and 3 deletions

View File

@ -59,7 +59,7 @@ def run_deposit_processing(spec, state, deposit, validator_index, valid=True, ef
@with_all_phases @with_all_phases
@spec_state_test @spec_state_test
def test_new_deposit(spec, state): def test_new_deposit_under_max(spec, state):
# fresh deposit = next validator index = validator appended to registry # fresh deposit = next validator index = validator appended to registry
validator_index = len(state.validators) validator_index = len(state.validators)
# effective balance will be 1 EFFECTIVE_BALANCE_INCREMENT smaller because of this small decrement. # effective balance will be 1 EFFECTIVE_BALANCE_INCREMENT smaller because of this small decrement.
@ -71,7 +71,19 @@ def test_new_deposit(spec, state):
@with_all_phases @with_all_phases
@spec_state_test @spec_state_test
def test_new_deposit_maxed_out(spec, state): def test_new_deposit_max(spec, state):
# fresh deposit = next validator index = validator appended to registry
validator_index = len(state.validators)
# effective balance will be exactly the same as balance.
amount = spec.MAX_EFFECTIVE_BALANCE
deposit = prepare_state_and_deposit(spec, state, validator_index, amount, signed=True)
yield from run_deposit_processing(spec, state, deposit, validator_index)
@with_all_phases
@spec_state_test
def test_new_deposit_over_max(spec, state):
# fresh deposit = next validator index = validator appended to registry # fresh deposit = next validator index = validator appended to registry
validator_index = len(state.validators) validator_index = len(state.validators)
# just 1 over the limit, effective balance should be set MAX_EFFECTIVE_BALANCE during processing # just 1 over the limit, effective balance should be set MAX_EFFECTIVE_BALANCE during processing