expected deposit count test

This commit is contained in:
protolambda 2019-06-22 02:37:20 +02:00
parent 64e15c524b
commit 1d6b1cab13
No known key found for this signature in database
GPG Key ID: EC89FDBB2B4C7623
1 changed files with 22 additions and 0 deletions

View File

@ -171,6 +171,28 @@ def test_attester_slashing(spec, state):
) )
@with_all_phases
@spec_state_test
def test_expected_deposit_in_block(spec, state):
# Make the state expect a deposit, then don't provide it.
state.eth1_data.deposit_count += 1
yield 'pre', state
block = build_empty_block_for_next_slot(spec, state)
sign_block(spec, state, block)
bad = False
try:
state_transition_and_sign_block(spec, state, block)
bad = True
except AssertionError:
pass
if bad:
raise AssertionError("expected deposit was not enforced")
yield 'blocks', [block]
yield 'post', None
@with_all_phases @with_all_phases
@spec_state_test @spec_state_test
def test_deposit_in_block(spec, state): def test_deposit_in_block(spec, state):